@charset "utf-8";
/* ============================================
   single.css
   個別投稿ページ（single.php）用のスタイル
   ※レイアウト（2カラム等）は single.php 内のスタイルおよび
     Tailwind CSS で制御
   ============================================ */

/* -------------------------------------------
   1. レイアウト調整 (Cocoonスタイル上書き)
   ------------------------------------------- */

/* メインカラムはレイアウトに従わせるため、
   Cocoon標準の幅制限やfloatを解除する */
.main {
  max-width: none !important;
  margin: 0 !important;
  width: 100% !important;
  float: none !important;
}

/* -------------------------------------------
   2. 記事コンテンツ (.post-content / .entry-content)
   ------------------------------------------- */

/* 記事本文のデザイン
   ※ single.php 側で bg-white 等を指定しているが、詳細度等で効かない場合の保険 */
.entry-content,
.post-content {
  background-color: #fff;
  /* padding等はTailwind (p-6 md:p-12) で制御するため、ここでは補足程度 */
}

/* 段落（pタグ）の余白を統一 */
.entry-content p,
.post-content p {
  margin-top: 0 !important;
  margin-bottom: 0.5em !important;
}

/* 「写真と文章」ブロック内のpタグにも余白を適用 */
.wp-block-media-text__content p {
  margin-top: 0 !important;
  margin-bottom: 0.5em !important;
}

/* 画像がコンテナからはみ出さないようにする */
.post-content img,
.entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px; /* 角丸 */
}

/* iframe (YouTube埋め込み等) のレスポンシブ対応 */
.post-content iframe,
.entry-content iframe {
  max-width: 100%;
}

/* --- アイキャッチ画像 --- */
.eye-catch {
  display: block;
  margin-bottom: 30px;
  text-align: center; /* 中央寄せ */
}

.eye-catch-image {
  width: 100%; /* 親要素(div.rounded-xl)いっぱいに広げる */
  height: 400px; /* 高さを指定 */
  object-fit: cover; /* 切り抜き */
  object-position: center;
  border-radius: 10px;
  margin: 0 auto;
}

/* --- スマホ調整 --- */
@media screen and (max-width: 768px) {
  .eye-catch-image {
    height: 250px; /* スマホでは高さを抑える */
  }
}

/* -------------------------------------------
   3. 見出し (Heading) の装飾
   ------------------------------------------- */

h2.wp-block-heading {
  font-weight: 700;
  font-size: 1.45em;
  /* 左から右へグラデーション（#f5f5e8 → 白） */
  background: linear-gradient(
    to right,
    #f5f5e8 0%,
    #f5f5e8 30%,
    rgba(255, 255, 255, 0) 100%
  );
  padding: 0.5em 1em 0.5em 1em;
  margin-top: 1.5em !important;
  margin-bottom: 1.2em !important;
  border-radius: 0 4px 4px 0;
  /* 左にアクセントカラーのボーダー */
  border-left: 0.5em solid #78cc7f;
  /* 背景を親要素より外側に広げる */
  margin-left: -0.5em;
  margin-right: -0.5em;
  padding-left: calc(1.5em - 0.5em); /* 左ボーダー分を引いて揃える */
  padding-right: 1.5em;
}

@media screen and (max-width: 768px) {
  h2.wp-block-heading {
    font-size: 1.2em;
    border-left: 0.4em solid #78cc7f;
    margin-left: -0.5em;
    margin-right: -0.5em;
    padding-left: calc(0.8em - 0.4em);
    padding-right: 0.8em;
  }
}

h3.wp-block-heading {
  font-weight: 700;
  font-size: 1.3em;
  /* 下線を左から右へグラデーション（緑 → 透明） */
  border-bottom: none;
  background-image: linear-gradient(
    to right,
    #78cc7f 0%,
    #78cc7f 50%,
    rgba(120, 204, 127, 0) 100%
  );
  background-size: 100% 4px;
  background-position: left bottom;
  background-repeat: no-repeat;
  padding-bottom: 0.4em;
  margin-top: 1.4em !important;
  margin-bottom: 1em !important;
}

@media screen and (max-width: 768px) {
  h3.wp-block-heading {
    font-size: 1.2em;
  }
}

h4.wp-block-heading {
  font-weight: 600;
  font-size: 1.15em;
  display: table;
  padding: 0.25em 0.5em;
  line-height: 1.28;
  border: 3px solid #ddd; /* ボーダー指定修正 */
  margin-top: 1.5em;
  margin-bottom: 1em;
}

