/* ==========================================================================
   Bonita OPC — site stylesheet

   DIRECTION: "Parish bulletin."  Ink on stock, not cards on a canvas.
   The printed Sunday bulletin and the hymnal are the reference: ruled panels,
   flat tinted grounds, small-caps labels set in the serif, and information
   density that respects a reader. Warmth comes from colour and photography,
   never from rounded corners and soft shadows.

   Palette is drawn from the building and the place — Bonita stucco, terracotta
   roof tile, eucalyptus and chaparral — and from the church's own orange.
   Deep eucalyptus green carries the page (60), plaster is the ground (30),
   brass and tile-red punctuate it (10).

   Re-skin the whole site from the tokens below.
   ========================================================================== */

/* --- 0. Page transitions ---------------------------------------------------
   Cross-fades page-to-page navigation instead of the default hard cut, using
   the browser's native View Transitions API — no JS, no router, nothing to
   go wrong. Currently Chrome/Edge/Opera; other browsers just keep the
   ordinary instant navigation they already have, no worse than before. */
@view-transition {
  navigation: auto;
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* --- 1. Tokens ----------------------------------------------------------- */

:root {
  /* Dominant — a warm, yellow-shifted green. Structural: masthead, footer,
     dark bands, headings. Never a cool blue-green; this page is not techy. */
  --green:        #2f4436;
  --green-deep:   #223328;
  --green-soft:   #47604e;
  --green-pale:   #dfe4d6;

  /* Ground — plaster, not "warm off-white". Sandier and more saturated. */
  --plaster:      #f3ebdd;
  --plaster-deep: #e8dcc7;
  --stock:        #fbf6ec;   /* the paper a panel is printed on */

  /* Ink */
  --ink:          #241f19;
  --ink-soft:     #4b4239;
  --muted:        #6c6256;

  /* Accents — two, with different jobs, used sparingly.
     Tile: the primary action and links. Brass: emphasis and labels.
     Brass on its own reads under AA contrast as text (2.9-4.4:1) against
     both plaster/stock and the dark green bands, so text uses pick one of
     the two variants below by the surface they sit on; --brass itself
     stays for borders and other non-text decoration. */
  --tile:         #a6432a;
  --tile-deep:    #8a3520;
  --on-tile:      #fff;     /* text on a tile-coloured button */
  --brass:        #b8802a;
  --brass-text:   #7d571c;  /* labels/links on plaster or stock (light) */
  --brass-onDark: #d7a251;  /* labels/links on the dark green bands */
  --brass-pale:   #f0e2c6;

  --rule:         #d9cdb8;
  --rule-strong:  #b9a98d;

  --focus:        #1f6f8b;

  /* Type — Vollkorn is a sturdy book serif; it reads printed and unfussy,
     which suits a congregation that dug its own foundation ditches.
     Alegreya Sans is a humanist companion drawn for literature, not UI. */
  --font-display: "Vollkorn", Georgia, "Times New Roman", serif;
  --font-body:    "Alegreya Sans", "Segoe UI", Helvetica, Arial, sans-serif;

  --measure: 66ch;
  --gutter: clamp(1.15rem, 4vw, 2.75rem);
  --radius: 2px;

  /* Sections carry different weight — spacing is not a constant. */
  --band-lg: clamp(4rem, 8vw, 6.5rem);
  --band-md: clamp(2.75rem, 5vw, 4rem);
  --band-sm: clamp(1.75rem, 3.5vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --green:        #d5dfcd;
    --green-deep:   #c2cfb8;
    --green-soft:   #9fb098;
    --green-pale:   #263123;
    --plaster:      #191611;
    --plaster-deep: #221e17;
    --stock:        #201c15;
    --ink:          #f0e8d9;
    --ink-soft:     #d3c8b5;
    --muted:        #9e9282;
    --tile:         #e08059;
    --tile-deep:    #ee9670;
    --on-tile:      #1c130d;
    --brass:        #ddab53;
    --brass-text:   #ddab53;
    --brass-onDark: #ddab53;
    --brass-pale:   #33291a;
    --rule:         #3a332a;
    --rule-strong:  #554b3d;
    --focus:        #6fb6cf;
  }
}
:root[data-theme="dark"] {
  --green:        #d5dfcd;
  --green-deep:   #c2cfb8;
  --green-soft:   #9fb098;
  --green-pale:   #263123;
  --plaster:      #191611;
  --plaster-deep: #221e17;
  --stock:        #201c15;
  --ink:          #f0e8d9;
  --ink-soft:     #d3c8b5;
  --muted:        #9e9282;
  --tile:         #e08059;
  --tile-deep:    #ee9670;
  --on-tile:      #1c130d;
  --brass:        #ddab53;
  --brass-text:   #ddab53;
  --brass-onDark: #ddab53;
  --brass-pale:   #33291a;
  --rule:         #3a332a;
  --rule-strong:  #554b3d;
  --focus:        #6fb6cf;
}

/* Surfaces that must stay dark-green in BOTH themes (masthead, footer, hero
   scrim) read from these, so the green tokens can invert for text use. */
:root {
  --band-ground: #2f4436;
  --band-ink:    #f4efe3;
  --band-rule:   rgba(244,239,227,.22);
  --band-muted:  rgba(244,239,227,.68);
}
:root[data-theme="dark"] { --band-ground: #141811; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --band-ground: #141811; }
}

/* --- 2. Reset ------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--plaster);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, video, iframe { max-width: 100%; display: block; }
img { height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.16;
  margin: 0 0 .45em;
  text-wrap: balance;
  color: var(--green);
}
h1 { font-size: clamp(2.3rem, 5.4vw, 4.1rem); font-weight: 600; letter-spacing: -.012em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 1.9vw, 1.4rem); }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; max-width: var(--measure); text-wrap: pretty; }

a { color: var(--tile); text-underline-offset: 2px; }
a:hover { color: var(--tile-deep); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* --- 3. Layout ----------------------------------------------------------- */

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 720px; }
.wrap--wide { max-width: 1280px; }

