/* Voice of Calvary — Dr. Jack MacArthur Legacy */
:root {
  --paper: #f6f1e7;
  --paper-2: #efe7d8;
  --card: #fbf8f2;
  --ink: #1d1a16;
  --ink-2: #4a443b;
  --muted: #7a7164;
  --rule: #d9cfbd;
  --accent: #7b2d1f;      /* oxblood */
  --accent-2: #9a3b28;
  --gold: #a9853e;
  --night: #17130f;
  --night-2: #241e18;
  --display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --body: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1180px;
  --radius: 4px;
  --player-h: 0px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.65;
  padding-bottom: var(--player-h);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.narrow { width: min(720px, 100% - 32px); margin-inline: auto; }

.eyebrow {
  font-family: var(--ui);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 14px;
}
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.08; margin: 0 0 .5em; letter-spacing: -.005em; }
h1 { font-size: clamp(44px, 7vw, 88px); }
h2 { font-size: clamp(34px, 4.6vw, 56px); }
h3 { font-size: clamp(24px, 2.4vw, 30px); }
p { margin: 0 0 1.1em; }
.lede { font-size: clamp(19px, 1.6vw, 22px); color: var(--ink-2); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: var(--paper);
  display: grid; place-items: center;
  font-family: var(--display); font-size: 22px; font-weight: 600; line-height: 1;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--display); font-size: 22px; font-weight: 600; }
.brand-text span { font-family: var(--ui); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; gap: 4px; }
.nav a {
  font-family: var(--ui); font-size: 14px; font-weight: 500;
  color: var(--ink-2); text-decoration: none;
  padding: 8px 14px; border-radius: 999px;
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--paper-2); }
.nav-toggle { display: none; background: none; border: 1px solid var(--rule); border-radius: 999px; padding: 8px 14px; font-family: var(--ui); font-size: 14px; color: var(--ink); cursor: pointer; }

@media (max-width: 820px) {
  .nav-toggle { display: inline-block; }
  .nav {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: 8px 16px 16px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 8px; border-radius: 0; border-bottom: 1px solid var(--rule); }
  .nav a:last-child { border-bottom: 0; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--ui); font-size: 15px; font-weight: 600;
  padding: 13px 22px; border-radius: 999px;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); color: #fff; }
.btn-ghost { border-color: currentColor; color: inherit; background: transparent; }
.btn-ghost:hover { background: rgba(255,255,255,.08); color: inherit; }
.btn svg { width: 16px; height: 16px; }

