/* ============================================================================
   theme.css -- this book's look. Book-owned: edit freely.

   The book's look comes from css/division.css, generated from bible-core's
   web/themes.json (its division's paper, ink and typefaces, plus this
   book's accent pair and emblem). To change the accents or emblem, set
   book.json "theme"; to adjust anything else, override it here: this file
   loads last. The :root block below is the fallback for a book with no
   division theme.

   The whitelist check reads every css/*.css: a class a fragment uses must be
   defined in one of them. A new component belongs in bible-core's component
   registry (biblecore/components/), enabled in book.json.
   ========================================================================== */

:where(:root) {  /* fallback only: division.css wins when present */
  --bg: #e9dfc3;
  --panel: #f4eed9;
  --panel-2: #e3d5ab;
  --ink: #2e2717;
  --ink-soft: #6b5d40;
  --rule: #cab883;
  --rule-soft: #ddcda0;

  /* stable chrome accents — independent of any unit's root palette */
  --accent-clay: #b1481f;     /* verse numbers, endnote markers */
  --accent-bronze: #8c6d1f;   /* pericope headings, spotlight-adjacent accents */
  --accent-jordan: #2f5f6b;   /* movement labels, structural chrome */
  --accent-olive: #55642f;
  --accent-wine: #7a3f5c;

  --display: "Cinzel", Georgia, serif;
  --serif: "Frank Ruhl Libre", Georgia, "Times New Roman", serif;

  --maxw: 100%;
  --flash: #f0c877;

  /* surfaces that used to be hard-coded */
  --glow-1: #f7f0da;                        /* body background, top-left glow */
  --glow-2: #ddc98f;                        /* body background, bottom-right glow */
  --topbar-bg: rgba(233, 223, 195, 0.94);   /* sticky bar, over the text */
  --root-active-bg: rgba(139, 109, 31, .12);/* clicked root, where color-mix is missing */
}

/* ---- book-only rules and overrides below ---- */

/* ============================================================================
   Matthew's own fragment components (rings, chiasms, triads, the exodus
   table, the prayer block, the Greek title), carried over from the old
   css/styles.css when Matthew moved to the template shell (2026-09-26).
   ========================================================================== */

/* Matthew's accent names, on the division's tokens */
:root, :root[data-theme] {
  --accent-crimson: var(--accent-clay);
  --accent-gold: var(--accent-bronze);
  --accent-slate: var(--accent-jordan);
  --accent-warm: var(--accent-olive);
  --accent-rust: var(--accent-wine);
}

