/**========================================================================
  Newsページ・エディタ内プレビュー用（公開側）
==========================================================================*/

/* 元のコンテンツ調整 ---------------------------------------- */
.news-single .thumb { /* TODO: ここも調整想定 */
    font-size: 0.8em;
}

/* 箇条書きリスト ---------------------------------------- */
.news-single .post ol { /* TODO: .postを外したい */
    padding: 0;
}


/* 番号付き箇条書きリスト ---------------------------------------- */
.news-single ul {
    padding: 0;
    padding-left: 1.5rem;
}
.news-single ul li {
    list-style-type: disc;
}

/* テーブル ---------------------------------------- */
.news-single table {
    height: auto;
    margin-bottom: 1rem;
}

.news-single table th,
.news-single table td {
    padding: .75rem .5rem;
}


/* タイトル ---------------------------------------- */
.news-single h2 {
    margin-top: 4rem;
    margin-bottom: 2rem;
}

.news-single h3 {
    margin-top: 2rem;
}

.news-single h4 {
    margin-top: 1rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* その他コンテンツ要素 ---------------------------------------- */
.news-single img {
    height: auto;
}

.news-single p {
    font-size: 16px;
    line-height: 1.8;
}

/* ボタン ---------------------------------------- */
.news-single btn {
    padding: 0.75rem 2rem;
    letter-spacing: .1em;
    font-weight: bold;
    margin: 1rem 0 2rem;
}

/**========================================================================
  メディアアップロード関連
==========================================================================*/

/* 画像アップロード用 [タブ] ---------------------------------------- */
.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;
}

/* 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;
}

/* プレビューエリア ---------------------------------------- */
.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;
}

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

}

/* 画像アップロード用 ---------------------------------------- */
.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;
}

/**========================================================================
  [Override] Editorのパネル用スタイル（Editor styleの上書き用）
===========================================================================
  - TinyMCEのカスタムパネルで使用しているcssなどは下記へも記載する想定
     aタグなどは.btnよりも Editor側が用意している.tox以下のcssが優先されてしまうため）
==========================================================================*/

/* 画角が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;
}
#news-editor-add-button-preview .btn,
.tox-dialog .news-template-item .btn {
  display: inline-block;
  font-weight: 400;
  color: #212529;
  text-align: center;
  vertical-align: middle;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  background-color: transparent;
  border: 1px solid transparent;
  padding: .375rem .75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: .25rem;
  transition: color .15s
      ease-in-out, background-color .15s
      ease-in-out, border-color .15s
      ease-in-out, box-shadow .15s
      ease-in-out;
  text-decoration: none;
  border-radius: 50vw;
  padding: 0.375rem 1rem;
  pointer-events: none;
}
#news-editor-add-button-preview .btn-info,
.tox-dialog .news-template-item .btn-info {
  background-color: #f26565;
  border-color: #fb7968;
  color: #fff;
}
#news-editor-add-button-preview .btn-success,
.tox-dialog .news-template-item .btn-success {
  background-color: #28a745;
  border-color: #28a745;
  color: #fff;
}
#news-editor-add-button-preview .btn-secondary,
.tox-dialog .news-template-item .btn-secondary {
  background-color: #fff;
  border-color: #ccc;
  color: #333;
}
