/**
 * confessional_base — shared component styles.
 *
 * Brand colors (--primary, --accent, and their derived tints) are injected
 * per-theme as a <style> block in <head> by confessional_base_preprocess_html()
 * — see theme-settings.php / confessional_base.theme. Everything below reads
 * those custom properties rather than hardcoding color, so a subtheme only
 * needs to change two hex values (Appearance > Settings) to re-skin the site.
 *
 * Neutrals are intentionally fixed/shared across sites built on this base —
 * only the brand hue is meant to vary.
 */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f6;
  --text: #23262b;
  --text-muted: #5f6368;
  --border: #e4e4e2;
  --radius: 4px;
  --max-width: 1180px;
  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --font-body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  /* Fallbacks in case the inline <style> block hasn't rendered yet — kept
     in sync with _confessional_base_default_colors() in confessional_base.theme,
     the single source of truth for what an unconfigured site looks like. */
  --primary: #2c5f7c;
  --primary-light: #4a7d9a;
  --primary-dark: #1f4359;
  --primary-tint: #eef3f6;
  --accent: #8a6f47;
  --accent-light: #e6dcc9;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

img { max-width: 100%; height: auto; }
a { color: var(--primary); }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  text-wrap: balance;
  margin: 0 0 0.6rem;
  color: var(--text);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.visually-hidden.focusable:not(:focus):not(:active) {
  clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; width: 1px;
  overflow: hidden; position: absolute; white-space: nowrap;
}
.visually-hidden.focusable:focus {
  position: fixed; top: 0.5rem; left: 0.5rem; z-index: 100;
  background: var(--primary); color: #fff; padding: 0.6rem 1rem;
  border-radius: var(--radius);
}

/* Buttons — deliberately not Bootstrap's .btn-primary, whose colors are
   baked in at Bootstrap's own build time and don't repaint from
   var(--bs-primary) alone. */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 600; font-size: 0.92rem; text-decoration: none;
  padding: 0.6rem 1.2rem; border-radius: var(--radius);
  border: 1.5px solid transparent; white-space: nowrap; cursor: pointer;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); color: #fff; }
.btn-outline { border-color: var(--border); color: var(--primary); background: var(--bg); }
.btn-outline:hover { background: var(--primary-tint); border-color: var(--primary-light); }
.btn-ghost { border-color: var(--border); color: var(--text); }

/* Announcements bar — sits above the sticky header, so it scrolls away
   naturally on scroll instead of permanently eating header space. Content
   comes entirely from Announcement nodes with an end date; see
   _confessional_base_get_active_announcements() in confessional_base.theme. */
/* Uses --accent rather than --primary: the client disliked the primary
   blue specifically on this bar, and --accent is already a distinct,
   per-site-configurable color (Appearance > Settings), so this follows
   each site's actual brand accent with no hardcoded hex here. */
.announcements-bar { background: var(--accent); color: #fff; font-size: 0.88rem; }
.announcement-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 1.5rem; flex-wrap: wrap; }
.announcement-item + .announcement-item { border-top: 1px solid rgba(255,255,255,0.15); }
.announcement-item i.fa-bullhorn { color: var(--accent-light); flex: none; }
.announcement-item p { margin: 0; }
.announcement-bar-title { font-weight: 600; }
.announcement-details-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-left: auto; padding: 0.3rem 0.8rem;
  background: rgba(255,255,255,0.12); color: #fff;
  border: 1px solid rgba(255,255,255,0.4); border-radius: var(--radius);
  font-size: 0.82rem; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.announcement-details-btn:hover { background: rgba(255,255,255,0.22); border-color: #fff; }

/* Announcement popup (Bootstrap modal) — gives the body room to render
   normal headings/paragraphs and an image, instead of squeezing both
   into the one-line bar above. */
.announcement-modal .modal-title { font-size: 1.3rem; color: var(--text); margin: 0; }
.announcement-modal .modal-header,
.announcement-modal .modal-body { padding: 1.75rem; }
.announcement-modal .modal-header { padding-bottom: 1.25rem; }
.announcement-modal .modal-body { padding-top: 1.25rem; }
.announcement-modal-image {
  width: 100%; max-height: 320px; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border);
  display: block; margin-bottom: 1.5rem;
}
.announcement-modal-link { margin-top: 1.1rem; }

/* Header
   A CSS grid, not flex — the toggle button lives in its own named grid
   area ("toggle") that never moves regardless of whether #primaryNav is
   open, closed, mobile, or desktop. That's the whole fix: position is
   architectural, not something CSS has to preserve across state changes. */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 3px solid var(--accent); }