h5.wp-block-heading {
  font-weight: 600;
  font-size: 1.1em;
  margin-top: 1.2em;
  margin-bottom: 0.8em;
}

h6.wp-block-heading {
  font-weight: 500;
  font-size: 1.05em;
  margin-top: 1em;
  margin-bottom: 0.8em;
}

/* -------------------------------------------
   4. リスト (ul, ol) の装飾
   ------------------------------------------- */

/* 共通設定 */
ul.wp-block-list,
ol.wp-block-list {
  --border-width: 0.15em;
  --line-height: 1.95;
  padding-left: 0; /* 左パディングリセット（独自装飾のため） */
  list-style: none; /* デフォルトの点を消す */
}

ol.wp-block-list li > ol:nth-child(n),
ul.wp-block-list li > ul:nth-child(n),
ol.wp-block-list li,
ul.wp-block-list li {
  margin: 0.5em 0 0;
}

ul.wp-block-list li {
  display: table; /* 箇条書き記号と位置を合わせる */
}

/* 箇条書き (ul) の点 */
ul.wp-block-list li::before {
  color: #49af52;
  content: "●";
  display: table-cell;
  padding-right: 0.4em;
}

/* 番号付きリスト (ol) */
ol.wp-block-list {
  counter-reset: li;
  display: block;
}

ol.wp-block-list > li {
  display: block;
  counter-increment: li;
  position: relative;
  padding-left: 2em; /* 番号分の余白 */
  line-height: var(--line-height);
}

/* 番号の装飾 */
ol.wp-block-list > li::before {
  color: #49af52;
  border-color: currentColor;
  content: counters(li, ".");
  border-width: var(--border-width);
  border-radius: 8px;
  display: block;
  position: absolute;
  left: 0;
  top: calc(var(--line-height) * 0.07em);
  margin: 0;
  padding: calc(var(--line-height) * 0.5em - var(--border-width) - 0.5em) 0.05em;
  height: calc(var(--line-height) * 1em);
  width: calc(var(--line-height) * 1em);
  line-height: 1;
  font-size: 0.875em;
  text-align: center;
  font-weight: 600;
}

/* -------------------------------------------
   5. ボタンの装飾 (ファイルブロックを含む)
   ------------------------------------------- */

