/* Fisherman's Friend — main.css
 * Phase 1 typography + dark/light theme.
 * Minimalist, content-first, comfortable for long reading.
 */

/* ─── Color palette via custom properties ─────────────────────────── */

:root {
  --bg:           #fafaf7;   /* warm off-white */
  --fg:           #1a1a1a;   /* near-black text */
  --muted:        #666;      /* secondary text */
  --subtle:       #999;      /* tertiary, fine details */
  --accent:       #7a2e2e;   /* muted burgundy — links, headings */
  --accent-hover: #5a1f1f;
  --border:       #e8e6e0;   /* subtle separators */
  --code-bg:      #f0eee8;   /* off-grey for code/footnote panel */
  --marginnote-highlight: rgba(122, 46, 46, 0.22);  /* clicked-from-body */
  --header-bg:    rgba(250, 250, 247, 0.82);        /* sticky-header backdrop */
}

[data-theme="dark"] {
  --bg:           #15171a;   /* warm dark */
  --fg:           #d8d8d8;   /* near-white text */
  --muted:        #888;
  --subtle:       #666;
  --accent:       #c97676;   /* brighter burgundy for dark bg */
  --accent-hover: #d99090;
  --border:       #2a2a2a;
  --code-bg:      #1f2126;
  --marginnote-highlight: rgba(201, 118, 118, 0.32);
  --header-bg:    rgba(21, 23, 26, 0.82);
}

/* ─── Reset / base ────────────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 18px;            /* slightly larger base for serif readability */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Gentium Plus", Georgia, "Times New Roman", serif;
  line-height: 1.6;
  transition: background 0.15s ease, color 0.15s ease;
}

/* ─── Site header ─────────────────────────────────────────────────── */

.site-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  /* Sticky chrome — header stays anchored to the top of the viewport
     while body content scrolls underneath. Translucent blurred
     backdrop so it doesn't compete visually with the prose
     underneath; theme-aware via --header-bg. z-index: 40 sits
     just below the reading-progress bar (z-index: 100) and any
     marginalia popovers (z-index: 10 inside content flow). */
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}