/* The header's row of brand + nav genuinely needs more width than the
   --max-width (1180px) reading-column cap everything else on the page
   uses — that cap was silently squeezing the header on every viewport,
   including very wide ones, which is what every "still cramped" report
   after supposedly fixing this turned out to trace back to. Wider than
   body content is also just normal for a site header/nav.
   A second fixed cap (1650px) had the opposite problem on genuinely wide
   monitors (2560px+, ultrawide): margin:auto centers it, but a fixed
   number doesn't grow with the window, so a 2560px-wide screen was left
   with ~450px of empty white on each side. min(92vw, 2200px) keeps
   growing with the viewport up to a point, instead of stopping dead at
   one fixed number. */
.site-header .container { max-width: min(92vw, 2200px); }
.header-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "brand toggle" "nav nav";
  align-items: center;
  column-gap: 1rem;
  padding: 1.1rem 1.5rem;
}
.brand { grid-area: brand; display: flex; align-items: center; gap: 0.85rem; color: var(--text); text-decoration: none; }
.brand-mark { width: 2.75rem; height: 2.75rem; flex: none; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-text .name { display: block; font-family: var(--font-display); font-size: 1.2rem; line-height: 1.15; color: var(--text); }
.brand-text .tag { display: block; margin-top: 0.3rem; font-size: 0.68rem; letter-spacing: 0.09em; color: var(--text-muted); text-transform: uppercase; }

.navbar-toggler { grid-area: toggle; border: 1px solid var(--border); background: none; border-radius: var(--radius); padding: 0.4rem 0.6rem; }
.navbar-toggler .fa-bars { color: var(--text); }

#primaryNav { grid-area: nav; }
#primaryNav:not(.show) { display: none; }
/* Bootstrap animates .collapsing with a ~350ms height transition by
   default — instant open/close reads as snappier than a slow slide. */
.collapsing { transition: none !important; }
.nav-panel { padding-top: 0.75rem; }

.primary-nav-list { display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; list-style: none; margin: 0; padding: 0.75rem 0; }
/* Without this, a flex row shrinks a multi-word label (e.g. "Service
   Times") by wrapping it across two lines before it lets the row itself
   run out of room — several items doing that at once is what produced
   the ragged, uneven-height menu bar. nowrap forces the row to hit its
   real width limit instead, so any given item is either full-width and
   flat, or the row scrolls (see overflow-x below) — never both-ways-broken. */
.primary-nav-list .nav-link { color: var(--text); text-decoration: none; font-size: 0.94rem; font-weight: 500; padding: 0.4rem 0.1rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.primary-nav-list .nav-link:hover { border-color: var(--accent); color: var(--primary); }
/* data-bs-display="static" on the toggle (menu--main.html.twig) skips
   Popper entirely — without it, Popper's async positioning inside the
   collapsing mobile panel is what read as a stalled, unanimated open.
   With Popper out of the way, display can stay "block" at all times and
   opacity/transform drive a real transition off Bootstrap's .show class. */
.primary-nav-list .dropdown-menu {
  /* Explicit rather than left to Bootstrap's own .dropdown-menu rule:
     with display forced to "block" below (so opacity/transform can
     animate it instead of Bootstrap's instant display:none/block swap),
     an out-of-flow position is what keeps the menu from being laid out
     as a real, space-occupying block — which, at ~170px tall, was
     inflating its parent nav-item's height and, via align-items:center
     on the row, throwing every item in the row out of vertical alignment. */
  position: absolute;
  top: 100%;
  left: 0;
  display: block;
  border-radius: var(--radius);
  border-color: var(--border);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  pointer-events: none;
}
.primary-nav-list .dropdown-menu.show { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.primary-nav-list .dropdown-menu .nav-link { color: var(--text); padding: 0.4rem 1rem; }

.site-link { font-size: 0.85rem; display: inline-flex; margin-top: 0.5rem; }

/* Breakpoint, not a JS overflow check — tried the dynamic version (measure
   real overflow, toggle a class) and reverted it in favor of a plain,
   predictable number. 1550px is measured against this site's own brand
   name + full nav actually fitting without wrapping or squeezing the
   logo; re-verify with a real overflow check before changing it rather
   than guessing a new value. */
@media (min-width: 1550px) {
  .header-grid { grid-template-columns: auto 1fr auto; grid-template-areas: "brand nav toggle"; }
  .navbar-toggler { display: none; }
  #primaryNav, #primaryNav:not(.show) { display: block; }
  .nav-panel { padding-top: 0; display: flex; align-items: center; gap: 1rem; min-width: 0; }
  /* A vertical rule reads as a deliberate boundary between the brand
     block and the nav, instead of leaving them to butt up against each
     other with nothing but whitespace (and, before this, not much of
     that either) separating a serif wordmark from sans-serif nav links. */
  #primaryNav { border-left: 1px solid var(--border); padding-left: 1.75rem; margin-left: 0.5rem; }
  /* No overflow-x/scroll fallback here on purpose: this element is also
     the containing block dropdown submenus render outside of (below the
     row), and overflow-x on one axis forces the other axis to clip too
     per the CSS overflow spec — that silently clipped every dropdown to
     invisible. The breakpoint above is measured so this row never needs
     to shrink in the first place; re-measure it (see comment above the
     media query) rather than reaching for overflow again if the menu
     grows past what it fits. */
  .primary-nav-list {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 1.3rem;
    padding: 0;
    min-width: 0;
  }
  .primary-nav-list .nav-item { flex-shrink: 0; }
  .site-link { margin-top: 0; margin-left: auto; flex-shrink: 0; }
}

/* Interior page header band */
.page-header-band { background: var(--bg-soft); border-bottom: 1px solid var(--border); padding: 2.2rem 0; }
.page-header-band h1 { margin: 0; color: var(--primary); }

.site-main { padding: 2.5rem 0 4rem; }

/* Hero (full-bleed photo w/ scrim, set inline via style="background-image:...")
   — or, when Hero Slide nodes exist, a multi-photo slideshow (see below). */
.hero {
  padding: 9.5rem 0 9rem;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-inner { position: relative; z-index: 2; max-width: 640px; margin: 0 auto; padding: 0 1.5rem; }
/* Matches the plain .eyebrow color exactly (e.g. "Join Us for Worship"
   further down the page) rather than a lightened variant. */
.hero .eyebrow { color: var(--accent); }
.hero h1 { font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1.2; color: #fff; margin: 0.7rem 0 1.1rem; }
.hero p.lead { font-size: 1.1rem; color: rgba(255,255,255,0.87); max-width: 600px; margin: 0 0 2rem; }
.hero .cta-row { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.hero-media img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); display: block; }

/* Hero slideshow — a stack of absolutely-positioned photos crossfaded on a
   timer (see js/hero-slideshow.js), each panning/zooming slowly while
   active. The scrim (same gradient the single-image hero uses inline)
   sits above the photo stack so hero text stays legible against any slide. */
.hero-slideshow { position: absolute; inset: 0; z-index: 0; }
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  overflow: hidden;
  /* Much slower than this file's other transitions (0.15s, on hover/focus
     state) — a hero photo swap should read as ambient, not a UI response. */
  transition: opacity 1.6s ease;
}
.hero-slide.is-active { opacity: 1; z-index: 1; }
.hero-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center var(--img-position-y, 50%);
  display: block;
  animation-duration: 7.5s;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  animation-play-state: paused;
}
.hero-slide.is-active img { animation-play-state: running; }
.hero-slide-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: linear-gradient(100deg, rgba(14,12,10,0.82) 0%, rgba(14,12,10,0.58) 42%, rgba(14,12,10,0.22) 75%, rgba(14,12,10,0.1) 100%);
}

/* Each pan direction over-scans (scale > 1) so panning never reveals empty
   space at the image's edge. Gated behind no-preference, same as the
   scroll-behavior rule below — a reduced-motion visitor still gets the
   crossfade above (a much gentler motion) but never a continuous pan/zoom. */
@media (prefers-reduced-motion: no-preference) {
  /* translateX/Y % is relative to the element's OWN box, not the source
     photo — since the hero is much wider than it is tall, the same 2%
     used for both axes moved ~25px horizontally but only ~10px vertically,
     making pan-up/pan-down look like they'd stalled right after a
     pan-left/pan-right slide. 4% on the vertical axis brings its actual
     pixel travel back in line with the horizontal pans. */
  @keyframes hero-pan-left  { from { transform: scale(1.12) translateX(2%);  } to { transform: scale(1.12) translateX(-2%); } }
  @keyframes hero-pan-right { from { transform: scale(1.12) translateX(-2%); } to { transform: scale(1.12) translateX(2%);  } }
  @keyframes hero-pan-up    { from { transform: scale(1.12) translateY(4%);  } to { transform: scale(1.12) translateY(-4%); } }
  @keyframes hero-pan-down  { from { transform: scale(1.12) translateY(-4%); } to { transform: scale(1.12) translateY(4%);  } }

  .hero-slide.pan-left img { animation-name: hero-pan-left; }
  .hero-slide.pan-right img { animation-name: hero-pan-right; }
  .hero-slide.pan-up img { animation-name: hero-pan-up; }
  .hero-slide.pan-down img { animation-name: hero-pan-down; }
}

/* Section rhythm */
.section { padding: 4rem 0; }
.section-head { max-width: 620px; margin: 0 0 2.2rem; }
.section-head h2 { font-size: clamp(1.55rem, 2.6vw, 2rem); }
.section-head p { color: var(--text-muted); margin-top: 0.7rem; }
.section-soft { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* Card grids */
/* Default capped at 2 — reads calmer and keeps card content (photos,
   text) large enough to stay legible instead of shrinking to fit a
   wider row. Individual templates can still opt up via --cols (only the
   homepage Ministries grid currently does, at 3). */
.card-grid { display: grid; gap: 1.3rem; grid-template-columns: repeat(var(--cols, 2), 1fr); }
@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .card-grid { grid-template-columns: 1fr; } }

.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem 1.3rem; display: flex; flex-direction: column; gap: 0.55rem; }
.card .icon-badge { width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--primary-tint); color: var(--primary); display: flex; align-items: center; justify-content: center; margin-bottom: 0.25rem; font-size: 1.1rem; }
.card h3 { font-size: 1.05rem; }
.card .when { font-weight: 700; color: var(--primary); font-size: 0.92rem; }
.card p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.card .img-ph { aspect-ratio: 16/10; border-radius: var(--radius); background: var(--bg-soft); margin-bottom: 1rem; overflow: hidden; border: 1px solid var(--border); }
.card .img-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card a.more { font-weight: 600; font-size: 0.88rem; color: var(--primary); text-decoration: none; margin-top: auto; }
.card a.more:hover { text-decoration: underline; }
/* Icon-left card layout: big icon beside the title/body instead of on top
   of it. Shared by any card that opts in via .icon-left-card — currently
   the homepage Resources cards and the school's Academics cards. */
