/* ========================================
   大河ドラマ図鑑 — 専用デザイン（/taiga/ 配下だけで使う）
   この CSS が正本。tools/generate-taiga-drama-pages.js は触らない。
   白基調＋紺＋朱。見出しは Noto Serif JP。画像は使わず文字と CSS で構成する。
   ======================================== */

:root {
  --tg-bg: #ffffff;
  --tg-paper: #f7f6f2;
  --tg-ink: #1d2233;
  --tg-ink-soft: #484e63;
  --tg-muted: #666c80;
  --tg-navy: #1f2a52;
  --tg-navy-deep: #151d3d;
  --tg-navy-soft: #e8ebf4;
  --tg-red: #b03a2e;
  --tg-red-soft: #f8e9e7;
  --tg-line: #dcdfe8;
  --tg-serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  --tg-sans: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic Medium", "Yu Gothic", "Noto Sans JP", sans-serif;
  --tg-radius: 12px;
  --tg-width: 1040px;
}

* { box-sizing: border-box; }

body.tg-body {
  margin: 0;
  background: var(--tg-bg);
  color: var(--tg-ink);
  font-family: var(--tg-sans);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

.tg-body a { color: var(--tg-navy); }
.tg-body a:hover { color: var(--tg-red); }
.tg-body :focus-visible { outline: 3px solid var(--tg-red); outline-offset: 2px; }

/* 見出し・短い文は BudouX の <wbr> で改行する */
.tg-wbr, .tg-body h1, .tg-body h2, .tg-body h3 {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.tg-wrap { max-width: var(--tg-width); margin: 0 auto; padding: 0 20px; }

/* ---------- ヘッダー ---------- */
.tg-header { border-bottom: 3px solid var(--tg-navy); background: #fff; }
.tg-header-inner {
  max-width: var(--tg-width); margin: 0 auto; padding: 10px 20px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px;
}
.tg-brand {
  font-family: var(--tg-serif); font-weight: 700; font-size: 1.2rem;
  color: var(--tg-navy); text-decoration: none; letter-spacing: .06em;
}
.tg-brand span { color: var(--tg-red); }
.tg-nav { display: flex; flex-wrap: wrap; gap: 0 4px; }
.tg-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px;
  font-size: .9rem; text-decoration: none; color: var(--tg-ink-soft);
}
.tg-crumb { font-size: .85rem; color: var(--tg-muted); padding: 14px 20px 2px; line-height: 1.6; }
.tg-crumb a { color: var(--tg-muted); }

/* ---------- ヒーロー ---------- */
.tg-hero {
  background: var(--tg-navy); color: #fff; position: relative; overflow: hidden;
  padding: 48px 0 44px;
}
.tg-hero::after {
  content: "大河"; position: absolute; right: -8px; bottom: -34px;
  font-family: var(--tg-serif); font-weight: 700; font-size: 9rem; line-height: 1;
  color: rgba(255,255,255,.06); pointer-events: none;
}
.tg-hero .tg-eyebrow { margin: 0 0 8px; font-size: .8rem; letter-spacing: .24em; color: #f0b9b2; }
.tg-hero h1 {
  margin: 0 0 14px; font-family: var(--tg-serif); font-weight: 700;
  font-size: clamp(1.9rem, 7vw, 2.8rem); line-height: 1.35; letter-spacing: .04em;
}
.tg-hero .tg-lead { margin: 0; max-width: 34em; font-size: 1.02rem; color: #e3e7f4; }

/* 詳細ページのヒーロー */
.tg-hero-detail { display: flex; gap: 20px; align-items: flex-start; }
.tg-hero-detail h1 { font-size: clamp(1.7rem, 6.4vw, 2.5rem); margin-bottom: 6px; }
.tg-title-sub { margin: 0 0 12px; font-size: .8rem; letter-spacing: .12em; color: #c9cfe6; }
.tg-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tg-meta li {
  font-size: .82rem; padding: 2px 10px; border-radius: 999px;
  background: rgba(255,255,255,.14); color: #fff;
}
.tg-meta li.tg-status { background: var(--tg-red); }

/* ---------- 節 ---------- */
.tg-section { padding: 40px 0 8px; }
.tg-section h2 {
  margin: 0 0 6px; padding-left: 14px; border-left: 5px solid var(--tg-red);
  font-family: var(--tg-serif); font-size: 1.45rem; line-height: 1.45; color: var(--tg-navy);
}
.tg-section h3 { font-family: var(--tg-serif); color: var(--tg-navy); line-height: 1.5; margin: 24px 0 8px; font-size: 1.15rem; }
.tg-section-lead { margin: 0 0 16px 19px; font-size: .92rem; color: var(--tg-muted); }
.tg-section p { margin: 0 0 1em; }

/* ---------- チップ ---------- */
.tg-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.tg-chips a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--tg-navy); border-radius: 999px; background: #fff;
  font-family: var(--tg-serif); font-weight: 700; text-decoration: none; color: var(--tg-navy);
}
.tg-chips a:hover { background: var(--tg-navy); color: #fff; }

/* ---------- カード ---------- */
.tg-cards { display: grid; gap: 14px; grid-template-columns: 1fr; margin: 16px 0 0; padding: 0; list-style: none; }
.tg-card {
  position: relative; display: flex; flex-direction: column; height: 100%;
  border: 1px solid var(--tg-line); border-radius: var(--tg-radius); background: #fff; overflow: hidden;
  color: var(--tg-ink); text-decoration: none;
}
a.tg-card:hover { border-color: var(--tg-navy); box-shadow: 0 4px 14px rgba(31,42,82,.12); color: var(--tg-ink); }
.tg-card-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--tg-navy-soft); border-bottom: 1px solid var(--tg-line);
}
.tg-card-title { margin: 0; font-family: var(--tg-serif); font-weight: 700; font-size: 1.15rem; line-height: 1.4; color: var(--tg-navy); }
.tg-card-body { padding: 12px 16px 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.tg-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: .78rem; }
.tg-card-tags li { padding: 1px 9px; border-radius: 999px; background: var(--tg-paper); color: var(--tg-ink-soft); border: 1px solid var(--tg-line); }
.tg-card-tags li.tg-badge { background: var(--tg-red); border-color: var(--tg-red); color: #fff; }
.tg-card-hero { margin: 0; font-size: .85rem; color: var(--tg-muted); }
.tg-card-hook { margin: 0; font-size: .94rem; line-height: 1.7; color: var(--tg-ink); }
.tg-card-go {
  margin-top: auto; padding: 10px 16px; border-top: 1px solid var(--tg-line);
  font-size: .9rem; font-weight: 700; color: var(--tg-red); text-align: right;
}
.tg-card-soon {
  margin-top: auto; padding: 10px 16px; border-top: 1px dashed var(--tg-line);
  font-size: .8rem; color: var(--tg-muted); text-align: right;
}
.tg-card.is-static { background: var(--tg-paper); }

/* ---------- 人物リンク ---------- */
.tg-people { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.tg-people a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--tg-line); border-radius: 8px; background: #fff; text-decoration: none;
}
.tg-people a:hover { border-color: var(--tg-red); }

/* ---------- 基本情報表・本文 ---------- */
.tg-facts { margin: 16px 0 0; border-top: 1px solid var(--tg-line); }
.tg-facts div { display: flex; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--tg-line); }
.tg-facts dt { flex: none; width: 5.5em; font-weight: 700; color: var(--tg-navy); font-size: .92rem; }
.tg-facts dd { margin: 0; flex: 1; min-width: 0; font-size: .95rem; }
.tg-hook { font-family: var(--tg-serif); font-size: 1.25rem; line-height: 1.6; color: var(--tg-red); margin: 0 0 12px; }
.tg-moods { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.tg-moods li { padding: 2px 12px; border-radius: 999px; background: var(--tg-red-soft); color: var(--tg-red); font-size: .85rem; }

.tg-appeal { display: grid; gap: 12px; margin: 16px 0 0; }
.tg-appeal article { padding: 16px; border-radius: var(--tg-radius); background: var(--tg-paper); border-left: 4px solid var(--tg-navy); }
.tg-appeal h3 { margin: 0 0 6px; font-size: 1.05rem; }
.tg-appeal p { margin: 0; font-size: .95rem; }

.tg-list { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.tg-list li { position: relative; padding-left: 1.6em; }
.tg-list li::before { content: "✓"; position: absolute; left: 0; color: var(--tg-red); font-weight: 700; }
.tg-bullets { margin: 12px 0 0; padding-left: 1.3em; }

/* ---------- 登場人物 ---------- */
.tg-cast { margin: 16px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--tg-line); }
.tg-cast li { padding: 12px 2px; border-bottom: 1px solid var(--tg-line); }
.tg-cast-name { margin: 0; font-weight: 700; line-height: 1.5; }
.tg-cast-name a { font-family: var(--tg-serif); }
.tg-cast-actor { font-weight: 400; font-size: .88rem; color: var(--tg-muted); margin-left: .5em; }
.tg-cast-role { margin: 2px 0 0; font-size: .9rem; color: var(--tg-ink-soft); }
.tg-cast-link { display: inline-block; margin-top: 4px; font-size: .82rem; font-weight: 700; color: var(--tg-red); }

/* ---------- 配信 ---------- */
.tg-stream { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.tg-stream li { padding: 12px 16px; border: 1px solid var(--tg-line); border-radius: var(--tg-radius); }
.tg-stream-note, .tg-stream-date { margin: 2px 0 0; font-size: .85rem; color: var(--tg-muted); }

/* ---------- 史実（折りたたみ） ---------- */
.tg-history { margin: 16px 0 0; border: 1px solid var(--tg-navy); border-radius: var(--tg-radius); background: #fff; }
.tg-history > summary {
  cursor: pointer; padding: 14px 44px 14px 16px; min-height: 44px; list-style: none; position: relative;
  font-family: var(--tg-serif); font-weight: 700; color: var(--tg-navy);
}
.tg-history > summary::-webkit-details-marker { display: none; }
.tg-history > summary::after {
  content: "＋"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  color: var(--tg-red); line-height: 1;
}
.tg-history[open] > summary::after { content: "－"; }
.tg-history-body { padding: 0 16px 16px; }
.tg-history-body h3 { margin-top: 18px; }
.tg-spoiler {
  margin: 0 0 8px; padding: 10px 12px; border-radius: 8px; background: var(--tg-red-soft);
  color: var(--tg-red); font-size: .88rem; line-height: 1.7;
}

/* ---------- 注記・フッター ---------- */
.tg-note { margin: 16px 0 0; font-size: .85rem; color: var(--tg-muted); line-height: 1.8; }
.tg-footer { margin-top: 56px; background: var(--tg-navy-deep); color: #d5d9ea; padding: 28px 0 24px; }
.tg-footer a { color: #fff; }
.tg-footer-brand { margin: 0 0 8px; font-family: var(--tg-serif); font-weight: 700; font-size: 1.05rem; color: #fff; }
.tg-footer-nav { display: flex; flex-wrap: wrap; gap: 0 12px; margin: 0 0 8px; }
.tg-footer-nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: .88rem; }
.tg-footer-note { margin: 0; font-size: .8rem; color: #aab0c8; line-height: 1.8; }

@media (min-width: 720px) {
  .tg-cards { grid-template-columns: repeat(2, 1fr); }
  .tg-cards.is-pickup { grid-template-columns: repeat(3, 1fr); }
  .tg-hero { padding: 72px 0 64px; }
}
@media (min-width: 960px) {
  .tg-cards.is-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 400px) {
  .tg-hero-detail { gap: 14px; }
  .tg-facts dt { width: 4.6em; }
}

@media print {
  .tg-header, .tg-nav, .tg-footer, .tg-hero::after { display: none; }
  .tg-hero { background: none; color: #000; padding: 0; }
  .tg-hero h1, .tg-hero .tg-lead { color: #000; }
}

/* ---------- 歴代一覧（/taiga/all/） ---------- */
.tg-all-intro { margin: 0 0 12px; max-width: 42em; line-height: 1.9; }
.tg-all-scroll { margin: 16px 0 0; overflow-x: auto; border: 1px solid var(--tg-line); border-radius: var(--tg-radius); -webkit-overflow-scrolling: touch; }
.tg-all { width: 100%; min-width: 640px; border-collapse: collapse; font-size: .92rem; }
.tg-all th, .tg-all td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--tg-line); line-height: 1.6; }
.tg-all thead th { background: var(--tg-navy-soft); color: var(--tg-navy); font-size: .85rem; white-space: nowrap; }
.tg-all tbody th { font-weight: 700; }
.tg-all tbody tr:last-child th, .tg-all tbody tr:last-child td { border-bottom: 0; }
.tg-all-year { white-space: nowrap; }
.tg-all-no { display: block; font-size: .75rem; color: var(--tg-muted); }
.tg-more { display: inline-block; padding: 10px 18px; border-radius: 999px; background: var(--tg-navy); color: #fff !important; font-weight: 700; text-decoration: none; }
.tg-more:hover { background: var(--tg-red); }
