/* ============================================================
   13分でわかる親と自分の老後準備マニュアル
   デザインテーマ: 「家族の教科書」
   明朝体見出し × 藍色 × 生成り × 柿色アクセント
   ============================================================ */
:root {
  --ink: #2b2723;
  --muted: #6b6355;
  --base: #f7f3ea;      /* 生成り */
  --panel: #fffdf8;
  --line: #e0d8c8;
  --navy: #2c4a6b;      /* 藍 */
  --navy-dark: #1d344f;
  --kaki: #c0572f;      /* 柿色 */
  --kaki-soft: #f5e3d9;
  --gold: #b98c2f;
  --gold-soft: #f3ead2;
  --green: #4a6b50;
  --shadow: 0 10px 30px rgba(44, 74, 107, 0.10);
  --radius: 10px;
  --content: 1140px;
  --serif: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --sans: "Yu Gothic", "YuGothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--base);
  font-family: var(--sans);
  line-height: 1.9;
  font-size: 16px;
}

img, svg { display: block; max-width: 100%; height: auto; }

a { color: var(--navy); text-underline-offset: 0.2em; }
a:hover { color: var(--kaki); }

h1, h2, h3, .brand-text { font-family: var(--serif); letter-spacing: 0.02em; line-height: 1.5; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--navy); color: #fff; padding: 8px 16px;
}
.skip-link:focus { left: 8px; }

.container { width: min(var(--content), calc(100% - 36px)); margin: 0 auto; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(247, 243, 234, 0.96);
  border-bottom: 2px solid var(--navy);
  backdrop-filter: blur(10px);
}
.header-inner {
  width: min(var(--content), calc(100% - 36px));
  margin: 0 auto; min-height: 72px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 40px; height: 40px; border-radius: 8px; flex: none;
  background: var(--navy); color: #fff;
  font-family: var(--serif); font-weight: 700; font-size: 20px;
  display: grid; place-items: center;
}
.brand-text { font-size: 15px; font-weight: 700; line-height: 1.35; }
.brand-text small { display: block; font-family: var(--sans); font-size: 11px; color: var(--kaki); font-weight: 700; letter-spacing: 0.12em; }

/* PCグローバルナビ（ドロップダウン付き） */
.global-nav { display: flex; align-items: stretch; gap: 2px; }
.nav-group { position: relative; }
.nav-group > a, .nav-group > button {
  display: flex; align-items: center; gap: 4px; height: 72px; padding: 0 14px;
  background: none; border: 0; cursor: pointer;
  font-family: var(--sans); font-size: 14.5px; font-weight: 700; color: var(--ink);
  text-decoration: none;
}
.nav-group > a:hover, .nav-group > button:hover { color: var(--kaki); }
.nav-group > button::after {
  content: ""; width: 7px; height: 7px; margin-left: 2px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}
.nav-drop {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  min-width: 240px; padding: 10px;
  background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--kaki);
  border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow);
  display: none;
}
.nav-group:hover .nav-drop,
.nav-group:focus-within .nav-drop,
.nav-group.open .nav-drop { display: block; }
.nav-drop a {
  display: block; padding: 9px 14px; border-radius: 6px;
  font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink);
}
.nav-drop a:hover { background: var(--kaki-soft); color: var(--kaki); }
.nav-drop a small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; line-height: 1.5; }

.menu-button { display: none; }