.brand {
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.brand:hover {
  color: var(--accent);
}

.breadcrumb {
  flex: 1;
  color: var(--muted);
  /* Allow long final crumbs (chapter/work titles can run very long
     in CCEL — Confessions has descriptive book-titles that span 30+
     words) to wrap naturally onto a second line within the
     breadcrumb area. Continuation lines start at the breadcrumb
     container's left edge — right after the "Fisherman's Friend"
     brand — not at the left of the screen. The header height grows
     accordingly; brand and theme toggle stay vertically centered. */
  line-height: 1.45;
}

.crumb {
  color: var(--muted);
}

.crumb-current {
  color: var(--fg);
  font-weight: 500;
}

.crumb-sep {
  color: var(--subtle);
  margin: 0 0.4em;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg);
  padding: 0.25rem 0.6rem;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Main content column ─────────────────────────────────────────── */

.content {
  max-width: 42rem;           /* ~672px at 18px base = comfortable line length */
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ─── Chapter header ──────────────────────────────────────────────── */

.chapter-header {
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
}

.chapter-title {
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.4rem;
  color: var(--fg);
}

.chapter-shorttitle {
  margin: 0;
  font-style: italic;
  color: var(--muted);
  font-size: 1rem;
}

/* ─── Chapter body ────────────────────────────────────────────────── */

.chapter-body {
  font-size: 1.05rem;
}

.verse {
  margin: 0 0 1.1em;
  text-indent: 0;
}

.verse-num {
  display: inline-block;
  min-width: 1.7em;
  margin-right: 0.3em;
  color: var(--subtle);
  font-size: 0.78em;
  font-family: system-ui, -apple-system, sans-serif;
  font-feature-settings: "tnum";  /* tabular numbers if available */
  text-align: right;
  vertical-align: 0.2em;
}

.inline-heading {
  margin: 2.2em 0 1em;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--fg);
}

.inline-heading + .verse {
  margin-top: 0;
}

.stanza {
  margin: 1.5em 0;
  padding-left: 2em;
  border-left: 2px solid var(--border);
  font-style: italic;
  color: var(--muted);
}

.stanza p {
  margin: 0 0 0.4em;
}

hr.decorative {
  border: none;
  border-top: 1px solid var(--border);
  width: 30%;
  margin: 2em auto;
  height: 0;
}

/* ─── Inline footnote refs + marginalia (Phase 2b.2, Tufte pattern) ─ */
/*  Inline `[N]` markers in source become a clickable label with a
 *  superscript number, an adjacent hidden checkbox, and an <aside>
 *  containing the footnote body. Wide screens float the aside into
 *  the right margin next to the referencing paragraph; narrow screens
 *  hide it by default and reveal inline on :checked. No JS.            */

.footnote-ref {
  color: var(--accent);
  font-size: 0.72em;
  vertical-align: super;
  font-feature-settings: "tnum";
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 0;             /* keep ref from inflating line-height */
  letter-spacing: 0.02em;
}

label.margin-toggle {
  cursor: pointer;
  /* The label IS the inline marker — no extra padding/border, just
     making the superscript clickable for the toggle. */
}

label.margin-toggle:hover .footnote-ref {
  color: var(--accent-hover);
  text-decoration: underline;
}

input.margin-toggle {
  /* Hidden checkbox — drives :checked state for the adjacent aside */
  display: none;
}

.marginnote {
  /* Defaults — overridden per-viewport below */
  display: none;
  font-family: "Gentium Plus", Georgia, serif;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
}

.marginnote::before {
  /* Number prefix on each marginalia note so reader can match it
     back to the inline marker. data-n is set in build_site.py. */
  content: attr(data-n) "  ";
  color: var(--accent);
  font-feature-settings: "tnum";
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.85em;
  margin-right: 0.15em;
}

/* Wide-screen marginalia: float into right margin next to paragraph */
@media (min-width: 1100px) {
  /* Widen the content column to reserve right-margin space.
     Reading column inside still ~42rem; the right ~16rem becomes
     the marginalia gutter. */
  .content {
    max-width: 60rem;
    padding-right: 18rem;
  }

  .marginnote {
    display: block;
    float: right;
    clear: right;
    width: 14rem;
    /* Push into the reserved right padding. -16rem = 14rem width
       + 2rem visual gap from the reading column. */
    margin-right: -16rem;
    margin-top: 0;
    margin-bottom: 0.4rem;
    padding-left: 0.5rem;
    padding-right: 0.4rem;
    border-left: 2px solid var(--border);
    /* keep the marginnote anchored to the line that produced it */
    position: relative;
    /* Smooth highlight transition when the user clicks an inline [N] */
    transition: background 0.25s ease, border-left-color 0.25s ease;
    /* Exclude marginalia from drag-selection so copying body prose
       doesn't sweep up footnote text from the right margin. To copy
       a footnote, narrow the window so it inline-expands (where
       selection is allowed), or future: a per-marginnote "copy"
       affordance. */
    -webkit-user-select: none;
            user-select: none;
  }

  /* Clicking an inline [N] toggles its checkbox; on wide screens the
     marginnote stays visible regardless, so we make the matched note
     pop visually: stronger accent-tinted background, brighter
     left-border, brighter text color, and bold weight. Clicking
     again unhighlights. */
  input.margin-toggle:checked + .marginnote {
    background: var(--marginnote-highlight);
    border-left-color: var(--accent);
    color: var(--fg);
    font-weight: 600;
    /* small inset so the border-left stays the dominant edge */
    padding-left: 0.6rem;
  }

  /* Numeric prefix on the highlighted note also gets brighter so the
     [N] correspondence is obvious at a glance. */
  input.margin-toggle:checked + .marginnote::before {
    color: var(--accent);
    font-weight: 700;
  }
}

/* Narrow-screen: collapse to inline-expand-on-tap */
@media (max-width: 1099px) {
  input.margin-toggle:checked + .marginnote {
    display: block;
    margin: 0.7rem 0;
    padding: 0.6rem 0.9rem;
    background: var(--code-bg);
    border-left: 2px solid var(--accent);
    font-size: 0.95em;
    color: var(--fg);
    border-radius: 2px;
  }

  input.margin-toggle:checked + .marginnote::before {
    content: "[" attr(data-n) "]  ";
  }

  /* Subtle visual nudge that the [N] marker is interactive */
  label.margin-toggle .footnote-ref {
    border-bottom: 1px dotted var(--accent);
  }
}

/* ─── Reading progress indicator (Phase 2b.3, refactored 2026-05-08) ─ */
/*  Thin bar at the bottom edge of the sticky site-header. Grows
 *  left-to-right as the user scrolls. Doubles as the chrome→content
 *  divider when active; falls back to the header's border-bottom
 *  when invisible (short pages). JS handler in layout.html sets
 *  its width.                                                        */

.reading-progress {
  position: absolute;
  left: 0;
  bottom: -1px;            /* sit directly on top of border-bottom */
  height: 2px;
  width: 0;
  background: var(--accent);
  pointer-events: none;
  opacity: 0;
  transition: width 0.05s linear, opacity 0.2s ease;
}

.reading-progress.is-visible {
  opacity: 0.5;            /* understated; the header handles the rest */
}

/* ─── Footnotes (Phase 1: simple list at bottom) ──────────────────── */

.footnotes {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted);
}

