/* ============================================================
   Static SEO pages (per-document and per-topic).
   Shares the palette with the SPA (styles.css) but uses a simple,
   single-column reading layout. Generated pages link back into
   the interactive app. Do not hand-edit alongside build/pages.js.
   ============================================================ */

:root {
  --bg: #faf7f2;
  --bg-panel: #f1ece3;
  --bg-card: #ffffff;
  --text: #2b2620;
  --text-muted: #6e6455;
  --accent: #8b2e2e;
  --accent-soft: #f3e2e2;
  --border: #ddd4c6;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
}
[data-theme="dark"] {
  --bg: #1d1b17;
  --bg-panel: #26231e;
  --bg-card: #2c2823;
  --text: #e8e2d6;
  --text-muted: #a89f8f;
  --accent: #d98f6c;
  --accent-soft: #3d2e28;
  --border: #3d382f;
  --shadow: 0 1px 3px rgba(0,0,0,.4);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d1b17;
    --bg-panel: #26231e;
    --bg-card: #2c2823;
    --text: #e8e2d6;
    --text-muted: #a89f8f;
    --accent: #d98f6c;
    --accent-soft: #3d2e28;
    --border: #3d382f;
    --shadow: 0 1px 3px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

.page-head {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
}
.page-head a.brand {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  font-size: 1.05rem;
}
.page-head a.brand:hover { text-decoration: underline; }

.wrap { max-width: 820px; margin: 0 auto; padding: 24px 20px 64px; }

nav.crumbs { font-size: .85rem; color: var(--text-muted); margin-bottom: 18px; }
nav.crumbs a { color: var(--accent); text-decoration: none; }
nav.crumbs a:hover { text-decoration: underline; }

h1 { font-size: 1.7rem; line-height: 1.25; margin: 0 0 8px; color: var(--accent); }
.lede { color: var(--text-muted); margin: 0 0 20px; font-size: 1.02rem; }

.interactive-cta {
  display: inline-block;
  margin: 4px 0 26px;
  padding: 9px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 7px;
  text-decoration: none;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: .92rem;
}
.interactive-cta:hover { filter: brightness(1.08); }

article.passage {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  margin: 0 0 16px;
  box-shadow: var(--shadow);
}
article.passage > .src {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
article.passage > .src a { color: var(--accent); text-decoration: none; }
article.passage h2, article.passage h3 { font-size: 1.12rem; margin: 4px 0 8px; }
article.passage p { margin: 0 0 10px; }
article.passage p:last-child { margin-bottom: 0; }

.tags {
  margin-top: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: .78rem;
}
.tags a {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 2px 9px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 20px;
  text-decoration: none;
}
.tags a:hover { text-decoration: underline; }

.index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.index-grid a {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 13px 15px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
}
.index-grid a:hover { border-color: var(--accent); }
.index-grid a strong { color: var(--accent); display: block; }
.index-grid a span { color: var(--text-muted); font-size: .85rem; }

.page-foot {
  border-top: 1px solid var(--border);
  margin-top: 36px;
  padding-top: 18px;
  color: var(--text-muted);
  font-size: .85rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.page-foot a { color: var(--accent); }

h2.section-head { font-size: 1.15rem; margin: 30px 0 12px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
