/* thebsb.app — Rubricated Paper (matches the native Berean Bible app)
   Cream paper, one liturgical red for structure, gold for the semantic-divine.
   Never tech gray, never pure black on white. */

@font-face {
  font-family: "Literata";
  src: url("/fonts/Literata-Variable.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("/fonts/Literata-Italic-Variable.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #F9F6EF;
  --ink: #221D19;
  --rubric: #AD291F;
  --jesus: #8B1B16;
  --quiet: #8F8476;
  --muted: #73695D;
  --gilt: #B7934C;
  --card: #F3EEE3;
  --serif: "Literata", "New York", ui-serif, Georgia, serif;
}
.vellum {
  --paper: #1D1A17;
  --ink: #E0D9CE;
  --rubric: #D95F4D;
  --jesus: #E07967;
  --quiet: #8A8073;
  --muted: #A3988A;
  --gilt: #CBA963;
  --card: #26221E;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.62;
  font-optical-sizing: auto;
}
a { color: var(--rubric); text-decoration: none; }
a:hover { text-decoration: underline; }
.measure { max-width: 42rem; margin-inline: auto; padding-inline: 1.25rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------------------------------------------------------- chrome */
.chrome {
  position: fixed; inset-inline: 0; top: 0; z-index: 10;
  transition: transform .28s ease, opacity .28s ease;
}
.chrome.hidden { transform: translateY(-110%); opacity: 0; }
.chrome-inner {
  display: flex; justify-content: space-between; align-items: center;
  padding: .6rem .8rem;
}
.chrome-left, .chrome-right { display: flex; gap: .45rem; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .42rem .85rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid color-mix(in srgb, var(--ink) 9%, transparent);
  box-shadow: 0 1px 8px rgb(0 0 0 / .06);
  color: var(--ink);
  font-size: .95rem;
  cursor: pointer;
  font-family: var(--serif);
}
.pill:hover { text-decoration: none; }
.pill.icon { padding: .42rem .62rem; font-size: 1.02rem; line-height: 1; }
.pill .chev { color: var(--quiet); font-size: .8em; margin-top: -0.4em; }
button.pill { appearance: none; }

/* ---------------------------------------------------------------- page */
.page { padding: 5.2rem 0 3rem; }
.page-title {
  font-size: 1.9rem; font-weight: 650; letter-spacing: .01em;
  margin: 0 0 1.2rem;
}

/* ---------------------------------------------------------------- scripture */
.chapter { font-size: 1.125rem; }
.chapter > p, .chapter > div.q { margin: 0; }
.chapter p.p { text-indent: 1.35em; margin: 0; }
.chapter p.p.ornament, .chapter :is(h2, h3, p.r, p.d, div.b) + p.p { }
.chapter p.p:first-child { text-indent: 0; }

/* headings: the rubrication layer */
.s1, .s2 {
  color: var(--rubric);
  font-size: .82rem; font-weight: 620;
  letter-spacing: .14em; text-transform: uppercase;
  margin: 1.9rem 0 .45rem;
}
.chapter h2.s1:first-child { margin-top: 0; }
.s2 { font-size: .76rem; letter-spacing: .12em; }
.ms {
  color: var(--rubric); text-align: center;
  font-size: .95rem; font-weight: 650;
  letter-spacing: .2em; text-transform: uppercase;
  margin: 2.4rem 0 .4rem;
}
.mr { text-align: center; color: var(--muted); font-style: italic; font-size: .9rem; margin: 0 0 1.4rem; }
.qa {
  color: var(--rubric); font-size: .8rem; font-weight: 620;
  letter-spacing: .16em; text-transform: uppercase;
  margin: 1.6rem 0 .4rem;
}
p.r { color: var(--muted); font-style: italic; font-size: .88rem; margin: 0 0 .9rem; }
p.d { color: var(--muted); font-style: italic; font-size: .97rem; margin: 0 0 1rem; }
p.pc { text-align: center; margin: .4rem 0; }
p.pmo { margin: .4rem 0; }

/* poetry: true hanging indents */
.q { padding-left: 2.6em; text-indent: -1.55em; }
.q2 { padding-left: 3.7em; }
.qr { text-align: right; padding-left: 0; text-indent: 0; font-style: italic; }
.li1 { padding-left: 2.6em; text-indent: -1.55em; }
.li2 { padding-left: 3.7em; }
.b { height: .95em; }

/* verse numbers and apparatus */
sup.vn {
  color: var(--quiet);
  font-size: .62em; font-weight: 500;
  line-height: 0; vertical-align: super;
  margin-right: .22em; letter-spacing: 0;
  scroll-margin-top: 5rem;
}
sup.fn a {
  color: var(--rubric);
  font-size: .68em; font-weight: 600;
  line-height: 0; text-decoration: none;
}
span[id^="v"] { scroll-margin-top: 5rem; }

/* the ornament: versal drop cap (ch 1) and red numeral (ch 2+) */
.versal, .numeral {
  float: left;
  color: var(--rubric);
  font-weight: 560;
  line-height: .84;
}
.versal {
  font-size: 3.55em;
  padding: .04em .09em 0 0;
}
.numeral {
  font-size: 2.6em;
  padding: .06em .14em 0 0;
  font-variant-numeric: lining-nums;
}
.ornament { text-indent: 0 !important; }
.q.ornament { padding-left: 0; }

/* red letter: off by default; toggle adds .redletter on <html> */
.redletter .wj { color: var(--jesus); }

/* target highlight when arriving via #vN */
:target { animation: settle 2.4s ease-out 1; }
@keyframes settle {
  0%, 45% { background: color-mix(in srgb, var(--gilt) 26%, transparent); }
  100% { background: transparent; }
}

/* footnotes at the foot of the page */
.footnotes { margin-top: 2.6rem; font-size: .92rem; color: var(--muted); }
.footnotes ol { list-style: none; margin: .9rem 0 0; padding: 0; }
.footnotes li { margin: .34rem 0; padding-left: 1.15rem; text-indent: -1.15rem; }
.fn-letter { color: var(--rubric); font-weight: 620; }
.fn-fr { color: var(--quiet); }
.fn-back { color: var(--quiet); font-size: .85em; }
.footnotes a { color: var(--rubric); }

/* prev/next */
.chapternav { display: flex; justify-content: space-between; max-width: 46rem; margin: 2.2rem auto 0; padding-inline: 1.25rem; }
.pagenav {
  font-size: 1.6rem; line-height: 1;
  padding: .5rem .95rem; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  color: var(--ink); background: var(--card);
}
.pagenav:hover { text-decoration: none; border-color: var(--gilt); }
.chapternav .next { margin-left: auto; }

/* ---------------------------------------------------------------- shared flourishes */
.gilt-rule {
  height: 1px; width: 5.5rem; background: var(--gilt);
  margin: 1.1rem auto; border: 0;
}
.gilt-rule.small { margin: .7rem auto .9rem; width: 3.2rem; }
.testament, .card-label {
  color: var(--rubric);
  font-size: .78rem; font-weight: 620;
  letter-spacing: .18em; text-transform: uppercase;
  text-align: center; margin: 0;
}

/* ---------------------------------------------------------------- home */
.masthead { text-align: center; padding-top: 2.2rem; }
.site-title {
  font-size: clamp(2.6rem, 7vw, 3.6rem);
  font-weight: 640; letter-spacing: .005em;
  margin: .45rem 0 0;
}
.subtitle { color: var(--muted); font-style: italic; margin: .1rem 0 0; }

.votd-card, .app-promo {
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--ink) 7%, transparent);
  border-radius: 18px;
  padding: 1.6rem 1.5rem 1.7rem;
  margin-top: 2.2rem;
  text-align: center;
}
.votd-card blockquote {
  margin: .4rem 0 .5rem;
  font-size: 1.22rem; line-height: 1.55;
}
.votd-ref { color: var(--muted); font-style: italic; margin: 0 0 1.1rem; }
.promo-copy { color: var(--ink); margin: .4rem auto 1.1rem; max-width: 30rem; }
.button {
  display: inline-block;
  background: var(--rubric); color: var(--paper);
  padding: .6rem 1.4rem; border-radius: 999px;
  font-weight: 600; font-size: .98rem;
  border: 0; cursor: pointer; font-family: var(--serif);
}
.button:hover { text-decoration: none; filter: brightness(1.08); }