.footnotes h2 {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--subtle);
  margin: 0 0 1rem;
}

.footnote-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4em 0.7em;
  margin: 0;
  padding: 0;
}

.footnote-list dt {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.85em;
  color: var(--subtle);
  text-align: right;
  white-space: nowrap;
  font-feature-settings: "tnum";
}

.footnote-list dd {
  margin: 0;
}

/* ─── Chapter navigation (prev/next) ──────────────────────────────── */

.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
}

.nav-prev,
.nav-next {
  color: var(--accent);
  text-decoration: none;
}

.nav-prev:hover,
.nav-next:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.nav-disabled {
  color: var(--subtle);
  cursor: default;
}

/* ─── Site footer ─────────────────────────────────────────────────── */

.site-footer {
  margin-top: 4rem;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ─── Generic links inside body content ───────────────────────────── */

.chapter a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.chapter a:hover {
  border-bottom-color: var(--accent);
}

/* ─── Responsive: narrow screens ──────────────────────────────────── */

@media (max-width: 640px) {
  html {
    font-size: 17px;
  }

  .site-header {
    padding: 0.6rem 1rem;
    gap: 0.75rem;
    font-size: 0.85rem;
  }

  .breadcrumb {
    display: none;            /* breadcrumb hides on narrow screens */
  }

  .content {
    padding: 1.75rem 1rem 3rem;
  }

  .chapter-title {
    font-size: 1.4rem;
  }

  .chapter-nav {
    flex-direction: column;
    gap: 0.6rem;
    align-items: stretch;
    text-align: center;
  }
}

/* ─── Clickable breadcrumbs (Phase 2a) ────────────────────────────── */

a.crumb {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

a.crumb:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ─── Generic page header (used by index/author/work pages) ───────── */

.page-header {
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.page-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-family: system-ui, -apple-system, sans-serif;
}

/* ─── Site index (landing page) ───────────────────────────────────── */

.landing {
  text-align: center;
}

.landing-header h1 {
  font-size: 2.4rem;
  font-weight: 700;
  margin: 1rem 0 0.5rem;
  letter-spacing: -0.01em;
}

.lede {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 auto 2.5rem;
  max-width: 30rem;
  line-height: 1.5;
}

.landing-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin: 2rem 0 3rem;
  font-family: system-ui, -apple-system, sans-serif;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.1;
  font-feature-settings: "tnum";
}

.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.2rem;
}

.landing-nav {
  /* Grid keeps all three big-links in one row on wide screens and
     wraps them gracefully on narrow. auto-fit + minmax means a
     two-link nav fills the row equally, three-link nav fills
     equally, and so on — no orphaned cards on their own line. */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 2rem auto 3rem;
  max-width: 50rem;
  text-align: left;
}

