/* ==========================================================================
   Grace Assembly — Sanctuary Editorial
   Tokens locked by handoff doc 01 §1. Mobile-first: base = 375px.
   No box-shadows anywhere. Radii 2px everywhere.
   ========================================================================== */

:root {
  /* Colour (locked) */
  --parchment: #F4EFE6;
  --parchment-alt: #F9F5EC;
  --ink: #14110F;
  --ink-soft: #57504A;
  --rule: #DCD3C4;
  --gold: #B8862F;
  --plum: #3A1F3D;
  --muted: #6B6258;

  /* Type */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Shape and spacing */
  --radius: 2px;
  --max: 1160px;
  --pad-x: 6vw;
  --section-y: 60px;
  --rail: 216px;
  --bar: 64px;
  --hair: 1px solid var(--rule);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* Leaves room for the 64px sticky bar so it never covers footer content. */
  padding-bottom: calc(var(--bar) + 24px);
}

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

/* Links: gold is a 1px rule, never the text colour (gold on parchment is 3.6:1). */
a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { text-decoration-color: var(--ink); }

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

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0 0 0.5em;
}

strong { font-weight: 600; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--parchment);
  padding: 14px 20px;
  z-index: 60;
}

.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------- helpers */

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;           /* 12px + bold satisfies the gold-size restriction */
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 14px;
}

.meta {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.display {
  font-size: clamp(40px, 6vw, 86px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.015em;
}

.headline {
  font-size: clamp(28px, 3.4vw, 46px);
  font-weight: 500;
  line-height: 1.1;
}

.subhead {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
}

.italic-plum {
  font-style: italic;
  color: var(--plum);
}

.lede { font-size: 17px; max-width: 420px; }

.prose { max-width: 680px; }
.prose p { font-size: 17px; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

.section { padding: var(--section-y) 0; border-bottom: var(--hair); }
.section:last-of-type { border-bottom: 0; }

.section__head { margin-bottom: 28px; }
.section__head .headline { margin-bottom: 0; }

.text-link {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 4px;
  display: inline-block;
  min-height: 48px;
  line-height: 48px;
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.btn--solid { background: var(--ink); color: var(--parchment); border-color: var(--ink); }
.btn--solid:hover { background: #000; }
.btn--ghost:hover { background: rgba(20, 17, 15, 0.06); }
.btn--light { background: var(--parchment); color: var(--ink); border-color: var(--parchment); }
.btn--light:hover { background: var(--parchment-alt); }
.btn--block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* --------------------------------------------------------------- masthead */

.masthead { border-bottom: var(--hair); background: var(--parchment); }

.masthead__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px var(--pad-x) 0;
}

.masthead__brand {
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
}

.masthead__name {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.masthead__place {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 5px;
}

.nav { margin-top: 14px; border-top: var(--hair); }

.nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

.nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 8px 16px 8px 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
}

.nav a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold); }

.nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold); }

/* ------------------------------------------------------------------- rail */
/* Desktop >=1280px only. Mirrors handoff doc §3: fixed left column, body
   shifts right by 216 + 48 = 264px. */

.rail { display: none; }

/* --------------------------------------------------------------- sticky bar */

.sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--bar);
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--parchment-alt);
  border-top: var(--hair);
  z-index: 40;
}

.sticky-bar__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.sticky-bar__btn + .sticky-bar__btn { border-left: var(--hair); }
.sticky-bar__btn:hover { background: var(--parchment); }

/* ------------------------------------------------------------------- hero */

.hero { display: grid; grid-template-columns: 1fr; border-bottom: var(--hair); }

.hero__text { padding: 92px var(--pad-x) 56px; }

/* At 375x812 the masthead plus hero text must leave the service times inside
   the first 812px. Keep this block tight; measured budget documented in the
   handoff report, not guessed. */
.hero__times-label { margin: 24px 0 4px; }

.hero__times {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}

.hero__title { margin-bottom: 20px; }

.hero__body { font-size: 17px; max-width: 420px; margin-bottom: 28px; }

