/* NouManの読み解き — 初版。文字中心、スマートフォン優先。画像・Webフォントは使わない */
:root {
  --bg: #fbfaf6;
  --surface: #ffffff;
  --text: #22251f;
  --muted: #5d6357;
  --line: #dcdcd2;
  --accent: #2f6b3f;        /* 落ち着いた緑。白地でのコントラスト比 約6:1 */
  --accent-soft: #e9f1ea;
  --fact: #f3f1e8;
  --interp: #eef4ef;
  --caution: #fbf3e4;
  --preview: #7a4b00;
  --preview-bg: #fff4dc;
  --radius: 10px;
  --measure: 648px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161814;
    --surface: #1e211c;
    --text: #e9ebe4;
    --muted: #a9afa2;
    --line: #353a31;
    --accent: #8fc79c;
    --accent-soft: #233025;
    --fact: #24261f;
    --interp: #1f2a21;
    --caution: #2c2618;
    --preview: #ffd28a;
    --preview-bg: #3a2c10;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  font-size: 17px;
  line-height: 1.9;
  overflow-wrap: anywhere;
  word-break: normal;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.preview-banner {
  background: var(--preview-bg); color: var(--preview);
  font-size: 14px; line-height: 1.6; padding: 8px 16px; text-align: center;
}
.site-header, main, .site-footer { max-width: calc(var(--measure) + 32px); margin: 0 auto; padding: 0 16px; }
.site-header { padding-top: 18px; padding-bottom: 10px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; border-bottom: 1px solid var(--line); }
.site-name { font-weight: 700; font-size: 19px; color: var(--text); text-decoration: none; }
.site-nav { display: flex; gap: 18px; font-size: 15px; }
.site-nav a { padding: 6px 0; }
main { padding-bottom: 40px; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; padding-top: 16px; padding-bottom: 40px; }
.site-footer p { margin: 4px 0; }

h1 { font-size: 26px; line-height: 1.45; margin: 24px 0 12px; letter-spacing: 0.01em; }
h2 { font-size: 20px; line-height: 1.5; margin: 32px 0 10px; }
.intro h1 { margin-top: 28px; }
.lead { font-size: 17px; color: var(--muted); margin: 0 0 8px; }
.muted { color: var(--muted); }
.soon { font-size: 15px; }

.cards { display: grid; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 12px; }
.card-meta { margin: 0 0 4px; font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.cat { color: var(--accent); font-weight: 600; }
.series { color: var(--muted); }
.badge { font-size: 12px; border: 1px solid var(--preview); color: var(--preview); border-radius: 999px; padding: 0 8px; line-height: 1.7; }
.card-title { font-size: 19px; line-height: 1.5; margin: 4px 0 6px; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover, .card-title a:focus-visible { text-decoration: underline; color: var(--accent); }
.card-summary { margin: 0 0 4px; }
.card-note { margin: 0; font-size: 14px; color: var(--muted); }
.dates { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.dates.draft { color: var(--preview); }

.themes { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.themes a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--text); }
.theme-name { display: block; font-weight: 700; color: var(--accent); }
.theme-desc { display: block; font-size: 15px; color: var(--muted); line-height: 1.7; }

.crumbs { font-size: 14px; color: var(--muted); margin-top: 16px; }
.post-header .summary { font-size: 17px; background: var(--surface); border-left: 4px solid var(--accent); padding: 10px 14px; margin: 14px 0 8px; border-radius: 0 var(--radius) var(--radius) 0; }
.period { font-size: 14px; color: var(--muted); margin: 0 0 22px; }
.term-head { margin: 10px 0 0; font-size: 15px; }
.post-body p { margin: 0 0 1.1em; }
.post-body ul, .post-body ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.post-body li { margin-bottom: 0.5em; }
.box { border-radius: var(--radius); padding: 12px 16px 2px; margin: 0 0 1.2em; }
.box-label { font-size: 14px; font-weight: 700; margin: 0 0 4px !important; }
.box-fact { background: var(--fact); }
.box-fact .box-label { color: var(--muted); }
.box-interpretation { background: var(--interp); border-left: 4px solid var(--accent); }
.box-interpretation .box-label { color: var(--accent); }
.box-caution { background: var(--caution); font-size: 15px; padding-top: 10px; }
.box-note { background: var(--surface); border: 1px solid var(--line); }
.term .gloss, .gloss { color: var(--muted); font-size: 0.95em; }

.sources ul, .related ul { list-style: none; padding: 0; margin: 0; }
.sources li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.7; }
.src-title { display: block; font-weight: 600; }
.src-meta { display: block; color: var(--muted); }
.src-link { display: inline-block; margin-top: 4px; padding: 4px 0; }
.related li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.related a { font-weight: 600; }

.guide { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 28px 0 0; background: var(--surface); }
.guide p { margin: 0 0 4px; }
.guide-label { font-size: 13px; color: var(--muted); }
.guide-note { font-size: 14px; color: var(--muted); }
.guide-unconnected { border-style: dashed; border-color: var(--preview); }
.guide-unconnected .guide-label { color: var(--preview); }

.back { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 28px 0 0; font-size: 16px; }
.back a { padding: 8px 0; }

@media (min-width: 760px) {
  body { font-size: 18px; }
  h1 { font-size: 30px; }
  .cards { grid-template-columns: 1fr; }
}

/* 表（スマートフォンでは横にスクロール。ページ全体ははみ出さない） */
.table-wrap { overflow-x: auto; margin: 0 0 1.2em; -webkit-overflow-scrolling: touch; }
.post-body table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.6; min-width: 100%; }
.post-body th, .post-body td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: right; white-space: nowrap; }
.post-body thead th { background: var(--fact); font-weight: 700; text-align: right; }
.post-body th[scope="row"], .post-body thead th:first-child { text-align: left; white-space: normal; font-weight: 600; }
.post-body table.has-total tbody tr:last-child th, .post-body table.has-total tbody tr:last-child td { font-weight: 700; }
@media (max-width: 520px) {
  .post-body table { font-size: 14px; }
  .post-body th, .post-body td { padding: 6px 4px; }
  .post-body td.num { white-space: nowrap; }
  .post-body td:not(.num) { text-align: left; min-width: 8em; white-space: normal; }
  .post-body th { white-space: normal; word-break: keep-all; overflow-wrap: anywhere; }
  .post-body th[scope="row"] { min-width: 3.5em; }
}

