/* =============================================================================
   BASE.CSS — the durable component system for church-classic.
   Reads every value from tokens.css. Do not hard-code a color/size here; add a
   token instead. WCAG 2.1 AA: visible focus, AA contrast on all key text,
   44px touch targets, reduced-motion honored.
============================================================================= */

/* ---- RESET / BASE --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--leading-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { color: var(--brand); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: var(--weight-heading); line-height: var(--leading-tight); color: var(--ink); margin: 0 0 0.5em; letter-spacing: 0.005em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; }

/* ---- A11Y: skip link + focus -------------------------------------------- */
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 3000;
  background: var(--brand); color: var(--on-brand); padding: 0.7rem 1.1rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); font-weight: 600; text-decoration: none;
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: 0; color: var(--on-brand); }
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- LAYOUT --------------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: var(--container-narrow); }
.section { padding-block: var(--section-y); }
.section--tint { background: var(--section-band); }
.section--brand { background: var(--brand-deep); color: var(--on-brand); }
.section-head { max-width: 42rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: var(--fs-eyebrow); font-weight: var(--weight-eyebrow);
  letter-spacing: var(--tracking-eyebrow); text-transform: var(--eyebrow-transform);
  color: var(--accent-text); margin-bottom: 0.9rem;
}
/* On dark brand bands the raw accent can fall just under AA (e.g. gold on a deep
   garnet); lighten the accent toward white so the eyebrow clears 4.5:1 on any
   church palette while staying on-brand. */
