/* Morals of the Church — a quiet, printed-book aesthetic */

:root {
  --paper: #faf6ee;
  --paper-deep: #f3ecdd;
  --ink: #241f1a;
  --ink-soft: #5a5248;
  --accent: #6d1a1a;        /* oxblood */
  --accent-soft: #8a3b2e;
  --rule: #d8cfbc;
  --card: #ffffff;
  --card-warm: #fffdf8;
  --mark: #f0e3b2;
  --latin-ink: #3a332c;
  --shadow: rgba(36, 31, 26, 0.14);
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --measure: 66ch;
  color-scheme: light;
}

/* Night: follows each reader's own device setting (prefers-color-scheme), which on most
   phones and computers turns dark in the evening of the reader's own timezone. Pure CSS —
   no script decides, and nobody's stated preference is overridden. Same book, lamplight. */
/* Three states: no attribute = follow the device; data-theme (set before first paint by the
   reader's remembered choice, public/js/theme.js) forces one look. The dark tokens appear twice
   by necessity — EDIT BOTH COPIES TOGETHER. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #191512;
    --paper-deep: #211c17;
    --ink: #e7dfd1;
    --ink-soft: #a99e8d;
    --accent: #d08a72;
    --accent-soft: #b96a52;
    --rule: #3e372e;
    --card: #201b16;
    --card-warm: #241f19;
    --mark: #5a4a1c;
    --latin-ink: #c7bca9;
    --shadow: rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --paper: #191512;
    --paper-deep: #211c17;
    --ink: #e7dfd1;
    --ink-soft: #a99e8d;
    --accent: #d08a72;
    --accent-soft: #b96a52;
    --rule: #3e372e;
    --card: #201b16;
    --card-warm: #241f19;
    --mark: #5a4a1c;
    --latin-ink: #c7bca9;
    --shadow: rgba(0, 0, 0, 0.5);
    color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.075rem;
  line-height: 1.65;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-soft); }

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}
h1 { font-size: 1.9rem; letter-spacing: 0.01em; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

.smallcaps, .site-nav a, .kicker {
  font-variant-caps: small-caps;
  letter-spacing: 0.08em;
}

/* Header */
.site-header {
  border-bottom: 3px double var(--rule);
  background: var(--paper);
}
.site-header-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.4rem 1.25rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}
.site-title {
  font-size: 1.55rem;
  font-variant-caps: small-caps;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-decoration: none;
}
.site-title .amp { font-style: italic; font-variant-caps: normal; letter-spacing: 0; color: var(--ink-soft); font-size: 1.1rem; }
.site-title:hover { color: var(--accent); }
.site-nav { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.site-nav a { text-decoration: none; color: var(--ink-soft); font-size: 1rem; }
.site-nav a:hover, .site-nav a.active { color: var(--accent); }

/* Main column */
.site-main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}
.prose { max-width: var(--measure); }

/* Footer */
.site-footer {
  border-top: 3px double var(--rule);
  color: var(--ink-soft);
  font-size: 0.9rem;
  text-align: center;
  padding: 1.5rem 1.25rem 2.5rem;
}
.site-footer p { max-width: 46rem; margin: 0.4rem auto; }
.footer-fine { font-style: italic; font-size: 0.82rem; }
.patronage {
  font-variant-caps: small-caps; letter-spacing: 0.1em;
  color: var(--accent); font-size: 0.95rem;
}
.patronage a { color: inherit; text-underline-offset: 3px; }
.hero .patronage { margin: -0.25rem auto 1rem; font-size: 1rem; }
.site-footer .patronage { margin-bottom: 0.75rem; }

/* Master table of contents: nesting <details> tree */
.toc-master details { margin: 0.15rem 0 0.15rem 0; }
.toc-master details details { margin-left: 1.4rem; }
.toc-master summary {
  cursor: pointer; list-style: none; padding: 0.3rem 0; display: flex; align-items: baseline; gap: 0.5rem;
}
.toc-master summary::-webkit-details-marker { display: none; }
.toc-master summary::before {
  content: '+'; display: inline-block; width: 1rem; color: var(--accent); font-weight: 700; flex: none;
}
.toc-master details[open] > summary::before { content: '–'; }
.toc-master summary a { text-decoration: none; }
.toc-master summary a:hover { text-decoration: underline; }
.toc-master .leaf { padding: 0.3rem 0 0.3rem 1.5rem; }
.toc-master .leaf a { text-decoration: none; }
.toc-master .leaf a:hover { text-decoration: underline; }
.toc-master .count { color: var(--ink-soft); font-size: 0.8rem; font-variant-caps: normal; letter-spacing: 0; }
.subtopics { color: var(--accent); font-size: 0.78rem; font-variant-caps: normal; letter-spacing: 0; white-space: nowrap; }
.toc-master summary .subtopics { border: 1px solid var(--rule); border-radius: 1rem; padding: 0 0.5rem; }
.topic-children li.has-sub > a { font-weight: 600; }
.toc-master > details > summary { font-variant-caps: small-caps; letter-spacing: 0.06em; font-size: 1.1rem; }
.toc-master details details > summary { font-weight: 600; }
.toc-master details details details > summary { font-weight: 400; }
.toc-controls { font-size: 0.88rem; margin: 0 0 1rem; }
/* the book's own contents, named apart from the tree this site builds */
.own-contents { margin: 1rem 0 0; padding: 0.6rem 0.9rem; border-left: 3px solid var(--accent);
  background: var(--paper-2, transparent); font-size: 0.95rem; }
.own-contents a { font-weight: 600; }
.toc-controls a { margin-right: 1rem; }

