/* ============================================================
   Cutting Straight — "Text & Apparatus" components
   ------------------------------------------------------------
   The load-bearing component styles from the approved study-page
   mockup (artifact b42a3e09), captured verbatim 2026-07-19.
   Requires tokens.css.

   These are the pieces that carry MEANING rather than decoration —
   the ones the generator must reproduce faithfully, because each
   one enforces a rule from Bible_Study_Rules.md on the page.
   ============================================================ */

/* ------------------------------------------------------------
   THE PLUMB LINE
   The reading column hangs off a hairline rule with a brass tip.
   This is the identity mark of the whole system — a plumb line
   against which the text is measured (2 Timothy 2:15).
   ------------------------------------------------------------ */
main.read {
  min-width: 0;
  padding: 40px 0 80px;
  position: relative;
  border-left: 1px solid var(--rule);
  padding-left: clamp(20px, 3vw, 40px);
}
main.read::before {
  content: "";
  position: absolute; left: -1px; top: 40px;
  width: 2px; height: 62px;
  background: linear-gradient(var(--brass), transparent);
}

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.15em; }

/* section headings are MONO — they are apparatus, not Word */
.prose h2 {
  font-size: 15px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  font-weight: 600;
  margin: 2.6em 0 .9em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 80px;
}
/* subsection titles are SERIF — they belong to the reading */
.prose h3 {
  font-size: 22px; font-weight: 600; line-height: 1.25;
  margin: 1.9em 0 .5em; text-wrap: balance;
  scroll-margin-top: 80px; letter-spacing: -.01em;
}
.prose h3 .n {
  font-family: var(--font-mono); font-size: 13px; color: var(--brass);
  margin-right: 12px; vertical-align: 3px; font-weight: 500;
}

/* ------------------------------------------------------------
   SHORT ANSWER HERO — answer-first, indigo left edge
   ------------------------------------------------------------ */
.shortanswer {
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  padding: 24px 28px;
  margin: 30px 0 8px;
  box-shadow: var(--shadow);
  scroll-margin-top: 80px;
  max-width: var(--measure);
}
.shortanswer .label {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; color: var(--accent);
}
.shortanswer .label::after {
  content: ""; flex: 1; height: 1px; background: var(--rule);
}
.shortanswer p { margin: 0 0 .8em; font-size: 18px; }
.shortanswer p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------
   GROUNDING LINE
   Closes every major section, naming the verses it rests on.
   Sunk well + indigo edge + mono = unmistakably apparatus.
   This is the structural enforcement of Authority vs Illumination.
   ------------------------------------------------------------ */
.grounding {
  font-family: var(--font-mono);
  font-size: 12.5px; line-height: 1.55;
  color: var(--ink-soft);
  background: var(--sunk);
  border-left: 2px solid var(--accent);
  padding: 11px 15px; margin: 14px 0 6px;
  border-radius: 0 2px 2px 0;
  max-width: var(--measure);
  transition: box-shadow .25s, background .25s;
}
.grounding b {
  color: var(--accent); text-transform: uppercase; letter-spacing: .1em;
  font-size: 10.5px; font-weight: 600; display: block; margin-bottom: 3px;
}

/* inline "(background-supported)" chip — ochre, links to the Dossier */
.bgchip {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--open);
  border: 1px solid color-mix(in srgb, var(--open) 45%, transparent);
  background: var(--open-bg);
  border-radius: 2px; padding: 1px 6px;
  white-space: nowrap; cursor: pointer; transition: box-shadow .25s;
}
.bgchip:hover {
  text-decoration: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--open) 30%, transparent);
}

/* scripture reference — dashed underline, popover on hover */
.ref { border-bottom: 1px dashed var(--rule-strong); cursor: help; color: inherit; }
.ref:hover { border-bottom-color: var(--accent); }

/* ------------------------------------------------------------
   THE SETTLED / OPEN LEDGER
   Two columns, pine and ochre. The honesty mechanism —
   what Scripture settles vs. what it genuinely leaves open.
   ------------------------------------------------------------ */
.ledger {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 18px; margin: 18px 0 6px; max-width: var(--measure);
}
@media (max-width: 640px) { .ledger { grid-template-columns: 1fr; } }

.panel { border-radius: 4px; padding: 18px 20px; border: 1px solid var(--rule-strong); }
.panel.settled {
  background: var(--settled-bg);
  border-color: color-mix(in srgb, var(--settled) 35%, var(--rule-strong));
}
.panel.open {
  background: var(--open-bg);
  border-color: color-mix(in srgb, var(--open) 35%, var(--rule-strong));
}
.panel h4 {
  margin: 0 0 12px; font-family: var(--font-mono); font-size: 12px;
  text-transform: uppercase; letter-spacing: .1em;
  display: flex; align-items: center; gap: 8px;
}
.panel.settled h4 { color: var(--settled); }
.panel.open h4 { color: var(--open); }
.panel h4 .count { margin-left: auto; font-size: 11px; opacity: .8; }
.panel ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 11px; }
.panel li { font-size: 15.5px; line-height: 1.45; padding-left: 18px; position: relative; }
.panel.settled li::before {
  content: "✓"; position: absolute; left: 0; color: var(--settled); font-size: 13px; top: 1px;
}
.panel.open li::before {
  content: "?"; position: absolute; left: 0; color: var(--open);
  font-weight: 700; font-family: var(--font-mono);
}

