/* latterdaysaint.me: light and airy. One stylesheet, light and dark. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f9fd;
  --tint: #eaf2fb;
  --ink: #1d2a3a;
  --ink-2: #3e4f63;
  --muted: #687a8e;
  --line: #e6edf4;
  --line-2: #d3dfeb;
  --brand: #1d3557;
  --link: #2c6aa3;
  --sky: #4a7fb5;
  --gold: #a9853a;
  --gold-soft: #f8f1e0;
  --rose-soft: #fbecec;
  --rose: #a3484a;
  --pair: #fdf3d6;
  --shadow: 0 1px 2px rgba(29, 53, 87, .04), 0 8px 24px rgba(29, 53, 87, .05);
  --radius: 14px;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, ui-serif, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111a24;
    --surface: #16212d;
    --surface-2: #1a2734;
    --tint: #1d2d3e;
    --ink: #e6edf5;
    --ink-2: #c3cfdc;
    --muted: #8fa1b5;
    --line: #233243;
    --line-2: #2f4256;
    --brand: #dce8f5;
    --link: #8ab8e6;
    --sky: #7fb0e0;
    --gold: #d9b86a;
    --gold-soft: #2c2716;
    --rose-soft: #2f1d1f;
    --rose: #e79a9b;
    --pair: #3a3218;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .2);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16.5px/1.65 var(--sans); }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--sky); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.22; color: var(--brand); }
h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.9rem); margin: .2em 0 .35em; letter-spacing: -.01em; }
h2 { font-size: 1.55rem; margin: 1.8em 0 .6em; }
h3 { font-size: 1.2rem; margin: 1.4em 0 .4em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.wrap { width: min(1140px, 100% - 2.5rem); margin-inline: auto; }
.narrow { max-width: 780px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: var(--bg); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; border-radius: 4px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .74rem; font-weight: 600; color: var(--gold); margin: 0; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 64ch; margin: .4rem 0 1rem; }

/* ---- header ---------------------------------------------------------------------------- */
.site-header { background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--brand); }
.brand:hover { color: var(--brand); }
.brand-mark { width: 30px; height: 30px; color: var(--sky); flex: none; }
.brand-name { font-family: var(--serif); font-size: 1.28rem; color: var(--brand); }
.brand-name span { color: var(--gold); }
.site-nav { display: flex; align-items: center; gap: .2rem; margin-left: auto; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-size: .94rem; padding: .42rem .7rem; border-radius: 999px; }
.site-nav a:hover { background: var(--surface-2); color: var(--brand); }
.site-nav a.active { color: var(--brand); background: var(--tint); }
.nav-search input { width: 8.5rem; font: inherit; font-size: .9rem; padding: .4rem .8rem; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface-2); color: var(--ink); margin-left: .5rem; }
.nav-search input:focus { width: 12rem; transition: width .2s; background: var(--surface); }
.nav-toggle { display: none; margin-left: auto; font: inherit; font-size: .9rem; background: none; border: 1px solid var(--line-2); border-radius: 999px; padding: .35rem .9rem; color: var(--ink); }
@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 68px; background: var(--bg); border-bottom: 1px solid var(--line); padding: .6rem 1.25rem 1rem; flex-direction: column; align-items: stretch; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: .65rem .6rem; border-radius: 10px; }
  .nav-search input, .nav-search input:focus { width: 100%; margin: .5rem 0 0; }
}

/* ---- buttons ---------------------------------------------------------------------------- */
.btn { display: inline-block; background: var(--brand); color: var(--bg); border: 0; font: inherit; font-weight: 500; font-size: .95rem; padding: .72rem 1.25rem; border-radius: 999px; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--link); color: #fff; }
.btn-ghost { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover { background: var(--tint); color: var(--brand); }
.btn-small { padding: .48rem .95rem; font-size: .88rem; }

/* ---- home ------------------------------------------------------------------------------- */
.hero { background: linear-gradient(180deg, var(--surface-2), var(--bg)); padding: 4.5rem 0 3.5rem; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3.5rem; align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.3rem); margin-top: .5rem; }
.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.8rem; }
.verse-card { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 1.6rem 1.7rem 1.3rem; box-shadow: var(--shadow); }
.verse-card figcaption { font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: 1rem; }
.verse-card p { font-family: var(--serif); font-size: 1.12rem; line-height: 1.55; margin: 0 0 .8rem; }
.verse-card .verse-ref { font-family: var(--sans); font-size: .88rem; color: var(--muted); margin: 1.1rem 0 0; }
.band { padding: 3rem 0 .5rem; }
.band-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.band-head h2 { margin: 0; }
.band-head a { font-size: .92rem; text-decoration: none; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem; }
.card { display: flex; flex-direction: column; gap: .35rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s, box-shadow .15s; }
.card:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.card-sec { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); font-weight: 600; }
.card-title { font-family: var(--serif); font-size: 1.3rem; color: var(--brand); line-height: 1.3; }
.card-sum { color: var(--ink-2); font-size: .95rem; }
.card-meta { font-size: .8rem; color: var(--muted); margin-top: auto; padding-top: .4rem; }
.section-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.8rem 2.5rem; padding-bottom: 2rem; }
.section-card h3 { margin: 0 0 .3rem; font-size: 1.3rem; }
.section-card h3 a { color: var(--brand); text-decoration: none; }
.section-card p { margin: 0 0 .6rem; font-size: .94rem; }
.section-card ul { list-style: none; padding: 0; margin: 0; }
.section-card li { padding: .3rem 0; border-top: 1px solid var(--line); font-size: .95rem; }
.section-card li a { color: var(--ink-2); text-decoration: none; }
.section-card li a:hover { color: var(--link); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 2rem; } .hero { padding-top: 2.5rem; } }