/* Kicker + page headings */
.kicker {
  color: var(--accent);
  font-size: 0.9rem;
  margin: 0 0 0.25rem;
}
.page-head { margin-bottom: 2rem; }
.page-head h1 { margin: 0 0 0.5rem; }
.page-head .subtitle { color: var(--ink-soft); font-style: italic; margin: 0; }

/* Home */
.hero { text-align: center; padding: 2.5rem 0 2rem; }
.hero h1 { font-size: 2.3rem; font-variant-caps: small-caps; letter-spacing: 0.05em; margin: 0 0 0.75rem; }
.hero p { max-width: 44rem; margin: 0.5rem auto; font-size: 1.15rem; color: var(--ink-soft); }
.hero .ask-inline { margin-top: 1.75rem; }
/* Doré's Moses Comes Down from Mount Sinai behind the title — IN DARK MODE ONLY (Bruce, 2026-10-25); in light the
   wrapper is plain and the picture is never fetched. scripts/build-dore-images.py makes the two sizes, the dark veil
   baked into them. The rules appear twice, like the dark tokens — EDIT BOTH COPIES TOGETHER. */
.hero-credit { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body:has(.hero-band) { overflow-x: clip; }
  :root:not([data-theme="light"]) .hero { padding-top: 0; }
  :root:not([data-theme="light"]) .hero-band {
    position: relative; width: 100vw; margin: 0 0 1.75rem calc(50% - 50vw); padding: 5.5rem 1rem 4.75rem;
    background: #1b1610 url(/img/dore-sinai-band.webp) center 38% / cover no-repeat;
  }
  :root:not([data-theme="light"]) .hero-band .kicker { color: #e9c9a0; }
  :root:not([data-theme="light"]) .hero-band h1 { color: #fbf6ea; font-size: 3rem; text-shadow: 0 2px 14px rgba(0,0,0,.65); margin-bottom: .6rem; }
  :root:not([data-theme="light"]) .hero-band .patronage { color: #efe4cc; text-shadow: 0 1px 8px rgba(0,0,0,.7); }
  :root:not([data-theme="light"]) .hero-credit {
    display: block; position: absolute; right: .9rem; bottom: .55rem;
    font-size: .72rem; font-style: italic; letter-spacing: .04em; color: rgba(246,239,223,.75);
  }
}
@media (prefers-color-scheme: dark) and (max-width: 700px) {
  :root:not([data-theme="light"]) .hero-band { background-image: url(/img/dore-sinai-band-phone.webp); }
}
:root[data-theme="dark"] body:has(.hero-band) { overflow-x: clip; }
:root[data-theme="dark"] .hero { padding-top: 0; }
:root[data-theme="dark"] .hero-band {
  position: relative; width: 100vw; margin: 0 0 1.75rem calc(50% - 50vw); padding: 5.5rem 1rem 4.75rem;
  background: #1b1610 url(/img/dore-sinai-band.webp) center 38% / cover no-repeat;
}
:root[data-theme="dark"] .hero-band .kicker { color: #e9c9a0; }
:root[data-theme="dark"] .hero-band h1 { color: #fbf6ea; font-size: 3rem; text-shadow: 0 2px 14px rgba(0,0,0,.65); margin-bottom: .6rem; }
:root[data-theme="dark"] .hero-band .patronage { color: #efe4cc; text-shadow: 0 1px 8px rgba(0,0,0,.7); }
:root[data-theme="dark"] .hero-credit {
  display: block; position: absolute; right: .9rem; bottom: .55rem;
  font-size: .72rem; font-style: italic; letter-spacing: .04em; color: rgba(246,239,223,.75);
}
@media (max-width: 700px) {
  :root[data-theme="dark"] .hero-band { background-image: url(/img/dore-sinai-band-phone.webp); }
}

.ask-inline form { display: flex; max-width: 38rem; margin: 0 auto; border: 1px solid var(--rule); background: var(--card); }
.ask-inline input[type="text"] {
  flex: 1; border: 0; padding: 0.7rem 1rem; font: inherit; background: transparent; outline: none;
}
.ask-inline button {
  border: 0; background: var(--accent); color: var(--paper); font: inherit;
  font-variant-caps: small-caps; letter-spacing: 0.06em; padding: 0 1.4rem; cursor: pointer;
}
.ask-inline button:hover { background: var(--accent-soft); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.card {
  border: 1px solid var(--rule);
  background: var(--card-warm);
  padding: 1.25rem 1.4rem;
}
.card h3 { margin: 0 0 0.3rem; }
.card .byline { color: var(--ink-soft); font-style: italic; font-size: 0.95rem; margin: 0 0 0.6rem; }
.card p { margin: 0.4rem 0; font-size: 0.98rem; }

hr.section-rule {
  border: 0; border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

/* Reading view */
.reading-layout { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 3rem; }
@media (max-width: 56rem) { .reading-layout { grid-template-columns: minmax(0, 1fr); } }
.toc-sidebar {
  font-size: 0.92rem;
  border-right: 1px solid var(--rule);
  padding-right: 1.25rem;
  align-self: start;
  position: sticky; top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}
@media (max-width: 56rem) { .toc-sidebar { position: static; border-right: 0; border-bottom: 1px solid var(--rule); padding: 0 0 1rem; max-height: none; } }
.toc-sidebar ul { list-style: none; padding-left: 0.9rem; margin: 0.2rem 0; }
.toc-sidebar > ul { padding-left: 0; }
.toc-sidebar li { margin: 0.25rem 0; }
.toc-sidebar a { text-decoration: none; color: var(--ink-soft); }
.toc-sidebar a:hover { color: var(--accent); }
.toc-sidebar .current > a { color: var(--accent); font-weight: 600; }
.toc-kind { font-variant-caps: small-caps; letter-spacing: 0.05em; color: var(--ink-soft); font-size: 0.8rem; }

.reading-body { max-width: var(--measure); }
.reading-body .chapter-title { margin-top: 0; }

.section-block { position: relative; margin: 1.6rem 0; padding-left: 3.4rem; }
.section-block .para-num {
  position: absolute; left: 0; top: 0.1rem;
  font-weight: 700; color: var(--accent);
  font-size: 0.95rem;
}
.section-block .para-num a { color: inherit; text-decoration: none; }
.section-block .para-num a:hover { text-decoration: underline; }
.section-block h3 { margin: 0 0 0.4rem; }
.section-block :target, .section-block.targeted { background: var(--paper-deep); }
.section-block:target { background: var(--paper-deep); outline: 0.6rem solid var(--paper-deep); }
.section-meta { font-size: 0.82rem; margin-top: 0.35rem; }
.section-meta a { color: var(--ink-soft); text-decoration: none; border: 1px solid var(--rule); padding: 0.05rem 0.5rem; border-radius: 1rem; margin-right: 0.35rem; display: inline-block; }
.section-meta a:hover { color: var(--accent); border-color: var(--accent-soft); }

.pager { display: flex; justify-content: space-between; margin-top: 3rem; border-top: 1px solid var(--rule); padding-top: 1rem; font-size: 0.95rem; }
.pager a { text-decoration: none; }

.breadcrumbs { font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 1.25rem; }
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs a:hover { color: var(--accent); }

/* Topic pages */
.treatment { border-left: 3px solid var(--rule); padding: 0.1rem 0 0.1rem 1.25rem; margin: 1.5rem 0; }
.treatment h3 { margin-bottom: 0.2rem; }
.treatment .byline { color: var(--ink-soft); font-style: italic; font-size: 0.92rem; margin: 0 0 0.5rem; }
.excerpt { font-size: 0.98rem; }
.excerpt-more { font-size: 0.9rem; }
.topic-children { columns: 2; column-gap: 3rem; max-width: 44rem; }
@media (max-width: 40rem) { .topic-children { columns: 1; } }
.topic-tree ul { list-style: none; padding-left: 1.4rem; }
.topic-tree > ul { padding-left: 0; }
.topic-tree li { margin: 0.3rem 0; }
.topic-tree .branch > a { font-variant-caps: small-caps; letter-spacing: 0.04em; text-decoration: none; }

/* Search + Ask */
.search-form { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0 0.4rem; max-width: 44rem; }
.search-hint { font-size: 0.88em; opacity: 0.7; margin: 0 0 2rem; max-width: 44rem; }
.search-form input[type="text"] {
  flex: 1 1 16rem; font: inherit; padding: 0.55rem 0.9rem;
  border: 1px solid var(--rule); background: var(--card);
}
.search-form select { font: inherit; padding: 0.5rem; border: 1px solid var(--rule); background: var(--card); }
.search-form button {
  font: inherit; font-variant-caps: small-caps; letter-spacing: 0.05em;
  background: var(--accent); color: var(--paper); border: 0; padding: 0.55rem 1.3rem; cursor: pointer;
}
.search-form button:hover { background: var(--accent-soft); }
.search-mode { font-size: 0.9rem; color: var(--ink-soft); }
.spelling-note { font-style: italic; }
.result { margin: 1.5rem 0; max-width: var(--measure); }
.result .where { font-size: 0.88rem; color: var(--ink-soft); margin: 0 0 0.15rem; }
.result mark { background: var(--mark); color: inherit; padding: 0 0.1em; }

.answer-panel {
  border: 1px solid var(--rule); background: var(--card-warm);
  padding: 1.5rem 1.75rem; max-width: var(--measure); margin-top: 1.5rem;
}
.answer-panel .citation-list { border-top: 1px solid var(--rule); margin-top: 1.25rem; padding-top: 1rem; font-size: 0.92rem; }
.answer-panel .citation-list p { margin: 0.35rem 0; }
.note { color: var(--ink-soft); font-size: 0.92rem; font-style: italic; }
.error-note { color: var(--accent); }

table.plain { border-collapse: collapse; width: 100%; max-width: 50rem; }
table.plain th, table.plain td { text-align: left; padding: 0.5rem 0.9rem 0.5rem 0; border-bottom: 1px solid var(--rule); }
table.plain th { font-variant-caps: small-caps; letter-spacing: 0.05em; font-weight: 600; }

/* Works shelf */
.card .credit { font-size: 0.85rem; color: var(--ink-soft); font-style: italic; }

/* Collapsible TOC (reading sidebar + work contents) */
.toc-collapsible details { margin: 0; }
.toc-collapsible summary { list-style: none; cursor: pointer; display: flex; gap: 0.4rem; align-items: baseline; }
.toc-collapsible summary::-webkit-details-marker { display: none; }
.toc-collapsible summary::before { content: '+'; color: var(--accent); font-weight: 700; width: 0.9rem; flex: none; }
.toc-collapsible details[open] > summary::before { content: '–'; }
.toc-collapsible li { margin: 0.2rem 0; }
.toc-collapsible ul { list-style: none; padding-left: 1.1rem; margin: 0.15rem 0; }
.toc-collapsible > ul { padding-left: 0; }
.toc-collapsible a.current-link { color: var(--accent); font-weight: 600; }
.toc-collapsible li:not(:has(details)) { padding-left: 1.3rem; }
/* the span of printed numbers an entry covers, as the books set it beside their own contents */
.toc-range { color: var(--ink-soft); font-size: 0.82rem; white-space: nowrap; margin-left: 0.4rem; }
.toc-sidebar .toc-range { display: none; }

/* Reading view: language toggle, Latin, apparatus, cited-by */
.lang-toggle { font-size: 0.88rem; color: var(--ink-soft); margin: -0.5rem 0 1.5rem; }
.lang-toggle a { text-decoration: none; color: var(--ink-soft); }
.lang-toggle a.active { color: var(--accent); font-weight: 600; }
.reading-body[data-lang="both"] .text-la { border-left: 2px solid var(--rule); padding-left: 0.9rem; margin-top: 0.6rem; }
.text-la { font-style: italic; color: var(--latin-ink); }
.text-la em, .text-la i { font-style: normal; }
.apparatus { font-size: 0.8rem; color: var(--ink-soft); margin: 0.3rem 0 0; letter-spacing: 0.01em; }
.section-block .para-num { white-space: nowrap; }
.section-block { padding-left: 4.6rem; }
.cited-by { display: inline-block; margin-top: 0.3rem; }
.cited-by summary { cursor: pointer; color: var(--ink-soft); font-size: 0.82rem; border: 1px dashed var(--rule); padding: 0.05rem 0.5rem; border-radius: 1rem; display: inline-block; }
.cited-by ul { margin: 0.4rem 0 0; padding-left: 1.2rem; font-size: 0.85rem; }
.cited-by ul a { border: 0; padding: 0; display: inline; }

/* Reference hover popups */
.ref-popup {
  position: absolute; z-index: 50; background: var(--card-warm); border: 1px solid var(--rule);
  box-shadow: 0 6px 24px var(--shadow); padding: 0.9rem 1.1rem 0.7rem; font-size: 0.92rem; line-height: 1.5;
  max-height: 22rem; overflow-y: auto;
}
.ref-popup-head { margin: 0 0 0.2rem; font-size: 0.78rem; color: var(--ink-soft); font-variant-caps: small-caps; letter-spacing: 0.05em; }
.ref-popup-head a { color: inherit; text-decoration: none; }
.ref-popup-num { margin: 0 0 0.3rem; font-weight: 700; color: var(--accent); }
.ref-popup-body p { margin: 0.35rem 0; }
.ref-popup-body a { pointer-events: none; color: inherit; text-decoration: none; }
.ref-popup-foot { margin: 0.5rem 0 0; font-size: 0.85rem; text-align: right; }
a[href^="/canon/"], a[href^="/denz/"], a[href^="/summa/"], a[href^="/trent/"], a[href^="/bible/"] { text-decoration-style: dotted; }

/* Codes: "Can. 1094." runs inline as a bold lead-in instead of in the margin */
.section-block-inline { padding-left: 0; }
.section-block-inline .para-num { position: static; display: block; margin-bottom: 0.15rem; font-size: 1rem; }
.section-block-inline .text-en > p:first-child, .section-block-inline .text-la > p:first-child { margin-top: 0; }

/* Ask: understanding/guidance line */
.guidance { border-bottom: 1px solid var(--rule); margin: 0 0 1rem; padding: 0 0 0.75rem; font-size: 0.9rem; color: var(--ink-soft); }
.guidance p { margin: 0.25rem 0; }
.guidance .g-label { font-variant-caps: small-caps; letter-spacing: 0.06em; color: var(--accent); margin-right: 0.35rem; }

/* Ask: answer grade (direct / reasoned from principles / prudential) */
.grade { font-size: 0.85rem; margin: -0.4rem 0 0.9rem; padding: 0.35rem 0.7rem; border-left: 3px solid var(--rule); color: var(--ink-soft); background: var(--paper-deep); }
.grade-direct .grade, .grade.grade-direct { border-left-color: #3b5d3b; }
.grade-determined .grade, .grade.grade-determined { border-left-color: var(--accent); }
.grade-prudential .grade, .grade.grade-prudential { border-left-color: #8a6d1e; }
.answer-panel.grade-determined { border-color: #d9b8a8; }
.answer-panel.grade-prudential { border-color: #e2cf9a; }

/* Editorial notes on works */
.work-note { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 1.25rem 0 0.5rem; margin: 2rem 0; }
.work-note h2 { margin-top: 0; }
.work-notice { font-size: 0.88rem; color: var(--ink-soft); font-style: italic; margin: -0.4rem 0 1.25rem; }
.card .card-actions { font-size: 0.9rem; margin-top: 0.6rem; }
.card .card-actions a { text-decoration: none; }
.card .card-actions a:hover { text-decoration: underline; }

/* Footnotes carried by a paragraph, and superscript markers in the text */
.section-block sup.fn { font-size: 0.7em; color: var(--accent); }
.fn-note { display: block; font-size: 0.86rem; color: var(--ink-soft); margin: 0.25rem 0 0 1.2rem; text-indent: -1.2rem; }
.fn-note sup { color: var(--accent); margin-right: 0.35rem; }
/* a further paragraph of the same note (Gury-Ballerini's notes run to several): no number, no hanging indent */
.fn-note.fn-cont { text-indent: 0; margin-left: 1.2rem; }

/* Alphabetical index */
.letter-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 0.55rem; margin: 0.5rem 0 1.5rem; font-variant-caps: small-caps; letter-spacing: 0.06em; }
.letter-nav a, .letter-nav span { text-decoration: none; padding: 0.1rem 0.35rem; border-radius: 0.25rem; }
.letter-nav a.active { background: var(--accent); color: #fff; }
.letter-nav span.empty { color: var(--rule); }
.letter-nav a.all { margin-left: auto; font-size: 0.85rem; }
.idx-list { max-width: 48rem; }
.idx-list dt { font-weight: 600; margin-top: 0.7rem; }
.idx-list dd { margin: 0.1rem 0 0 1.4rem; line-height: 1.55; }
.idx-work { margin: 0.1rem 0; }
.idx-list dd { line-height: 1.7; }
/* entries with many sub-entries: one per line, gently indented, so the eye can travel */
.idx-work.many .idx-sub { display: block; margin: 0.3rem 0 0.3rem 0.9rem; }
.idx-work.many .idx-sub > .idx-sep:first-child { margin-right: 0.35rem; }
.idx-work.many .idx-see { display: block; margin: 0.3rem 0 0.3rem 0.9rem; }
.idx-see-also { font-size: 0.78em; font-weight: 400; color: var(--ink-soft); margin-left: 0.45rem; }
.idx-see-also a { text-decoration: none; border-bottom: 1px dotted var(--accent); }
.idx-work-title { font-variant-caps: small-caps; letter-spacing: 0.04em; color: var(--ink-soft); margin-right: 0.4rem; }
.idx-sep { color: var(--rule); }
.idx-list a.ref { text-decoration: none; border-bottom: 1px dotted var(--accent); }
.idx-list a.ref:hover { border-bottom-style: solid; }
.idx-list .ref.dead { color: var(--ink-soft); }
.idx-headwords { columns: 3; column-gap: 2.5rem; list-style: none; padding: 0; max-width: 60rem; }
@media (max-width: 40rem) { .idx-headwords { columns: 1; } }
.idx-headwords a { text-decoration: none; }
.index-panel { border: 1px solid var(--rule); border-radius: 0.4rem; padding: 0.6rem 1rem 0.8rem; margin: 0 0 1.5rem; max-width: 48rem; background: var(--paper-soft, transparent); }
.index-panel h2 { margin: 0 0 0.3rem; font-size: 0.95rem; }
.idx-list.compact dt { margin-top: 0.4rem; }
.idx-list.compact dt a { text-decoration: none; }
.idx-list .ed { color: var(--ink-soft); font-size: 0.8em; }
.index-terms { color: var(--ink-soft); font-size: 0.95rem; max-width: 48rem; margin: 0.25rem 0 1.25rem; }
.index-terms a { text-decoration: none; border-bottom: 1px dotted var(--accent); }
.idx-list .printed { font-style: italic; color: var(--ink-soft); font-weight: 400; }
.idx-gloss { color: var(--ink-soft); font-weight: 400; font-size: 0.85em; }
.excerpt.place .units a.pop { text-decoration: none; border-bottom: 1px dotted var(--accent); padding: 0 0.1rem; }
.excerpt.place .place-note { color: var(--ink-soft); font-size: 0.9em; }
.toc-controls .toc-tip { display: block; color: var(--ink-soft); font-size: 0.85rem; margin-top: 0.3rem; }
.subtitle a.desc-link { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--accent); }
.subtitle a.desc-link:hover { color: var(--accent); }

/* See also (topic cross-links) */
.see-also { margin: 0.4rem 0 0.8rem; font-size: 0.95rem; line-height: 1.7; }
.see-also .smallcaps { margin-right: 0.25rem; }
.see-also-under { color: var(--muted, #6b6560); font-size: 0.85em; font-style: italic; }
.answer-panel .citation-list details.consulted { margin-top: 0.75rem; }
.answer-panel .citation-list details.consulted summary { cursor: pointer; color: var(--muted, #666); font-size: 0.88rem; }
.answer-panel .citation-list details.consulted p { opacity: 0.8; }
.answer-panel .read-further { border-top: 1px solid var(--rule); margin-top: 1rem; padding-top: 0.75rem; font-size: 0.92rem; }
.answer-panel .read-further p { margin: 0.35rem 0; }
.answer-panel .citation-list .expounded { color: var(--muted, #666); font-size: 0.88rem; }

.answer-panel .matched-note { border-left: 3px solid var(--accent, #8b1e1e); padding-left: 0.75rem; }
.answer-panel .rating { margin-top: 1rem; font-size: 0.92rem; color: var(--muted, #666); }
.answer-panel .rating .rate-btn { background: none; border: 1px solid var(--rule); border-radius: 4px; cursor: pointer; font-size: 1rem; padding: 0.1rem 0.45rem; }
.answer-panel .rating .rate-btn:hover { border-color: var(--accent, #8b1e1e); }
.answer-panel .rating .rate-tally { margin-left: 0.5rem; }
.answer-panel .fr-work { font-variant: small-caps; color: var(--muted, #666); }
button.linklike { background: none; border: none; padding: 0; color: var(--accent, #8b1e1e); text-decoration: underline; cursor: pointer; font: inherit; }
.popular-questions { padding-left: 1.4rem; }
.popular-questions li { margin: 0 0 1rem; }
.popular-questions .pq-excerpt { margin: 0.2rem 0; color: var(--muted, #555); font-size: 0.92rem; }
.popular-questions .pq-meta { margin: 0; font-size: 0.82rem; color: var(--muted, #777); }

/* Parallel topic view */
.compare-link { margin: -0.3rem 0 0.8rem; }
.compare-picker { margin: 0 0 1rem; font-size: 0.92rem; }
.compare-picker label { margin-right: 0.9rem; }
.compare-wrap { overflow-x: auto; margin-top: 1rem; padding-bottom: 1rem; }
.compare-grid { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(21rem, 1fr)); gap: 2.4rem; align-items: start; }
.compare-col { min-width: 0; max-width: none; }
.compare-col.reading-body { max-width: none; }
.compare-head { position: sticky; top: 0; background: var(--paper); padding: 0.4rem 0 0.5rem; border-bottom: 1px solid var(--rule); z-index: 1; }
.compare-head h2 { font-size: 1.25rem; margin: 0; }
.compare-head .byline { color: var(--ink-soft); font-style: italic; font-size: 0.9rem; margin: 0.1rem 0 0; }
.compare-outline { font-size: 0.85rem; color: var(--ink-soft); margin: 0.4rem 0 0; }
.compare-col h4 { margin: 1.6rem 0 0.2rem; font-size: 0.98rem; font-variant: small-caps; letter-spacing: 0.02em; }
.compare-col h4 a { color: var(--ink-soft); text-decoration: none; }
.compare-col .section-block { margin: 1rem 0; }
.compare-col .section-block .para-num { font-size: 0.88rem; color: var(--ink-soft); }
.compare-col .section-block h3 { font-size: 1rem; }
@media (max-width: 760px) { .compare-grid { grid-template-columns: 1fr; } .compare-head { position: static; } }

/* Admin review room */
.admin-login input { font: inherit; padding: 0.3rem 0.5rem; }
.adm-inline { display: inline; }
.adm-card { border: 1px solid var(--rule); border-radius: 6px; padding: 0.7rem 1rem; margin: 0.8rem 0; }
.adm-q { margin: 0 0 0.3rem; }
.adm-meta { color: var(--ink-soft); font-size: 0.85rem; font-style: italic; }
.adm-comments { margin: 0.3rem 0; padding-left: 1.2rem; font-size: 0.92rem; }
.adm-when { color: var(--ink-soft); font-size: 0.8rem; }
.adm-actions { margin: 0.4rem 0 0; font-size: 0.88rem; }
.adm-actions button { font: inherit; font-size: 0.85rem; margin-right: 0.5rem; padding: 0.1rem 0.5rem; border: 1px solid var(--rule); border-radius: 4px; background: var(--paper); cursor: pointer; }
.adm-actions button:hover { border-color: var(--accent); }
.adm-actions .adm-danger { color: #8b1e1e; }
.adm-answer { font-size: 0.92rem; max-width: none; }
.adm-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 760px) { .adm-compare { grid-template-columns: 1fr; } }
.rate-form { display: block; margin-top: 0.4rem; }
.rate-form textarea { width: 100%; max-width: 36rem; min-height: 3.2rem; font: inherit; font-size: 0.92rem; padding: 0.3rem 0.5rem; }
.rate-form button { font: inherit; font-size: 0.88rem; margin-top: 0.3rem; }
.rate-retry { margin-left: 0.5rem; }

.rate-criteria { font-size: 0.82rem; color: var(--ink-soft); margin: 0.35rem 0 0; max-width: 40rem; }
.rate-form label { display: block; font-size: 0.9rem; margin: 0.2rem 0; }
.rate-form .rate-kind-q { margin: 0.4rem 0 0.2rem; font-weight: 600; font-size: 0.92rem; }
.adm-kind { color: var(--ink-soft); }
.adm-voter { font-size: 0.8rem; color: var(--ink-soft); }
.adm-voter button { font: inherit; font-size: 0.78rem; padding: 0 0.35rem; border: 1px solid var(--rule); border-radius: 3px; background: var(--paper); cursor: pointer; }
.adm-disregarded { opacity: 0.55; }
.adm-kinds { font-size: 0.85rem; color: #8b1e1e; }
details.topic-aliases { margin: 0.4rem 0; }
details.topic-aliases summary { cursor: pointer; color: var(--ink-soft); font-size: 0.9rem; list-style-position: inside; }
details.topic-aliases summary:hover { color: var(--accent); }
details.topic-aliases > p { margin: 0.3rem 0 0 1.1rem; }

/* --- the veil over the specific passages of the sixth and ninth commandments ---------------
   Presentation only: the text is present and unaltered, covered on the page and opened by a
   click. No JavaScript — the control is an HTML <details>. */
.veil-notice { border: 1px solid var(--rule); border-left: 3px solid var(--accent); background: var(--paper-deep); padding: 0.85rem 1.1rem; margin: 0 0 1.6rem; font-size: 0.88rem; color: var(--ink-soft); }
.veil-notice p { margin: 0 0 0.6rem; line-height: 1.6; }
.veil-notice p:last-child { margin-bottom: 0; }
.veil-notice-quote { font-style: italic; text-align: center; margin: 0.9em 0 0.4em; }
.veil-notice-attr { font-style: normal; font-size: 0.88em; opacity: 0.75; margin-left: 0.6em; white-space: nowrap; }
.veil-notice-foot { font-style: italic; }

/* The finder's layered results: topics, then the authors' own questions, before raw passages. */
.finder-topics, .finder-asked { border: 1px solid var(--rule); background: var(--paper-deep); padding: 0.9rem 1.15rem; margin: 0 0 1.3rem; }
.finder-topics h2, .finder-asked h2 { margin: 0 0 0.6rem; }
.finder-topic { margin: 0 0 0.75rem; }
.finder-topic:last-child { margin-bottom: 0; }
.finder-topic-title { margin: 0; font-weight: 600; }
.finder-via { font-weight: 400; font-style: italic; color: var(--ink-soft); font-size: 0.88em; }
.finder-topic-desc { margin: 0.15rem 0 0; font-size: 0.9rem; color: var(--ink-soft); }
.finder-topic-works { margin: 0.15rem 0 0; font-size: 0.82rem; color: var(--ink-soft); }
.finder-asked-card { margin: 0 0 0.7rem; }
.finder-asked-q { margin: 0; }
.finder-asked-work { color: var(--ink-soft); font-size: 0.86em; }
.finder-asked-excerpt { margin: 0.1rem 0 0; font-size: 0.88rem; color: var(--ink-soft); }
.finder-more { margin: 0.4rem 0 0; font-size: 0.86rem; }

/* Present-law notes: where the discipline described has since changed (src/lib/present-law.ts). */
.law-note { border: 1px solid var(--rule); border-left: 3px solid var(--ink-soft); background: var(--paper-deep); padding: 0.85rem 1.1rem; margin: 0 0 1.4rem; font-size: 0.88rem; color: var(--ink-soft); }
.law-note.guarded { border-left-color: var(--accent); }
.law-note p { margin: 0 0 0.6rem; line-height: 1.6; }
.law-note p:last-child { margin-bottom: 0; }
.law-note-head { font-weight: 600; color: var(--ink); }
.law-note-head .ed { font-weight: 400; font-style: italic; opacity: 0.75; }
.law-note-source { font-size: 0.86em; font-style: italic; opacity: 0.8; }
.law-notes { margin-top: 1.4rem; }

/* The agreement before a conjugal chapter (see src/lib/veil.ts, GATED_DIVISIONS). */
.chastity-gate { position: fixed; inset: 0; z-index: 60; background: rgba(20, 16, 12, 0.55); background: color-mix(in srgb, var(--ink) 55%, transparent); display: flex; align-items: center; justify-content: center; padding: 1.2rem; }
.chastity-gate[hidden] { display: none !important; } /* display:flex would otherwise defeat the hidden attribute */
.chastity-gate-panel { background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-top: 3px solid var(--accent); max-width: 34rem; max-height: 88vh; overflow-y: auto; padding: 1.6rem 1.8rem; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); }
.chastity-gate-panel h2 { margin: 0 0 0.9rem; font-size: 1.15rem; }
.chastity-gate-panel p { font-size: 0.92rem; line-height: 1.65; margin: 0 0 0.85rem; }
.chastity-gate-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: 1.2rem; }
.gate-agree { font: inherit; font-size: 0.92rem; padding: 0.55rem 1rem; background: var(--accent); color: var(--paper); border: none; cursor: pointer; }
.gate-agree:hover { opacity: 0.9; }
.gate-back { font-size: 0.92rem; }
body.gate-locked { overflow: hidden; }
/* after agreement the covering is gone entirely: no Greek, no per-paragraph controls */
body.gate-lifted details.veil > summary { display: none; }
details.veil > summary { cursor: pointer; list-style: none; }
details.veil > summary::-webkit-details-marker { display: none; }
.veil-greek { color: var(--ink-soft); opacity: 0.45; font-family: var(--serif); letter-spacing: 0.06em; word-spacing: 0.12em; user-select: none; }
.veil-greek span { display: block; margin: 0 0 0.55rem; }
.veil-show, .veil-hide { display: block; font-size: 0.8rem; color: var(--accent); letter-spacing: 0.02em; margin: 0 0 0.5rem; }
.veil-show { text-decoration: underline dotted; }
details.veil[open] > summary .veil-greek, details.veil[open] > summary .veil-show { display: none; }
details.veil:not([open]) > summary .veil-hide { display: none; }
details.veil[open] > summary .veil-hide { text-decoration: underline dotted; }
/* Latin-only view: the original is itself the veil the manuals used, so the Greek and its control step aside. */
.reading-body[data-lang="la"] details.veil > summary { display: none; }

/* "Asked in the books": printed questions matching the reader's, answered verbatim, works side by side */
.authored-answers { margin: 1.6em 0 0.6em; border-top: 1px solid var(--rule, #d8d2c4); padding-top: 0.9em; }
.authored-note { font-size: 0.92em; opacity: 0.85; margin: 0.2em 0 0.8em; }
.authored-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1em; align-items: start; }
.authored-card { border: 1px solid var(--rule, #d8d2c4); border-radius: 4px; padding: 0.65em 0.9em; background: var(--card, transparent); }
.authored-card summary { cursor: pointer; line-height: 1.45; }
.authored-work { font-variant: small-caps; letter-spacing: 0.02em; margin-right: 0.45em; }
.authored-q { font-style: italic; }
.authored-body { margin-top: 0.7em; font-size: 0.95em; }
.authored-body p { margin: 0.5em 0; }
.authored-cite { margin: 0.6em 0 0.1em; font-size: 0.9em; }

/* the Questions page: two views, a live filter, the works as fold-out lists */
.q-toggle { display: flex; gap: 0.6em; margin: 0.4em 0 1.1em; }
.q-tab { padding: 0.32em 0.9em; border: 1px solid var(--rule, #d8d2c4); border-radius: 3px; text-decoration: none; }
.q-tab.active { font-weight: 600; border-color: currentColor; }
.q-filter input { width: 100%; max-width: 34em; padding: 0.45em 0.7em; font: inherit; border: 1px solid var(--rule, #d8d2c4); border-radius: 3px; background: transparent; color: inherit; }
.q-count { font-size: 0.88em; opacity: 0.7; margin-left: 0.6em; }
.q-work { margin: 0.9em 0; border-top: 1px solid var(--rule, #d8d2c4); padding-top: 0.5em; }
.q-work summary { cursor: pointer; padding: 0.25em 0; }
.q-list { list-style: none; padding-left: 0.2em; margin: 0.5em 0 0.9em; }
.q-list li { margin: 0.34em 0; line-height: 1.45; }
.q-cite { font-size: 0.85em; opacity: 0.65; white-space: nowrap; margin-left: 0.4em; }

.q-workfilter { display: flex; flex-wrap: wrap; gap: 0.4em 1.1em; font-size: 0.92em; margin: 0.5em 0 0.9em; align-items: center; }
.q-workfilter label { white-space: nowrap; cursor: pointer; }
.q-q { background: none; border: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
.q-q:hover { text-decoration-color: currentColor; }
.q-answers { margin: 0.7em 0 1em; }
.q-related { margin-top: 0.7em; border: 1px solid var(--rule, #d8d2c4); border-radius: 4px; padding: 0.45em 0.9em; background: var(--card, transparent); font-size: 0.95em; }
.q-related > summary { cursor: pointer; line-height: 1.5; }
.q-related > summary .q-count { margin-left: 0.35em; }
.q-related .authored-grid { margin-top: 0.7em; }
.q-topic { margin: 0.35em 0; }
.q-topic .q-topic { margin-left: 1.15em; }
.q-topic > summary { cursor: pointer; line-height: 1.6; }
.q-topic > summary .q-topic-title { font-weight: 600; }
.q-topic > summary .q-topic-page { font-size: 0.82em; opacity: 0.65; margin-left: 0.4em; }
.q-worktag { font-size: 0.78em; opacity: 0.75; margin-right: 0.25em; }
.q-topiclink { font-size: 0.95em; font-style: italic; margin: 0.4em 0 1em; }
.q-subtag { font-size: 0.72em; letter-spacing: 0.04em; text-transform: uppercase; border: 1px solid var(--rule, #d8d2c4); border-radius: 3px; padding: 0 0.3em; margin-right: 0.3em; opacity: 0.7; white-space: nowrap; }
.q-casetag { font-size: 0.78em; font-style: italic; opacity: 0.7; margin-right: 0.35em; }
.q-case { margin: 0.45em 0 0.45em 0.9em; }
.q-case > summary { cursor: pointer; line-height: 1.55; }
.q-case > summary .q-case-title { font-weight: 600; font-size: 0.95em; }
.authored-crumb { font-size: 0.82em; opacity: 0.65; margin: 0.35em 0 0.2em; }
.print-fix { font-size: 0.72em; opacity: 0.65; cursor: help; margin-left: 1px; text-decoration: none; }
.found-forms { opacity: 0.75; }
.found-forms a { text-decoration: none; border-bottom: 1px dotted currentColor; }
.search-exact { display: inline-flex; align-items: center; gap: 0.4em; white-space: nowrap; font-size: 0.92em; opacity: 0.85; }
.search-exact input { accent-color: var(--accent, #7a2e2e); }
.search-works { position: relative; display: inline-block; }
.search-works > summary { cursor: pointer; list-style: none; border: 1px solid var(--rule, #d8d2c4); border-radius: 4px; padding: 0.45em 0.8em; background: var(--card, transparent); white-space: nowrap; }
.search-works > summary::after { content: " ▾"; font-size: 0.8em; opacity: 0.6; }
.search-works[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.search-works-list { position: absolute; z-index: 30; min-width: 15em; max-height: 20em; overflow-y: auto; border: 1px solid var(--rule, #d8d2c4); border-radius: 0 4px 4px 4px; background: var(--bg, #faf6ee); padding: 0.5em 0.8em; display: flex; flex-direction: column; gap: 0.35em; box-shadow: 0 3px 12px rgba(0,0,0,0.08); }
.search-works-list label { white-space: nowrap; cursor: pointer; font-size: 0.93em; }
.search-pager { margin: 1.4em 0; display: flex; gap: 1.2em; align-items: baseline; font-size: 0.95em; }
.search-works-note { margin: 0.5em 0 0; font-size: 0.8em; font-variant: small-caps; letter-spacing: 0.04em; opacity: 0.7; border-top: 1px solid var(--rule, #d8d2c4); padding-top: 0.5em; }

/* The theme toggle: a small glyph at the header's right (hidden without scripting; the site
   then follows the device). ◐ follows the device, ☾ forces dark, ☀ forces light. */
.theme-toggle { font: inherit; font-size: 1rem; line-height: 1; color: var(--ink-soft); background: transparent; border: 1px solid var(--rule); border-radius: 999px; width: 1.9rem; height: 1.9rem; padding: 0; cursor: pointer; align-self: center; flex: none; }
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* Errors & questions (src/routes/feedback.tsx; the link closes the site footer) */
.site-footer .feedback-link { margin-top: 0.9rem; font-variant-caps: small-caps; letter-spacing: 0.04em; }
.feedback-note { color: var(--ink-soft); font-style: italic; }
.feedback-form { max-width: var(--measure); margin: 1.5rem 0 0; display: flex; flex-direction: column; gap: 0.8rem; }
.feedback-kind { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0; }
.feedback-kind label { cursor: pointer; }
.feedback-context { margin: 0; color: var(--ink-soft); font-size: 0.92rem; overflow-wrap: anywhere; }
.feedback-form textarea, .feedback-form input[type="email"] {
  font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--rule);
  padding: 0.7rem 0.9rem; width: 100%; box-sizing: border-box;
}
.feedback-form textarea { resize: vertical; min-height: 10rem; }
.feedback-form textarea:focus, .feedback-form input[type="email"]:focus { outline: 2px solid var(--accent-soft); outline-offset: 1px; }
.feedback-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.feedback-send { margin: 0.2rem 0 0; }
.feedback-send button {
  border: 0; background: var(--accent); color: var(--paper); font: inherit; font-variant-caps: small-caps;
  letter-spacing: 0.06em; padding: 0.55rem 1.8rem; cursor: pointer;
}
.feedback-send button:hover { background: var(--accent-soft); }
.feedback-result { max-width: var(--measure); border-left: 3px solid var(--accent); padding: 0.5rem 0.9rem; margin: 1.25rem 0 0; background: var(--paper-deep); }
.feedback-result.ok { border-left-color: var(--rule); }

/* Support (src/routes/home.tsx /support) */
.support-ways { max-width: var(--measure); margin: 1.75rem 0; }
.support-ways p { margin: 0.4rem 0; }
.support-give {
  display: inline-block; background: var(--accent); color: var(--paper); text-decoration: none;
  font-variant-caps: small-caps; letter-spacing: 0.06em; padding: 0.6rem 1.9rem;
}
.support-give:hover { background: var(--accent-soft); color: var(--paper); }
.support-desc { color: var(--ink-soft); font-style: italic; font-size: 0.95rem; }
.support-fine { color: var(--ink-soft); font-size: 0.9rem; }
