/* ============================================================
   記事まわりのスタイル
   （記事詳細・記事一覧・カテゴリ一覧ページで共通）

   目次
    1. パンくずリスト
    2. 2カラムレイアウト（本文＋サイドバー）
    3. 記事詳細：タイトル・アイキャッチ・目次
    4. 記事本文（投稿の本文内で使えるクラスを含む）
    5. 関連記事
    6. サイドバー
    7. レスポンシブ
   ============================================================ */

/* ---------- 1. パンくずリスト ---------- */
.breadcrumb {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}
.breadcrumb .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 13px 0;
  font-size: 13.5px;
  color: #3a4a40;
}
.breadcrumb a {
  color: #3a4a40;
  transition: 0.2s;
  position: relative;
  padding: 3px 6px;
  margin: -3px -6px;
  border-radius: 6px;
}
.breadcrumb a:hover {
  color: var(--green);
  background: #e3efe4;
  transform: translateY(-1px);
}
.breadcrumb span.sep {
  color: #9caa9f;
}
.breadcrumb span[aria-current] {
  color: var(--ink);
  font-weight: 700;
}

/* ---------- 2. 2カラムレイアウト（本文＋サイドバー） ---------- */
.article-main {
  padding: 36px 0 70px;
}
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 44px;
  align-items: stretch;
}

/* ---------- 3. 記事詳細：タイトル・アイキャッチ・目次 ---------- */
.article-head {
  margin-bottom: 26px;
}
.article-head .tag {
  background: var(--green);
  font-size: 12.5px;
  padding: 5px 14px;
  border-radius: 14px;
  margin-bottom: 14px;
}
.article-head h1 {
  font-size: clamp(25px, 3.2vw, 34px);
  line-height: 1.5;
  margin: 0 0 14px;
  font-weight: 800;
  color: var(--ink);
}
.article-lead {
  font-size: 16px;
  line-height: 1.9;
  color: #243228;
  margin: 0 0 18px;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 13.5px;
  color: #3a4a40;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.article-meta time {
  font-family: Outfit, sans-serif;
  font-weight: 700;
  color: #1c2b21;
}
.article-meta .author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #1c2b21;
}
.article-meta .author:before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d9e3db;
  display: inline-block;
}

/* アイキャッチ */
.article-hero {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.article-hero-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #eef2ee;
}
.article-hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 目次（single.php で本文の h2 から自動生成） */
.toc {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 34px;
}
.toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.toc-head h2 {
  font-size: 16.5px;
  margin: 0;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1c2b21;
}
.toc-head h2:before {
  content: "";
  width: 17px;
  height: 17px;
  background: var(--green);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 6h16M4 12h16M4 18h10'/%3E%3C/svg%3E")
    center/contain no-repeat;
}
.toc-toggle {
  border: 0;
  background: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.toc-toggle:after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  transform: rotate(45deg);
  transition: 0.25s;
}
.toc.is-collapsed .toc-toggle:after {
  transform: rotate(-135deg);
}
.toc-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  gap: 6px 28px;
  overflow: hidden;
  max-height: 400px;
  transition:
    max-height 0.3s ease,
    margin-top 0.3s ease,
    opacity 0.2s ease;
}
.toc.is-collapsed .toc-list {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
}
.toc-list li {
  border-bottom: 1px dashed var(--line);
  padding: 9px 2px;
}
.toc-list a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 700;
  color: #1c2b21;
  transition: 0.2s;
}
.toc-list a:hover {
  color: var(--green);
  transform: translateX(5px);
}
.toc-list a b {
  font-family: Outfit, sans-serif;
  color: var(--green);
  font-size: 14px;
}

/* ---------- 4. 記事本文 ----------
   投稿の本文（HTML）で次のクラスが使えます。
     .article-section / .section-heading / .section-num … 番号付きの見出しブロック
     .title-box / .indent-box … 強調ボックス
     .data-table / .table-note … 表
     .faq-list / .faq-item / .faq-q / .faq-a … よくある質問
     .inline-cta … 記事内の相談カード
   ※ .section-heading はトップページ（style.css）とクラス名を共用しています */
.article-body {
  font-size: 16px;
  line-height: 1.95;
  color: #1e2c22;
}
.article-section {
  margin: 0 0 44px;
  scroll-margin-top: 96px;
}
.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--green);
}
.section-heading .section-num {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--green);
  color: #fff !important;
  display: grid;
  place-items: center;
  font-family: Outfit, sans-serif;
  font-weight: 700;
  font-size: 18px;
}
.section-heading h2 {
  font-size: 23px;
  margin: 0;
  line-height: 1.5;
  font-weight: 800;
  color: var(--ink);
}
.article-body p {
  margin: 0 0 16px;
}
.article-body h3 {
  position: relative;
  font-size: 18.5px;
  line-height: 1.6;
  margin: 36px 0 16px;
  padding: 12px 20px;
  font-weight: 800;
  color: #fff;
  background: var(--green);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(21, 88, 41, 0.18);
}
.article-body h3:first-child {
  margin-top: 0;
}
.article-body h4 {
  position: relative;
  font-size: 15.5px;
  line-height: 1.6;
  margin: 28px 0 12px;
  padding-left: 19px;
  font-weight: 800;
  color: #1c2b21;
}
.article-body h4:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--green);
  transform: rotate(45deg);
}
.article-body h4:first-child {
  margin-top: 0;
}
.article-body ul,
.article-body ol {
  margin: 0 0 18px;
  padding-left: 1.3em;
}
.article-body li {
  margin: 0 0 8px;
}
.article-body strong {
  color: var(--green-2);
}