.on-dark .eyebrow, .section--brand .eyebrow { color: color-mix(in srgb, var(--accent) 70%, #fff); }
.eyebrow .church-motif { width: 1.5rem; height: 1.5rem; color: var(--accent); opacity: 0.9; }
h2.section-title { font-size: var(--fs-h2); margin-bottom: 0.4em; }
.section-lead { font-size: var(--fs-lead); color: var(--ink-soft); }

/* ---- BUTTONS -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 44px; padding: 0.72rem 1.4rem;
  font-family: var(--font-body); font-size: 1rem; font-weight: 600; line-height: 1;
  border-radius: var(--btn-radius); border: 1.5px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), color var(--dur-fast);
}
.btn svg { width: 1.15em; height: 1.15em; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--brand); color: var(--on-brand); }
.btn--primary:hover { background: var(--brand-deep); color: var(--on-brand); box-shadow: var(--shadow); }
.btn--accent { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-accent); }
.btn--accent:hover { background: var(--accent-deep); color: var(--accent-ink); }
.btn--ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn--on-dark { background: transparent; color: var(--on-brand); border-color: rgba(255,255,255,0.4); }
.btn--on-dark:hover { background: rgba(255,255,255,0.1); color: var(--on-brand); border-color: var(--on-brand); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---- DEMO RIBBON (honesty floor; shown only while demo label is set) ------ */
.demo-ribbon {
  display: flex; align-items: center; justify-content: center; gap: 0.55rem;
  background: var(--accent-ink); color: #f4e6c8; text-align: center;
  font-size: 0.82rem; font-weight: 500; padding: 0.5rem 1rem; line-height: 1.4;
}
.demo-ribbon strong { color: #fff; }
.demo-ribbon .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); flex: none; }

/* ---- HEADER / NAV --------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 900;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: var(--header-height); }
.brand { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; color: var(--ink); font-weight: 700; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.6rem; height: 2.6rem; flex: none;
  background: var(--brand); color: var(--on-brand);
  border-radius: 12px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.02em;
}
.brand-logo { max-height: 2.9rem; width: auto; }
.brand-name { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; line-height: 1.05; }
.brand-name small { display: block; font-family: var(--font-body); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }
.site-nav { margin-left: auto; }
.nav-list { display: flex; align-items: center; gap: 0.35rem; list-style: none; margin: 0; padding: 0; }
.nav-link {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0.4rem 0.75rem;
  color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: 0.98rem; border-radius: var(--radius-sm);
}
.nav-link:hover, .nav-link[aria-current] { color: var(--brand); background: var(--brand-tint); }
.header-actions { display: flex; align-items: center; gap: 0.6rem; }
.header-cta { padding-inline: 1.05rem; }
.nav-toggle {
  display: none; width: 44px; height: 44px; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
}
.nav-toggle-lines, .nav-toggle-lines::before, .nav-toggle-lines::after {
  content: ""; display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast);
}
.nav-toggle-lines::before { transform: translateY(-6px); }
.nav-toggle-lines::after { transform: translateY(4px); }
.nav-toggle[aria-expanded="true"] .nav-toggle-lines { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-lines::before { transform: translateY(0) rotate(45deg); background: var(--ink); }
.nav-toggle[aria-expanded="true"] .nav-toggle-lines::after { transform: translateY(-2px) rotate(-45deg); background: var(--ink); }

/* ---- HERO ----------------------------------------------------------------- */
.hero { position: relative; color: var(--on-brand); isolation: isolate; }
.hero-media { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: var(--hero-overlay); }
.hero--no-image { background: linear-gradient(160deg, var(--brand) 0%, var(--brand-deep) 100%); }
.hero-inner { display: grid; gap: clamp(2rem, 5vw, 3.5rem); padding-block: clamp(3.5rem, 9vw, 7rem); }
.hero-copy { max-width: 40rem; }
.hero .eyebrow { color: #ecdcb6; }
.hero h1 { color: #fff; font-size: var(--fs-display); margin-bottom: 0.35em; }
.hero-tagline { font-size: var(--fs-lead); color: var(--on-brand-soft); max-width: 34rem; }
.hero-affil { display: inline-block; margin-top: 0.4rem; font-size: 0.9rem; letter-spacing: 0.08em; text-transform: uppercase; color: #ecdcb6; }
.hero-actions { margin-top: 1.8rem; }

/* Service-times cards inside hero */
.svc-times { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.svc-card {
  background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.22);
  border-radius: var(--radius); padding: 1.15rem 1.25rem; backdrop-filter: blur(4px);
}
.svc-card .svc-name { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; color: #fff; }
.svc-card .svc-name svg { width: 1.1rem; height: 1.1rem; color: var(--accent); }
.svc-card .svc-time { font-family: var(--font-display); font-size: 1.5rem; color: #fff; margin-top: 0.15rem; }
.svc-card .svc-note { font-size: 0.9rem; color: var(--on-brand-soft); margin-top: 0.15rem; }

/* ---- WELCOME / PROSE ------------------------------------------------------ */
.prose { max-width: var(--container-narrow); }
.prose p { font-size: var(--fs-body); color: var(--ink-soft); }
.lead { font-size: var(--fs-lead); color: var(--ink-soft); }
.welcome-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 860px) { .welcome-grid { grid-template-columns: 1.05fr 0.95fr; } }
.welcome-media img { border-radius: var(--img-frame-radius); box-shadow: var(--shadow-lg); }

/* ---- CARD GRIDS (ministries, sermons, events, staff, beliefs) ------------- */
.grid { display: grid; gap: clamp(1.1rem, 2.5vw, 1.6rem); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
  padding: var(--card-pad); box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card h3 { font-size: var(--fs-h3); }
.card p { color: var(--ink-soft); }
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; margin-bottom: 1rem;
  background: var(--wash-accent); color: var(--accent-text); border-radius: 14px;
}
.card-icon svg { width: 1.5rem; height: 1.5rem; }
.card-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.88rem; color: var(--ink-faint); margin-top: auto; padding-top: 0.9rem; }
.card-meta span { display: inline-flex; align-items: center; gap: 0.35rem; }
.card-meta svg { width: 1rem; height: 1rem; color: var(--accent-text); }

/* Ministry card */
.ministry-card .ministry-lead { font-weight: 600; color: var(--brand); }

/* Sermon card */
.sermon-card { padding: 0; overflow: hidden; }
.sermon-embed { position: relative; aspect-ratio: 16 / 9; background: var(--brand-deep); }
.sermon-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sermon-thumb { position: relative; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--brand), var(--brand-deep)); color: var(--on-brand); }
.sermon-thumb svg { width: 3rem; height: 3rem; opacity: 0.85; }
.sermon-body { padding: var(--card-pad); display: flex; flex-direction: column; gap: 0.4rem; }
.sermon-series { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); }
.sermon-scripture { font-family: var(--font-display); font-style: italic; font-size: 1.1rem; color: var(--brand); }

/* Event row */
.event-list { display: grid; gap: 1rem; }
.event-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1.25rem; align-items: center;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
  padding: 1.2rem var(--card-pad); box-shadow: var(--shadow-sm);
}
.event-date {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 4.6rem; padding: 0.65rem 0.5rem; background: var(--brand-tint); border-radius: var(--radius);
  text-align: center; line-height: 1.1;
}
.event-date .ed-month { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-text); }
.event-date .ed-day { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: var(--brand); }
.event-main h3 { margin-bottom: 0.25rem; font-size: 1.25rem; }
.event-main p { margin: 0; color: var(--ink-soft); }
@media (max-width: 640px) { .event-row { grid-template-columns: auto 1fr; } .event-row .btn { grid-column: 1 / -1; } }

/* Staff */
.staff-card { text-align: center; align-items: center; }
.staff-photo { width: 7rem; height: 7rem; border-radius: 50%; object-fit: cover; margin-bottom: 1rem; box-shadow: var(--shadow-sm); background: var(--brand-tint); }
.staff-photo--placeholder { display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--brand); }
.staff-role { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-text); }

/* Beliefs list */
.beliefs { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); }
.belief {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 1.25rem;
}
.belief-check { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; background: var(--wash-accent); color: var(--accent-text); border-radius: 50%; flex: none; }
.belief-check svg { width: 1.15rem; height: 1.15rem; }
.belief h3 { font-size: 1.15rem; margin-bottom: 0.25rem; }
.belief p { margin: 0; font-size: 0.96rem; color: var(--ink-soft); }