.big-link {
  display: block;
  padding: 1.2rem 2rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--fg);
  background: var(--code-bg);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.big-link:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.big-link-title {
  display: block;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
}

.big-link-sub {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
  font-family: system-ui, -apple-system, sans-serif;
}

.landing-attribution {
  margin-top: 3rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-family: system-ui, -apple-system, sans-serif;
}

.landing-attribution a {
  color: var(--muted);
}

.landing-attribution a:hover {
  color: var(--accent);
}

/* ─── Author index ────────────────────────────────────────────────── */

.author-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.author-list-item {
  border-bottom: 1px solid var(--border);
}

.author-link {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 0.85rem 0.25rem;
  text-decoration: none;
  color: var(--fg);
  border-bottom: none;
  transition: background 0.15s ease;
}

.author-link:hover {
  background: var(--code-bg);
}

.author-name {
  grid-column: 1;
  font-size: 1.05rem;
  font-weight: 500;
}

.author-link:hover .author-name {
  color: var(--accent);
}

.author-dates {
  /* Pin to column 2 so missing dates leave the slot empty rather than
     letting .author-count flow leftward into it. */
  grid-column: 2;
  color: var(--muted);
  font-size: 0.9rem;
  font-family: system-ui, -apple-system, sans-serif;
  font-feature-settings: "tnum";
  white-space: nowrap;
  text-align: right;
}

.author-count {
  /* Always col 3 — without this, missing dates would let the count
     slide into col 2 and look mis-aligned with neighbouring rows. */
  grid-column: 3;
  color: var(--subtle);
  font-size: 0.85rem;
  font-family: system-ui, -apple-system, sans-serif;
  font-feature-settings: "tnum";
  white-space: nowrap;
  min-width: 4.5rem;
  text-align: right;
}

/* ─── Author landing page ─────────────────────────────────────────── */

.author-longname {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-style: italic;
  font-size: 1rem;
}

.author-native {
  margin: 0.5rem 0 1rem;
  color: var(--fg);
  font-size: 1.05rem;
}

.native-name {
  /* lang attribute drives any per-language tweaks */
  display: inline;
}

.author-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1rem;
  margin: 1rem 0 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
}

.author-meta dt {
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.78rem;
  padding-top: 0.15em;
}

.author-meta dd {
  margin: 0;
  color: var(--fg);
}

.approx {
  color: var(--subtle);
  font-size: 0.85em;
}

.works-list {
  margin-top: 2rem;
}

.works-list h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--fg);
}

.works-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.works-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.works-list a {
  color: var(--accent);
  text-decoration: none;
  font-size: 1.02rem;
}

.works-list a:hover {
  text-decoration: underline;
}

.work-series {
  color: var(--subtle);
  font-size: 0.85rem;
  font-family: system-ui, -apple-system, sans-serif;
  margin-left: 0.4em;
}

/* ─── Work landing (TOC page) ─────────────────────────────────────── */

.work-meta {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-family: system-ui, -apple-system, sans-serif;
}

.work-volume {
  margin: 0;
  color: var(--subtle);
  font-size: 0.85rem;
  font-style: italic;
}

.chapter-toc {
  margin-top: 1rem;
}

.chapter-toc h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 1.5rem;
  color: var(--fg);
}

.book-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 0.4rem;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

.book-short {
  margin: 0 0 0.5rem;
  font-style: italic;
  color: var(--muted);
  font-size: 0.9rem;
}

.chapter-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  counter-reset: ch;
}

.chapter-list li {
  border-bottom: 1px solid var(--border);
}

.chapter-list a {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.6rem;
  padding: 0.5rem 0.25rem;
  text-decoration: none;
  color: var(--fg);
  border-bottom: none;
  transition: background 0.15s ease;
}

.chapter-list a:hover {
  background: var(--code-bg);
}

.ch-num {
  color: var(--subtle);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.85rem;
  font-feature-settings: "tnum";
  text-align: right;
  padding-top: 0.1em;
}

.ch-title {
  color: var(--fg);
}