.card.icon-left-card { flex-direction: row; align-items: center; gap: 1.1rem; }
.card.icon-left-card .icon-badge { width: 3.4rem; height: 3.4rem; font-size: 1.5rem; flex: none; margin-bottom: 0; }
.card.icon-left-card .card-text { display: flex; flex-direction: column; gap: 0.3rem; }
.card.icon-left-card h3 { margin: 0; }
.card.icon-left-card p { margin: 0; }

a.card.resource-card { text-decoration: none; transition: border-color 0.15s ease; }
a.card.resource-card:hover { border-color: var(--primary-light); }
a.card.resource-card h3 { color: var(--primary); }

/* Confession / pull-quote band */
/* New Members callout — deliberately more eye-catching than the section
   rhythm around it (tinted background + border + icon), since this is
   meant to stand out as an invitation to act, not just information. */
.newmembers-band { padding-top: 0; padding-bottom: 2.5rem; }
.newmembers-box {
  display: flex; align-items: center; gap: 1.6rem;
  background: var(--primary-tint); border: 1px solid var(--primary-light);
  border-radius: var(--radius); padding: 2rem 2.2rem;
}
.newmembers-box .icon-badge { width: 3.2rem; height: 3.2rem; font-size: 1.4rem; flex: none; background: var(--bg); }
.newmembers-box h2 { font-size: 1.4rem; margin-bottom: 0.4rem; }
.newmembers-box p { color: var(--text-muted); margin: 0 0 1rem; }
@media (max-width: 620px) {
  .newmembers-box { flex-direction: column; align-items: flex-start; text-align: left; }
}

