/* ============================================================
   elegant.css — refined visual layer for Daily Bible Listening
   Purely presentational: overrides the inline <style> block.
   Loaded AFTER the inline styles so these rules win the cascade.
   If this file fails to load, the app falls back to its base look.
   ============================================================ */

:root {
  --paper:        #FAF7F0;  /* warm paper page background */
  --paper-deep:   #F2ECDF;  /* recessed areas */
  --card:         #FFFDF8;  /* cards sit just above the paper */
  --ink:          #232A33;  /* deep ink-navy, never pure black */
  --ink-soft:     #3E3A32;  /* scripture body text */
  --muted:        #8A7E68;  /* quiet metadata */
  --hairline:     #E4DDCC;  /* dividers and card borders */
  --bronze:       #A87F2F;  /* the one restrained accent */
  --bronze-deep:  #85641F;
  --deep:         #26313D;  /* header / player bar */
  --green:        #3E7C4F;  /* "done" status, muted */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
           "Source Serif Pro", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

/* ---------- paper ground with a whisper of grain ---------- */
body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* ---------- header ---------- */
header {
  background: linear-gradient(180deg, #2C3947 0%, var(--deep) 100%);
  padding: 14px 18px 10px;
  border-bottom: 1px solid #1B232C;
}
header h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: .01em;
}
header .week {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .72;
  margin-top: 5px;
}
header a { font-family: var(--sans); }

/* ---------- day navigation (item 97) ---------- */
/* The old .daynav strip — a light band with dark tiles sitting in the
   dark header — is GONE. The prev/next arrows now live on the version
   line as light ghost circles on the dark ground (styled in the page's
   inline CSS); the date rides on the weekline above them. Only the
   day-complete note keeps an elegant-layer colour here. */
.weekrow .daydone { color: #9FE8BB; letter-spacing: .02em; }

/* ---------- chapter cards ---------- */
main { max-width: 620px; }
/* item 118 (Jeremy, 2026-11-15): EVERY reading box wears this one
   face. This rule used to name .ch only — the Torah portion and
   single-chapter NT cards — while the merged section's readings
   are .bookitem boxes and the checklists .ckitem boxes, which no
   elegant rule reached: they fell back to the plainer inline style
   (flat white, no border, 14px corners) and so looked different
   from the Torah and New Testament boxes for no reason but the
   omission. The selector now covers all three box kinds. */
.ch, .bookitem, .ckitem, .videocard, .card, .shabbat {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(80, 66, 40, .06);
  margin-bottom: 14px;
}
/* item 118: inside the merged section's ONE box (.secbox) the
   readings stand as sub-items — the box chrome belongs to the
   wrapper alone; a hairline stands between the readings */
.secbox > .bookitem.subitem {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 0;
}
.secbox > .bookitem.subitem + .bookitem.subitem {
  border-top: 1px solid var(--hairline);
}
.ch-head { padding: 16px; }
.play {
  width: 48px;
  height: 48px;
  background: var(--bronze);
  font-size: 16px;
  box-shadow: 0 2px 6px rgba(168, 127, 47, .35);
}
.ch-info .g {
  font-size: 10.5px;
  letter-spacing: .14em;
  color: var(--muted);
}
.ch-info .r {
  /* Change E3 (Jeremy, 2026-11-18): ONE reference style everywhere.
     This rule had drifted to serif 18px while combined-item titles
     (.bi-title) and checklist titles (.ck-title) stood at sans
     16px — so a single-chapter card ("Psalm 37") rendered in a
     different font and size from a combined item ("1 Samuel
     10–11") on the same day. The majority style wins: sans, 16px,
     regular weight (descriptions are never bold, in any section;
     only the section titles are bold). */
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  color: var(--ink);
}
.prog { background: #EDE6D4; height: 3px; margin-top: 8px; }
.prog i { background: var(--bronze); }
.done-mark { color: var(--green); font-size: 16px; }

/* scripture reading text: the heart of the app */
.ch-text {
  /* item 140: colour and font are owned by the inline rule in
     index.html (one owner, no cascade race) — this rule keeps the
     box's surface only */
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 18px 16px;
  max-height: 340px;
}
.ch-actions button {
  border: 1px solid var(--hairline);
  background: var(--card);
  border-radius: 12px;
  padding: 12px 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.ch-actions button.marked {
  background: #EDF3EA;
  border-color: #B9CDB4;
  color: #2F6B3E;
}

/* ---------- section labels: small caps over hairlines ---------- */
.sechead { margin: 26px 4px 12px; }
.sechead .st {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}
.sechead .sv {
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}
.sechead .opt {
  color: var(--muted);
  border-color: var(--hairline);
  background: var(--card);
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 10.5px;
}
.hint { color: var(--muted); font-size: 13px; margin: 2px 4px 10px; }
.shabbat {
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.7;
  padding: 20px 18px;
  text-align: center;
  color: var(--ink-soft);
}

/* ---------- bibleproject video cards ---------- */
.vc-head {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  padding: 16px 16px 12px;
}
.vc-play {
  font-size: 0; /* hide raw glyph; draw an elegant medallion instead */
}
.vc-play::after {
  content: "▶";
  font-size: 26px;
  color: #fff;
  background: rgba(168, 127, 47, .94);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 5px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .45);
  border: 1px solid rgba(255, 255, 255, .35);
}
.vc-credit, .poster-credit {
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--muted);
  padding: 10px 16px 14px;
}
.vc-credit a, .poster-credit a, .aboutrow a { color: var(--bronze-deep); }

/* ---------- about-book chips ---------- */
.aboutrow { margin: 0 4px 14px; gap: 10px; }
.aboutchip {
  background: var(--card);
  border: 1px solid var(--hairline);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .02em;
  box-shadow: 0 1px 3px rgba(80, 66, 40, .06);
}

/* ---------- player bar ---------- */
#playerbar {
  background: linear-gradient(180deg, #2C3947 0%, var(--deep) 100%);
  border-top: 1px solid #1B232C;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
#playerbar .t {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: .01em;
}
.speedrow button { font-weight: 600; }
.speedrow button.on { color: var(--deep); }

/* ---------- group modal ---------- */
.gmodal-card {
  background: var(--paper);
  border-radius: 22px 22px 0 0;
}
.gmodal-card h3 { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }
.gperson { border-color: var(--hairline); background: var(--card); }
.gperson.sel { border-color: var(--bronze); background: #F7F0DF; }
.gperson .me { color: var(--green); }
.gmodal-card .btn { background: var(--deep); border-radius: 14px; }

/* ---------- misc ---------- */
.loading {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--muted);
  padding: 48px 20px;
}
.groupbtn, .profrow button, .grouprow #groupend { font-weight: 700; }

/* ---------- books.html ---------- */
.blurb {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.72;
  color: var(--ink-soft);
  padding: 20px 18px;
}
.poster img { border-bottom: 1px solid var(--hairline); }

/* ---------- dark mode (item 98) ----------
   This layer shipped with NO dark rules, so its near-black ink colours
   won the cascade on the inline layer's dark cards: the reading title
   (.ch-info .r, var(--ink) #232A33 on the #1E262E card) measured
   1.06:1, the clip note text 2.01:1, muted metadata 3.84:1. In dark
   mode the elegant variables themselves go dark, and the colours this
   layer cannot reach through variables get explicit dark values.
   Measured with a WCAG contrast script before and after (see
   hidden/item98-build-2026-11-13.md): main text lands at 11:1 or
   better, secondary text at 5.9:1 or better. */
body.dark {
  --paper: #141A20;
  --paper-deep: #171E25;
  --card: #1E262E;
  --ink: #F0EBDD;
  --ink-soft: #E6E0D2;
  --muted: #B7BFC7;
  --hairline: #333D46;
  --bronze: #C9A44C;
  --bronze-deep: #D8BC72;
}
body.dark .cp-note { color: #C9CFD6; }
body.dark .localq .qrow.now { color: #9CC3E5; }
body.dark .picker .phead { color: #B7BFC7; }
body.dark header .week { opacity: .88; }
body.dark .gperson.sel { background: #2A3644; }
body.dark .ch-actions button.marked { background: #24402E; border-color: #3E6B4F; color: #A9D6B5; }

/* the version name as the page title (item 98): the serif title face,
   in the header's own light colour — set in the page's inline CSS */
header .vertitle { font-family: var(--serif); font-weight: 600; letter-spacing: .01em; }

/* ---------- section headings: ONE face for all (item 98 addendum 3) ----------
   The Neviim heading rendered in a bold, different font from the
   other section headings. Every section heading on the page — Torah,
   the merged "Neviim, Ketuvim and Psalms", New Testament, and the
   Sabbath headings — is built by the one heading builder and carries
   the one .sechead .st class, and this closing rule is the single
   authority for that class in this layer: same family, size, weight
   and style for every heading, with no per-section variant. */
.sechead .st {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  font-style: normal;
  letter-spacing: normal;
  text-transform: none;
}