/* ------------------------------------------------------------
   LOAD-BEARING BADGES — Background Dossier ratings
   Every background item is rated yes / partly / no.
   Brick (yes) is a warning colour on purpose.
   ------------------------------------------------------------ */
.badge {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 2px; font-weight: 600;
  white-space: nowrap; display: inline-block;
}
.badge.no {
  color: var(--load-no);
  background: color-mix(in srgb, var(--load-no) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--load-no) 35%, transparent);
}
.badge.partly {
  color: var(--load-partly);
  background: color-mix(in srgb, var(--load-partly) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--load-partly) 35%, transparent);
}
.badge.yes {
  color: var(--load-yes);
  background: color-mix(in srgb, var(--load-yes) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--load-yes) 35%, transparent);
}

/* ------------------------------------------------------------
   APPENDIX ACCORDIONS — the apparatus, collapsed by default
   ------------------------------------------------------------ */
details.acc {
  border: 1px solid var(--rule); border-radius: 3px;
  margin-bottom: 10px; background: var(--surface); overflow: hidden;
}
details.acc[open] { box-shadow: var(--shadow); }
details.acc > summary {
  list-style: none; cursor: pointer; padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 12.5px;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink); user-select: none;
}
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary .code { color: var(--brass); font-weight: 600; }
details.acc > summary .plus {
  margin-left: auto; color: var(--ink-faint); font-size: 15px; transition: transform .2s;
}
details.acc[open] > summary .plus { transform: rotate(45deg); }
details.acc > summary:hover { color: var(--accent); }
.acc-body { padding: 4px 18px 20px; border-top: 1px solid var(--rule); }

/* scripture quoted in full */
.passage {
  border-left: 2px solid var(--rule-strong); padding-left: 14px;
  margin: 12px 0; font-style: italic; color: var(--ink-soft);
}
.passage b {
  font-style: normal; color: var(--ink); font-family: var(--font-mono);
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  display: block; margin-bottom: 3px;
}

.textnote { background: var(--sunk); border-radius: 3px; padding: 14px 16px; margin: 12px 0; }

/* ------------------------------------------------------------
   METADATA CHIPS — type, status, settled/open counts
   ------------------------------------------------------------ */
.chip {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 2px;
  border: 1px solid var(--rule-strong); color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip.type {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--rule-strong));
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip .s { color: var(--settled); font-weight: 600; }
.chip .o { color: var(--open); font-weight: 600; }

/* ------------------------------------------------------------
   AUDIT MODE
   Dims the prose and lights up what every claim rests on.
   The reader can check the work instead of trusting the voice —
   this is the design answering the "show the work" commitment.
   ------------------------------------------------------------ */
body.audit .prose > p,
body.audit .prose h3,
body.audit .shortanswer p,
body.audit .acc-body { opacity: .32; transition: opacity .3s; }

body.audit .grounding {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}
body.audit .bgchip { box-shadow: 0 0 0 2px color-mix(in srgb, var(--open) 45%, transparent); }
body.audit .badge  { box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 40%, transparent); }
body.audit .ledger, body.audit .panel { opacity: 1 !important; }
body.audit .prose h2 { opacity: 1; }

.audit-banner {
  display: none; position: sticky; top: 58px; z-index: 40;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em;
  background: color-mix(in srgb, var(--accent) 14%, var(--paper));
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  padding: 7px clamp(16px, 4vw, 40px);
}
body.audit .audit-banner { display: block; }

/* ------------------------------------------------------------
   BRAND MARK — the brass tick is the plumb line in miniature
   ------------------------------------------------------------ */
.brand {
  display: flex; align-items: baseline; gap: 8px;
  font-family: var(--font-mono); font-weight: 600;
  letter-spacing: .14em; font-size: 13px;
  text-transform: uppercase; color: var(--ink);
}
.brand .tick {
  width: 2px; height: 15px; background: var(--brass);
  display: inline-block; transform: translateY(2px);
}
.brand b { color: var(--accent); font-weight: 600; }

/* A sentence the writer marks as the point of its paragraph, written
   `[...]{.stress}` in the source. Bold alone read as another bold lead-in, and
   on a line of its own as a heading with nothing under it (Jim, 2026-09-26),
   so it stays inside the paragraph and takes the brass ink instead. */
strong.stress { color: var(--brass-ink); font-weight: 600; }