/* ---------- Hero ---------- */
.hero {
  background: var(--night); color: #f2eadb; position: relative; overflow: hidden;
}
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; min-height: min(86vh, 780px); align-items: center; gap: 48px; }
.hero-copy { padding: 72px 0; position: relative; z-index: 2; }
.hero .eyebrow { color: var(--gold); }
.hero h1 { color: #fbf6ec; }
.hero h1 em { font-style: italic; color: #e8c98a; }
.hero .lede { color: #cfc4b1; max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-photo { align-self: stretch; position: relative; }
.hero-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%;
  filter: grayscale(1) contrast(1.05);
  mask-image: linear-gradient(to right, transparent 0, #000 30%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 30%);
}
.hero-dates { display: flex; gap: 28px; margin-top: 44px; font-family: var(--ui); font-size: 13px; letter-spacing: .08em; color: #a99f8e; text-transform: uppercase; }
.hero-dates b { display: block; font-family: var(--display); font-size: 34px; font-weight: 500; color: #f2eadb; letter-spacing: 0; text-transform: none; }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; min-height: 0; gap: 0; }
  .hero-photo { order: -1; height: 360px; margin-inline: -16px; }
  .hero-photo img { mask-image: linear-gradient(to bottom, #000 60%, transparent); -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent); }
  .hero-copy { padding: 0 0 56px; margin-top: -40px; }
}

/* ---------- Sections ---------- */
section { padding: clamp(64px, 9vw, 120px) 0; }
.section-alt { background: var(--paper-2); }
.section-dark { background: var(--night); color: #efe6d6; }
.section-dark .eyebrow { color: var(--gold); }
.section-dark .lede, .section-dark p { color: #cfc4b1; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }

.statement { text-align: center; }
.statement p.big {
  font-family: var(--display); font-size: clamp(26px, 3.2vw, 40px); line-height: 1.3; font-weight: 500; color: var(--ink);
  max-width: 30ch; margin: 0 auto 28px;
}
.statement p.big em { color: var(--accent); }
.ornament { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--gold); margin-bottom: 28px; }
.ornament::before, .ornament::after { content: ""; height: 1px; width: 56px; background: currentColor; opacity: .6; }

/* Paths (three doors) */
.paths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.path {
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.path:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -24px rgba(40,25,10,.45); color: var(--ink); }
.path figure { margin: 0; aspect-ratio: 4/3; overflow: hidden; background: #ddd; }
.path figure img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: transform .5s; }
.path:hover figure img { transform: scale(1.03); }
.path-body { padding: 24px 24px 28px; display: flex; flex-direction: column; flex: 1; }
.path-body h3 { margin-bottom: 8px; }
.path-body p { color: var(--ink-2); font-size: 16.5px; flex: 1; }
.path-link { font-family: var(--ui); font-size: 14px; font-weight: 600; color: var(--accent); }
@media (max-width: 860px) { .paths { grid-template-columns: 1fr; } }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(255,255,255,.14); border-bottom: 1px solid rgba(255,255,255,.14); margin-top: 48px; }
.stat { padding: 28px 20px; border-left: 1px solid rgba(255,255,255,.14); }
.stat:first-child { border-left: 0; }
.stat b { display: block; font-family: var(--display); font-size: clamp(40px, 5vw, 60px); font-weight: 500; color: #f2eadb; line-height: 1; margin-bottom: 8px; }
.stat span { font-family: var(--ui); font-size: 13px; color: #a99f8e; letter-spacing: .04em; }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr 1fr; } .stat:nth-child(3) { border-left: 0; } .stat:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.14); } }

/* Split feature */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.split img { width: 100%; border-radius: var(--radius); filter: grayscale(1); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

blockquote.pull {
  margin: 0; padding: 0 0 0 28px; border-left: 2px solid var(--gold);
  font-family: var(--display); font-size: clamp(24px, 2.6vw, 32px); line-height: 1.3; font-style: italic; color: var(--ink);
}
blockquote.pull cite { display: block; margin-top: 16px; font-family: var(--ui); font-style: normal; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.section-dark blockquote.pull { color: #f2eadb; }

/* ---------- Sermon rows ---------- */
.sermon-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.sermon {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: center;
  padding: 14px 4px; border-bottom: 1px solid var(--rule);
}
.sermon:hover { background: color-mix(in srgb, var(--paper-2) 70%, transparent); }
.sermon.playing { background: var(--paper-2); }
.play {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule);
  background: var(--card); color: var(--accent); display: grid; place-items: center; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.play:hover, .sermon.playing .play { background: var(--accent); color: #fff; border-color: var(--accent); }
.play svg { width: 14px; height: 14px; }
.sermon-title { font-family: var(--display); font-size: 22px; font-weight: 600; line-height: 1.2; }
.sermon-meta { font-family: var(--ui); font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.sermon-meta .code { letter-spacing: .04em; }
.sermon-desc { font-size: 15.5px; color: var(--ink-2); margin-top: 4px; }
.dl { font-family: var(--ui); font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-radius: 999px; display: inline-flex; gap: 6px; align-items: center; }
.dl:hover { background: var(--paper-2); color: var(--accent); }
.dl svg { width: 15px; height: 15px; }
@media (max-width: 560px) { .dl span { display: none; } .sermon { grid-template-columns: 40px 1fr auto; gap: 12px; } .sermon-title { font-size: 20px; } }

/* ---------- Archive page ---------- */
.page-hero { padding: clamp(56px, 8vw, 96px) 0 clamp(32px, 4vw, 48px); border-bottom: 1px solid var(--rule); }
.page-hero h1 { font-size: clamp(44px, 6vw, 76px); }
.page-hero .lede { max-width: 58ch; }

.archive { display: grid; grid-template-columns: 280px 1fr; gap: 48px; padding-top: 40px; padding-bottom: 96px; }
.archive aside { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 110px - var(--player-h)); overflow: auto; padding-right: 6px; }
.facet h4 { font-family: var(--ui); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 24px 0 8px; font-weight: 600; }
.facet h4:first-child { margin-top: 0; }
.facet button {
  display: flex; justify-content: space-between; width: 100%; text-align: left;
  background: none; border: 0; padding: 7px 10px; border-radius: 6px; cursor: pointer;
  font-family: var(--ui); font-size: 14px; color: var(--ink-2);
}
.facet button:hover { background: var(--paper-2); color: var(--ink); }
.facet button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.facet button small { opacity: .65; font-variant-numeric: tabular-nums; }
.searchbar { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.search {
  flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--rule); border-radius: 999px; padding: 0 18px;
}
.search:focus-within { border-color: var(--gold); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { border: 0; background: transparent; font: 16px var(--ui); padding: 14px 0; width: 100%; color: var(--ink); outline: none; }
.count { font-family: var(--ui); font-size: 13.5px; color: var(--muted); }
.group-title { font-family: var(--display); font-size: 30px; font-weight: 500; margin: 40px 0 10px; display: flex; align-items: baseline; gap: 12px; }
.group-title:first-child { margin-top: 8px; }
.group-title small { font-family: var(--ui); font-size: 13px; color: var(--muted); }
.empty { padding: 48px 0; color: var(--muted); font-family: var(--ui); }
.facet-select { display: none; }
@media (max-width: 900px) {
  .archive { grid-template-columns: 1fr; gap: 0; }
  .archive aside { display: none; }
  .facet-select { display: block; width: 100%; font: 15px var(--ui); padding: 12px 14px; border-radius: 999px; border: 1px solid var(--rule); background: var(--card); color: var(--ink); }
}

/* ---------- Books ---------- */
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 40px 28px; }
.book { display: flex; flex-direction: column; }
.book .cover { aspect-ratio: 7/10; background: #e3dccd; border-radius: 2px 6px 6px 2px; overflow: hidden; box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 20px 30px -18px rgba(40,25,10,.55); position: relative; }
.book .cover::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 8px; background: linear-gradient(to right, rgba(0,0,0,.18), transparent); }
.book .cover img { width: 100%; height: 100%; object-fit: cover; }
.book h3 { font-size: 23px; margin: 18px 0 2px; font-weight: 600; }
.book .sub { font-family: var(--ui); font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.book .files { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.chip {
  font-family: var(--ui); font-size: 12.5px; font-weight: 600; text-decoration: none;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink-2);
  padding: 6px 12px; border-radius: 999px;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip small { font-weight: 400; color: var(--muted); }

/* ---------- Life page ---------- */
.letter { padding: clamp(56px, 8vw, 100px) 0; border-bottom: 1px solid var(--rule); }
.letter:last-of-type { border-bottom: 0; }
.letter-head { margin-bottom: 32px; }
.letter-head h2 { margin-bottom: 6px; }
.letter-head .by { font-family: var(--ui); font-size: 14px; color: var(--muted); }
.letter .narrow > p:first-of-type::first-letter { font-family: var(--display); float: left; font-size: 74px; line-height: .8; padding: 8px 10px 0 0; color: var(--accent); }
.signoff { font-style: italic; color: var(--ink-2); margin-top: 28px; }
.signoff strong { display: block; font-style: normal; font-family: var(--display); font-size: 24px; color: var(--ink); }
figure.inline { margin: 40px 0; }
figure.inline img { width: 100%; border-radius: var(--radius); filter: grayscale(1); }
figure.inline figcaption, .gallery figcaption { font-family: var(--ui); font-size: 13px; color: var(--muted); margin-top: 10px; }
.wide-fig { width: min(980px, 100% - 32px); margin: 48px auto; }

.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 92px; top: 6px; bottom: 6px; width: 1px; background: rgba(255,255,255,.2); }
.timeline li { display: grid; grid-template-columns: 92px 1fr; gap: 32px; padding: 14px 0; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 88px; top: 26px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.timeline .yr { font-family: var(--display); font-size: 28px; color: #f2eadb; line-height: 1.2; text-align: right; padding-right: 8px; }
.timeline .ev { color: #cfc4b1; padding-top: 6px; }
@media (max-width: 560px) {
  .timeline::before { left: 70px; } .timeline li { grid-template-columns: 70px 1fr; gap: 24px; } .timeline li::before { left: 66px; } .timeline .yr { font-size: 22px; }
}

.gallery { columns: 3 260px; column-gap: 16px; }
.gallery figure { margin: 0 0 16px; break-inside: avoid; }
.gallery img { width: 100%; border-radius: var(--radius); filter: grayscale(1); cursor: zoom-in; transition: filter .3s; }
.gallery img:hover { filter: grayscale(.3); }

.lightbox { position: fixed; inset: 0; background: rgba(10,8,6,.92); display: none; place-items: center; z-index: 100; padding: 24px; cursor: zoom-out; }
.lightbox.open { display: grid; }
.lightbox img { max-height: 88vh; max-width: 100%; border-radius: 4px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 32px; }
.card h3 { margin-bottom: 14px; }
.card address { font-style: normal; color: var(--ink-2); }
.links { list-style: none; padding: 0; margin: 0; }
.links li { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.links li:last-child { border-bottom: 0; }
.links a { font-family: var(--display); font-size: 22px; font-weight: 600; text-decoration: none; }
.links span { display: block; font-size: 15px; color: var(--ink-2); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-form { display: grid; gap: 16px; }
.contact-form label { display: grid; gap: 6px; font: 600 13px var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.contact-form input, .contact-form textarea { font: 17px var(--body); color: var(--ink); background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 14px; width: 100%; text-transform: none; letter-spacing: 0; }
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form button { justify-self: start; border: 0; cursor: pointer; }
.contact-form button[disabled] { opacity: .6; cursor: wait; }
.form-status { margin: 0; font: 15px var(--ui); min-height: 1.4em; }
.form-status.ok { color: #2f6b3a; }
.form-status.err { color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { background: var(--night); color: #a99f8e; padding: 64px 0 40px; font-family: var(--ui); font-size: 14px; }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.site-footer h4 { font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: #e8dcc6; margin: 0 0 14px; font-weight: 600; }
.site-footer a { color: #cfc4b1; text-decoration: none; display: block; padding: 3px 0; }
.site-footer a:hover { color: #fff; }
.site-footer .verse { font-family: var(--display); font-style: italic; font-size: 22px; color: #e8dcc6; line-height: 1.35; margin-bottom: 8px; }
.site-footer .legal { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.1); padding-top: 24px; margin-top: 16px; font-size: 12.5px; color: #7f7667; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }

/* ---------- Audio player ---------- */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--night-2); color: #efe6d6; border-top: 1px solid rgba(255,255,255,.08);
  transform: translateY(100%); transition: transform .25s ease;
}
.player.show { transform: none; }
.player .wrap { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 12px 0; }
.player .pp { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; }
.player .pp svg { width: 16px; height: 16px; }
.player .now { min-width: 0; }
.player .now strong { display: block; font-family: var(--display); font-size: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .bar { display: flex; align-items: center; gap: 10px; font-family: var(--ui); font-size: 12px; color: #a99f8e; font-variant-numeric: tabular-nums; }
.player input[type=range] { flex: 1; accent-color: var(--gold); min-width: 60px; }
.player .x { background: none; border: 0; color: #a99f8e; font-size: 26px; cursor: pointer; padding: 4px 8px; line-height: 1; }
.player .x:hover { color: #fff; }
.player .status { font-family: var(--ui); font-size: 12px; color: #e8a68a; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .player, .site-footer, .archive aside { display: none; } body { background: #fff; } }