/* ---- generic page ---------------------------------------------------------------------- */
.page { padding: 1.8rem 0 4rem; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: .8rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--link); }
.crumbs .sep { margin: 0 .5rem; opacity: .6; }
.page-head { margin-bottom: 2rem; }
.group h2 { font-size: 1.3rem; margin-top: 1.5rem; }
.callout { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.6rem; margin-top: 3rem; }
.callout h2 { margin: 0 0 .4rem; font-size: 1.25rem; }
.callout p { color: var(--ink-2); max-width: 75ch; }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; flex-direction: column; padding: .9rem 0; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.list-row:hover .lr-title { color: var(--link); }
.lr-title { font-family: var(--serif); font-size: 1.15rem; color: var(--brand); }
.lr-sum { color: var(--ink-2); font-size: .93rem; }
.lr-meta { font-size: .8rem; color: var(--muted); }

/* ---- article ---------------------------------------------------------------------------- */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 4rem; }
.article { max-width: 720px; }
.article-head { margin-bottom: 2rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.article-head h1 { margin: .3rem 0 .4rem; }
.byline { color: var(--muted); font-size: .88rem; margin: .6rem 0 0; }
.prose { font-size: 1.07rem; line-height: 1.8; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.15em; }
.prose li { margin: .3em 0; }
.prose h2 { font-size: 1.6rem; margin-top: 2.2em; }
.prose h3 { font-size: 1.22rem; }
.prose blockquote { margin: 1.5em 0; padding: .9em 1.3em; background: var(--surface-2); border-left: 3px solid var(--sky); border-radius: 0 12px 12px 0; font-family: var(--serif); color: var(--ink); font-size: 1.08rem; line-height: 1.7; }
.prose blockquote p { margin: 0 0 .5em; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote cite { display: block; font-family: var(--sans); font-style: normal; font-size: .85rem; color: var(--muted); margin-top: .5em; }
.prose table { border-collapse: collapse; margin: 1.4em 0; font-size: .93rem; width: 100%; display: block; overflow-x: auto; }
.prose td, .prose th { border-bottom: 1px solid var(--line); padding: .5rem .7rem; vertical-align: top; text-align: left; }
.prose th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; border-bottom-color: var(--line-2); }
.prose td.num, .prose th.num { text-align: right; font-variant-numeric: tabular-nums; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose .note { font-size: .92rem; color: var(--ink-2); background: var(--gold-soft); border-radius: 12px; padding: .9rem 1.1rem; }
.prose .sources { font-size: .9rem; color: var(--ink-2); }
.prose .sources li { margin: .5em 0; }
a.sref { text-decoration-style: dotted; white-space: nowrap; }
.article-side { display: flex; flex-direction: column; gap: 1.2rem; padding-top: 3rem; }
.side-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.side-box h2 { font-family: var(--sans); font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 .6rem; font-weight: 600; }
.side-box ul, .side-box ol { list-style: none; padding: 0; margin: 0; }
.side-box li { padding: .32rem 0; font-size: .92rem; line-height: 1.4; }
.side-box li a { text-decoration: none; color: var(--ink-2); }
.side-box li a:hover, .side-box li a.current { color: var(--link); }
.toc { position: sticky; top: 90px; }
.side-cta { background: var(--surface-2); }
.side-cta p { font-size: .92rem; color: var(--ink-2); margin: 0 0 .9rem; }
@media (max-width: 980px) { .article-layout { grid-template-columns: 1fr; gap: 1rem; } .article-side { padding-top: 0; } .toc { position: static; } }

/* ---- chiasms ---------------------------------------------------------------------------- */
.chiasm { margin: 1.8em 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.2rem 1.3rem 1rem; font-family: var(--serif); font-size: 1rem; line-height: 1.55; }
.chiasm figcaption { font-family: var(--sans); font-size: .85rem; color: var(--muted); margin-top: .9rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.chiasm figcaption strong { color: var(--ink-2); font-weight: 600; }
.chiasm ol { list-style: none; margin: 0; padding: 0; }
.chiasm li { display: grid; grid-template-columns: 2.1rem 1fr auto; gap: .3rem; align-items: baseline; margin: 0; padding: .22rem .5rem .22rem calc(.5rem + var(--d, 0) * 1.35rem); border-radius: 8px; transition: background .12s; }
.chiasm li b { font-family: var(--sans); font-size: .82rem; font-weight: 600; color: var(--sky); }
.chiasm li .v { font-family: var(--sans); font-size: .75rem; color: var(--muted); white-space: nowrap; padding-left: .6rem; }
.chiasm li.center { color: var(--gold); }
.chiasm li.center b { color: var(--gold); }
.chiasm li.on { background: var(--pair); }
.chiasm li em { font-style: normal; background: linear-gradient(transparent 62%, var(--tint) 62%); }
@media (max-width: 600px) { .chiasm li { padding-left: calc(.2rem + var(--d, 0) * .38rem); grid-template-columns: 1.7rem 1fr; } .chiasm li .v { display: none; } }

/* ---- bar charts in articles -------------------------------------------------------------- */
.bars { margin: 1.6em 0; border: 1px solid var(--line); border-radius: 16px; padding: 1.1rem 1.3rem .9rem; font-family: var(--sans); }
.bars figcaption { font-size: .85rem; color: var(--muted); margin-top: .7rem; }
.bars .bars-title { font-weight: 600; font-size: .95rem; color: var(--ink); margin: 0 0 .7rem; }
.bar { display: grid; grid-template-columns: 11.5rem 1fr 3.2rem; gap: .7rem; align-items: center; font-size: .9rem; margin: .38rem 0; }
.bar .track { background: var(--surface-2); border-radius: 999px; height: 12px; overflow: hidden; }
.bar .fill { display: block; height: 100%; background: var(--sky); border-radius: 999px; }
.bar.hi .fill { background: var(--gold); }
.bar .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
@media (max-width: 560px) { .bar { grid-template-columns: 7.5rem 1fr 2.8rem; font-size: .82rem; } }

/* ---- promise index ---------------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1.2rem; }
.filters label { display: flex; flex-direction: column; gap: .25rem; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.filters label.grow { flex: 1; min-width: 12rem; }
.filters select, .filters input { font: inherit; font-size: .93rem; text-transform: none; letter-spacing: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: .48rem .7rem; max-width: 100%; }
.filters .clear { font-size: .9rem; align-self: center; }
.js .filters[data-autosubmit] button[type=submit] { display: none; }
.result-count { color: var(--muted); font-size: .9rem; }
.vol-head { font-size: 1.35rem; margin: 2rem 0 .9rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); }
.promise { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.05rem 1.25rem; margin-bottom: .9rem; }
.promise:target { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.promise-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .55rem; }
.promise-head a { font-weight: 600; text-decoration: none; }
.promise-head .form { font-size: .78rem; color: var(--muted); }
.promise-body p, .verse-card .cond, .verse-card .bless { display: grid; grid-template-columns: 3.4rem 1fr; gap: .5rem; align-items: baseline; }
.promise-body p { margin: .3rem 0; font-family: var(--serif); font-size: 1.03rem; line-height: 1.55; }
.tag { font-family: var(--sans); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; text-align: center; border-radius: 999px; padding: .12rem 0; }
.cond .tag { background: var(--tint); color: var(--link); }
.bless .tag { background: var(--gold-soft); color: var(--gold); }
.conv .tag { background: var(--rose-soft); color: var(--rose); }
.promise-note { font-size: .9rem; color: var(--ink-2); margin: .6rem 0 0; }
.promise-topics { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .7rem; }
.chip { font-size: .78rem; text-decoration: none; padding: .16rem .65rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.chip:hover { border-color: var(--line-2); color: var(--link); }

/* ---- search / sitemap / footer -------------------------------------------------------- */
.search-big { display: flex; gap: .6rem; margin: 1rem 0 1.6rem; }
.search-big input { flex: 1; font: inherit; font-size: 1.05rem; padding: .7rem 1.1rem; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--ink); }
.sitemap-grid { columns: 3 280px; column-gap: 2.5rem; }
.sitemap-grid section { break-inside: avoid; margin-bottom: 1.5rem; }
.sitemap-grid h2 { margin-top: 0; font-size: 1.25rem; }
.sitemap-grid h2 a { color: var(--brand); text-decoration: none; }
.sitemap-grid h3 { font-family: var(--sans); font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); margin: .8rem 0 .2rem; }
.sitemap-grid ul { margin: 0; padding-left: 1rem; }
.site-footer { background: var(--surface-2); border-top: 1px solid var(--line); padding: 2.8rem 0 1.4rem; margin-top: 3rem; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.footer-grid h2 { font-family: var(--sans); font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 .6rem; font-weight: 600; }
.footer-grid a:not(.brand) { display: block; color: var(--ink-2); text-decoration: none; padding: .15rem 0; }
.footer-grid a:not(.brand):hover { color: var(--link); }
.footer-grid p { margin: .6rem 0 0; max-width: 40ch; }
.footer-base { display: flex; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1rem; color: var(--muted); font-size: .82rem; }
.footer-base p { margin: 0; max-width: 80ch; }
.footer-base a { color: inherit; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } }
