/* Scripture index: book grid (A) + passage lookup (C) + chapter pages. From the scripture-layout study
   (journal-platform\scripture-layout\, mocks A and C), Drew 2026-10-29: "Yes, A + C". */
:root { --h0:#ffffff; --h1:#e3edf8; --h2:#c3d8f0; --h3:#8fb6e2; --h4:#2f6db5; --h5:#005cb9; --h6:#034d8a; }
/* Dark mode (Drew 2026-11-03: "the white tiles ... don't show up well with dark theme enabled"). base.html's #dark sheet sets
   color-scheme:dark, whether from the system or the header toggle, and light-dark() follows it, so no second sheet is needed.
   Each rule repeats the light value first, so a browser without light-dark() keeps the light look. Dark: the scale runs from
   the surface up to bright blue (more articles = brighter); lv5-6 take dark text. */
@supports (color:light-dark(#000, #fff)) {
  :root { --h0:light-dark(#ffffff, var(--c-surface)); --h1:light-dark(#e3edf8, #1a3446); --h2:light-dark(#c3d8f0, #1c4662);
          --h3:light-dark(#8fb6e2, #1f5a84); --h4:light-dark(#2f6db5, #2668a6); --h5:light-dark(#005cb9, #5aa8e8); --h6:light-dark(#034d8a, #9fd0f7);
          --sx-edge:light-dark(rgba(0,48,73,.12), var(--c-rule)); --sx-on:light-dark(#034d8a, #79c6f2); --sx-off:light-dark(rgba(0,0,0,.08), rgba(255,255,255,.12)); } }
.lede { max-width:35.5rem; }

/* heat levels: background + readable text */
.lv0 { background:var(--h0); color:var(--c-muted, #5f5d58); }
.lv1 { background:var(--h1); color:var(--c-heading, #1d1d1b); }
.lv2 { background:var(--h2); color:var(--c-heading, #1d1d1b); }
.lv3 { background:var(--h3); color:#00203a; color:light-dark(#00203a, #fff); }
.lv4 { background:var(--h4); color:#fff; }
.lv5 { background:var(--h5); color:#fff; color:light-dark(#fff, #0f1a22); }
.lv6 { background:var(--h6); color:#fff; color:light-dark(#fff, #0f1a22); }

/* passage lookup */
.sx-find { margin:1rem 0 1.4rem; max-width:34rem; font-family:var(--font-ui, system-ui, sans-serif); }
.sx-find label { display:block; font-weight:600; margin-bottom:.3rem; }
.sx-row { display:flex; gap:.4rem; }
.sx-row input { flex:1; min-width:0; font:inherit; font-size:1.05rem; padding:.55rem .7rem; border:1px solid var(--c-rule, #d9d6cf);
                border-radius:6px; background:#fff; background:var(--c-field, #fff); }
.sx-row button { font:inherit; font-weight:600; padding:.5rem 1rem; border:0; border-radius:6px; background:var(--c-link, #1f4e79);
                 background:var(--c-chip, var(--c-link)); color:#fff; cursor:pointer; }
.sx-hint { min-height:1.4em; margin:.35rem 0 0; font-size:.9rem; color:var(--c-muted, #5f5d58); }
.sx-hint a { font-weight:600; }

/* book tiles */
h2.sx-t { font-family:var(--font-ui, system-ui, sans-serif); font-size:.95rem; font-weight:600; text-transform:uppercase;
          letter-spacing:.06em; color:var(--c-muted, #5f5d58); margin:1.2rem 0 .45rem; }
.sx-tiles { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(auto-fill, minmax(6.6rem, 1fr)); gap:4px; }
.sx-tile { display:flex; flex-direction:column; justify-content:space-between; min-height:3.6rem; padding:.3rem .45rem .25rem;
           border-radius:6px; text-decoration:none; font-family:var(--font-ui, system-ui, sans-serif); line-height:1.3;
           border:1px solid rgba(0,48,73,.12); border-color:var(--sx-edge, rgba(0,48,73,.12)); }
a.sx-tile:hover { box-shadow:0 0 0 2px var(--c-link-hover, #c45f00); text-decoration:none; }
.sx-tile .nm { font-weight:600; font-size:.88rem; }
.sx-tile .ab { display:none; font-weight:600; font-size:.88rem; }
.sx-tile .ct { font-size:.78rem; font-variant-numeric:tabular-nums; opacity:.9; }
.sx-tile.none { color:#767676; background:#fff; color:light-dark(#767676, #8a98a3); background:var(--h0); border-style:dashed; }
.sx-tile svg { display:block; width:100%; height:5px; margin-top:.2rem; }
.sx-tile svg .on { fill:#034d8a; fill:var(--sx-on, #034d8a); } .sx-tile svg .off { fill:rgba(0,0,0,.08); fill:var(--sx-off, rgba(0,0,0,.08)); }
.lv4 svg .on, .lv5 svg .on, .lv6 svg .on { fill:#fff; }
.lv4 svg .off, .lv5 svg .off, .lv6 svg .off { fill:rgba(255,255,255,.25); }
.lv5 svg .on, .lv6 svg .on { fill:light-dark(#fff, #0f1a22); } .lv5 svg .off, .lv6 svg .off { fill:light-dark(rgba(255,255,255,.25), rgba(15,26,34,.25)); }
@media (max-width:34rem) {
  .sx-tiles { grid-template-columns:repeat(auto-fill, minmax(4.1rem, 1fr)); gap:3px; }
  .sx-tile { min-height:3.1rem; padding:.25rem .3rem; }
  .sx-tile .nm { display:none; } .sx-tile .ab { display:block; font-size:.82rem; }
}

/* most discussed */
.sx-hot { list-style:none; padding:0; margin:.4rem 0 0; display:flex; flex-wrap:wrap; gap:.35rem; font-family:var(--font-ui, system-ui, sans-serif); }
.sx-hot a { display:inline-block; padding:.25rem .7rem; border:1px solid var(--c-rule, #d9d6cf); border-radius:999px; text-decoration:none; font-size:.9rem; }
.sx-hot a span { color:var(--c-muted, #5f5d58); font-size:.8rem; margin-left:.15rem; }
.sx-ocr { font-family:var(--font-ui, system-ui, sans-serif); font-size:.8rem; color:#8a4a00; color:light-dark(#8a4a00, #ffb27a); }

/* book page: chapter cells */
.sx-up { font-family:var(--font-ui, system-ui, sans-serif); font-size:.9rem; margin:0; }
.sx-chs { list-style:none; margin:.8rem 0 0; padding:0; display:grid; grid-template-columns:repeat(auto-fill, minmax(3rem, 1fr)); gap:4px; max-width:46rem; }
.sx-ch { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:2.9rem; border-radius:4px;
         text-decoration:none; font-family:var(--font-ui, system-ui, sans-serif); line-height:1.15; border:1px solid rgba(0,48,73,.12);
         border-color:var(--sx-edge, rgba(0,48,73,.12)); }
.sx-ch b { font-size:1rem; } .sx-ch small { font-size:.7rem; font-variant-numeric:tabular-nums; }
.sx-ch.lv0 { color:#9a9a9a; color:light-dark(#9a9a9a, #8a98a3); border-style:dashed; }
a.sx-ch:hover { box-shadow:0 0 0 2px var(--c-link-hover, #c45f00); text-decoration:none; }
.sx-legend { display:flex; flex-wrap:wrap; align-items:center; gap:.25rem; font-family:var(--font-ui, system-ui, sans-serif);
             font-size:.8rem; color:var(--c-muted, #5f5d58); margin:.6rem 0; }
.sx-legend .k { display:inline-block; min-width:2.1rem; text-align:center; border:1px solid var(--c-rule, #d9d6cf); border-radius:3px; padding:0 .25rem; }

/* chapter page */
.sx-pn { display:flex; justify-content:space-between; flex-wrap:wrap; gap:.4rem 1rem; font-family:var(--font-ui, system-ui, sans-serif);
         font-size:.9rem; margin:0 0 .4rem; }
.sx-arts { list-style:none; padding:0; margin:.6rem 0 0; }
.sx-arts li { padding:.6rem 0; border-bottom:1px solid var(--c-rule, #d9d6cf); line-height:1.45; }
.sx-arts li.hit { background:#fff7dc; background:light-dark(#fff7dc, var(--c-target)); margin:0 -.5rem; padding-left:.5rem; padding-right:.5rem; border-radius:4px; }
.sx-arts .vv { display:inline-block; min-width:4.2rem; font-family:var(--font-ui, system-ui, sans-serif); font-weight:600;
               color:var(--c-heading, #1d1d1b); margin-right:.4rem; }
.sx-arts a.t { text-decoration:none; } .sx-arts a.t:hover { text-decoration:underline; }
.sx-arts .pp { display:block; color:var(--c-muted, #5f5d58); font-size:.88rem; margin:.1rem 0 0 4.6rem; }
/* chapter page: the passage in its own column, title and byline beside it, so a long title wraps in its column
   (Drew, 2026-11-04: "long article titles are wrapping under ref rather than in their column") */
.sx-arts:not(.book) li { display:grid; grid-template-columns:5.4rem minmax(0, 1fr); column-gap:.4rem; }
.sx-arts:not(.book) .vv { grid-row:1 / span 2; min-width:0; margin:0; }
.sx-arts:not(.book) .pp { margin-left:0; }
/* chapter page: related passages from XREF, folded behind a toggle at the end of the byline and set in the byline's
   own type, so a row is no taller until the reader asks (Drew, 2026-11-11: "build the XREF related verses, top 5,
   placement A"; "uncessary space taken up … font styling out of proportion … hidden and then revealed") */
.sx-arts:not(.book) .sx-meta { grid-column:2; margin:.1rem 0 0; color:var(--c-muted, #5f5d58); font-size:.88rem; }
.sx-arts .sx-meta .pp { display:inline; margin:0; font-size:inherit; }
.sx-arts .sx-rel { display:inline; }
.sx-arts .sx-rel summary { display:inline; list-style:none; cursor:pointer; white-space:nowrap; color:var(--c-link, #1f5f99); }
.sx-arts .sx-rel summary::-webkit-details-marker { display:none; }
.sx-arts .sx-rel summary::before { content:"· "; color:var(--c-muted, #5f5d58); }
.sx-arts .sx-rel summary::after { content:" ▸"; font-size:.8em; }
.sx-arts .sx-rel[open] summary::after { content:" ▾"; }
.sx-arts .sx-rel summary:hover { text-decoration:underline; }
.sx-arts .sx-rel summary:focus-visible { outline:2px solid var(--c-focus, var(--c-link, #1f5f99)); outline-offset:2px; border-radius:2px; }
.sx-arts .sx-rel .n { font-variant-numeric:tabular-nums; }
.sx-arts .sx-rel-list { display:block; margin:.15rem 0 .1rem; }
.sx-arts .sx-rel-list a { white-space:nowrap; }
@media (pointer:coarse) { .sx-arts .sx-rel summary { padding:.35rem 0; } }
@media print { .sx-arts .sx-rel:not([open]) { display:none; } }
.sx-h { font-size:1.05rem; margin:1.2rem 0 0; }
@media (max-width:34rem) { .sx-arts .vv { display:block; margin-bottom:.1rem; } .sx-arts .pp { margin-left:0; }
  .sx-arts:not(.book) li { display:block; } }
/* book page: one row per article, which may cite many passages, so title first and the passages under it */
.sx-arts.book a.t { display:block; }
.sx-arts.book .pp { margin-left:0; }
.sx-arts.book .vv { display:block; min-width:0; margin:.15rem 0 0; font-size:.86rem; font-weight:500; }

/* book rail (book + chapter pages): every book in canonical order, OT | NT, shaded by article count; the current
   book is outlined and scrolled to the middle; ‹ › and the [ ] keys jump to the previous / next cited book */
.sx-rail { position:sticky; top:env(safe-area-inset-top, 0px); z-index:5; display:flex; align-items:stretch; gap:.3rem;
           margin:0 0 1rem; padding:.4rem 0; background:var(--c-page, #fff); border-bottom:1px solid var(--c-rule, #d9d6cf);
           font-family:var(--font-ui, system-ui, sans-serif); }
.sx-rs { flex:1; min-width:0; overflow-x:auto; scroll-behavior:smooth; scrollbar-width:none;
         -webkit-mask-image:linear-gradient(90deg, transparent, #000 1.2rem, #000 calc(100% - 1.2rem), transparent);
                 mask-image:linear-gradient(90deg, transparent, #000 1.2rem, #000 calc(100% - 1.2rem), transparent); }
.sx-rs::-webkit-scrollbar { display:none; }
.sx-rs ol { list-style:none; display:flex; gap:3px; margin:0; padding:.15rem 1.2rem; width:max-content; }
.sx-rs li.nt { margin-left:.9rem; padding-left:.9rem; border-left:2px solid var(--c-rule, #d9d6cf); }
.sx-rs a, .sx-rs span { display:block; white-space:nowrap; padding:.28rem .55rem; border-radius:999px; font-size:.82rem;
                        font-weight:600; line-height:1.2; text-decoration:none; border:1px solid rgba(0,48,73,.12);
                        transition:transform .12s ease, box-shadow .12s ease; }
.sx-rs span { color:#9a9a9a; background:transparent; border-style:dashed; font-weight:500; }
.sx-rs a:hover { transform:translateY(-1px); box-shadow:0 0 0 2px var(--c-link-hover, #c45f00); }
.sx-rs a[aria-current] { box-shadow:0 0 0 2px var(--c-page, #fff), 0 0 0 4px var(--c-heading, #1d1d1b); }
.sx-rj { flex:none; display:grid; place-items:center; width:2rem; border-radius:999px; font-size:1.3rem; line-height:1;
         text-decoration:none; color:var(--c-heading, #1d1d1b); border:1px solid var(--c-rule, #d9d6cf); background:var(--c-surface, #fff); }
a.sx-rj:hover { border-color:var(--c-link, #1f4e79); color:var(--c-link, #1f4e79); }
.sx-rj.off { opacity:.3; }
@media (prefers-reduced-motion:reduce) { .sx-rs { scroll-behavior:auto; } .sx-rs a { transition:none; } }