.section { padding-block: var(--band-lg); }
.section--tight { padding-block: var(--band-md); }
.section--sm { padding-block: var(--band-sm); }
.section--stock { background: var(--stock); border-block: 1px solid var(--rule); }
.section--deep { background: var(--band-ground); color: var(--band-ink); }
.section--deep h2, .section--deep h3 { color: var(--band-ink); }
.section--deep p { color: var(--band-muted); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--tile); color: var(--on-tile); padding: .7rem 1.2rem; font-weight: 700;
}
.skip-link:focus { left: 0; color: #fff; }

/* --- 4. The label system (signature detail) ------------------------------
   Small-caps set in the serif, on a rule — lifted from a printed order of
   worship. This replaces the uppercase letterspaced sans eyebrow. */

.label {
  font-family: var(--font-display);
  font-variant-caps: small-caps;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: .04em;
  color: var(--brass-text);
  margin: 0 0 .9rem;
  padding-bottom: .45rem;
  border-bottom: 1px solid var(--rule);
  display: block;
}
.label--plain { border-bottom: 0; padding-bottom: 0; margin-bottom: .35rem; }
.section--deep .label { color: var(--brass-onDark); border-bottom-color: var(--band-rule); }

.section-head { max-width: 46rem; margin-bottom: var(--band-md); }
.lede { font-size: 1.24rem; line-height: 1.5; color: var(--ink-soft); }
.section--deep .lede { color: var(--band-ink); }

/* Double rule — the bulletin's divider. */
.rule-double {
  border: 0; border-top: 3px double var(--rule-strong);
  margin: var(--band-md) 0;
}

/* --- 5. Buttons ---------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: .72rem 1.5rem;
  font-family: var(--font-body); font-size: 1.02rem; font-weight: 700;
  line-height: 1.25; text-decoration: none;
  border: 1px solid transparent; border-radius: var(--radius);
  cursor: pointer;
  transition: background-color .15s linear, color .15s linear, border-color .15s linear;
}
.btn--primary { background: var(--tile); color: var(--on-tile); border-color: var(--tile); }
.btn--primary:hover { background: var(--tile-deep); border-color: var(--tile-deep); color: var(--on-tile); }
.btn--primary:active { background: var(--tile-deep); }

.btn--ghost { border-color: var(--rule-strong); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--green); background: var(--green-pale); color: var(--green); }

.btn--onDark { border-color: rgba(255,255,255,.55); color: #fff; background: transparent; }
.btn--onDark:hover { background: #fff; color: var(--green-deep); border-color: #fff; }

.btn--sm { padding: .45rem 1rem; font-size: .95rem; }

.textlink { font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; }

/* --- 6. Masthead --------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--band-ground);
  border-bottom: 3px solid var(--brass);
}
.site-header__inner { display: flex; align-items: center; gap: 1.5rem; min-height: 82px; }

.brand { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.brand img { width: 205px; }

.nav { margin-left: auto; display: flex; align-items: center; gap: .4rem; }
.nav .btn { margin-left: .6rem; white-space: nowrap; flex-shrink: 0; }
.nav a.nav__link {
  padding: .45rem .7rem;
  font-size: 1.02rem; font-weight: 600; color: var(--band-ink); text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: border-color .15s linear, color .15s linear;
}
.nav a.nav__link:hover { border-bottom-color: var(--brass); }
.nav a.nav__link[aria-current="page"] { border-bottom-color: var(--brass); color: var(--brass-onDark); }

.header-actions { display: flex; align-items: center; gap: .5rem; margin-left: .75rem; }

.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--band-rule); border-radius: var(--radius);
  background: transparent; color: var(--band-ink); cursor: pointer;
  transition: border-color .15s linear, color .15s linear;
}
.icon-btn:hover { border-color: var(--brass); color: var(--brass-onDark); }
.icon-btn svg { width: 17px; height: 17px; }

.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
}

/* Homepage only: header starts as glass over the hero video, and turns
   solid the moment site.js marks it "is-stuck" (scrollY > 8). No extra JS
   needed — that hook already existed for the header's scroll shadow. */
body.home .site-header {
  position: sticky; background: transparent; border-bottom-color: transparent;
  transition: background-color .3s ease, border-bottom-color .3s ease, box-shadow .3s ease;
}
body.home .site-header.is-stuck {
  background: var(--band-ground); border-bottom-color: var(--brass);
  box-shadow: 0 6px 24px rgba(0,0,0,.28);
}

.nav-toggle { display: none; }

@media (max-width: 1360px) {
  .nav {
    position: fixed; inset: 82px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--band-ground); padding: .5rem var(--gutter) 1.5rem;
    border-bottom: 3px solid var(--brass);
    display: none;
    max-height: calc(100vh - 82px); overflow-y: auto;
  }
  .nav.is-open { display: flex; }
  .nav a.nav__link {
    padding: .8rem 0; font-size: 1.15rem;
    border-bottom: 1px solid var(--band-rule);
  }
  .nav .btn { margin-top: 1.1rem; text-align: center; }
  .nav-toggle { display: grid; margin-left: auto; }
  .header-actions { margin-left: 0; }
}