.chapter-list a:hover .ch-title {
  color: var(--accent);
}

.work-source {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-family: system-ui, -apple-system, sans-serif;
}

.work-source a {
  color: var(--muted);
}

.work-source a:hover {
  color: var(--accent);
}

/* ─── Strong's lexicon — entry page (Phase 2b.1) ──────────────────── */

.strongs-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.strongs-id {
  margin: 0 0 0.5rem;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--subtle);
  font-feature-settings: "tnum";
}

.strongs-lemma {
  margin: 0 0 0.6rem;
  font-size: 3.2rem;
  font-weight: 400;          /* Greek lemmas read better at regular weight */
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.strongs-translit {
  margin: 0;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--muted);
}

.strongs-pron {
  margin: 0.2rem 0 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.95rem;
  color: var(--subtle);
}

.strongs-section {
  margin: 2rem 0;
}

.strongs-section h2 {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
  font-family: system-ui, -apple-system, sans-serif;
}

.strongs-section p {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.65;
}

.strongs-kjv p {
  font-size: 0.95rem;
  color: var(--muted);
}

a.strongs-deriv-link {
  color: var(--accent);
  text-decoration: none;
  font-feature-settings: "tnum";
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

a.strongs-deriv-link:hover {
  border-bottom-color: var(--accent);
}

.strongs-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
  font-feature-settings: "tnum";
}

.strongs-nav .nav-prev,
.strongs-nav .nav-next {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  /* Prevent the link's underline-on-hover from spanning the whole
     cell — we apply it to the .nav-arrow child instead. */
}

.strongs-nav .nav-prev {
  align-items: flex-start;
}

.strongs-nav .nav-next {
  align-items: flex-end;
}

.strongs-nav .nav-lemma {
  /* The actual word — primary signal for "where am I going next?" */
  font-family: "Gentium Plus", Georgia, serif;
  font-size: 1.15rem;
  color: var(--fg);
  line-height: 1.2;
  margin-bottom: 0.15rem;
}

.strongs-nav .nav-arrow {
  /* G-number with directional arrow — secondary metadata */
  font-size: 0.82rem;
  color: var(--accent);
  font-feature-settings: "tnum";
  letter-spacing: 0.02em;
}

.strongs-nav .nav-prev:hover .nav-lemma,
.strongs-nav .nav-next:hover .nav-lemma {
  color: var(--accent);
}

.strongs-nav .nav-prev:hover .nav-arrow,
.strongs-nav .nav-next:hover .nav-arrow {
  color: var(--accent-hover);
  text-decoration: underline;
}

.strongs-nav .nav-up {
  color: var(--muted);
  text-decoration: none;
  padding: 0 1rem;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
}

.strongs-nav .nav-up:hover {
  color: var(--accent);
  text-decoration: underline;
}

.strongs-nav .nav-disabled {
  color: var(--subtle);
  font-size: 0.85rem;
  font-feature-settings: "tnum";
}

/* ─── Strong's lexicon — index page ───────────────────────────────── */

.strongs-jumpbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin: 1.5rem 0 2.5rem;
  padding: 1rem;
  background: var(--code-bg);
  border-radius: 6px;
}

.strongs-jumpbar .jump-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.4rem;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--fg);
  border-radius: 3px;
  transition: background 0.15s ease, color 0.15s ease;
}

.strongs-jumpbar .jump-letter:hover {
  background: var(--accent);
  color: var(--bg);
}

.strongs-letter-section {
  margin-bottom: 2.5rem;
  scroll-margin-top: 5rem;     /* keep letter heading clear of sticky header */
}

.strongs-letter {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 1.5rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--accent);
}

.strongs-letter-count {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--subtle);
  font-family: system-ui, -apple-system, sans-serif;
  font-feature-settings: "tnum";
}

.strongs-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.strongs-list-row {
  border-bottom: 1px solid var(--border);
}