.continue { margin-top: 1.1rem; }
.continue-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--ink) 7%, transparent);
  border-radius: 14px;
  padding: .95rem 1.2rem;
  color: var(--ink);
}
.continue-row:hover { text-decoration: none; border-color: var(--gilt); }
.continue-row .arrow { color: var(--quiet); font-size: 1.3rem; }

.books-list { margin-top: 2.6rem; }
.books-list .s1 { text-align: center; margin: 2.2rem 0 1rem; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .5rem; }
.book-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: .62rem .9rem;
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--ink) 6%, transparent);
  border-radius: 10px;
  color: var(--ink);
}
.book-row:hover { text-decoration: none; border-color: var(--gilt); }
.book-row .count { color: var(--quiet); font-size: .82rem; }

/* ---------------------------------------------------------------- book ceremony */
.ceremony { text-align: center; padding-top: 3.2rem; }
.book-title {
  font-size: clamp(2.3rem, 6vw, 3.2rem);
  font-weight: 620; margin: .5rem 0 0;
}
.chapter-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(3.2rem, 1fr));
  gap: .45rem; margin-top: 1.6rem;
}
.chip {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1.25; border-radius: 10px;
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink); font-size: 1.02rem;
  font-variant-numeric: lining-nums;
}
.chip:hover { text-decoration: none; border-color: var(--gilt); color: var(--rubric); }