/* ---------- モバイルメニュー ---------- */
@media (max-width: 960px) {
  .global-nav {
    position: fixed; top: 0; right: 0;
    height: 100vh; height: 100dvh;
    width: min(320px, 86vw);
    flex-direction: column; gap: 0; align-items: stretch;
    background: var(--panel); border-left: 1px solid var(--line);
    padding: 84px 12px 24px; overflow-y: auto;
    transform: translateX(105%); visibility: hidden;
    transition: transform 0.25s ease, visibility 0.25s ease;
    box-shadow: -12px 0 30px rgba(43, 39, 35, 0.12);
    z-index: 70;
  }
  .global-nav.open { transform: translateX(0); visibility: visible; }
  .nav-group > a, .nav-group > button {
    width: 100%; height: auto; padding: 13px 10px; justify-content: space-between;
    border-bottom: 1px solid var(--line); font-size: 15px;
  }
  .nav-drop {
    position: static; transform: none; display: none; min-width: 0;
    border: 0; border-left: 3px solid var(--kaki-soft); border-radius: 0;
    box-shadow: none; background: none; padding: 4px 0 4px 10px; margin: 4px 0 8px;
  }
  .nav-group.open .nav-drop { display: block; }
  .nav-group:hover .nav-drop { display: none; }
  .nav-group.open:hover .nav-drop { display: block; }
  .menu-button {
    display: grid; place-items: center;
    width: 46px; height: 46px; border-radius: 8px;
    background: var(--navy); border: 0; cursor: pointer;
    position: relative; z-index: 80;
  }
  .menu-button span, .menu-button::before, .menu-button::after {
    content: ""; display: block; width: 22px; height: 2px; background: #fff;
    margin: 3px auto; transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .menu-button[aria-expanded="true"]::before { transform: translateY(5px) rotate(45deg); }
  .menu-button[aria-expanded="true"] span { opacity: 0; }
  .menu-button[aria-expanded="true"]::after { transform: translateY(-5px) rotate(-45deg); }
}

/* ---------- ヒーロー ---------- */
.hero { position: relative; border-bottom: 1px solid var(--line); background: var(--panel); }
.hero-grid {
  width: min(var(--content), calc(100% - 36px)); margin: 0 auto;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center;
  padding: 56px 0;
}
.hero-grid img { border-radius: var(--radius); box-shadow: var(--shadow); }
.eyebrow {
  display: inline-block; margin: 0 0 10px;
  color: var(--kaki); font-size: 13.5px; font-weight: 700; letter-spacing: 0.14em;
}
.hero h1 { margin: 0 0 18px; font-size: clamp(26px, 4vw, 40px); }
.hero .lead { margin: 0 0 26px; color: var(--muted); font-size: 16.5px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn-row .button { text-align: center; }

.button {
  display: inline-block; padding: 13px 26px; border-radius: 999px;
  background: var(--kaki); color: #fff; font-weight: 700; font-size: 15px;
  text-decoration: none; border: 2px solid var(--kaki);
  transition: opacity .15s ease;
}
.button:hover { opacity: 0.85; color: #fff; }
.button.secondary { background: transparent; color: var(--navy); border-color: var(--navy); }
.button.secondary:hover { background: var(--navy); color: #fff; opacity: 1; }

/* ---------- セクション共通 ---------- */
.section { padding: 56px 0; }
.section.alt { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { max-width: 780px; margin-bottom: 34px; }
.section-head h2, .section h2 { font-size: clamp(22px, 3vw, 30px); margin: 0 0 14px; }
.section-head p { color: var(--muted); margin: 0; }

/* 章番号つき見出し（教科書スタイル） */
.chapter { display: flex; align-items: baseline; gap: 14px; border-bottom: 2px solid var(--navy); padding-bottom: 10px; margin-bottom: 24px; }
.chapter .no { font-family: var(--serif); font-size: 34px; font-weight: 700; color: var(--kaki); line-height: 1; }
.chapter h2 { border: 0; margin: 0; }

h3 { font-size: 19px; margin: 32px 0 12px; padding-left: 12px; border-left: 4px solid var(--kaki); }

/* ---------- カード・グリッド ---------- */
.grid { display: grid; gap: 22px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.three { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.card .body { padding: 18px 20px 22px; }
.card .body h3 { margin: 0 0 8px; padding: 0; border: 0; font-size: 18px; }
.card .body p { margin: 0; font-size: 14.5px; color: var(--muted); }
.card.pad { padding: 24px 26px; }
.card.pad h2 { font-size: 21px; margin-top: 0; }
.media-card img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }

/* 番号つき手順リスト */
.step-list { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 14px; }
.step-list > li {
  counter-increment: step; position: relative;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px 18px 76px;
}
.step-list > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 20px; top: 18px;
  font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--kaki);
}
.step-list h3 { margin: 0 0 6px; padding: 0; border: 0; font-size: 17.5px; }
.step-list p { margin: 0; font-size: 14.5px; color: var(--muted); }

/* チェックリスト */
.chk { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 8px; }
.chk li { display: flex; gap: 10px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 11px 14px; font-size: 15px; }
.chk input[type="checkbox"] { width: 20px; height: 20px; margin-top: 4px; accent-color: var(--kaki); flex: none; }
.chk label { cursor: pointer; }

/* 注意・ポイントボックス */
.point, .notice, .memo {
  border-radius: var(--radius); padding: 20px 24px; margin: 22px 0;
  border: 1px solid var(--line); background: var(--panel);
}
.point { border-left: 6px solid var(--gold); background: var(--gold-soft); }
.notice { border-left: 6px solid var(--kaki); background: var(--kaki-soft); }
.memo { border-left: 6px solid var(--navy); }
.point h2, .notice h2, .memo h2, .point h3, .notice h3, .memo h3 { margin: 0 0 8px; padding: 0; border: 0; font-size: 17px; }
.point p, .notice p, .memo p { margin: 0; font-size: 14.5px; }
.point p + p, .notice p + p, .memo p + p { margin-top: 8px; }

/* テーブル */
.table-wrap { overflow-x: auto; margin: 20px 0; border-radius: var(--radius); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; background: var(--panel); font-size: 14.5px; min-width: 560px; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.7; }
thead th { background: var(--navy); color: #fff; font-weight: 700; white-space: nowrap; }
tbody tr:nth-child(even) { background: rgba(224, 216, 200, 0.18); }
tbody tr:last-child td { border-bottom: 0; }

/* FAQ */
details.faq {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0 22px; margin: 0 0 12px;
}
details.faq summary {
  cursor: pointer; padding: 16px 0; font-weight: 700; font-size: 15.5px;
  list-style: none; position: relative; padding-right: 34px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::before { content: "Q."; color: var(--kaki); font-family: var(--serif); margin-right: 8px; font-size: 17px; }
details.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 24px;
  width: 9px; height: 9px; border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy);
  transform: rotate(45deg); transition: transform .2s ease;
}
details.faq[open] summary::after { transform: rotate(225deg); top: 30px; }
details.faq .a { padding: 2px 0 18px; border-top: 1px dashed var(--line); font-size: 14.5px; color: #4a4438; }
details.faq .a p { margin: 10px 0 0; }

/* 図解 */
figure.diagram { margin: 26px 0; }
figure.diagram img, figure.diagram svg { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
figure.diagram figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; text-align: center; }

/* パンくず */
.breadcrumb { font-size: 13px; padding: 14px 0 0; color: var(--muted); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; color: var(--line); }
.breadcrumb a { color: var(--muted); }

/* ページヘッダー（下層） */
.page-header { padding: 30px 0 34px; border-bottom: 1px solid var(--line); background: var(--panel); }
.page-header h1 { margin: 10px 0 12px; font-size: clamp(24px, 3.4vw, 34px); }
.page-header .lead { color: var(--muted); margin: 0; max-width: 820px; }

/* 目次 */
.toc {
  background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--navy);
  border-radius: var(--radius); padding: 20px 26px; margin: 30px 0;
}
.toc strong { font-family: var(--serif); font-size: 17px; }
.toc ol { margin: 10px 0 0; padding-left: 22px; columns: 2; column-gap: 40px; font-size: 14.5px; }
.toc li { margin: 4px 0; break-inside: avoid; }

/* ピル */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pill { background: var(--navy); color: #fff; border-radius: 999px; padding: 5px 14px; font-size: 13px; font-weight: 600; }

/* 関連リンク */
.related { margin: 40px 0 0; padding: 22px 26px; background: var(--gold-soft); border-radius: var(--radius); border: 1px solid var(--line); }
.related strong { font-family: var(--serif); font-size: 17px; display: block; margin-bottom: 8px; }
.related ul { margin: 0; padding-left: 20px; font-size: 14.5px; }
.related li { margin: 5px 0; }

/* 次へナビ */
.next-nav { display: flex; justify-content: space-between; gap: 14px; margin: 44px 0 0; flex-wrap: wrap; }
.next-nav a {
  flex: 1; min-width: 220px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 20px; text-decoration: none; font-size: 14.5px;
}
.next-nav a small { display: block; color: var(--kaki); font-weight: 700; font-size: 12px; letter-spacing: 0.1em; margin-bottom: 4px; }
.next-nav a.next { text-align: right; }
.next-nav a:hover { border-color: var(--kaki); }

/* ---------- フッター ---------- */
.footer { margin-top: 70px; background: var(--navy); color: #e8e4da; }
.footer a { color: #fff; text-decoration: none; }
.footer a:hover { color: #f0c9b4; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 36px; padding: 44px 0 20px; }
.footer .brand { color: #fff; margin-bottom: 12px; }
.footer .brand-mark { background: #fff; color: var(--navy); }
.footer p { font-size: 13.5px; margin: 0 0 10px; }
.footer nav { display: grid; gap: 7px; font-size: 14px; align-content: start; }
.footer nav strong { font-family: var(--serif); font-size: 15px; color: #f0c9b4; margin-bottom: 4px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.18); padding: 14px 0 22px; font-size: 12.5px; color: #b9c2cf; }
.footer-info { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; }
.footer-info a { font-size: 13px; color: #f0c9b4; }
.footer-info a:hover { color: #fff; }

/* ---------- 用語集 ---------- */
.glossary-group { margin: 30px 0; }
.glossary-group > h2 { border-bottom: 2px solid var(--navy); padding-bottom: 8px; }
.term {
  background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--gold);
  border-radius: var(--radius); padding: 16px 20px; margin: 12px 0;
}
.term dt { font-family: var(--serif); font-size: 17.5px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.term dd { margin: 0; font-size: 14.5px; color: var(--ink); }
.term dd a { font-weight: 600; }
.glossary-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 20px; }
.glossary-nav a { background: var(--navy); color: #fff; border-radius: 999px; padding: 5px 14px; font-size: 13px; font-weight: 600; text-decoration: none; }
.glossary-nav a:hover { background: var(--kaki); color: #fff; }

/* ---------- コラム一覧・記事メタ ---------- */
.article-meta { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.article-meta .cat { background: var(--kaki-soft); color: var(--kaki); font-weight: 700; border-radius: 999px; padding: 3px 12px; }
.column-list { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 16px; }
.column-list li {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 24px;
}
.column-list h3 { margin: 0 0 6px; padding: 0; border: 0; font-size: 18px; }
.column-list h3 a { text-decoration: none; }
.column-list p { margin: 8px 0 0; font-size: 14.5px; color: var(--muted); }

/* ---------- お問い合わせフォーム ---------- */
.contact-form { display: grid; gap: 20px; max-width: 640px; }
.contact-form .field label { display: block; font-weight: 700; margin-bottom: 6px; }
.contact-form .field label small { font-weight: 400; color: var(--muted); margin-left: 8px; font-size: 12.5px; }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form select,
.contact-form textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--ink);
  font: inherit; line-height: 1.7;
}
.contact-form textarea { min-height: 180px; resize: vertical; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: 2px solid var(--navy); outline-offset: 1px; border-color: var(--navy);
}
.contact-form .consent { font-size: 13.5px; color: var(--muted); }
.contact-form .button { justify-self: start; border: 0; cursor: pointer; font-family: var(--sans); }
/* ハニーポット(スパム対策の隠し欄) ― 人間には見えない */
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* 本文中の情報ソース注記 */
.source-note { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.def-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 20px; margin: 18px 0; }
.def-box dt { font-weight: 700; margin-top: 14px; color: var(--navy); }
.def-box dd { margin: 4px 0 14px; font-size: 14.5px; }

/* トップへ戻る */
.to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--kaki); color: #fff; font-size: 20px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.to-top.show { opacity: 1; pointer-events: auto; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; padding: 34px 0 40px; gap: 26px; }
  .grid.three { grid-template-columns: 1fr; }
  .grid.two { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .toc ol { columns: 1; }
  .section { padding: 42px 0; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .step-list > li { padding: 16px 16px 16px 62px; }
  .step-list > li::before { left: 14px; font-size: 22px; }
  th, td { padding: 10px 12px; }
}

/* 印刷用（チェックリスト印刷を想定） */
@media print {
  .site-header, .footer, .to-top, .next-nav, .hero-actions, .breadcrumb { display: none !important; }
  body { background: #fff; }
  .card, .chk li, .step-list > li { break-inside: avoid; }
}