.strongs-link {
  display: grid;
  grid-template-columns: 4.5rem minmax(7rem, auto) minmax(7rem, 11rem) 1fr;
  gap: 0.4rem 1rem;
  align-items: start;        /* baseline misaligns when def wraps to
                                multiple lines; "start" keeps the
                                G-number / lemma / translit anchored
                                to the first line of the def. */
  padding: 0.55rem 0.25rem;
  text-decoration: none;
  color: var(--fg);
  border-bottom: none;
  transition: background 0.15s ease;
}

.strongs-link:hover {
  background: var(--code-bg);
}

.strongs-list-id {
  color: var(--subtle);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.85rem;
  font-feature-settings: "tnum";
}

.strongs-list-lemma {
  font-size: 1.15rem;
  color: var(--fg);
}

.strongs-link:hover .strongs-list-lemma {
  color: var(--accent);
}

.strongs-list-translit {
  font-style: italic;
  color: var(--muted);
  font-size: 0.95rem;
}

.strongs-list-def {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  /* Wrap freely — multi-line briefs are fine, the row height grows
     to accommodate. The baseline-alignment trade-off is handled by
     align-items: start on the parent. */
}

/* ─── Hover-card pattern (Phase 2b.1 prototype) ───────────────────── */
/*  Pure-CSS popover. Wraps a <a class="strongs-ref" data-…> token in
 *  body text. On hover or keyboard focus, a tooltip shows the lemma,
 *  translit, and definition. Click navigates to the full entry.
 *  Mobile: focus state replaces hover (tap puts the link in :focus).
 */

a.strongs-ref {
  position: relative;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
  cursor: help;
}

a.strongs-ref:hover,
a.strongs-ref:focus {
  outline: none;
  border-bottom-style: solid;
}

a.strongs-ref::after {
  content: attr(data-lemma) "  ·  " attr(data-translit) "  ·  " attr(data-def);
  position: absolute;
  bottom: calc(100% + 0.4rem);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 22rem;
  padding: 0.6rem 0.8rem;
  background: var(--fg);
  color: var(--bg);
  border-radius: 4px;
  font-size: 0.85rem;
  font-style: normal;
  font-family: "Gentium Plus", Georgia, serif;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 10;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

a.strongs-ref:hover::after,
a.strongs-ref:focus::after {
  opacity: 1;
}

/* Showcase strip on the Strong's index page */

.strongs-showcase {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.strongs-showcase h2 {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
}

.showcase-sub {
  margin: 0 0 1.2rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.showcase-demo {
  font-size: 1.1rem;
  line-height: 1.8;
  text-align: center;
  padding: 2rem 1rem;
  background: var(--code-bg);
  border-radius: 6px;
  margin: 0;
}

/* ─── Scripture (Phase 2c.0) ──────────────────────────────────────── */

/* Theme-aware red-letter color for words of Christ */
:root {
  --red-letter: #b03a3a;
}
[data-theme="dark"] {
  --red-letter: #e08585;
}

/* Scripture index page — book browse */

.scripture-section {
  margin: 2.5rem 0;
}

.scripture-section h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 0.3rem;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

.scripture-section-sub {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-family: system-ui, -apple-system, sans-serif;
}

.scripture-book-list {
  list-style: none;
  margin: 0;
  padding: 0;
  /* Multi-column layout — books flow top-to-bottom within a column,
     then jump to the top of the next column. That's the natural
     reading order for a sequential index (phone book / library
     catalog / Bible TOC pattern), not row-major.
     `columns: 15rem auto` = each column at least 15rem wide,
     browser picks the count that fits. */
  columns: 15rem auto;
  column-gap: 2rem;
}

.scripture-book-list-row {
  border-bottom: 1px solid var(--border);
  /* Prevent a book row from splitting across two columns mid-card. */
  break-inside: avoid;
}

.scripture-book-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.55rem 0.5rem;
  text-decoration: none;
  color: var(--fg);
  border-bottom: none;
  transition: background 0.15s ease;
}

.scripture-book-link:hover {
  background: var(--code-bg);
}

.scripture-book-name {
  font-size: 1.02rem;
}

.scripture-book-link:hover .scripture-book-name {
  color: var(--accent);
}

.scripture-book-chapters {
  color: var(--subtle);
  font-size: 0.85rem;
  font-family: system-ui, -apple-system, sans-serif;
  font-feature-settings: "tnum";
  white-space: nowrap;
}

/* Per-book chapter TOC */

.scripture-chapter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(3rem, 1fr));
  gap: 0.4rem;
}