.confession { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 4rem 0; }
.confession-inner { max-width: 700px; border-left: 3px solid var(--accent); padding-left: 1.6rem; }
.confession blockquote { font-family: var(--font-display); font-size: clamp(1.2rem, 2.3vw, 1.55rem); line-height: 1.45; margin: 0 0 1.1rem; color: var(--primary); font-style: italic; }
.confession cite { color: var(--text-muted); font-style: normal; font-size: 0.88rem; }

/* Two-column media/text rows (history, confession-with-image, etc.) */
.media-row { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.media-row.no-image { grid-template-columns: 1fr; max-width: 68ch; }
@media (max-width: 800px) { .media-row { grid-template-columns: 1fr; } }
.media-row .img-ph { aspect-ratio: 4/3; border-radius: var(--radius); background: var(--bg-soft); border: 1px solid var(--border); overflow: hidden; }
.media-row .img-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stat-row { display: flex; gap: 2rem; margin-top: 1.4rem; flex-wrap: wrap; }
.stat-row .stat b { display: block; font-family: var(--font-display); font-size: 1.55rem; color: var(--primary); }
.stat-row .stat span { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Find Us */
.find-us-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 2.8rem; align-items: center; }
@media (max-width: 860px) { .find-us-grid { grid-template-columns: 1fr; } }
.find-us-list { list-style: none; padding: 0; margin: 1.2rem 0 1.6rem; display: flex; flex-direction: column; gap: 0.6rem; }
.find-us-list li { display: flex; align-items: center; gap: 0.6rem; color: var(--text-muted); font-size: 0.95rem; }
.find-us-list a { display: flex; align-items: center; gap: 0.6rem; color: inherit; text-decoration: none; }
.find-us-list a:hover { color: var(--primary); text-decoration: underline; }
.find-us-list i { width: 1.1em; text-align: center; flex: none; }
.find-us-map { position: relative; aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--bg); }
.find-us-map iframe { width: 100%; height: 100%; display: block; border: 0; }
.find-us-map iframe { pointer-events: none; }
.find-us-map.is-active iframe { pointer-events: auto; }
.find-us-map .map-overlay {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
  background: rgba(255,255,255,0.65); border: none; cursor: pointer;
  color: var(--primary); font-family: var(--font-body); font-weight: 600; font-size: 0.92rem;
}
.find-us-map .map-overlay i { font-size: 1.6rem; }
.find-us-map.is-active .map-overlay { display: none; }
.find-us-fallback { margin-top: 0.6rem; font-size: 0.82rem; color: var(--text-muted); }
.find-us-fallback a { color: var(--primary); font-weight: 600; }