.hero__media {
  min-height: 280px;
  border-top: var(--hair);
  /* Client supplies a 2000px+ community photo. Placeholder until then:
     a warm paper gradient, no generated imagery. */
  background:
    repeating-linear-gradient(115deg, rgba(184, 134, 47, 0.10) 0 1px, transparent 1px 14px),
    linear-gradient(160deg, var(--parchment-alt) 0%, #E7DCC8 55%, #D9C7AA 100%);
  display: flex;
  align-items: flex-end;
  padding: 20px;
}

.photo-note {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}

/* ------------------------------------------------------------ service strip */

.strip { display: grid; grid-template-columns: 1fr; }

.strip__cell { padding: 22px 0; border-bottom: var(--hair); }
.strip__cell:last-child { border-bottom: 0; }

.strip__value {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

/* ----------------------------------------------------------- sermon rows */

.sermon-row {
  display: grid;
  gap: 6px;
  padding: 22px 0;
  border-top: var(--hair);
  text-decoration: none;
  color: var(--ink);
}

.sermon-row:last-of-type { border-bottom: var(--hair); }
.sermon-row:hover .sermon-row__title { text-decoration: underline; text-decoration-color: var(--gold); }

.sermon-row__title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}

.sermon-row__excerpt { font-size: 15px; color: var(--ink-soft); margin: 0; }

/* ------------------------------------------------------------- pull quote */

.pullquote {
  border-top: 2px solid var(--gold);
  padding-top: 28px;
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(26px, 4vw, 56px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--plum);
}

.pullquote p { margin: 0 0 18px; }

.pullquote cite {
  display: block;
  font-family: var(--mono);
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

/* -------------------------------------------------------- ministries grid */

.ministries { border: var(--hair); }

.ministry { padding: 28px 0; border-bottom: var(--hair); }
.ministry:last-child { border-bottom: 0; }
.ministry__inner { padding: 0 22px; }

.ministry h3 { font-size: 22px; font-weight: 600; margin-bottom: 10px; }

.ministry p { font-size: 15px; color: var(--ink-soft); margin-bottom: 14px; }

/* ----------------------------------------------------------- giving block */

.giving {
  background: var(--plum);
  color: var(--parchment);
  padding: var(--section-y) 0;
}

.giving h2 { color: var(--parchment); font-size: clamp(28px, 3.4vw, 46px); margin-bottom: 14px; }
.giving p { color: var(--parchment); max-width: 520px; }
.giving .btn { margin-top: 24px; }

/* ----------------------------------------------------------------- footer */

.footer {
  border-top: var(--hair);
  padding-top: 44px;
  padding-bottom: 24px;
}

.footer__grid { display: grid; grid-template-columns: 1fr; gap: 0; }

.footer__col { padding: 22px 0; border-bottom: var(--hair); }
.footer__col:last-child { border-bottom: 0; }

.footer__name { font-family: var(--serif); font-size: 22px; font-weight: 600; margin: 0 0 8px; }

.footer p,
.footer address {
  font-size: 15px;
  color: var(--ink-soft);
  font-style: normal;
  margin: 0 0 6px;
}

.footer a { color: var(--ink); }

.footer__note {
  border-top: var(--hair);
  margin-top: 22px;
  padding-top: 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ------------------------------------------------------------ page intro */

.page-intro { padding: 64px 0 40px; border-bottom: var(--hair); }
.page-intro .headline { margin-bottom: 18px; }
.page-intro p { max-width: 680px; color: var(--ink-soft); }

/* ------------------------------------------------------------------ table */

.schedule {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.schedule caption { text-align: left; }

.schedule tr { display: block; border-bottom: var(--hair); padding: 18px 0; }
.schedule thead { display: none; }

.schedule th,
.schedule td { display: block; padding: 0; border: 0; font-weight: 400; }

.schedule th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.schedule td { font-size: 15px; padding: 2px 0; }

.schedule td::before {
  content: attr(data-label) ": ";
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* -------------------------------------------------------------- sub nav */

.subnav { display: none; }

/* ----------------------------------------------------------------- lists */

.def-list { list-style: none; margin: 0; padding: 0; }

.def-list li { padding: 20px 0; border-top: var(--hair); }
.def-list li:last-child { border-bottom: var(--hair); }

.def-list h3 { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.def-list p { font-size: 15px; color: var(--ink-soft); margin: 0; }

.numbered { list-style: none; margin: 0; padding: 0; counter-reset: belief; }

.numbered li {
  counter-increment: belief;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  padding: 20px 0;
  border-top: var(--hair);
}

.numbered li:last-child { border-bottom: var(--hair); }

.numbered li::before {
  content: counter(belief, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--gold);
  padding-top: 4px;
}

.numbered h3 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.numbered p { font-size: 15px; color: var(--ink-soft); margin: 0; }

/* ------------------------------------------------------------- leaders */

.leaders { display: grid; grid-template-columns: 1fr; gap: 0; }

.leader { padding: 22px 0; border-bottom: var(--hair); }

.leader__photo {
  aspect-ratio: 3 / 4;
  border: var(--hair);
  background: linear-gradient(155deg, #E9DECB 0%, #D6C4A6 100%);
  display: flex;
  align-items: flex-end;
  padding: 12px;
  margin-bottom: 14px;
}

.leader__name { font-family: var(--serif); font-size: 22px; font-weight: 600; margin: 0 0 4px; }

.leader__role {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

/* --------------------------------------------------------------- maps */

.map-slot {
  border: var(--hair);
  min-height: 260px;
  background:
    repeating-linear-gradient(0deg, rgba(184, 134, 47, 0.12) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(184, 134, 47, 0.12) 0 1px, transparent 1px 24px),
    var(--parchment-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}

/* --------------------------------------------------------------- panels */

.panel { border: var(--hair); padding: 24px; }
.panel h2 { font-size: 22px; font-weight: 600; }

.notice {
  border: var(--hair);
  border-left: 2px solid var(--gold);
  padding: 18px 20px;
  font-size: 15px;
  color: var(--ink-soft);
  background: var(--parchment-alt);
}

.give-rows { list-style: none; margin: 0; padding: 0; }

.give-rows li { padding: 22px 0; border-top: var(--hair); }
.give-rows li:last-child { border-bottom: var(--hair); }
.give-rows h3 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.give-rows p { font-size: 15px; color: var(--ink-soft); }

.mono-value {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.pager { display: flex; justify-content: space-between; gap: 16px; border-top: var(--hair); padding-top: 20px; }

/* --------------------------------------------------------------- reveal */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.reveal.is-visible { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ 404 */

.center-page { padding: 92px var(--pad-x) 64px; text-align: center; }
.center-page .display { margin-bottom: 16px; }
.center-page p { max-width: 480px; margin-left: auto; margin-right: auto; }

/* ==========================================================================
   430 — same layout, more breathing room
   ========================================================================== */

@media (min-width: 430px) {
  :root { --section-y: 64px; }
  .hero__text { padding-top: 96px; }
}

/* ==========================================================================
   900 — two-column where it earns its place; ministries stays single column
   ========================================================================== */

@media (min-width: 900px) {
  :root { --section-y: 92px; }

  body { font-size: 15px; }

  .masthead__inner {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 32px;
    padding-top: 22px;
    padding-bottom: 6px;
  }

  .nav { margin-top: 0; border-top: 0; }
  .nav ul { justify-content: flex-end; }
  .nav a { padding: 0 0 0 26px; min-height: 48px; }

  .hero__text { padding: 92px var(--pad-x) 92px; }

  .strip { grid-template-columns: repeat(3, 1fr); }
  .strip__cell { padding: 0 24px; border-bottom: 0; border-left: var(--hair); }
  .strip__cell:first-child { padding-left: 0; border-left: 0; }
  .strip__cell:last-child { padding-right: 0; }

  .footer__grid { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .footer__col { padding: 0; border-bottom: 0; border-left: 0; }

  .leaders { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .leader { padding: 0; border-bottom: 0; }

  /* Ministries stay single column to 900px only per §3; this is the switch. */
  .ministries { display: grid; grid-template-columns: repeat(3, 1fr); }
  .ministry { padding: 34px 0; border-bottom: 0; border-left: var(--hair); }
  .ministry:first-child { border-left: 0; }

  .schedule tr { display: grid; grid-template-columns: 130px 190px 1fr 1fr; gap: 12px; padding: 18px 0; }
  .schedule thead { display: block; }
  .schedule thead tr { border-bottom: var(--hair); }
  .schedule th,
  .schedule td { display: block; }
  .schedule thead th {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .schedule td::before { content: none; }
  .schedule tbody th {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink);
    margin: 0;
  }

  .sermon-row { grid-template-columns: 150px 1fr; gap: 8px 24px; align-items: baseline; }
  .sermon-row__excerpt { grid-column: 2; }

  .page-intro { padding: 92px 0 56px; }

  .subnav {
    display: block;
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--parchment-alt);
    border-bottom: var(--hair);
    margin-bottom: 0;
  }

  .subnav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0; margin: 0; padding: 0; max-width: var(--max); margin: 0 auto; padding-left: var(--pad-x); padding-right: var(--pad-x); }

  .subnav a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding-right: 28px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-soft);
    text-decoration: none;
  }

  .subnav a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold); }

  .pager { padding-top: 24px; }
}

/* ==========================================================================
   1000 — leadership drops to 4 across
   ========================================================================== */

@media (min-width: 1000px) {
  .leaders { grid-template-columns: repeat(4, 1fr); gap: 24px; }
}

/* ==========================================================================
   1280 — utility rail appears; content shifts right 264px; sticky bar goes
   ========================================================================== */

@media (min-width: 1280px) {
  body { padding-bottom: 0; }

  .sticky-bar { display: none; }

  .rail {
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--rail);
    background: var(--parchment-alt);
    border-right: var(--hair);
    padding: 34px 26px;
    overflow-y: auto;
    z-index: 35;
  }

  .rail__label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 6px;
  }

  .rail__times {
    font-family: var(--serif);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 20px;
  }

  .rail__rule { border-top: var(--hair); margin: 0 0 20px; }

  .rail__address {
    font-size: 14px;
    color: var(--ink-soft);
    margin: 0 0 22px;
  }

  .rail .btn { min-height: 48px; font-size: 14px; }

  /* 216 + 48 = 264px shift, per §3. */
  .page-shell { padding-left: 264px; }

  .hero { grid-template-columns: 1.1fr 0.9fr; }
  .hero__text { padding: 92px 48px 92px var(--pad-x); }
  .hero__media { min-height: 420px; border-top: 0; border-left: var(--hair); }
}

/* ==========================================================================
   1440 / 1920 — more whitespace, same max measure
   ========================================================================== */

@media (min-width: 1440px) {
  :root { --section-y: 100px; }
  .hero__text { padding-top: 100px; padding-bottom: 100px; }
}

@media (min-width: 1920px) {
  :root { --pad-x: 48px; }
}

/* ==========================================================================
   Reduced motion — all reveal transitions off
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ------------------------------------------------------------------ print */

@media print {
  .sticky-bar,
  .rail,
  .nav,
  .skip-link { display: none; }

  body { padding-bottom: 0; background: #fff; }
  .reveal { opacity: 1; transform: none; }
}