/* Psalms grid uses wider tiles to fit "N [M]" inline dual-numbering */
.scripture-chapter-list-wide {
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
}

.scripture-chapter-list-wide a {
  /* Inherits flex-row from base; just widen the gap a touch */
  gap: 0.3rem;
}

.scripture-chapter-list-wide .ch-num {
  font-weight: 500;
}

.scripture-chapter-list-wide .mt-label {
  font-size: 0.78em;
  color: var(--subtle);
  font-feature-settings: "tnum";
}

/* Chapter-title MT label (shown in <h1>) */
.chapter-title .mt-label {
  margin-left: 0.4rem;
  font-size: 0.6em;
  font-weight: 400;
  color: var(--muted);
  font-family: system-ui, -apple-system, sans-serif;
  font-feature-settings: "tnum";
  vertical-align: middle;
}

/* Psalm category chips — small badges under the chapter title showing
   traditional groupings (penitential, imprecatory, royal, hexapsalmos,
   etc.). Hover-tooltip on each gives the description. */

.psalm-categories {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.psalm-category {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;          /* fully-rounded pill */
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--muted);
  background: var(--code-bg);
  cursor: help;                  /* signals the hover-tooltip */
  transition: color 0.15s ease, border-color 0.15s ease;
}

.psalm-category:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Liturgical (Orthodox-specific) categories get a slight accent tint
   so they're visually distinguishable from form-critical groupings. */
.psalm-category[data-key="hexapsalmos"],
.psalm-category[data-key="polyeleos"] {
  border-color: var(--accent);
  color: var(--accent);
}

.psalm-category[data-key="penitential"] {
  border-color: var(--muted);
}

.scripture-chapter-list li {
  border: 1px solid var(--border);
  border-radius: 3px;
  transition: border-color 0.15s ease;
}

.scripture-chapter-list li:hover {
  border-color: var(--accent);
}

.scripture-chapter-list a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.4rem;
  text-decoration: none;
  color: var(--fg);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
  font-feature-settings: "tnum";
  border-bottom: none;
}

.scripture-chapter-list a:hover {
  color: var(--accent);
}

/* Per-chapter verse rendering — bilingual */

.scripture-body {
  margin-top: 1rem;
}

.scripture-verse {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.4rem 0.8rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 5rem;     /* keep verse heading clear of chrome */
}

.scripture-verse:last-child {
  border-bottom: none;
}

/* Subtle highlight when a verse anchor is targeted via #v{n} */
.scripture-verse:target {
  background: var(--marginnote-highlight);
  border-radius: 4px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  margin-left: -0.5rem;
  margin-right: -0.5rem;
}

.verse-anchor {
  grid-column: 1;
  grid-row: 1 / -1;
  text-decoration: none;
  border-bottom: none;
  align-self: start;
  padding-top: 0.3em;
  text-align: right;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

.verse-anchor:hover {
  opacity: 1;
}

.verse-anchor .verse-num {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.8rem;
  font-feature-settings: "tnum";
  color: var(--subtle);
}

.verse-greek {
  grid-column: 2;
  margin: 0 0 0.3rem;
  font-family: "Gentium Plus", Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--fg);
}

.verse-english {
  grid-column: 2;
  margin: 0;
  font-family: "Gentium Plus", Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--fg);
}

/* Words-of-Christ red-letter treatment */
.scripture-verse.is-red .verse-greek,
.scripture-verse.is-red .verse-english {
  color: var(--red-letter);
}

/* Scripture chapter prev/next nav */

.scripture-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
  gap: 1rem;
}