/* --- 7. Hero ------------------------------------------------------------- */

.hero { position: relative; isolation: isolate; color: #fff; background: var(--band-ground); }
.hero__media { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.hero__media img, .hero__media video { width: 100%; height: 100%; object-fit: cover; object-position: 50% 72%; }

/* Leads the hero, then fades to reveal the video beneath (see the comment
   in index.html). Sits above the video within the media layer; the shared
   .hero::after scrim above both keeps contrast consistent through the fade. */
.hero__lead {
  position: absolute; inset: 0; z-index: 1;
  opacity: 1; transition: opacity 1.4s ease;
}
.hero__lead.is-hidden { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .hero__lead { transition: none; }
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(24,30,20,.30) 0%, rgba(24,30,20,.06) 30%, rgba(24,30,20,.62) 78%, rgba(24,30,20,.85) 100%),
    linear-gradient(90deg, rgba(24,30,20,.68) 0%, rgba(24,30,20,.30) 46%, rgba(24,30,20,0) 72%);
}
.hero__inner { padding-block: clamp(4.5rem, 13vw, 8rem) clamp(2.75rem, 7vw, 4.5rem); }
.hero h1 { color: #fff; max-width: 15ch; margin-bottom: .35em; }

/* Scripture, not a slogan — the reference churches both lead with the Word.
   The verse carries the hero as the big heading; "Gathered in Bonita since
   1972" drops to a small tagline underneath it. */
.hero__verse {
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  color: #fff; max-width: 30ch; margin: 0 0 .5rem;
  padding-left: 1.1rem; border-left: 3px solid var(--brass);
}
.hero__verse cite {
  display: block; font-style: normal; font-variant-caps: small-caps;
  font-size: 1.05rem; letter-spacing: .06em; color: var(--brass-onDark); margin-top: .5rem;
}
.hero__tagline {
  font-family: var(--font-body); font-variant-caps: small-caps;
  font-size: clamp(1.05rem, 2vw, 1.3rem); letter-spacing: .03em;
  color: rgba(255,255,255,.8); margin: 0 0 1.5rem;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2rem; }

/* --- 7b. Full-viewport video hero (home page only) ------------------------
   Slides up under the sticky header (see "body.home .site-header" above)
   so the header reads as glass over the footage until the visitor scrolls.
   Swap in real footage per the comment beside the markup in index.html. */

.hero--video {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end;
  margin-top: -85px; /* pulls the video up under the header's box */
}
/* A dedicated scrim just for the glass-nav band, independent of the overall
   hero grade below — keeps the logo/nav readable no matter how bright the
   footage is at the top of frame (sky, stucco in full sun, etc.). */
.hero--video::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 150px; z-index: 0;
  background: linear-gradient(180deg, rgba(20,26,17,.6) 0%, rgba(20,26,17,0) 100%);
}
.hero--video .hero__inner { padding-top: clamp(6rem, 16vw, 10rem); }
.hero--video h1 { font-size: clamp(2.35rem, 6.4vw, 4.5rem); max-width: 17ch; }
.hero--video .hero__verse { font-size: clamp(1.45rem, 3vw, 2.3rem); line-height: 1.25; text-shadow: 0 1px 12px rgba(0,0,0,.35); }
.hero__verse h1 { max-width: none; font-weight: inherit; }

.hero__poster--kenburns {
  animation: kenburns 22s ease-in-out infinite alternate;
  transform-origin: 50% 60%;
}
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.06); } }