a.wp-block-button__link,
a.wp-block-file__button {
  background-color: white;
  color: rgb(51, 54, 49);
  margin-top: 1rem;
  padding-left: 2rem;
  padding-right: 2rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  border-width: 1px;
  border-style: solid;
  border-color: #4a3b2a;
  border-radius: 9999px;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 700;
  transition-property: color, background-color, border-color,
    text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ボタンホバー時の色の反転 */
a.wp-block-button__link:hover,
a.wp-block-file__button:hover {
  background-color: #4a3b2a;
  color: white !important;
  opacity: 100%;
}

/* -------------------------------------------
   6. 目次のナンバリング
   ------------------------------------------- */

ol.toc-list {
  counter-reset: toc;
}

ol.toc-list li {
  counter-increment: toc;
}

ol.toc-list ol {
  counter-reset: toc;
}

ol.toc-list li a {
  display: flex; /* 横並びのFlexコンテナにする */
  align-items: baseline; /* テキストのベースラインを揃える */
}

ol.toc-list li a::before {
  content: counters(toc, "-") ". ";
  font-weight: bold;
  color: silver;
  flex-shrink: 0;
  min-width: 1.6em;
}

ol.toc-list li li a::before {
  min-width: 2.6em;
}

ol.toc-list li li li a::before {
  min-width: 3.8em;
}

ol.toc-list li li li li a::before {
  min-width: 5em;
}

ol.toc-list li li li li li a::before {
  min-width: 6.2em;
}

.toc .toc-list {
  padding-left: 0;
}

/* -------------------------------------------
   7. テーブルの装飾
   ------------------------------------------- */

figure.wp-block-table thead {
  border-bottom: none;
}

table.has-fixed-layout {
  width: 100%;
  border-collapse: collapse;
}

table.has-fixed-layout tr {
  border-bottom: solid 2px white;
}

table.has-fixed-layout tr:last-child {
  border-bottom: none;
}

table.has-fixed-layout th {
  position: relative;
  text-align: left;
  width: 30%;
  background-color: #71b800;
  color: white;
  text-align: center;
  padding: 10px 0;
  border-color: white;
}

table.has-fixed-layout td {
  text-align: left;
  width: 70%;
  text-align: center;
  background-color: #eee;
  padding: 10px 0;
  border-color: white;
}

/* -------------------------------------------
   8. 引用文の装飾
   ------------------------------------------- */

blockquote.wp-block-quote {
  padding: 2.8em 3.6em;
}

blockquote.wp-block-quote::before,
blockquote.wp-block-quote::after {
  font-size: 600%;
}

@media screen and (max-width: 480px) {
  blockquote.wp-block-quote {
    border-width: 0 0 0 0.3em;
    padding: 0 0 0 2em;
    background-color: transparent;
  }

  blockquote.wp-block-quote::before {
    font-size: 225%;
    left: 0.1em;
  }

  blockquote.wp-block-quote::after {
    display: none;
  }
}

/* -------------------------------------------
   9. メディア（画像・動画・埋め込み）の装飾
   ------------------------------------------- */

/* メディアと文章ブロック */
.wp-block-media-text {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  gap: 1.5em; /* グリッド間の余白 */
}

.wp-block-media-text__content {
  padding: 0 !important; /* Cocoonのデフォルト(0 8%)を上書き */
}

/* 画像が右側の場合 */
.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content {
  padding: 0 !important;
}

/* 画像が左側の場合 */
.wp-block-media-text:not(.has-media-on-the-right)
  .wp-block-media-text__content {
  padding: 0 !important;
}

.wp-block-media-text__media {
  margin: 0;
}

/* スマホ時の調整（スタック表示） */
@media screen and (max-width: 600px) {
  .wp-block-media-text.is-stacked-on-mobile {
    gap: 1em;
  }
  .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content {
    padding: 0;
  }
}

/* カラムブロックの余白調整 */
.wp-block-columns {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  gap: 1.5em;
}

/* スマホ時：カラムの順序を逆にして、右側（画像）を先に表示 */
@media screen and (max-width: 781px) {
  .wp-block-columns {
    flex-direction: column-reverse;
  }
}

/* ギャラリーブロック スマホ・タブレット時は1カラム表示 */
@media screen and (max-width: 1023px) {
  .wp-block-gallery.has-nested-images {
    flex-direction: column;
  }
  .wp-block-gallery.has-nested-images figure.wp-block-image {
    width: 100% !important;
    flex: none !important;
  }
}

/* 画像キャプションの装飾 */
figure.wp-block-image figcaption,
.wp-element-caption {
  margin-top: 0.8em;
  font-size: 0.9em;
  color: #555;
  text-align: left;
  line-height: 1.6;
  font-style: normal;
}

/* 画像の装飾 */
figure.wp-block-image {
  width: 100%;
}

figure.wp-block-image img {
  width: 100%;
}

/* 投稿動画の装飾 */
figure.wp-block-video {
  width: 100%;
}

figure.wp-block-video video {
  width: 100%;
  border-radius: 8px;
}

/* YouTube動画の装飾 */
figure.wp-block-embed .wp-block-embed__wrapper .video-container {
  width: 100%;
  max-width: 100%;
}

figure.wp-block-embed .wp-block-embed__wrapper .video-container .video {
  border-radius: 8px;
}

/* -------------------------------------------
   10. 全体のline-heightの調整
   ------------------------------------------- */

.leading-loose {
  line-height: 1.6 !important;
}

/* -------------------------------------------
   11. 目次のpaddingのレスポンシブ調整
   ------------------------------------------- */

@media screen and (max-width: 640px) {
  .post-content .toc {
    padding: 0.75em 1.2em;
  }
}

/* -------------------------------------------
   12. モバイルサイドバー（記事末尾）のスタイル
   ------------------------------------------- */

/* モバイルサイドバーの基本スタイル */
#mobile-sidebar {
  /* padding: 0 1rem; */
}

/* PC表示時（lg以上）はモバイルサイドバーを非表示 */
@media screen and (min-width: 1024px) {
  #mobile-sidebar {
    display: none !important;
  }
}

/* スマホ・タブレット時のサイドバーウィジェットスタイル調整 */
@media screen and (max-width: 1023px) {
  #mobile-sidebar .sidebar-main,
  #mobile-sidebar .sidebar-scroll {
    display: block;
  }
}