.scripture-nav .nav-prev,
.scripture-nav .nav-next {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.scripture-nav .nav-prev {
  align-items: flex-start;
}

.scripture-nav .nav-next {
  align-items: flex-end;
}

.scripture-nav .nav-label {
  color: var(--fg);
  font-size: 1rem;
  margin-bottom: 0.15rem;
}

.scripture-nav .nav-arrow {
  color: var(--accent);
  font-size: 0.82rem;
  font-feature-settings: "tnum";
}

.scripture-nav .nav-prev:hover .nav-label,
.scripture-nav .nav-next:hover .nav-label {
  color: var(--accent);
}

.scripture-nav .nav-up {
  color: var(--muted);
  text-decoration: none;
  padding: 0 1rem;
  font-size: 0.9rem;
}

.scripture-nav .nav-up:hover {
  color: var(--accent);
  text-decoration: underline;
}

.scripture-nav .nav-disabled {
  color: var(--subtle);
  font-size: 0.85rem;
}

/* ─── Mobile tweaks for new page types ────────────────────────────── */

@media (max-width: 640px) {
  .landing-header h1 {
    font-size: 2rem;
  }

  .landing-stats {
    gap: 1.2rem;
    flex-wrap: wrap;
  }

  .stat-num {
    font-size: 1.6rem;
  }

  /* Strong's entry: keep big lemma readable on phones, but smaller */
  .strongs-lemma {
    font-size: 2.4rem;
  }

  /* Strong's index: stack the row instead of trying to fit four columns */
  .strongs-link {
    grid-template-columns: 4rem 1fr;
    gap: 0.2rem 0.6rem;
  }

  .strongs-list-id {
    grid-column: 1;
    grid-row: 1;
  }

  .strongs-list-lemma {
    grid-column: 2;
    grid-row: 1;
  }

  .strongs-list-translit {
    grid-column: 2;
    grid-row: 2;
    font-size: 0.85rem;
  }

  .strongs-list-def {
    grid-column: 1 / -1;
    grid-row: 3;
    font-size: 0.85rem;
    white-space: normal;       /* allow wrapping on mobile */
  }

  /* Hover-card popover: anchor to the link's left edge so it doesn't
     run off the right side of small viewports. */
  a.strongs-ref::after {
    left: 0;
    transform: none;
    max-width: calc(100vw - 2rem);
  }

  .strongs-jumpbar {
    gap: 0.25rem;
    padding: 0.6rem;
  }

  .strongs-jumpbar .jump-letter {
    min-width: 1.7rem;
    height: 1.7rem;
    font-size: 1rem;
  }

  /* Scripture mobile: tighter verse layout, single-column book browse */
  .scripture-book-list {
    grid-template-columns: 1fr;
  }

  .scripture-chapter-list {
    grid-template-columns: repeat(auto-fill, minmax(2.6rem, 1fr));
    gap: 0.3rem;
  }

  .scripture-chapter-list a {
    height: 2.1rem;
    font-size: 0.9rem;
  }

  .scripture-verse {
    grid-template-columns: 2rem 1fr;
    gap: 0.3rem 0.5rem;
    padding: 0.5rem 0;
  }

  .verse-greek,
  .verse-english {
    font-size: 1rem;
  }

  .scripture-nav {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
  }

  .scripture-nav .nav-up {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
  }

  .scripture-nav .nav-prev {
    grid-column: 1;
    grid-row: 2;
  }

  .scripture-nav .nav-next {
    grid-column: 2;
    grid-row: 2;
  }

  .author-link {
    grid-template-columns: 1fr auto;
    gap: 0.4rem 1rem;
  }

  .author-count {
    grid-column: 2;
    grid-row: 1;
    min-width: auto;
  }

  .author-dates {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 0.85rem;
  }

  .chapter-list a {
    grid-template-columns: 1.8rem 1fr;
  }

  .author-meta {
    grid-template-columns: 1fr;
    gap: 0.1rem 0;
  }

  .author-meta dt {
    margin-top: 0.5rem;
  }
}

/* ─── Print ───────────────────────────────────────────────────────── */

@media print {
  .site-header,
  .site-footer,
  .chapter-nav,
  .theme-toggle {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .content {
    max-width: 100%;
    padding: 0;
  }
}