/* CTA band (Give / Admissions) */
.cta-band { text-align: center; border-top: 1px solid var(--border); padding: 4rem 0; }
.cta-band .container { max-width: 640px; }
.cta-band p { color: var(--text-muted); margin: 0.8rem 0 1.8rem; }

/* Footer */
.site-footer { background: var(--bg-soft); color: var(--text); padding: 3.2rem 0 0; border-top: 3px solid var(--accent); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2.5rem; padding-bottom: 2.2rem; border-bottom: 1px solid var(--border); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-col h4 { font-size: 0.92rem; margin-bottom: 0.85rem; }
.footer-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.9rem; color: var(--text-muted); }
.footer-list li { display: flex; align-items: center; gap: 0.5rem; }
.footer-list a { display: flex; align-items: center; gap: 0.5rem; color: var(--text-muted); text-decoration: none; }
.footer-list a:hover { color: var(--primary); }
/* Font Awesome glyphs have different intrinsic widths (a location pin is
   narrower than a phone icon) — a fixed, centered box per icon keeps the
   gap to the text visually even instead of following each glyph's ink. */
.footer-list i { width: 1.1em; text-align: center; flex: none; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding: 1.2rem 1.5rem; font-size: 0.78rem; color: var(--text-muted); flex-wrap: wrap; gap: 0.4rem; max-width: var(--max-width); margin: 0 auto; }
.footer-bottom a { color: var(--primary); text-decoration: none; font-weight: 600; }
.footer-bottom a:hover { text-decoration: underline; }
/* Deliberately understated — findable by someone who knows to look, not a
   visible invitation for casual visitors to click. */
.footer-login-link { margin-left: 0.9rem; color: var(--text-muted) !important; font-weight: 400 !important; opacity: 0.65; font-size: 0.85em; text-decoration: none; }
.footer-login-link:hover { opacity: 1; }
.footer-credit { padding: 0 1.5rem 1.1rem; font-size: 0.72rem; color: var(--text-muted); opacity: 0.8; max-width: var(--max-width); margin: 0 auto; }
.footer-credit a { color: var(--text-muted); text-decoration: underline; }