.hero__scrollcue {
  align-self: center; margin-bottom: clamp(1rem, 3vw, 1.75rem);
  color: rgba(255,255,255,.6); font-size: .8rem; letter-spacing: .1em;
  font-variant-caps: small-caps; text-align: center;
}
.hero__scrollcue::after {
  content: ""; display: block; width: 1px; height: 22px; margin: .4rem auto 0;
  background: rgba(255,255,255,.4);
}

/* --- 7c. Section right after the hero -------------------------------------
   Used to overlap up onto the hero's bottom edge, but that meant a sliver
   of this panel's gold border was always visible at the bottom of the
   very first screen, competing with the hero photo/video. Full-bleed hero,
   clean edge, panel starts only once you actually scroll. */

.section--overlap {
  position: relative; z-index: 5;
  border-top: 4px solid var(--brass);
}

/* Interior page heads */
.pagehead {
  position: relative; isolation: isolate; color: #fff; background: var(--band-ground);
  border-top: 3px solid var(--brass);
}
.pagehead__media { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.pagehead__media img { width: 100%; height: 100%; object-fit: cover; opacity: .4; }
.pagehead::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(24,30,20,.42) 0%, rgba(24,30,20,.68) 55%, rgba(24,30,20,.88) 100%);
}
.pagehead__inner { padding-block: clamp(3.5rem, 9vw, 6rem) clamp(2.25rem, 5vw, 3.25rem); }
.pagehead h1 { color: #fff; margin-bottom: .25em; font-size: clamp(2.1rem, 4.6vw, 3.2rem); }
.pagehead p { color: rgba(255,255,255,.88); max-width: 50ch; margin: 0; font-size: 1.15rem; }
.crumbs { font-size: .95rem; color: rgba(255,255,255,.7); margin: 0 0 .9rem; font-variant-caps: small-caps; letter-spacing: .04em; }
.crumbs a { color: rgba(255,255,255,.88); text-decoration: none; }
.crumbs a:hover { color: #fff; text-decoration: underline; }
.crumbs span { margin-inline: .4rem; opacity: .5; }

/* --- 8. The order-of-service panel (the organising element) ---------------
   What the successful Reformed sites all put front and centre: this Sunday,
   in full, set like the printed order it is. */

.order {
  background: var(--stock);
  border: 1px solid var(--rule-strong);
  border-top: 4px solid var(--brass);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}
.order__date {
  font-family: var(--font-display); font-variant-caps: small-caps;
  font-size: 1.05rem; letter-spacing: .05em; color: var(--brass-text);
  margin: 0 0 1.25rem; padding-bottom: .5rem; border-bottom: 1px solid var(--rule);
}
.order__item { padding: .85rem 0; border-bottom: 1px dotted var(--rule-strong); }
.order__item:last-child { border-bottom: 0; padding-bottom: 0; }
.order__when {
  font-family: var(--font-body); font-weight: 700; font-size: .92rem;
  letter-spacing: .06em; text-transform: uppercase; color: var(--green-soft);
  display: block; margin-bottom: .15rem;
}
.order__what { font-family: var(--font-display); font-size: 1.22rem; color: var(--green); margin: 0 0 .1rem; line-height: 1.3; }
.order__ref { font-size: 1rem; color: var(--muted); margin: 0; font-style: italic; }

/* --- 9. Ruled facts list (replaces the icon-card row) --------------------- */

.facts { border-top: 2px solid var(--rule-strong); }
.facts__row {
  display: grid; gap: .2rem 2rem;
  padding: 1.15rem 0; border-bottom: 1px solid var(--rule);
}
@media (min-width: 720px) { .facts__row { grid-template-columns: 13rem 1fr; gap: 0 2.5rem; } }
.facts__term {
  font-family: var(--font-display); font-variant-caps: small-caps;
  font-size: 1.18rem; letter-spacing: .03em; color: var(--green); margin: 0;
}
.facts__def { margin: 0; color: var(--ink-soft); max-width: 52ch; }
.facts__def p:last-child { margin-bottom: 0; }

/* --- 10. Panels (flat, ruled — never a floating card) --------------------- */

.panel {
  background: var(--stock); border: 1px solid var(--rule);
  padding: clamp(1.25rem, 2.6vw, 1.75rem);
}
.panel p:last-child { margin-bottom: 0; }
.panel--plain { background: transparent; border: 0; padding: 0; }
.panel--brass { background: var(--brass-pale); border-color: var(--rule-strong); }

.grid { display: grid; gap: clamp(1rem, 2.4vw, 1.75rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }

/* Deliberately asymmetric: the order panel outweighs the column beside it. */
.split-major { display: grid; gap: clamp(1.75rem, 4vw, 3.25rem); align-items: start; }
@media (min-width: 900px) { .split-major { grid-template-columns: 1.32fr 1fr; } }
.split-minor { display: grid; gap: clamp(1.75rem, 4vw, 3.25rem); align-items: start; }
@media (min-width: 900px) { .split-minor { grid-template-columns: 1fr 1.32fr; } }

.split { display: grid; gap: clamp(1.75rem, 4.5vw, 3.25rem); align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } .split--reverse > :first-child { order: 2; } }
.split img { width: 100%; border: 1px solid var(--rule-strong); }

/* Event photo gallery — ruled borders, no radius, no shadow, same as every
   other photo treatment on the site. A caption sits under the frame like a
   printed photo credit, not overlaid on the image. */
.gallery { display: grid; gap: clamp(1rem, 2.4vw, 1.5rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid var(--rule-strong); display: block; }
.gallery figcaption { margin-top: .5rem; font-size: .95rem; color: var(--muted); }
.gallery img { cursor: zoom-in; transition: opacity .15s; }
.gallery img:hover { opacity: .88; }

/* Photo viewer, opened from any .gallery photo (see site.js). */
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: clamp(3.5rem, 6vw, 4.5rem) clamp(3.5rem, 7vw, 6rem);
  border: 0; background: rgba(12, 10, 8, .97); color: #fff;
}
.lightbox::backdrop { background: rgba(12, 10, 8, .6); }
.lightbox__figure {
  margin: 0; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .75rem;
}
.lightbox__img {
  max-width: 100%; max-height: calc(100% - 2.5rem); object-fit: contain;
  border: 1px solid rgba(255,255,255,.18); cursor: default;
}
.lightbox__cap { font-size: 1rem; color: rgba(255,255,255,.82); text-align: center; }
.lightbox__btn {
  position: absolute; display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem; padding: 0; cursor: pointer;
  color: #fff; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.3); border-radius: var(--radius);
}
.lightbox__btn:hover { background: rgba(255,255,255,.2); }
.lightbox__btn:focus-visible { outline: 2px solid var(--brass-onDark); outline-offset: 2px; }
.lightbox__btn svg { width: 1.35rem; height: 1.35rem; }
.lightbox__close { top: 1rem; right: 1rem; }
.lightbox__prev, .lightbox__next { top: 50%; transform: translateY(-50%); }
.lightbox__prev { left: clamp(.5rem, 2vw, 1.25rem); }
.lightbox__next { right: clamp(.5rem, 2vw, 1.25rem); }
.lightbox.is-single .lightbox__prev, .lightbox.is-single .lightbox__next { display: none; }
.has-lightbox { overflow: hidden; }
@media (max-width: 600px) {
  .lightbox { padding: 4rem .75rem 5rem; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 1rem; transform: none; }
  .lightbox__prev { left: calc(50% - 3.25rem); }
  .lightbox__next { right: calc(50% - 3.25rem); }
}

/* --- 11. Sermons --------------------------------------------------------- */

.video-frame {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  overflow: hidden; background: var(--green-deep);
  border: 1px solid var(--rule-strong);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.sermon-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--rule-strong); }
.sermon-list li { border-bottom: 1px solid var(--rule); }
.sermon-list a { display: block; padding: .9rem 0; text-decoration: none; color: inherit; }
.sermon-list a:hover .title { color: var(--tile); text-decoration: underline; }
.sermon-list .title { font-family: var(--font-display); font-size: 1.18rem; color: var(--green); display: block; line-height: 1.3; }
.sermon-list .meta { font-size: .98rem; color: var(--muted); }

/* On the deep band the list inherits band colours, not page colours. */
.section--deep .sermon-list { border-top-color: var(--band-rule); }
.section--deep .sermon-list li { border-bottom-color: var(--band-rule); }
.section--deep .sermon-list .title { color: var(--band-ink); }
.section--deep .sermon-list .meta { color: var(--band-muted); }
.section--deep .sermon-list a:hover .title { color: var(--brass-onDark); }

.sermon-table { width: 100%; border-collapse: collapse; }
.sermon-table th {
  text-align: left; font-family: var(--font-display); font-variant-caps: small-caps;
  font-size: 1.02rem; font-weight: 600; letter-spacing: .04em; color: var(--brass-text);
  padding: 0 1.25rem .5rem 0; border-bottom: 2px solid var(--rule-strong);
}
.sermon-table td { padding: .9rem 1.25rem .9rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.sermon-table tr:hover td { background: var(--stock); }
.sermon-table .t-title { font-family: var(--font-display); font-size: 1.14rem; line-height: 1.3; }
.sermon-table .t-title a { text-decoration: none; color: var(--green); }
.sermon-table .t-title a:hover { color: var(--tile); text-decoration: underline; }
.sermon-table .t-ref { color: var(--ink-soft); font-style: italic; }
.sermon-table .t-date { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

@media (max-width: 780px) {
  .sermon-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sermon-table, .sermon-table tbody, .sermon-table tr, .sermon-table td { display: block; width: 100%; }
  .sermon-table tr { border-bottom: 1px solid var(--rule-strong); padding: .9rem 0; }
  .sermon-table tr:first-child { border-top: 2px solid var(--rule-strong); }
  .sermon-table td { border: 0; padding: .1rem 0; }
  .sermon-table .t-title { margin-bottom: .2rem; }
}

.filter-bar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: baseline; margin-bottom: 1.5rem; }
.filter-bar input[type="search"] {
  flex: 1 1 18rem; min-width: 0; padding: .6rem .8rem;
  font: inherit; font-size: 1.02rem; color: var(--ink);
  background: var(--stock); border: 1px solid var(--rule-strong); border-radius: var(--radius);
}
.filter-bar input::placeholder { color: var(--muted); }
.filter-bar input:focus { border-color: var(--green); }

/* --- 12. Events ---------------------------------------------------------- */

.event { display: flex; gap: 1.2rem; padding: 1.05rem 0; border-bottom: 1px solid var(--rule); }
.event:first-of-type { border-top: 2px solid var(--rule-strong); }
.event__date {
  flex: 0 0 auto; width: 3.6rem; text-align: center; align-self: flex-start;
  border-right: 1px solid var(--rule-strong); padding-right: .9rem;
}
.event__date .m {
  display: block; font-family: var(--font-display); font-variant-caps: small-caps;
  font-size: .95rem; letter-spacing: .06em; color: var(--brass-text);
}
.event__date .d { display: block; font-family: var(--font-display); font-size: 1.75rem; line-height: 1.05; color: var(--green); }
.event__body h3 { font-size: 1.16rem; margin-bottom: .1rem; }
.event__body h3 a { color: inherit; text-decoration: none; }
.event__body h3 a:hover { color: var(--tile); text-decoration: underline; }
.event__body p { font-size: 1rem; color: var(--muted); margin: 0; }
.event-empty { margin: 0; padding: 1.05rem 0; border-top: 2px solid var(--rule-strong); border-bottom: 1px solid var(--rule); color: var(--muted); }

/* --- 13. People ---------------------------------------------------------- */

.people { display: grid; gap: 1.5rem 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr)); }
.person { text-align: left; }
.person img {
  width: 100%; max-width: 150px; aspect-ratio: 1; object-fit: cover;
  border: 1px solid var(--rule-strong); margin-bottom: .7rem; background: var(--plaster-deep);
}
.person h3 { font-size: 1.1rem; margin-bottom: 0; }
.person .role {
  font-family: var(--font-display); font-variant-caps: small-caps;
  font-size: 1rem; letter-spacing: .04em; color: var(--brass-text); margin: 0;
}