/* ---------------------------------------------------------------- search */
.search-ui { padding-top: 1rem; }
.search-row { display: flex; gap: .5rem; margin-bottom: .8rem; flex-wrap: wrap; }
#q {
  flex: 1 1 16rem;
  font: inherit; color: var(--ink);
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  border-radius: 12px; padding: .68rem 1rem;
}
#scope {
  font: inherit; color: var(--ink);
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  border-radius: 12px; padding: .68rem .8rem;
}
.search-status { color: var(--muted); font-style: italic; min-height: 1.4em; }
.results { list-style: none; margin: 1rem 0 0; padding: 0; }
.results li { margin: 0 0 1.05rem; }
.results .ref { color: var(--rubric); font-weight: 620; }
.results mark { background: color-mix(in srgb, var(--gilt) 34%, transparent); color: inherit; border-radius: 3px; }

/* ---------------------------------------------------------------- prose pages */
.prose p { margin: .85rem 0; }
.prose .s1 { margin-top: 2rem; }
.legal-date { color: var(--quiet); font-size: .9rem; }

/* ---------------------------------------------------------------- footer */
.site-foot { padding: 3.4rem 0 3rem; text-align: center; }
.foot-lede { color: var(--muted); font-style: italic; max-width: 30rem; margin: .8rem auto .5rem; }
.foot-credit { color: var(--quiet); font-size: .86rem; max-width: 32rem; margin: 0 auto 1.4rem; }
.foot-links { display: flex; gap: 1.3rem; justify-content: center; flex-wrap: wrap; font-size: .95rem; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--rubric); }

@media (max-width: 480px) {
  .chapter { font-size: 1.06rem; }
  .q { padding-left: 1.9em; }
  .q2, .li2 { padding-left: 2.9em; }
}

@media print {
  .chrome, .chapternav, .site-foot { display: none; }
  body { background: white; }
}

/* ---------------------------------------------------------------- app banner
   Shown only where Safari's native Smart App Banner is unavailable
   (Android, and non-Safari browsers on iOS). Same paper, same rubric. */
.app-banner {
  position: sticky; top: 0; z-index: 11;
  background: var(--card);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  box-shadow: 0 1px 10px rgb(0 0 0 / .06);
}
.app-banner-inner {
  display: flex; align-items: center; gap: .7rem;
  max-width: 42rem; margin-inline: auto;
  padding: .55rem .8rem;
}
.app-banner-close {
  appearance: none; border: 0; background: transparent;
  color: var(--quiet); font-size: 1.35rem; line-height: 1;
  padding: .2rem .35rem; cursor: pointer; font-family: var(--serif);
}
.app-banner-icon { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.app-banner-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.app-banner-text strong { font-weight: 600; font-size: .98rem; }
.app-banner-text span { color: var(--muted); font-size: .84rem; }
.app-banner-cta {
  display: inline-block; flex: none;
  background: var(--rubric); color: var(--paper);
  padding: .42rem 1rem; border-radius: 999px;
  font-weight: 600; font-size: .9rem;
}
.app-banner-cta:hover { text-decoration: none; filter: brightness(1.08); }
body.has-app-banner .chrome { top: var(--banner-h, 62px); }
.promo-buttons { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