::selection { background: var(--accent-light); color: var(--text); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Anchor targets (#contact, #give, #service-times, etc.) need this to
   account for the sticky header — without it, the browser scrolls the
   target flush to the very top of the viewport, and the sticky header then
   sits directly on top of it, hiding the heading underneath. That reads as
   "the button did nothing," which is exactly the situation that leads to a
   confused second tap landing on whatever's now sitting where the first
   tap was — e.g. Get Directions right after tapping Plan Your Visit. */
section[id] { scroll-margin-top: 90px; }

/* Drupal status/error messages (page.highlighted region) */
.highlighted-messages { margin: 1.5rem auto 0; }
.messages { padding: 0.9rem 1.1rem; border-radius: var(--radius); border: 1px solid; margin-bottom: 1rem; font-size: 0.92rem; }
.messages--status { background: var(--primary-tint); border-color: var(--primary-light); color: var(--primary-dark, var(--primary)); }
.messages--error { background: #fbeaea; border-color: #d9534f; color: #7a1f1a; }
.messages--warning { background: var(--accent-light); border-color: var(--accent); color: #5a4318; }
.messages ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }

/* Rich-text body content (Page/Ministry/Staff Member bodies, Resource Link
   summaries — anything a content editor writes through CKEditor) had zero
   typographic rules of its own until now, so headings/lists/quotes all
   fell back to raw, inconsistent browser defaults. This is the shared fix,
   scoped to .node-page-body so it never touches hand-built layout markup
   elsewhere on the site. */
.node-page-body { max-width: 89ch; }
.node-page-body > *:first-child { margin-top: 0; }
.node-page-body > *:last-child { margin-bottom: 0; }
.node-page-body p { margin: 0 0 1.1rem; color: var(--text); line-height: 1.7; }
.node-page-body h2, .node-page-body h3, .node-page-body h4, .node-page-body h5, .node-page-body h6 {
  margin: 1.8rem 0 0.6rem; color: var(--primary); line-height: 1.3;
}
.node-page-body h2 { font-size: 1.4rem; }
.node-page-body h3 { font-size: 1.2rem; }
.node-page-body h4 { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.node-page-body ul, .node-page-body ol { margin: 0 0 1.1rem; padding-left: 1.3rem; color: var(--text); line-height: 1.6; }
.node-page-body li { margin-bottom: 0.35rem; }
.node-page-body li:last-child { margin-bottom: 0; }
.node-page-body blockquote {
  margin: 0 0 1.1rem; padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 3px solid var(--accent); color: var(--text-muted); font-style: italic;
}
.node-page-body blockquote p { margin-bottom: 0.3rem; }
.node-page-body blockquote p:last-child { margin-bottom: 0; }
.node-page-body cite { display: block; font-style: normal; font-size: 0.85rem; font-weight: 600; color: var(--primary); }
/* :not(.btn) matters: a .btn-primary inside body content (e.g. the
   field_page_cta_url button) has higher specificity here than in its own
   rule (0,1,0), so without this exclusion this repainted its text the
   same blue as the button background — invisible white-on-blue text
   turned into blue-on-blue. */
.node-page-body a:not(.btn) { color: var(--primary); }
.node-page-body a:not(.btn):hover { text-decoration: underline; }

/* CKEditor's "Align" and "Caption" toolbar buttons (filter_align /
   filter_caption on basic_html) stamp data-align into class="align-left/
   right/center" on either the bare <img> (no caption) or the <figure>
   wrapper filter_caption builds around it (captioned) — core ships no
   visual CSS for either shape. This is why an editor's in-text image looks
   right inside CKEditor itself (its own admin-only preview stylesheet)
   but not on the live page: nothing here was ever styling it. */
.node-page-body img[class*="align-"],
.node-page-body figure[class*="align-"] {
  max-width: 45%;
  border-radius: var(--radius);
}
.node-page-body .align-left { float: left; margin: 0.35rem 1.5rem 1rem 0; }
.node-page-body .align-right { float: right; margin: 0.35rem 0 1rem 1.5rem; }
.node-page-body .align-center { display: block; margin: 1.75rem auto; max-width: 75%; }
/* Headings shouldn't wrap around a still-floated photo from the section above. */
.node-page-body h2, .node-page-body h3 { clear: both; }
.node-page-body figure { margin: 0; }
/* max-width, not width: 100% — filter_align puts the align-* class (and
   therefore the 45% cap above) on the <figure>, which is a shrink-to-fit
   floated box with no width of its own. A flat `width: 100%` here would
   win over the <img>'s own width="" attribute (any author CSS beats an
   HTML presentational attribute) and feed back into that shrink-to-fit
   calculation, ballooning the figure past whatever size an editor picked
   with CKEditor's resize handles — max-width only ever shrinks, never
   grows past what the editor actually set. */
.node-page-body figure img { display: block; max-width: 100%; height: auto; border-radius: 0; }
.node-page-body figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Staff Member profile page */
.staff-profile-header { display: flex; align-items: flex-start; gap: 1.5rem; margin-bottom: 2rem; flex-wrap: wrap; }
.staff-profile-photo { width: 8rem; height: 8rem; flex: none; border-radius: 50%; overflow: hidden; background: var(--primary-tint); }
.staff-profile-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.staff-profile-meta { padding-top: 0.3rem; }
.staff-profile-title { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.2rem; }
.staff-profile-email a { color: var(--primary); font-size: 0.92rem; text-decoration: none; margin-top: 0.5rem; display: inline-block; }
.staff-profile-email a:hover { text-decoration: underline; }

/* Ministry profile page. position: relative + the img at position: absolute
   fills the box directly off .ministry-profile-image's own size — plain
   width/height: 100% on the img didn't work here because the field
   formatter wraps it in several divs with no explicit height of their
   own, and percentage heights don't resolve against an auto-height
   ancestor chain. Positioning sidesteps that chain entirely. */
.ministry-profile-image { position: relative; aspect-ratio: 21/9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--bg-soft); margin-bottom: 1.6rem; }
/* Logged-in editors get an extra .contextual-region wrapper here (the
   "Edit"/"Delete" gear icon on the media entity) that anonymous visitors
   never see — Drupal core gives it position: relative for its own gear-
   button positioning, which was quietly hijacking the img's containing
   block instead of .ministry-profile-image above. Making it also fill
   via inset: 0 keeps it a harmless pass-through rather than a boundary. */
.ministry-profile-image .contextual-region { position: absolute; inset: 0; }
.ministry-profile-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center var(--img-position-y, 50%); display: block; }
.ministry-profile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.6rem; margin-bottom: 1.8rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--border); }
.ministry-profile-meta .when { font-weight: 700; color: var(--primary); font-size: 1rem; margin: 0; }
.ministry-profile-meta .ministry-contact { display: flex; align-items: center; gap: 0.45rem; color: var(--text-muted); font-size: 0.92rem; margin: 0; }
.ministry-profile-meta .ministry-contact i { color: var(--primary); }