/* --- 14. Prose ----------------------------------------------------------- */

.prose { max-width: var(--measure); }
.prose > h2 { margin-top: 2.2em; }
.prose > h2:first-child, .prose > .label:first-child + h2 { margin-top: 0; }
.prose h3 { margin-top: 1.9em; }
.prose ul, .prose ol { padding-left: 1.15rem; max-width: var(--measure); }
.prose li { margin-bottom: .4em; }
.prose blockquote {
  margin: 1.75rem 0; padding-left: 1.25rem; border-left: 2px solid var(--brass);
  font-family: var(--font-display); font-style: italic; font-size: 1.2rem; color: var(--ink-soft);
}

/* Drop cap — a bulletin/book move, used once per prose page. */
.opener::first-letter {
  float: left; font-family: var(--font-display); font-size: 3.6em;
  line-height: .82; font-weight: 600; color: var(--brass-text);
  padding: .06em .09em 0 0;
}

/* --- 15. Timeline (the church's own history) ----------------------------- */

.timeline { border-top: 2px solid var(--rule-strong); margin: 0; }
.timeline__row {
  display: grid; gap: .15rem 2rem; padding: 1.1rem 0; border-bottom: 1px solid var(--rule);
}
@media (min-width: 680px) { .timeline__row { grid-template-columns: 8.5rem 1fr; gap: 0 2.5rem; } }
.timeline__year {
  font-family: var(--font-display); font-size: 1.35rem; color: var(--brass-text);
  margin: 0; font-variant-numeric: tabular-nums; line-height: 1.3;
}
.timeline__what { margin: 0; color: var(--ink-soft); max-width: 54ch; }

