/* =============================================================================
   Fellowship Church — styles.css
   Single global stylesheet. No framework, no build step.

   Structure:
     1. Design tokens (custom properties)
     2. Base / reset
     3. Accessibility helpers (skip link, focus)
     4. Layout primitives (container, section rhythm)
     5. Header + navigation
     6. Buttons + CTAs
     7. Hero
     8. Content components (cards, chips, feature grid, invite band)
     9. Forms (contact / prayer request)
    10. Footer
    11. 404
    12. Motion + reduced-motion
    13. Responsive breakpoints

   Design direction — "Gathered Light":
     A small, warm Pentecostal fellowship. Palette anchored in a deep garnet
     (Pentecost flame) with a warm gold/ember accent over warm off-white paper.
     Deliberately NOT the cream + terracotta + high-contrast-serif default.
     Signature: the Sunday service time treated as a designed "time chip",
     echoed in header, hero, and footer — because driving attendance is the
     site's #1 job, so the time is the thing to remember.
============================================================================= */

/* 1. DESIGN TOKENS ---------------------------------------------------------- */
:root {
  /* Palette (named) */
  --ink:        #241a1c;   /* warm near-black — body text */
  --garnet:     #6e2436;   /* brand anchor — headings, primary surfaces */
  --garnet-deep:#3a1620;   /* deepest field — hero/footer grounds */
  --ember:      #c8791b;   /* gold/amber accent — large text & fills only */
  --ember-lift: #e9a94c;   /* lighter gold — for use ON dark surfaces */
  --paper:      #fbf8f4;   /* warm off-white — page background */
  --paper-sink: #f2ebe1;   /* slightly deeper paper — cards / alt sections */
  --line:       #e2d6c8;   /* hairline borders on paper */
  --ink-soft:   #5c4d4f;   /* muted text on paper (passes AA on --paper) */

  /* Typography */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Type scale (fluid, clamped) */
  --step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.92rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.13rem);
  --step-1:  clamp(1.2rem, 1.10rem + 0.5vw, 1.5rem);
  --step-2:  clamp(1.5rem, 1.30rem + 1vw, 2.1rem);
  --step-3:  clamp(2rem, 1.60rem + 2vw, 3.1rem);
  --step-4:  clamp(2.6rem, 2.00rem + 3vw, 4.2rem);

  /* Spacing + measure */
  --container: 68rem;
  --gutter: clamp(1.1rem, 0.6rem + 2.4vw, 2.2rem);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(58, 22, 32, 0.06), 0 8px 24px rgba(58, 22, 32, 0.08);
}

/* 2. BASE / RESET ----------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  color: var(--garnet);
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); font-weight: 600; }

p { margin: 0 0 1rem; max-width: 62ch; }

a { color: var(--garnet); text-underline-offset: 0.18em; }
a:hover { color: var(--garnet-deep); }

img { max-width: 100%; height: auto; display: block; }

/* Eyebrow — small-caps label system used above section headings */
.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ember);
  margin: 0 0 0.6rem;
}

/* 3. ACCESSIBILITY HELPERS -------------------------------------------------- */
.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  z-index: 999;
  background: var(--garnet);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0.5rem; }

.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;
}