/* Staff directory grid cards (node--page.html.twig's staff_directory loop)
   render the same bio HTML as the full profile page, but inside a narrow,
   center-aligned card — the full .node-page-body treatment (1.4rem
   headings, 1.8rem top margins) is sized for a full-width article, not a
   ~300px card, so this is a deliberately more compact variant rather than
   reusing that class directly. Bio text itself stays left-aligned even
   though the photo/name/role above it are centered — centered paragraphs
   and bullet lists read poorly. */
/* Staff directory section heading (field_staff_group) — same small-caps
   label treatment as .events-list h3 / .news-list h3, so a grouped
   directory (School Faculty / Early Learning Teachers / Office Staff)
   reads consistently with the rest of the site's list headings. */
.staff-group-heading {
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent);
  margin-bottom: 0.8rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border);
}
.staff-card-bio { text-align: left; margin-top: 0.9rem; font-size: 0.88rem; }
.staff-card-bio p { margin: 0 0 0.7rem; line-height: 1.55; }
.staff-card-bio h4 {
  margin: 1rem 0 0.35rem; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
}
.staff-card-bio > *:first-child { margin-top: 0; }
.staff-card-bio > *:last-child { margin-bottom: 0; }
.staff-card-bio ul, .staff-card-bio ol { margin: 0 0 0.7rem; padding-left: 1.1rem; }
.staff-card-bio li { margin-bottom: 0.25rem; }
.staff-card-bio li:last-child { margin-bottom: 0; }
.staff-card-bio blockquote {
  margin: 0 0 0.7rem; padding: 0.1rem 0 0.1rem 0.8rem;
  border-left: 2px solid var(--accent); color: var(--text-muted); font-style: italic;
}
.staff-card-bio blockquote p { margin-bottom: 0.2rem; }
.staff-card-bio cite { display: block; font-style: normal; font-size: 0.8rem; font-weight: 600; color: var(--primary); }

/* Forms & Documents (field_show_documents grouped list, node--page.html.twig) */
.document-groups { margin-top: 2.5rem; }
.document-group { margin-bottom: 2rem; }
.document-group:last-child { margin-bottom: 0; }
.document-group h3 {
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent);
  margin-bottom: 0.8rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border);
}
.document-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.document-list-item {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.8rem 1rem; background: var(--bg);
}
.document-list-item a {
  display: flex; align-items: center; gap: 0.7rem;
  color: var(--text); text-decoration: none; font-weight: 600;
}
.document-list-item a:hover { color: var(--primary); }
.document-list-item i { color: var(--primary); flex: none; width: 1.1em; text-align: center; }
.document-list-item .document-description { margin: 0.35rem 0 0 1.8rem; font-size: 0.85rem; color: var(--text-muted); }
.document-list-item .document-description p { margin: 0; }

.document-download { margin-top: 1.5rem; }
.document-download i { color: var(--primary); margin-right: 0.4rem; }
.document-download a { color: var(--primary); font-weight: 600; text-decoration: none; }

/* Events (field_show_events, node--page.html.twig) — shown in full, one
   big item per event rather than a card grid; these are meant to answer
   "what's coming up" without a click-through. */
.events-list { margin-top: 2.5rem; }
.events-list h3, .news-list h3, .past-events h3 {
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent);
  margin-bottom: 0.8rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border);
}
.events-empty { color: var(--text-muted); }
.event-item {
  display: flex; gap: 1.4rem; padding: 1.4rem 0;
  border-bottom: 1px solid var(--border);
}
.event-item:first-of-type { padding-top: 0; }
.event-item-image {
  flex: 0 0 14rem; width: 14rem; aspect-ratio: 4/3; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border); display: block;
}
.event-item-body { flex: 1; min-width: 0; }
.event-item-date { font-weight: 700; color: var(--primary); font-size: 0.9rem; display: flex; align-items: center; gap: 0.4rem; }
.event-item-body h4 { margin: 0.3rem 0; }
.event-item-body h4 a { color: var(--text); text-decoration: none; }
.event-item-body h4 a:hover { color: var(--primary); }
.event-item-location { display: flex; align-items: center; gap: 0.4rem; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.6rem; }
.event-item-location i { color: var(--primary); }
.event-item-content { color: var(--text); }
.event-item-content > *:first-child { margin-top: 0; }
.event-item-content > *:last-child { margin-bottom: 0; }

/* News (field_show_news, node--page.html.twig) — a compact dated list with
   an auto-generated excerpt; click through for the full story. Kept
   visually distinct from .event-item (list row vs. big block) so the two
   sections read as different kinds of content, not one long feed. */