/* --- 16. FAQ ------------------------------------------------------------- */

.faq { border-top: 2px solid var(--rule-strong); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1rem 2.25rem 1rem 0;
  font-family: var(--font-display); font-size: 1.24rem; color: var(--green); position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: .4rem; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; color: var(--brass-text); line-height: 1;
}
.faq details[open] summary::after { content: "\2013"; }
.faq summary:hover { color: var(--tile); }
.faq summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.faq .faq__body { padding: 0 2.25rem 1.2rem 0; }
.faq .faq__body p:last-child { margin-bottom: 0; }

/* --- 17. Template CONFIRM marker ------------------------------------------
   Visible on purpose. Search the HTML for class="todo" and delete every one
   before this goes live. */
.todo {
  display: inline-block; background: var(--brass-pale); color: var(--tile-deep);
  font-family: var(--font-body); font-size: .78rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  padding: .1em .45em; margin-left: .35em; border: 1px solid var(--brass);
}

/* --- 18. Map ------------------------------------------------------------- */

.map-frame {
  aspect-ratio: 16 / 10; width: 100%;
  border: 1px solid var(--rule-strong); overflow: hidden; background: var(--plaster-deep);
}
.map-frame iframe { width: 100%; height: 100%; border: 0; }

/* Google's embed loads its own JS bundle the moment the iframe exists, even
   with loading="lazy" — a real cost for a map most visitors never open.
   This stands in for it until clicked, so nothing map-related loads unless
   someone actually asks for it. */