.unit .mast .greek-title { font-size: 21px; color: var(--accent-gold); font-style: italic; margin-bottom: .2em; }
.unit .mast .greek-title .tsub { color: var(--ink-soft); font-size: .8em; font-style: normal; }
.unit .tr { font-style: italic; color: var(--ink-soft); font-size: .92em; }
.unit .structure { margin: 34px 0 40px; border: 1px solid var(--rule); border-radius: 7px; background: var(--panel); padding: 24px; }
.unit .structure h2 { font-family: var(--display); font-size: 16px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; margin: 0 0 4px; text-align: center; }
.unit .structure p.cap { text-align: center; font-style: italic; color: var(--ink-soft); font-size: 15px; margin: 0 0 20px; }
.unit .frame { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--display); font-size: 20px; margin-bottom: 6px; }
.unit .frame .node { padding: 3px 10px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--rule); }
.unit .frame .arrow { color: var(--ink-soft); }
.unit .frame .j { color: var(--accent-warm); font-weight: 600; }
.unit .frame .d { color: var(--accent-gold); font-weight: 600; }
.unit .frame .a { color: var(--ink); font-weight: 600; }
.unit .mirror { text-align: center; color: var(--ink-soft); font-size: 14px; font-style: italic; margin: 2px 0 22px; }
.unit .triads { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--rule-soft); }
.unit .triad { display: flex; align-items: center; justify-content: space-between; padding: 11px 4px; border-bottom: 1px solid var(--rule-soft); gap: 12px; }
.unit .triad .span { font-family: var(--display); font-size: 18px; }
.unit .triad .cnt { font-size: 14px; color: var(--ink-soft); font-style: italic; }
.unit .triad .pivot { color: var(--accent-gold); font-weight: 600; }
.unit .triad .exile { color: var(--accent-crimson); font-weight: 600; }
.unit .gem { text-align: center; font-size: 14.5px; color: var(--ink-soft); margin-top: 16px; font-style: italic; line-height: 1.5; }
.unit .gem b { color: var(--accent-gold); font-style: normal; }
.unit h3.movement, .unit h3.panel { font-family: var(--display); font-size: 15px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; margin: 40px 0 16px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); text-indent: 0; }
.unit .movement { font-family: var(--display); font-size: 21px; font-weight: 600; color: var(--accent-gold); margin: 38px 0 4px; border-bottom: 1px solid var(--rule); padding-bottom: 5px; }
.unit .movement small { display: block; font-size: 13.5px; font-weight: 400; font-style: italic; color: var(--ink-soft); letter-spacing: 0; text-transform: none; }
.unit .ring { display: grid; grid-template-columns: 1fr; gap: 10px; }
.unit .ringrow { display: grid; grid-template-columns: 42px 1fr; gap: 14px; align-items: start; padding: 9px 12px; border-radius: 6px; background: var(--panel-2); }
.unit .ringrow.center { background: #efe4cb; border: 1px solid var(--rule); }
.unit .ringrow .lab { font-family: var(--display); font-weight: 600; font-size: 21px; color: var(--accent-gold); text-align: center; align-self: start; }
.unit .ringrow .lab.lab-word {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  line-height: 1.2; padding-top: 3px;
}
.unit .ringrow .lab small { display: block; font-size: 11px; color: var(--ink-soft); letter-spacing: .06em; font-weight: 400; }
.unit .ringrow .txt { font-size: 15.5px; line-height: 1.45; }
.unit .ringrow .ref { color: var(--ink-soft); font-style: italic; }
.unit table.exod { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.unit table.exod th, .unit table.exod td { padding: 8px 10px; border: 1px solid var(--rule); text-align: left; vertical-align: top; }
.unit table.exod th { background: var(--panel-2); font-family: var(--display); letter-spacing: .08em; text-transform: uppercase; font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.unit table.exod td.mt { color: var(--accent-rust); font-weight: 600; }
.unit table.exod td.eg { color: var(--ink-soft); }
.unit .prayer { margin: 6px 0 18px 44px; padding: 14px 20px; background: var(--panel); border-left: 3px solid var(--accent-gold); border-radius: 0 6px 6px 0; page-break-inside: avoid; break-inside: avoid; }
.unit .prayer p { margin: 0 0 4px; line-height: 1.55; }
.unit .prayer .pn { font-family: var(--display); font-size: 13px; color: var(--accent-crimson); font-weight: 600; margin-right: 8px; }
@media (max-width: 720px) {
  .unit .mast .greek-title { font-size: 18px; }
  .unit .structure { padding: 18px 15px; }
  .unit .triad { flex-direction: column; align-items: flex-start; gap: 3px; }
  .unit .triad .cnt { white-space: normal; }
}
.unit .ringrow.center { background: var(--panel-2); }
/* class="rl" (root-linked, uncounted) in legend rows keeps the italic the counted .r had there */
.unit .legend .rl { font-style: italic; }

/* Unit 8's three-column correspondence table at phone width: it scrolls inside
   its own panel instead of widening the page (display:block makes the table
   the scroll container; tighter text and cells keep most tables on one screen).
   Replaces the old shell's JS .table-scroll wrapper (2026-09-30). */
@media (max-width: 720px) {
  .unit table.exod { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: 14px; }
  .unit table.exod th, .unit table.exod td { padding: 7px 8px; }
}
