/* Book theme -- layered over theme.css.
   A reading-first treatment for ordered, interconnected chapters: a large
   chapter folio, a serif measure set for long-form reading, and prev/next
   pagers between chapters. Only the frame and prose typography change; the
   generated body markup is identical to every other theme. */

:root { --measure: 1080px; }

/* Hero: a book-page opening with a large drop folio above the title. */
.book-hero {
  max-width: 760px; padding: 64px 0 40px;
  border-bottom: 1px solid var(--line);
}
.chapter-folio {
  margin: 0 0 10px;
  font: 600 12px var(--mono); letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent);
}
.book-hero .feynman-title {
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 60px); line-height: 1.08; max-width: 720px;
}
.book-hero .feynman-subtitle { margin-top: 18px; font-family: var(--serif); font-style: italic; }
/* Credit row: the shared `.doc-meta` in theme.css, set in the mono face and
   tucked in a little so it reads as a colophon under a serif title. */
.book-meta { gap: 6px 20px; margin-top: 22px; font-family: var(--mono); }

/* Layout: a generous single measure with the in-chapter contents to the side. */
.book-layout {
  display: grid; grid-template-columns: 200px minmax(0, 1fr);
  gap: 60px; padding: 48px 0 72px;
}
.book-prose { max-width: 680px; }

/* Long-form serif prose: larger type, a looser measure, drop-cap-free but airy. */
.book-prose p { font-family: var(--serif); font-size: 1.12rem; line-height: 1.9; }
.book-prose li { font-family: var(--serif); }
.book-prose h2, .book-prose h3 { font-family: var(--serif); }
.book-prose h2 { margin-top: 2.2em; }

/* Header prev/next: compact icon links flanking Home; label hides when tight. */
.chapter-nav {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--body); padding-block: 8px;
}
.chapter-nav:hover { color: var(--accent); }
.chapter-nav-label { font-family: var(--mono); letter-spacing: 0.04em; }

/* Footer pager: the primary "keep reading" affordance between chapters. */
.chapter-pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin: 8px 0 72px; padding-top: 28px; border-top: 1px solid var(--line);
}
.pager-link {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); text-decoration: none; transition: border-color 0.15s;
}
.pager-link:hover { border-color: var(--accent); }
/* Keep "next" in the right column even when there is no "previous" link. */
.pager-next { grid-column: 2; text-align: right; }
.pager-dir { font: 600 11px var(--mono); letter-spacing: 0.08em; color: var(--muted); }
.pager-title { font-family: var(--serif); font-size: 1.05rem; color: var(--ink); }

/* Contents page: a numbered chapter index, the book's entry point. */
.book-contents { max-width: 720px; padding: 40px 0 72px; }
.chapter-list { list-style: none; margin: 0; padding: 0; }
.chapter-item { border-top: 1px solid var(--line); }
.chapter-item:last-child { border-bottom: 1px solid var(--line); }
.chapter-link {
  display: flex; align-items: baseline; gap: 22px;
  padding: 22px 6px; text-decoration: none; transition: color 0.15s;
}
.chapter-link:hover { color: var(--accent); }
.chapter-link:hover .chapter-title { color: var(--accent); }
.chapter-num {
  font: 600 13px var(--mono); color: var(--muted); letter-spacing: 0.06em;
  min-width: 2.4em;
}
.chapter-text { display: flex; flex-direction: column; gap: 4px; }
.chapter-title { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); }
.chapter-sub { font-size: 0.95rem; color: var(--muted); }

@media (max-width: 860px) {
  .book-layout { display: block; padding-top: 36px; }
  .book-layout .contents, .book-layout .contents.js-only { display: none; }
  .book-prose { max-width: 100%; }
  .chapter-nav-label { display: none; }
}
@media (max-width: 560px) {
  .chapter-pager { grid-template-columns: 1fr; }
  .pager-next { text-align: left; }
}
@media print {
  .book-hero { padding-top: 20px; }
  .book-layout { display: block; padding-top: 24px; }
  .chapter-nav, .chapter-pager { display: none; }
}