/* ---- GIVING --------------------------------------------------------------- */
.give-wrap { display: grid; gap: clamp(2rem, 5vw, 3.5rem); align-items: center; }
@media (min-width: 860px) { .give-wrap { grid-template-columns: 1fr 1fr; } }
.give-badge { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.85rem; background: var(--wash-accent); color: var(--accent-text); border-radius: var(--radius-pill); font-size: 0.85rem; font-weight: 600; }
.zeffy-embed { width: 100%; min-height: 640px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }

/* ---- VISIT / CONTACT ------------------------------------------------------ */
.info-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.info-card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); padding: var(--card-pad); }
.info-card .card-icon { margin-bottom: 0.75rem; }
.info-card h3 { font-size: 1.2rem; margin-bottom: 0.35rem; }
.info-card p, .info-card a { color: var(--ink-soft); }
.map-embed { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }

/* ---- FAQ / details -------------------------------------------------------- */
.faq { display: grid; gap: 0.75rem; }
.faq details { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 0.35rem 1.1rem; }
.faq summary { cursor: pointer; font-weight: 600; padding: 0.75rem 0; list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--accent-text); line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--ink-soft); padding-bottom: 0.75rem; margin: 0; }

/* ---- CTA band ------------------------------------------------------------- */
.cta-band { text-align: center; }
.cta-band h2 { color: #fff; font-size: var(--fs-h2); }
.cta-band p { color: var(--on-brand-soft); font-size: var(--fs-lead); max-width: 40rem; margin-inline: auto; }
.cta-band .btn-row { justify-content: center; margin-top: 1.6rem; }

/* ---- PAGE HERO (interior pages) ------------------------------------------- */
.page-hero { background: linear-gradient(160deg, var(--brand) 0%, var(--brand-deep) 100%); color: var(--on-brand); padding-block: clamp(3rem, 7vw, 5rem); }
.page-hero .eyebrow { color: color-mix(in srgb, var(--accent) 70%, #fff); }
.page-hero h1 { color: #fff; font-size: clamp(2.3rem, 1.5rem + 3vw, 4rem); }
.page-hero p { color: var(--on-brand-soft); font-size: var(--fs-lead); max-width: 44rem; }

/* ---- FOOTER --------------------------------------------------------------- */
.site-footer { background: var(--brand-deep); color: var(--on-brand); padding-block: clamp(3rem, 6vw, 4.5rem) 1.5rem; }
.footer-top { display: grid; gap: clamp(2rem, 5vw, 3rem); grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-top { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-brand .brand { color: #fff; }
.footer-brand .brand-name { color: #fff; }
.footer-brand p { color: var(--on-brand-soft); margin-top: 0.8rem; max-width: 24rem; }
.footer-col h3 { color: #fff; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.9rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.footer-col a { color: var(--on-brand-soft); text-decoration: none; }
.footer-col a:hover { color: #fff; }
.footer-social { display: flex; gap: 0.6rem; margin-top: 1rem; }
.footer-social a { display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,0.24); border-radius: 50%; color: var(--on-brand); }
.footer-social a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.footer-social svg { width: 1.15rem; height: 1.15rem; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; justify-content: space-between; align-items: center; margin-top: clamp(2rem, 5vw, 3rem); padding-top: 1.4rem; border-top: 1px solid rgba(255,255,255,0.14); font-size: 0.85rem; color: var(--on-brand-soft); }
.footer-disclosure { display: inline-flex; align-items: center; gap: 0.5rem; }
.footer-disclosure .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); flex: none; }
.footer-legal a { color: var(--on-brand-soft); }
.footer-legal a:hover { color: #fff; }

/* ---- REVEAL ON SCROLL ----------------------------------------------------- */
/* Only hidden when JS is active (html.js is set by an inline script in the head)
   so that with JS off, or for crawlers/screenshots, all content is fully visible.
   Progressive enhancement, never a content dependency. */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js [data-reveal] { opacity: 1; transform: none; } }

/* ---- MOBILE NAV ----------------------------------------------------------- */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .header-cta--quote { display: none; }
  .site-nav {
    position: fixed; inset: 0 0 0 auto; width: min(20rem, 82vw);
    background: var(--paper); box-shadow: var(--shadow-lg);
    transform: translateX(100%); transition: transform var(--dur) var(--ease);
    padding: calc(var(--header-height) + 1rem) 1.5rem 2rem; z-index: 950; overflow-y: auto;
    border-left: 1px solid var(--line);
  }
  .site-nav.is-open { transform: none; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0.25rem; }
  .nav-link { min-height: 48px; font-size: 1.05rem; padding-inline: 0.9rem; }
  .nav-backdrop { position: fixed; inset: 0; background: rgba(20,26,44,0.5); opacity: 0; visibility: hidden; transition: opacity var(--dur); z-index: 940; }
  .nav-backdrop.is-open { opacity: 1; visibility: visible; }
}
@media (min-width: 901px) { .nav-backdrop { display: none; } }

/* small helpers */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