/* Visible, non-obscured focus (WCAG 2.2: 2.4.11 / 2.4.13) */
:focus-visible {
  outline: 3px solid var(--ember);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Anchor targets clear the sticky header when focused/scrolled to */
:target { scroll-margin-top: 6rem; }

/* 4. LAYOUT PRIMITIVES ------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Vertical rhythm between major sections (kept on ONE selector to avoid
   specificity conflicts flagged in the design guidance) */
.section { padding-block: clamp(3rem, 2rem + 5vw, 6rem); }
.section--sink { background: var(--paper-sink); }
.section--dark {
  background: var(--garnet-deep);
  color: #f4e7dd;
}
.section--dark h2, .section--dark h3 { color: #fff; }
.section--dark .eyebrow { color: var(--ember-lift); }
.section--dark a { color: var(--ember-lift); }

.lede { font-size: var(--step-1); color: var(--ink-soft); max-width: 54ch; }
.section--dark .lede { color: #e8d8cd; }

/* 5. HEADER + NAV ----------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 248, 244, 0.9);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-1);
  color: var(--garnet);
  text-decoration: none;
  margin-right: auto;
}
.brand__mark { color: var(--ember); }

/* Primary navigation */
.nav { display: flex; align-items: center; gap: 0.35rem; }
.nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  min-height: 44px;            /* comfortable target size */
  display: inline-flex;
  align-items: center;
}
.nav a:hover { background: var(--paper-sink); color: var(--garnet); }
.nav a[aria-current="page"] { color: var(--garnet); text-decoration: underline; }

/* Header time chip — the signature object (hidden on small screens) */
.time-chip {
  display: none;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: var(--step--1);
  color: var(--garnet);
  background: var(--paper-sink);
  border: 1px solid var(--line);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
}
.time-chip::before {
  content: "";
  width: 0.55rem; height: 0.55rem;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 3px rgba(200, 121, 27, 0.2);
}

/* Mobile nav toggle */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; stroke: var(--garnet); }

/* 6. BUTTONS + CTAs --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--step-0);
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.12s ease, background-color 0.12s ease, color 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--garnet); color: #fff; }
.btn--primary:hover { background: var(--garnet-deep); color: #fff; }

.btn--gold { background: var(--ember); color: #2a1608; }
.btn--gold:hover { background: var(--ember-lift); color: #2a1608; }

.btn--ghost {
  background: transparent;
  color: var(--garnet);
  border-color: var(--garnet);
}
.btn--ghost:hover { background: var(--garnet); color: #fff; }
.section--dark .btn--ghost { color: #fff; border-color: #f4e7dd; }
.section--dark .btn--ghost:hover { background: #fff; color: var(--garnet-deep); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* 7. HERO ------------------------------------------------------------------- */
.hero {
  position: relative;
  background: var(--garnet-deep);
  color: #f6ece3;
  overflow: hidden;
  isolation: isolate;
}
/* Warm "lamp glow" — the gathered-light motif */
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 130%;
  background:
    radial-gradient(60% 55% at 72% 18%, rgba(233, 169, 76, 0.28), transparent 60%),
    radial-gradient(70% 60% at 20% 90%, rgba(110, 36, 54, 0.55), transparent 65%);
  z-index: -1;
}
.hero__inner { padding-block: clamp(3.5rem, 2rem + 8vw, 7rem); }
.hero h1 { color: #fff; max-width: 16ch; }
.hero__lede { font-size: var(--step-1); color: #ecd9cb; max-width: 46ch; }

/* Hero time+place chip (larger, standalone version of the signature) */
.stamp {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  margin-bottom: 1.5rem;
  padding: 0.55rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(244, 231, 221, 0.25);
  border-radius: 999px;
  font-weight: 600;
  color: #fbeede;
}
.stamp strong { color: var(--ember-lift); }
.stamp span { opacity: 0.55; }

/* 8. CONTENT COMPONENTS ----------------------------------------------------- */
/* Feature grid — "what a Sunday looks like" etc. */
.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-top: 2rem;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.section--sink .card { background: #fff; }
.card h3 { color: var(--garnet); margin-top: 0.25rem; }
.card p:last-child { margin-bottom: 0; }
.card__icon {
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--paper-sink);
  color: var(--ember);
  margin-bottom: 0.75rem;
}
.card__icon svg { width: 1.5rem; height: 1.5rem; }

/* Split — text + detail/map panel */
.split {
  display: grid;
  gap: clamp(1.5rem, 1rem + 3vw, 3rem);
  grid-template-columns: 1fr;
  align-items: center;
}

/* Detail list — service time / address facts */
.facts { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.facts li {
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}
.facts li:last-child { border-bottom: 1px solid var(--line); }
.facts dt, .facts .facts__label {
  font-weight: 700; color: var(--garnet);
  min-width: 6.5rem;
}
.facts .facts__val { margin: 0; }

/* Map/location panel */
.panel {
  background: var(--paper-sink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.map-embed {
  aspect-ratio: 16 / 10;
  width: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  background: #ddd;
}

/* Invite band — closing call to action */
.invite {
  text-align: center;
}
.invite h2 { color: #fff; }
.invite p { margin-inline: auto; color: #ecd9cb; }

/* 9. FORMS ------------------------------------------------------------------ */
.form { max-width: 40rem; margin-top: 1.5rem; }
.field { margin-bottom: 1.15rem; }
.field label {
  display: block;
  font-weight: 700;
  color: var(--garnet);
  margin-bottom: 0.35rem;
}
.field .hint { font-weight: 400; color: var(--ink-soft); font-size: var(--step--1); }
.field input,
.field textarea,
.field select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  min-height: 48px;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--garnet);
  outline: 3px solid var(--ember);
  outline-offset: 1px;
}
.form__note { font-size: var(--step--1); color: var(--ink-soft); }
.req::after { content: "*"; color: var(--garnet); margin-left: 0.15em; }

/* 10. FOOTER ---------------------------------------------------------------- */
.site-footer {
  background: var(--garnet-deep);
  color: #e8d8cd;
  padding-block: clamp(2.5rem, 2rem + 3vw, 4rem);
}
.site-footer a { color: #f6e7db; }
.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
.footer-grid h2 { font-size: var(--step-1); color: #fff; }
.footer__brand { font-family: var(--font-display); font-size: var(--step-2); color: #fff; }
.footer__links { list-style: none; margin: 0; padding: 0; }
.footer__links li { margin-bottom: 0.5rem; }
.footer__bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(244, 231, 221, 0.2);
  font-size: var(--step--1);
  color: #cdb6aa;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
}

/* 11. 404 ------------------------------------------------------------------- */
.notfound { text-align: center; padding-block: clamp(4rem, 3rem + 6vw, 8rem); }
.notfound .code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 2rem + 12vw, 9rem);
  color: var(--ember);
  line-height: 1;
  margin: 0;
}

/* 12. MOTION ---------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* 13. RESPONSIVE ------------------------------------------------------------ */
@media (min-width: 46rem) {
  .time-chip { display: inline-flex; }
  .split { grid-template-columns: 1.1fr 0.9fr; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

@media (max-width: 52rem) {
  /* Collapse nav into a disclosure menu */
  .nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gutter) 1rem;
    box-shadow: var(--shadow);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { min-height: 48px; }
  .nav .btn { margin-top: 0.5rem; justify-content: center; }
}
@media (min-width: 52.01rem) {
  .nav-toggle { display: none; }
}