.map-frame__load {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .6rem;
  background: var(--plaster-deep); border: 0; cursor: pointer;
  font: inherit; font-size: 1.02rem; font-weight: 600; color: var(--ink-soft);
  transition: background-color .15s linear, color .15s linear;
}
.map-frame__load:hover { background: var(--rule); color: var(--ink); }
.map-frame__load svg { width: 30px; height: 30px; color: var(--tile); }

/* --- 19. Forms ----------------------------------------------------------- */

.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.field { display: grid; gap: .3rem; }
.field--full { grid-column: 1 / -1; }
.field label {
  font-family: var(--font-display); font-variant-caps: small-caps;
  font-size: 1.05rem; letter-spacing: .03em; color: var(--green);
}
.field input, .field textarea {
  font: inherit; font-size: 1.02rem; color: var(--ink);
  padding: .6rem .75rem; background: var(--stock);
  border: 1px solid var(--rule-strong); border-radius: var(--radius); width: 100%;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--green); outline: 2px solid var(--focus); outline-offset: 1px; }
.field input:invalid:not(:placeholder-shown) { border-color: var(--tile); }

.form-status {
  grid-column: 1 / -1; background: var(--green-pale); color: var(--green-deep);
  border: 1px solid var(--rule-strong); padding: .75rem 1rem; font-size: .98rem;
}