/* 画像・図（2026-10-18 追加）。表示サイズは HTML の width・height で確保し、レイアウトのずれを防ぐ */
.hero { margin: 14px 0 10px; }
.hero img { display: block; width: 100%; height: auto; border-radius: var(--radius); background: #f3efe2; }
.credit { margin-top: 6px; font-size: 12px; color: var(--muted); }
.card.has-image { padding-top: 0; overflow: hidden; }
.card-img { display: block; margin: 0 -16px 12px; }
.card-img img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; }
.chart { margin: 22px 0; padding: 14px; background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius); }
.chart-title { margin: 0 0 10px; font-weight: 700; color: #22251f; }
.chart img { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; }
.chart-note { margin-top: 10px; font-size: 13px; line-height: 1.6; color: #4b5046; }
.chart-note-strong { color: #22251f; }
.card-img { position: relative; }
.img-badge { position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; font-size: 11px; color: #22251f; background: rgba(255, 255, 255, 0.85); border-radius: 999px; }
.info-checked { margin: 0 0 18px; padding: 10px 12px; font-size: 14px; color: var(--text); background: var(--caution); border-radius: var(--radius); }
.post-body h3 { margin: 26px 0 8px; font-size: 17px; line-height: 1.5; }
/* 文章の入るセルは、PC でも折り返す（数字だけのセルは改行しない） */
.post-body td:not(.num), .post-body tbody th { white-space: normal; text-align: left; }
.post-body td:not(.num) { min-width: 7em; }
.post-body thead th { text-align: left; }
.post-body thead th.num { text-align: right; }

/* ── 読み物の型（2026-10-19、記事の属性 layout: "reading" の記事だけ）──────────────
   方針: 白地・文字組み・余白・見出しの強弱で区切る。色の箱を減らし、書き分けはラベルと細い線で残す（visual-style.md §0）
   指定のない記事（ヤオコー編など）は、上のこれまでの表示のまま */
.layout-reading {
  --bg: #ffffff;
  --text: #1f221d;
  --muted: #5f655a;
  --line: #e4e4dc;
  --measure: 640px;
  --wide: 880px;
  letter-spacing: 0.02em;
  line-height: 2;
}
@media (prefers-color-scheme: dark) {
  .layout-reading { --bg: #151714; --text: #e8eae3; --muted: #a6ac9f; --line: #30352d; }
}
.layout-reading .site-header { padding-top: 14px; padding-bottom: 12px; }
.layout-reading .site-name { font-size: 16px; letter-spacing: 0.06em; }
.layout-reading .site-nav { font-size: 14px; }
.layout-reading .crumbs { font-size: 13px; margin-top: 20px; }
.layout-reading .post-header .card-meta { margin-top: 28px; font-size: 13px; letter-spacing: 0.08em; }
.layout-reading .post-header h1 { font-size: 25px; line-height: 1.5; margin: 6px 0 14px; }
.layout-reading .title-main, .layout-reading .title-sub { display: block; }
/* 日本語の文節で折り返し、行の長さをそろえる（対応していないブラウザは通常の折り返し） */
.layout-reading .title-main, .layout-reading .title-sub { word-break: auto-phrase; text-wrap: balance; }
.layout-reading .title-sub { margin-top: 10px; font-size: 17px; line-height: 1.6; font-weight: 600; color: var(--muted); letter-spacing: 0.03em; }
.layout-reading .post-header .dates { font-size: 13px; margin: 0 0 22px; }
.layout-reading .hero { margin: 0 -16px; }
.layout-reading .hero img { border-radius: 0; }
.layout-reading .hero .credit { padding: 0 16px; line-height: 1.6; }
.layout-reading .post-header .summary { background: none; border: 0; border-radius: 0; padding: 0; margin: 26px 0 8px; font-size: 17px; line-height: 1.95; font-weight: 500; }
.layout-reading .period { font-size: 13px; margin-bottom: 36px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.layout-reading .post-body h2 { font-size: 22px; line-height: 1.55; margin: 64px 0 20px; letter-spacing: 0.02em; }
.layout-reading .post-body h3 { font-size: 18px; margin: 40px 0 12px; }
.layout-reading .post-body p { margin: 0 0 1.5em; }
.layout-reading .post-body li { margin-bottom: 0.7em; }
.layout-reading .box { border-radius: 0; margin: 0 0 1.8em; padding: 0; background: none; }
.layout-reading .box-label { font-size: 12px !important; letter-spacing: 0.1em; margin: 0 0 8px !important; }
.layout-reading .box-fact { border-top: 1px solid var(--text); border-bottom: 1px solid var(--line); padding: 14px 0 2px; }
.layout-reading h2 + .box-fact { border-top-color: var(--line); }
.layout-reading .box-interpretation { border-left: 3px solid var(--accent); padding: 2px 0 2px 18px; }
.layout-reading .box-caution { background: var(--caution); padding: 14px 16px 4px; font-size: 15px; }
.layout-reading .box-note { border: 0; border-top: 1px solid var(--line); padding: 16px 0 0; font-size: 14px; line-height: 1.85; color: var(--muted); margin-top: 48px; }
.layout-reading .box-note .box-label { color: var(--muted); }
.layout-reading .post-body table { font-size: 14px; }
.layout-reading .post-body thead th { background: none; border-bottom: 1px solid var(--text); }
.layout-reading .sources h2, .layout-reading .related h2 { font-size: 15px; letter-spacing: 0.1em; margin-top: 56px; color: var(--muted); }
.layout-reading .sources li { font-size: 14px; }

/* 本文の写真（[[IMG-nnnn]]）。撮影の年・場所と、作者・ライセンスを写真ごとに直下へ */
.photos { margin: 36px -16px 40px; }
.photo-item { margin: 0 0 20px; }
.photo-item img { display: block; width: 100%; height: auto; background: #eeece4; }
.photo-item figcaption { padding: 8px 16px 0; }
.photo-label { display: block; font-size: 13px; line-height: 1.7; color: var(--text); }
.photo-credit { display: block; margin-top: 2px; font-size: 11px; line-height: 1.6; color: var(--muted); }
.photo-credit a { color: inherit; }
.layout-reading .post-body .photos-note, .photos-note { margin: 0; padding: 0 16px; font-size: 12px; line-height: 1.7; color: var(--muted); }

/* 次に読む（写真つきのカード）と、区分への入口 */
.next-reads { margin-top: 64px; border-top: 1px solid var(--text); padding-top: 18px; }
.next-reads h2 { font-size: 15px; letter-spacing: 0.1em; margin: 0 0 16px; color: var(--muted); }
.next-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; }
.next-card { display: grid; grid-template-columns: 128px 1fr; gap: 14px; text-decoration: none; color: var(--text); align-items: start; }
.next-img { position: relative; display: block; aspect-ratio: 1200 / 630; background: #eeece4; overflow: hidden; }
.next-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.next-img .img-badge { right: 4px; bottom: 4px; font-size: 10px; padding: 0 6px; }
.next-text { display: block; }
.next-cat { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--accent); letter-spacing: 0.06em; line-height: 1.6; }
.next-title { display: block; margin-top: 2px; font-weight: 700; font-size: 15px; line-height: 1.6; }
.next-card:hover .next-title, .next-card:focus-visible .next-title { text-decoration: underline; }
.next-themes { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-top: 28px; font-size: 14px; }
.next-themes-label { width: 100%; font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }
.next-themes a { border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; text-decoration: none; color: var(--text); line-height: 1.7; }
.layout-reading .back { display: none; }

@media (min-width: 760px) {
  .layout-reading { font-size: 18px; }
  .layout-reading .post-header h1 { font-size: 34px; line-height: 1.45; }
  .layout-reading .title-sub { font-size: 20px; }
  .layout-reading .hero, .layout-reading .photos { width: min(var(--wide), calc(100vw - 48px)); position: relative; left: 50%; transform: translateX(-50%); margin-left: 0; margin-right: 0; }
  .layout-reading .hero .credit { padding: 0; }
  .layout-reading .post-header .summary { font-size: 18px; }
  .layout-reading .post-body h2 { font-size: 25px; margin-top: 80px; }
  .layout-reading .photos { margin-top: 44px; margin-bottom: 48px; }
  .photos-multi { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
  .photos-multi .photos-note { grid-column: 1 / -1; }
  .photo-item figcaption { padding: 8px 0 0; }
  .layout-reading .post-body .photos-note, .photos-note { padding: 0; }
  .next-list { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .next-card { grid-template-columns: 1fr; gap: 10px; }
  .next-themes-label { width: auto; margin-right: 6px; }
}
.layout-reading .nowrap { white-space: nowrap; }