/* 強調ボックス */
.article-body .title-box,
.article-body .indent-box {
  background: #f3f8f2;
  border: 1px solid #cfe0ce;
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 0 0 28px;
}
.article-body .indent-box {
  border-left: 4px solid var(--green);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.article-body .title-box > :first-child,
.article-body .indent-box > :first-child {
  margin-top: 0;
}
.article-body .title-box > :last-child,
.article-body .indent-box > :last-child {
  margin-bottom: 0;
}
.article-body .title-box p,
.article-body .indent-box p {
  margin: 0 0 12px;
}
.article-body .title-box h3,
.article-body .indent-box h3,
.article-body .title-box h4,
.article-body .indent-box h4 {
  margin-top: 0;
}
.article-body .title-box ul,
.article-body .title-box ol,
.article-body .indent-box ul,
.article-body .indent-box ol {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
}
.article-body .title-box li,
.article-body .indent-box li {
  margin: 0 0 8px;
  padding: 0;
}
.article-body .title-box li:last-child,
.article-body .indent-box li:last-child {
  margin-bottom: 0;
}

/* 表 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0 22px;
  font-size: 14.5px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.data-table thead th {
  background: #eef5ef;
  color: var(--green-2);
  font-weight: 700;
  font-size: 13.5px;
}
.data-table tbody tr:last-child td {
  border-bottom: 0;
}
.data-table tbody tr:nth-child(even) {
  background: #fafbf8;
}
.table-note {
  font-size: 13px;
  color: #3a4a40;
  margin: -8px 0 20px;
}

/* よくある質問 */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 6px;
}
.faq-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
}
.faq-q,
.faq-a {
  display: flex;
  gap: 12px;
  margin: 0;
}
.faq-q {
  font-weight: 700;
  color: #182a1e;
  font-size: 15.5px;
}
.faq-a {
  font-size: 14.5px;
  color: #293b2f;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px dashed var(--line);
}
.faq-q b,
.faq-a b {
  flex: none;
  font-family: Outfit, sans-serif;
  font-weight: 800;
  font-size: 15px;
}
.faq-q b {
  color: var(--green);
}
.faq-a b {
  color: #a56b1f;
}

/* 記事内の相談カード */
.inline-cta {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 22px;
  align-items: center;
  background: #f3f8f2;
  border: 1px solid #cfe0ce;
  border-radius: var(--radius);
  padding: 22px;
  margin: 8px 0 44px;
}
.inline-cta img {
  width: 100%;
  height: 100%;
  min-height: 120px;
  object-fit: cover;
  border-radius: 8px;
}
.inline-cta h3 {
  font-size: 17px;
  margin: 0 0 10px;
  line-height: 1.6;
  font-weight: 800;
  color: #173a1f;
}
.inline-cta-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  font-size: 13.5px;
  font-weight: 700;
  color: #1e3323;
}
.inline-cta-list li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.inline-cta-list li:before {
  content: "✓";
  color: var(--green);
  font-weight: 800;
}
.inline-cta-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #33453a;
  margin-bottom: 14px;
}
.inline-cta-brand i {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 12px;
}
.inline-cta .button {
  min-height: 46px;
  font-size: 13.5px;
}

/* ---------- 5. 関連記事 ---------- */
.related {
  margin: 0 0 40px;
}
.related-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 18px;
  color: var(--ink);
}
.related-title:before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.related-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}
.related-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 22px rgba(23, 50, 31, 0.13);
}
.related-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1.5;
  overflow: hidden;
  background: #eef2ee;
}
.related-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.related-card:hover .related-media img {
  transform: scale(1.09);
}
.related-card .tag {
  position: relative;
  z-index: 2;
  margin: -12px 12px 0;
  font-size: 11px;
}
.related-card div {
  padding: 10px 13px 15px;
}
.related-card h3 {
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 8px;
  font-weight: 700;
  color: #182a1e;
}
.related-card time {
  font-size: 12px;
  color: #3a4a40;
  font-family: Outfit, sans-serif;
}

/* ---------- 6. サイドバー（sidebar.php） ---------- */
/* .article-layout 側で align-items:stretch にしているため、
   .sidebar（aside）は本文カラムと同じ高さまで伸びる。
   その余った高さをすべて .side-sticky-spacer に吸収させることで、
   カテゴリ一覧の追従が本文の終わり（コンバージョンエリア手前）
   あたりまで続き、右カラムに空白ができないようにしている。 */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 0;
}
.side-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 6px 20px rgba(23, 50, 31, 0.05);
  flex: none;
}
/* カテゴリ一覧カードだけを追従（sticky）させるための専用コンテナ。
   「人気の記事」以降のカードはラッパーの外側（＝別の包含ブロック）に
   配置することで、追従中に後続コンテンツが背面に隠れるのを防いでいる。 */