/* --- 20. Footer ---------------------------------------------------------- */

.site-footer {
  background: var(--band-ground); color: var(--band-muted);
  border-top: 3px solid var(--brass);
  padding-block: clamp(2.5rem, 5vw, 3.75rem) 1.75rem;
}
.site-footer h2 {
  color: var(--brass-onDark); font-family: var(--font-display); font-variant-caps: small-caps;
  font-size: 1.15rem; letter-spacing: .04em; margin-bottom: .8rem;
  padding-bottom: .4rem; border-bottom: 1px solid var(--band-rule);
}
.site-footer a { color: var(--band-ink); text-decoration: none; }
.site-footer a:hover { color: var(--brass-onDark); text-decoration: underline; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .4rem; }
.site-footer address { font-style: normal; line-height: 1.65; }
.site-footer p { color: var(--band-muted); }

/* Two columns and a line — built from what the site actually has. */
.site-footer__grid { display: grid; gap: 2.25rem; }
@media (min-width: 760px) { .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer__brand img { width: 215px; margin-bottom: 1rem; }
.site-footer__note { font-size: 1rem; max-width: 34ch; }

.site-footer__bottom {
  margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--band-rule);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
  font-size: .95rem;
}
.site-footer__bottom p { margin: 0; }

.social { display: flex; gap: .5rem; margin-top: 1rem; }
.social a { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--band-rule); }
.social a:hover { background: var(--brass); color: var(--green-deep); border-color: var(--brass); }
.social svg { width: 17px; height: 17px; }

/* --- 21. Motion ----------------------------------------------------------
   One quiet entrance on the masthead and hero at first load. Nothing else
   animates: a Reformed congregation does not decorate its worship, and the
   page should not decorate its content either. */

@keyframes settle { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.hero h1, .hero__verse, .hero__tagline, .hero__cta { animation: settle .5s cubic-bezier(.2,.6,.3,1) backwards; }
.hero__verse { animation-delay: .04s; }
.hero__tagline { animation-delay: .13s; }
.hero__cta { animation-delay: .22s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* --- 22. Utilities ------------------------------------------------------- */

.stack > * + * { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