.news-list-items { list-style: none; margin: 0; padding: 0; }
.news-list-item { display: flex; gap: 1.1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.news-list-item:first-child { padding-top: 0; }
.news-list-image { flex: 0 0 6rem; width: 6rem; height: 6rem; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); display: block; }
.news-list-text { flex: 1; min-width: 0; }
.news-list-date { font-weight: 700; color: var(--primary); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.news-list-text h4 { margin: 0.25rem 0 0.3rem; }
.news-list-text h4 a { color: var(--text); text-decoration: none; }
.news-list-text h4 a:hover { color: var(--primary); }
.news-list-excerpt { color: var(--text-muted); font-size: 0.95rem; }
.news-list-excerpt p { margin: 0; }

/* Event / News — individual page (node--event.html.twig, node--news.html.twig) */
.item-profile-image { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--bg-soft); margin-bottom: 1.6rem; max-height: 32rem; display: flex; justify-content: center; }
.item-profile-image img { width: 100%; height: auto; max-height: 32rem; object-fit: contain; display: block; }
.item-profile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.6rem; margin-bottom: 1.8rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--border); }
.item-profile-meta p { display: flex; align-items: center; gap: 0.45rem; font-weight: 700; color: var(--primary); font-size: 1rem; margin: 0; }
.item-profile-meta .where { color: var(--text-muted); font-weight: 500; }
.item-profile-meta i { color: var(--primary); }

@media (max-width: 620px) {
  .event-item { flex-direction: column; }
  .event-item-image { width: 100%; flex-basis: auto; aspect-ratio: 16/9; }
  .news-list-item { flex-direction: column; }
  .news-list-image { width: 100%; height: auto; aspect-ratio: 16/9; }
}

/* Homepage Upcoming Events / News teasers (page--front.html.twig,
   #events-news) — reuses the site's existing .card / .card-grid / .when
   idiom (same one Ministries and Service Times use) rather than
   introducing another card style, so the homepage stays visually
   consistent. .events-news-subhead is the "Upcoming Events" / "News"
   row-label + "View all" link pairing above each row of cards. */
.events-news-subhead { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.events-news-subhead h3 { margin: 0; }
.events-news-subhead .more { font-weight: 600; font-size: 0.88rem; color: var(--primary); text-decoration: none; white-space: nowrap; }
.events-news-subhead .more:hover { text-decoration: underline; }
#events-news .card-grid + .events-news-subhead { margin-top: 2.4rem; }
.document-download a:hover { text-decoration: underline; }

/* Staff login / password reset — Drupal's own markup here (user-login-
   form, user-pass, the local-tasks tab block) carries no visual styling
   at all beyond a browser/Bootstrap reset, unlike the rest of the site.
   [id$="-primary-local-tasks"] rather than a literal block ID because
   that ID embeds the site's machine name and differs between church and
   school — this file is shared between them. */
[id$="-primary-local-tasks"] ul {
  list-style: none; display: flex; gap: 1.5rem; margin: 0 0 2rem; padding: 0;
  border-bottom: 1px solid var(--border);
}
[id$="-primary-local-tasks"] a {
  display: inline-block; padding: 0 0 0.8rem; color: var(--text-muted);
  text-decoration: none; font-size: 0.92rem; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
[id$="-primary-local-tasks"] a:hover { color: var(--primary); }
[id$="-primary-local-tasks"] a.is-active { color: var(--primary); border-color: var(--accent); }

.user-login-form, .user-pass {
  max-width: 400px; margin: 1rem auto 3rem; padding: 2rem 2.2rem 2.2rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 2); box-shadow: 0 2px 14px rgba(0,0,0,0.055);
}
.user-login-form .form-item, .user-pass .form-item { margin-bottom: 1.3rem; }
.user-login-form label, .user-pass label {
  display: block; font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem;
}
.user-login-form input.form-text, .user-pass input.form-text {
  width: 100%; padding: 0.6rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius);
  font-family: var(--font-body); font-size: 0.95rem; color: var(--text); background: var(--bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.user-login-form input.form-text:focus, .user-pass input.form-text:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint);
}
.user-login-form .form-actions, .user-pass .form-actions { margin-top: 1.6rem; }
.user-login-form input.form-submit, .user-pass input.form-submit {
  width: 100%; padding: 0.7rem 1rem; border: none; border-radius: var(--radius);
  background: var(--primary); color: #fff; font-weight: 600; font-size: 0.95rem; cursor: pointer;
  transition: background-color 0.15s ease;
}
.user-login-form input.form-submit:hover, .user-pass input.form-submit:hover { background: var(--primary-light); }
.user-pass p { font-size: 0.85rem; color: var(--text-muted); margin: -0.4rem 0 1.3rem; }
.user-login-form .url-textfield, .user-pass .url-textfield { display: none !important; }