.side-sticky-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.side-sticky {
  position: sticky;
  top: 104px;
  flex: none;
}
.side-sticky-spacer {
  flex: 1 1 auto;
}
.side-card h2 {
  font-size: 16px;
  margin: 0 0 16px;
  font-weight: 800;
  color: var(--ink);
}

/* 相談バナー */
.side-cta-head {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.7;
  color: #16281c;
  margin: 0 0 14px;
}
.side-cta-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f4f8f3;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.side-cta-brand i {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
}
.side-cta-brand i svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.side-cta-brand b {
  display: block;
  font-size: 14px;
  color: #1c2b21;
}
.side-cta-brand small {
  font-size: 11.5px;
  color: #3a4a40;
}
.side-cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}
.side-cta-grid div {
  background: #fff;
  padding: 12px 8px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
  color: #16281c;
}
.side-cta-grid svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--green);
  stroke-width: 1.8;
  margin: 0 auto 6px;
  display: block;
}
/* サイドバー内のボタン（相談・メルマガ） */
.side-card .button {
  width: 100%;
  min-height: 46px;
  font-size: 13.5px;
}

/* カテゴリ一覧 */
.side-categories {
  list-style: none;
  margin: 0;
  padding: 0;
}
.side-categories li {
  border-top: 1px solid var(--line);
}
.side-categories li:first-child {
  border-top: 0;
}
.side-categories a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 2px;
  font-size: 14.5px;
  font-weight: 700;
  color: #1c2b21;
  transition: 0.2s;
  border-radius: 6px;
}
.side-categories a:hover {
  color: var(--green);
  background: #f2f8f3;
  padding-left: 10px;
  padding-right: 10px;
  margin: 0 -10px;
}
.side-categories a:after {
  content: "›";
  font-size: 16px;
  color: #8ea095;
  transition: 0.2s;
}
.side-categories a:hover:after {
  color: var(--green);
  transform: translateX(3px);
}
.side-cat-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.side-cat-label svg {
  flex: none;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: var(--green);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 人気の記事 */
.side-popular {
  list-style: none;
  margin: 0;
  padding: 0;
}
.side-popular li {
  border-top: 1px solid var(--line);
}
.side-popular li:first-child {
  border-top: 0;
}
.side-popular a {
  display: grid;
  grid-template-columns: auto 68px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 2px;
  border-radius: 8px;
  transition:
    background 0.25s,
    padding 0.25s,
    margin 0.25s;
}
.side-popular a:hover {
  background: #f2f8f3;
  padding-left: 10px;
  padding-right: 10px;
  margin: 0 -10px;
}
.side-popular a:hover .pop-body h3 {
  color: var(--green);
}
.side-popular img {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 7px;
}
.side-popular .num {
  width: 21px;
  height: 21px;
  border-radius: 5px;
  background: var(--green);
  color: #fff;
  font-family: Outfit, sans-serif;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.side-popular .pop-body h3 {
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0 0 5px;
  font-weight: 700;
  color: #182a1e;
  transition: color 0.25s;
}
.side-popular time {
  font-size: 12px;
  color: #3a4a40;
  font-family: Outfit, sans-serif;
}

/* メルマガ登録 */
.side-newsletter p {
  font-size: 13.5px;
  color: #33453a;
  margin: 0 0 14px;
  line-height: 1.8;
}
.side-newsletter input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
  font-size: 14px;
  margin-bottom: 10px;
}
.side-newsletter small {
  display: block;
  text-align: center;
  margin-top: 9px;
  font-size: 13.5px;
  color: #4c5b51;
}

/* ---------- 7. レスポンシブ ---------- */
@media (max-width: 1100px) {
  .article-layout {
    grid-template-columns: 1fr 300px;
    gap: 28px;
  }
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
  /* サイドバーを本文の下に移動し、カードを横に並べる */
  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .side-sticky-wrap {
    display: contents;
  }
  .side-sticky {
    position: static;
  }
  .side-sticky-spacer {
    display: none;
  }
  .side-card {
    flex: 1 1 260px;
  }
}
@media (max-width: 820px) {
  .article-main {
    padding: 26px 0 54px;
  }
  .inline-cta {
    grid-template-columns: 1fr;
  }
  .inline-cta img {
    min-height: 150px;
  }
  .inline-cta-list {
    grid-template-columns: 1fr;
  }
  .toc-list {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-flow: row;
  }
}
@media (max-width: 600px) {
  .related-grid {
    grid-template-columns: 1fr 1fr;
  }
  .article-meta {
    gap: 10px 14px;
  }
  .sidebar {
    flex-direction: column;
  }
}
@media (max-width: 480px) {
  .related-grid {
    grid-template-columns: 1fr;
  }
}
