/**===============================================================
   [Components] News content
==================================================================
   @description
       - ニュースコンテンツ・admin側のエディタプレビューのstyle
       - お知らせのコンテンツcssはこのシートの「コンテンツのstyle」にて
=================================================================*/

/* [Tiny MCE] 画像アップロード用 (タブ)
---------------------------------------------------------------- */
.tox .upload-tabs {
  font-family: sans-serif;
}

.tox .upload-tab-header {
  display: flex;
  border-bottom: 1px solid #ddd;
  margin-bottom: 8px;
}

.tox .upload-tab-btn {
  padding: 8px 12px;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tox .upload-tab-btn.is-active {
  border-bottom-color: #2271b1; /* WP青 */
  font-weight: bold;
}

.tox .upload-tab-panel {
  display: none;
}

.tox .upload-tab-panel.is-active {
  display: block;
}

/* [Tiny MCE] Form関連
---------------------------------------------------------------- */
.tox .media-select {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.tox .media-select::after {
  position: absolute;
  right: 15px;
  width: 10px;
  height: 7px;
  background-color: #535353;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  content: '';
  pointer-events: none;
}

.tox .media-select select{
  appearance: none;
  min-width: 160px;
  padding: .5rem calc(.8em + 10px) .5rem .6rem;
  border: 1px solid #bbb;
  border-radius: 3px;
  background-color: #fff;
  color: #333333;
  font-size: 1em;
  cursor: pointer;
}

.tox .media-input-text input {
  min-width: 250px;
  padding: .5rem;
  border: solid 1px #bbb;
  border-radius: 3px;
  box-sizing: border-box;
  font-size: 1em;
  outline: none;
}

/* [Tiny MCE] エディタプレビュー用
---------------------------------------------------------------- */
.tox #media-preview-container {
  background: #f5f5f5;
  padding: 10px;
  margin-bottom: 20px;
}
.tox #media-preview-wrapper {
  display: flex;
  align-items: center;
}

.tox .media-preview-title {
  margin: 0 auto;
  line-height: 1.4rem;
}

.tox #media-preview-container .media-column + .media-column {
  padding-left: 10px;
  min-width: 0; /* tox側のoverride */
}

.tox #media-preview-container .media-detail-text {
  margin: 0 auto;
  font-size: 80%;
  line-height: 1.4rem;
  overflow-wrap: anywhere;
}

.tox #media-preview-container dd {
  margin-left: auto;
  padding-inline-start: 0;
}

.tox button[name="media-delete-button"] {
  font-size: 80%;
  line-height: 1.4rem;
  color: red;
}

.tox #media-preview-setting {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  border-top: solid 1px #ccc;
  margin-top: 10px;
}
.tox #media-preview-setting > p {
  display: flex;
  font-size: 85%;
  min-width: 0;
  margin-bottom: 0 !important;
}
.tox #media-preview-setting input {
  width: 48%;
  padding: 10px;
  border-radius: 3px;
  border: solid 1px #aaa;
  background-color: #fefefe;
  font-size: 90%;
}

.tox #media-preview-setting dl {
  width: 100%;
}

.tox #media-preview-container .media-detail-bold {
  font-weight: bold;
}

.tox #media-preview-container .media-preview {
  overflow: hidden;
}

.tox #media-preview-container .media-preview img {
  max-width: 160px;
  max-height: 100px;
  border: solid 1px #ddd;
}

/* [Tiny MCE] メディア検索エリア
---------------------------------------------------------------- */
.tox .media-header {
  display: flex;
  justify-content: space-between;
  margin: 10px auto;

}

/* [Tiny MCE] 画像アップロード用
---------------------------------------------------------------- */
.tox .thumbnail-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px;
}

.tox .thumbnail-item {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1; /* 正方形 */
  border: solid 4px transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #f4f4f4;
}

.tox .thumbnail-item.selected {
  border-color: #47b4fc;
}

.tox .thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 中央トリミング */
  display: block;
  transition: transform .15s ease;
}

.tox .thumbnail-item:hover img {
  transform: scale(1.05);
}

/* 選択状態 */
.tox .thumbnail-item.is-selected {
  outline: 2px solid #2271ff;
  outline-offset: -2px;
}

/* [Tiny MCE] Overirde系
---------------------------------------------------------------- */
/* 画角がwidth:100%;になるのを上書き調整 */
html body#tinymce img {
    width: auto;
    max-width: 100%;
    height: auto;
}

/* editorのstyleに上書きされてしまうので、さらに上書き */
.tox-dialog .news-template-item {
  display: inline-block;
}
.tox-dialog .news-template-item button {
  cursor: pointer !important;
}

/* コンテンツのstyle
---------------------------------------------------------------- */
.app-news-content h2 {
  padding-bottom: 0.25rem;
  border-bottom: dotted 1px var(--bs-gray);
  margin-bottom: 0.5rem;
  font-size: calc(1.3rem + 0.6vw);
}

.app-news-content img {
  max-width: 100%;
  height: auto;
}

.app-news-content * + h2 {
  margin-top: 4rem;
}

.app-news-content .btn {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}
