/* The Saints Together Churches — "Calm" concept. One global stylesheet: every colour, size,
   space and movement is a token in :root; components only read tokens.
   Site by Studio Nine · https://studionine.agency */

/* Geist stays as the fallback (self-hosted); Satoshi is loaded per page for the concept */
@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Colour: warm paper and stone, soft ink, one earthy hue per church */
  --paper: #f7f4ef;
  --stone: #ebe5df;
  --cream: #fffaee;
  --ink: #1c1b19;
  --ink-2: #57524c;
  --ink-3: #8a847d;
  --line: rgba(28, 27, 25, 0.12);
  --line-light: rgba(255, 250, 238, 0.22);

  /* The three churches, kept apart by hue and by depth: a deep church blue,
     a fresher, lighter green, and gold (from the brand's #24425f, #1f4d33, #e9b949).
     Each church has five (see assets/js/brand-colours.js): the colour itself (tiles, bands with
     only marks on them), -deep (sections and buttons with words on them), -ink (words in the colour
     on light grounds), -mark (marks and dots on light grounds) and -soft (pale backgrounds).
     Colours chosen in Admin → Brand replace these through /api/theme.css (linked after this file). */
  --peter: #2b5480;          /* St Peter's, Caverswall: blue */
  --peter-deep: #2b5480;
  --peter-ink: #2b5480;
  --peter-mark: #2b5480;
  --peter-soft: #b8c8dc;
  --andrew: #3d7353;         /* St Andrew's, Weston Coyney: green */
  --andrew-deep: #3c7151;
  --andrew-ink: #3d7353;
  --andrew-mark: #3d7353;
  --andrew-soft: #d3e3d6;
  --allsaints: #e5b53e;      /* All Saints, Dilhorne: gold (surfaces; ink text on it) */
  --allsaints-deep: #e5b53e;
  --allsaints-ink: #8a6600;  /* All Saints text on light grounds: deep gold, 4.8:1 on paper */
  --allsaints-mark: #c4941a; /* All Saints lines and dots on light grounds */
  --allsaints-soft: #f3e2b4;
  --error: #9c2121;          /* form errors */
  --benefice: #a9705a;     /* The three together: clay */
  --benefice-deep: #8b5c4a;
  --benefice-ink: #8b5c4a;
  --benefice-mark: #a9705a;
  --benefice-soft: #eaddd7;

  /* Type */
  --font: "Satoshi", "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-display: clamp(2.6rem, 1.6rem + 3.6vw, 4.4rem);
  --fs-h2: clamp(2rem, 1.4rem + 2vw, 3rem);
  --fs-h3: clamp(1.35rem, 1.2rem + 0.5vw, 1.6rem);
  --fs-lede: clamp(1.1rem, 1rem + 0.35vw, 1.3rem);
  --fs-body: 1.125rem;
  --fs-small: 0.95rem;
  --fs-label: 0.75rem;
  --tracking-label: 0.14em;
  --weight-display: 400;
  --weight-body: 400;
  --weight-strong: 500;

  /* Space and shape */
  --wrap: 1280px;
  --gutter: clamp(20px, 4vw, 64px);
  --section: clamp(88px, 11vw, 168px);
  --radius: 6px;
  --radius-lg: 10px;
  --header-h: 88px;
  --split-gap: clamp(40px, 7vw, 120px);   /* between the two columns of a .split */
  --line-h: 46px;             /* the church line under the docked header */
  --header-h-docked: 64px;    /* the header once it has stepped in */
  --dock-inset: 12px;         /* gap round the stepped-in header */
  --dock-w: 1180px;           /* widest the docked header gets */
  --dock-x: max(var(--dock-inset), calc((100% - var(--dock-w)) / 2));   /* its side inset */
  --dock-dur: 0.7s;           /* docking and undocking: even-paced, so both directions read */
  --dock-ease: cubic-bezier(0.65, 0, 0.35, 1);

  /* Movement: slow and soft */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.5s;
  --dur-slow: 1.1s;
  --ring-turn: 140s;       /* one full turn of a ring */
  --ring-breath: 6s;       /* the light travelling round a ring */
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--dock-inset) + var(--header-h-docked) + var(--line-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: var(--weight-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { font-weight: var(--weight-display); line-height: 1.1; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
p + p { margin-top: 1em; }
strong { font-weight: var(--weight-strong); }
button { font: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 680px; margin-left: auto; margin-right: auto; }
.center { text-align: center; }
.skip-link { position: absolute; left: -9999px; top: 12px; z-index: 100; background: var(--ink); color: var(--cream); padding: 10px 16px; }
.skip-link:focus { left: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

.display { font-size: var(--fs-display); }
.h2 { font-size: var(--fs-h2); }
.h3 { font-size: var(--fs-h3); }
.lede { font-size: var(--fs-lede); line-height: 1.55; color: var(--ink-2); }
.label {
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: var(--weight-strong);
  color: var(--ink-3);
}
.muted { color: var(--ink-2); }

/* ---------- Sections (tone sets background + text together) ---------- */

.section { padding: var(--section) 0; }
.tone-paper { background: var(--paper); }
.tone-stone { background: var(--stone); }
.tone-cream { background: var(--cream); }
.tone-peter, .tone-andrew, .tone-ink { color: var(--cream); }
.tone-peter { background: var(--peter-deep); }
.tone-andrew { background: var(--andrew-deep); }
.tone-ink { background: var(--ink); }
:is(.tone-peter, .tone-andrew, .tone-ink) :is(.lede, .muted) { color: rgba(255, 250, 238, 0.92); }
:is(.tone-peter, .tone-andrew, .tone-ink) .label { color: rgba(255, 250, 238, 0.86); }   /* the faintest words on a colour: brand-colours.js FAINT */

.stack > * + * { margin-top: var(--stack, 24px); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--split-gap); align-items: start; }
.split > * { min-width: 0; }   /* let wide children (sliders, swipe rows) scroll, not stretch the grid */
.split.middle { align-items: center; }
/* The eyebrow (and the heading, when the left column has copy beneath it) sits above
   the two columns, so the right column lines up with the left column's text rather
   than with the eyebrow */
.split-head { max-width: calc((100% - var(--split-gap)) / 2); }
.split-head + .split { margin-top: var(--stack, 24px); }
@media (max-width: 880px) { .split-head { max-width: none; } }
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } }

/* ---------- Buttons: small, square-ish, quietly spaced capitals ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px;
  border-radius: var(--radius);
  border: 1px solid currentColor;
  background: transparent; color: inherit;
  font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; font-weight: var(--weight-strong);
  text-decoration: none; cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.btn.fill { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.btn.fill:hover { background: var(--andrew-deep); border-color: var(--andrew-deep); }
.btn.cream { background: var(--cream); border-color: var(--cream); color: var(--ink); }
.btn.cream:hover { background: transparent; color: var(--cream); }
:is(.tone-peter, .tone-andrew, .tone-ink, .hero) .btn:not(.cream):hover { background: var(--cream); border-color: var(--cream); color: var(--ink); }
.btn.sm { min-height: 42px; padding: 0 18px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-row:has(> .text-link) { column-gap: 32px; }
.center .btn-row, .btn-row.center { justify-content: center; }

.text-link {
  font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; font-weight: var(--weight-strong);
  text-decoration: none; display: inline-flex; align-items: center; gap: 10px;
}
.text-link::after { content: "→"; transition: transform var(--dur) var(--ease); }
a:hover .text-link::after, .text-link:hover::after { transform: translateX(4px); }

/* ---------- The ring marks (drawn by calm.js) ---------- */

.ring { display: inline-block; width: var(--ring-size, 64px); aspect-ratio: 1; line-height: 0; color: inherit; }
.ring svg { width: 100%; height: 100%; overflow: visible; }
/* Line weight follows the ring's drawn size (calm.js sets --ring-auto-sw); --ring-sw overrides */
.ring svg * { vector-effect: non-scaling-stroke; stroke-width: var(--ring-sw, var(--ring-auto-sw, 1.2px)); }
.ring .ring-spin { transform-box: view-box; transform-origin: 50% 50%; animation: ring-turn var(--ring-turn) linear infinite; }
.ring .rg { transform-box: fill-box; transform-origin: 50% 50%; opacity: 0; transform: scale(0.2) rotate(-90deg); transition: opacity 0.7s var(--ease), transform 1.1s var(--ease); transition-delay: calc(var(--i) * 90ms); }
.ring.on .rg { opacity: 1; transform: none; }
.ring.on .rg-in { animation: ring-breath var(--ring-breath) ease-in-out infinite; animation-delay: calc(var(--i) * var(--ring-breath) / var(--n, 9) + 1.4s); }
/* Hover speeds a ring's turn up gently (calm.js eases its playback rate, so the angle never jumps) */
@keyframes ring-turn { to { transform: rotate(360deg); } }
@keyframes ring-breath { 0%, 100% { opacity: 1; } 50% { opacity: 0.28; } }
@media (prefers-reduced-motion: reduce) {
  .ring .ring-spin, .ring.on .rg-in { animation: none; }
  .ring .rg { transition: none; opacity: 1; transform: none; }
}

/* ---------- The STC marks (Joe's logos, November 2026) ----------
   calm.js draws them into the same .ring spans the ring marks used, so every place a
   ring stood (and its size and colour) carries over. They don't turn: they rise in
   once, when first seen. --mark-scale sizes the drawing inside its square. */
.ring.stc svg { display: block; fill: currentColor; scale: var(--mark-scale, 0.86); opacity: 0; translate: 0 10px; transition: opacity 0.9s var(--ease), translate 1.1s var(--ease), scale 0.6s var(--ease); }
.ring.stc :is(.stc-fox, .stc-well, .stc-tree) { --mark-scale: 0.74; }
.ring.stc.on svg, html.vt-arrived .site-header .ring.stc svg { opacity: 1; translate: none; }
.ring.stc.set svg { opacity: 1; translate: none; transition: none; }
.church:is(:hover, :focus-visible) .tile .ring.stc svg { scale: calc(var(--mark-scale, 0.86) * 1.06); }
.marks-stc .site-header.docked .brand .ring svg { rotate: none; }
.marks-stc .quote .ring { opacity: 0.07; }
html.marks-stc::view-transition-old(brand-ring), html.marks-stc::view-transition-new(brand-ring) { animation: none; }
@media (prefers-reduced-motion: reduce) { .ring.stc svg { transition: none; opacity: 1; translate: none; } }

/* ---------- Header ---------- */

.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  /* With a notice showing, the header rides just below it until the notice has
     scrolled away (calm.js keeps --hdr-top in step with the scroll) */
  translate: 0 var(--hdr-top, 0px);
  color: var(--cream); background-color: rgba(247, 244, 239, 0); border-radius: 0;
  box-shadow: 0 0 0 1px rgba(28, 27, 25, 0), 0 18px 40px -18px rgba(28, 27, 25, 0);
  transition: top var(--dock-dur) var(--dock-ease), left var(--dock-dur) var(--dock-ease), right var(--dock-dur) var(--dock-ease),
    border-radius var(--dock-dur) var(--dock-ease), background-color var(--dock-dur) var(--dock-ease), color var(--dock-dur) var(--dock-ease), box-shadow var(--dock-dur) var(--dock-ease);
}
/* Above the open menu, so Menu / Close stays to hand */
.site-header > .wrap { position: relative; z-index: 61; display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 24px; transition: height var(--dock-dur) var(--dock-ease), padding var(--dock-dur) var(--dock-ease); }
/* Docked (calm.js adds .docked once the hero has scrolled away; taking it off plays
   every move backwards): the header steps in from the edges and down from the top
   into a floating card, its parts draw in tighter, the benefice ring turns a quarter,
   and the church line unfolds beneath */
.site-header.docked {
  top: var(--dock-inset); left: var(--dock-x); right: var(--dock-x);
  background-color: rgba(247, 244, 239, 0.94); color: var(--ink); border-radius: var(--radius-lg);
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -18px rgba(28, 27, 25, 0.28);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.site-header.docked > .wrap { height: var(--header-h-docked); padding-inline: 12px 10px; }
.site-header.docked .church-line .wrap { padding-inline: 12px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; transition: gap var(--dock-dur) var(--dock-ease); }
.brand .ring { --ring-size: 46px; transition: width var(--dock-dur) var(--dock-ease); }
.brand .ring svg { transition: rotate var(--dur-slow) var(--ease); }
.brand-name { font-size: 0.98rem; line-height: 1.15; font-weight: var(--weight-strong); letter-spacing: -0.005em; transition: font-size var(--dock-dur) var(--dock-ease); }
.site-header.docked .brand { gap: 10px; }
.site-header.docked .brand .ring { width: 38px; }
.site-header.docked .brand .ring svg { rotate: 90deg; }   /* the mark repeats every quarter turn */
.site-header.docked .brand-name { font-size: 0.92rem; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.head-actions .btn {
  min-height: 44px; padding: 0 16px; font-size: 0.82rem; letter-spacing: 0.01em; text-transform: none; font-weight: var(--weight-body); border-color: rgba(255, 250, 238, 0.55);
  transition: min-height var(--dock-dur) var(--dock-ease), padding var(--dock-dur) var(--dock-ease), background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.site-header.docked .head-actions .btn { min-height: 40px; padding: 0 14px; border-color: var(--line); }
.site-header.docked .head-actions .btn:nth-child(2) { transition-delay: 0.04s; }
.site-header.docked .head-actions .btn:nth-child(3) { transition-delay: 0.08s; }
.site-header.docked .head-actions .btn:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); transition-delay: 0s; }
.menu-toggle .dots { display: grid; grid-template-columns: repeat(3, 3px); gap: 3px; }
.menu-toggle .dots i { width: 3px; height: 3px; background: currentColor; border-radius: 50%; }
/* The full-screen menu needs the header back at the top, full width, with no offset */
body.nav-open .site-header { top: 0; left: 0; right: 0; translate: none; border-radius: 0; transition: none; }
body.nav-open .site-header > .wrap { height: var(--header-h); padding-inline: var(--gutter); }
@media (max-width: 720px) {
  :root { --dock-inset: 8px; --header-h-docked: 60px; }
  .head-actions .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header, .site-header > .wrap, .brand, .brand .ring, .brand .ring svg, .brand-name, .head-actions .btn { transition: none; }
}

/* Church line: the three churches one tap away. Folded away over the hero, it
   unfolds under the header once you scroll; the church you're on is underlined
   in its own colour */
/* In: the card forms, then the line unfolds and the churches step in one by one.
   Out: the churches fade first, then the line folds away. */
.church-line { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur) var(--ease) 0.12s, box-shadow var(--dur) var(--ease); }
.church-line .wrap { min-height: 0; overflow: hidden; display: flex; justify-content: center; gap: clamp(4px, 4vw, 64px); }
.site-header.docked .church-line { grid-template-rows: 1fr; box-shadow: inset 0 1px 0 var(--line); transition-delay: 0.14s, 0.14s; }
body.nav-open .church-line { grid-template-rows: 0fr; box-shadow: none; }
.church-line a { position: relative; display: inline-flex; align-items: center; gap: 10px; height: var(--line-h); padding: 0 6px; font-size: var(--fs-small); color: var(--ink-2); text-decoration: none; white-space: nowrap; opacity: 0; transform: translateY(-10px); transition: opacity 0.3s var(--ease), transform var(--dur) var(--ease), color var(--dur) var(--ease); }
.site-header.docked .church-line a { opacity: 1; transform: none; transition-duration: var(--dur); transition-delay: 0.26s, 0.26s, 0s; }
.site-header.docked .church-line a:nth-child(2) { transition-delay: 0.34s, 0.34s, 0s; }
.site-header.docked .church-line a:nth-child(3) { transition-delay: 0.42s, 0.42s, 0s; }
.church-line a::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 0; height: 2px; background: var(--c-bar, var(--c)); transform: scaleX(0); transform-origin: left; transition: transform var(--dur) var(--ease); }
.church-line a:hover, .church-line a[aria-current="page"] { color: var(--ink); }
.church-line a:hover::after, .church-line a[aria-current="page"]::after { transform: scaleX(1); }
.church-line .tag-icon { color: var(--c); transition: transform var(--dur) var(--ease); }
.church-line a:hover .tag-icon { transform: scale(1.25); }
.church-line .cl-village { color: var(--ink-3); }
.cl-peter { --c: var(--peter-mark); --c-bar: var(--peter); }
.cl-andrew { --c: var(--andrew-mark); --c-bar: var(--andrew); }
.cl-allsaints { --c: var(--allsaints-mark); --c-bar: var(--allsaints); }   /* gold, not the deep text gold */
@media (max-width: 720px) {
  .church-line .wrap { justify-content: space-between; gap: 4px; }
  .church-line a { gap: 7px; padding: 0 2px; font-size: 0.85rem; }
  .church-line .cl-name { display: none; }
  .church-line .cl-village { color: inherit; }
}
@media (prefers-reduced-motion: reduce) { .church-line, .church-line a, .church-line a::after { transition: none; } }

/* Full-screen menu (main.js toggles .open on .nav and adds .nav-brand) */
.nav {
  position: fixed; inset: 0; z-index: 60;
  background: var(--stone); color: var(--ink);
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 0 clamp(32px, 6vw, 96px);
  align-content: center;
  padding: calc(var(--header-h) + 24px) var(--gutter) 48px;
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur) var(--ease), visibility 0s linear var(--dur);
}
.nav.open { opacity: 1; visibility: visible; transition: opacity var(--dur) var(--ease); }
.nav .nav-brand { position: absolute; left: var(--gutter); top: 0 !important; height: var(--header-h); display: flex; align-items: center; gap: 12px; }
.nav .nav-brand .ring { --ring-size: 46px; }
.nav .nav-brand .brand-sub { display: none; }
.nav .nav-brand .brand-name { font-size: 0.98rem; font-weight: var(--weight-strong); }
.nav-main { list-style: none; margin: 0; padding: 0; }
.nav-main a { display: block; text-decoration: none; font-size: clamp(2rem, 1.2rem + 3vw, 3.6rem); line-height: 1.2; letter-spacing: -0.02em; padding: 4px 0; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.nav-main:hover a { opacity: 0.4; }
.nav-main a:hover { opacity: 1; transform: translateX(8px); }
.nav-churches { display: grid; gap: 14px; align-content: center; }
.nav-church { display: grid; grid-template-columns: 72px 1fr; gap: 18px; align-items: center; text-decoration: none; }
.nav-church .tile { --tile-size: 72px; }
.nav-church .label { display: block; margin-bottom: 2px; }
.nav-church span:last-child { font-size: 1.15rem; }
.nav .btn.menu-close { display: none; }
body.nav-open { overflow: hidden; }
body.nav-open .site-header { color: var(--ink); background: transparent; box-shadow: none; position: fixed; z-index: 70; -webkit-backdrop-filter: none; backdrop-filter: none; }
body.nav-open .site-header .brand { visibility: hidden; }
body.nav-open .head-actions .btn { border-color: var(--line); }
body.nav-open .head-actions .btn:hover { background: var(--ink); color: var(--cream); }
@media (max-width: 880px) {
  .nav { grid-template-columns: 1fr; align-content: start; gap: 40px; overflow-y: auto; }
}

/* ---------- Hero ---------- */

.hero { position: relative; min-height: 100svh; display: grid; place-items: center; color: var(--cream); overflow: hidden; background: #3d3a35; }
.hero-slides, .hero-slides .hs { position: absolute; inset: 0; background-size: cover; background-position: center; }
/* The carousel (main.js: .on is showing, .was is the one before). The incoming photo
   dissolves in on top while the outgoing one holds still just beneath it, so there's
   always a whole photograph behind the fade; the rest wait underneath, hidden. Each
   photo's slow zoom is one unbroken move from its fade-in to its fade-out. The slides
   keep their own layers (z-index 0), so nothing slips behind the hero's background. */
.hero-slides { z-index: 0; }
.hero-slides .hs { z-index: 0; opacity: 0; }
.hero-slides .hs.on { z-index: 2; opacity: 1; transition: opacity 2.4s ease; }
.hero-slides .hs.was { z-index: 1; opacity: 1; }
.hero-slides .hs:is(.on, .was) { animation: hero-drift 10s linear both; }
@keyframes hero-drift { from { transform: scale(1.06); } to { transform: scale(1); } }
.hero-slides:not(.running) .hs:first-child { opacity: 1; }   /* showing before the carousel starts */
.hero-slides.running { background-image: none !important; }
/* Legibility over photographs: the wash is darkest behind the words (and the header band at the
   top) and light elsewhere, so the photo still reads. Strengths are tokens (--wash-*) and were set by measuring the contrast of every
   line against the pixels behind it, for every hero photo, on desktop and phone (WCAG AA). */
.hero::after { content: ""; position: absolute; inset: 0; background:
  linear-gradient(180deg, rgba(28, 27, 25, var(--wash-top, 0.6)) 0%, rgba(28, 27, 25, calc(var(--wash-top, 0.6) * 0.75)) 12%, rgba(28, 27, 25, 0) 24%),
  radial-gradient(ellipse 62% 48% at 50% 52%, rgba(28, 27, 25, var(--wash-centre, 0.5)) 0%, rgba(28, 27, 25, calc(var(--wash-centre, 0.5) * 0.6)) 55%, rgba(28, 27, 25, 0) 100%),
  linear-gradient(180deg, rgba(28, 27, 25, 0.5) 0%, rgba(28, 27, 25, 0.25) 30%, rgba(28, 27, 25, 0.25) 70%, rgba(28, 27, 25, 0.6) 100%); }
@media (max-width: 720px) { .hero::after { background:
  linear-gradient(180deg, rgba(28, 27, 25, var(--wash-top, 0.6)) 0%, rgba(28, 27, 25, calc(var(--wash-top, 0.6) * 0.75)) 12%, rgba(28, 27, 25, 0) 24%),
  radial-gradient(ellipse 95% 46% at 50% 55%, rgba(28, 27, 25, 0.62) 0%, rgba(28, 27, 25, 0.4) 60%, rgba(28, 27, 25, 0) 100%),
  linear-gradient(180deg, rgba(28, 27, 25, 0.5) 0%, rgba(28, 27, 25, 0.28) 30%, rgba(28, 27, 25, 0.28) 70%, rgba(28, 27, 25, 0.62) 100%); } }
.hero-inner { position: relative; z-index: 1; text-align: center; padding: calc(var(--header-h) + 40px) var(--gutter) 140px; max-width: 980px; }
.hero .ring { --ring-size: clamp(120px, 14vw, 176px); margin-bottom: 40px; }
.hero h1 { font-size: var(--fs-display); letter-spacing: -0.025em; }
.hero .lede { color: var(--cream); max-width: 560px; margin: 26px auto 0; }
.hero .btn-row { justify-content: center; margin-top: 40px; }
.hero-places { position: absolute; z-index: 1; left: 0; right: 0; bottom: 40px; display: flex; justify-content: center; gap: 28px; color: rgba(255, 250, 238, 0.86); }
.hero-places span { transition: color 1.2s ease; }
.hero-places span.on { color: var(--cream); }
.scroll-cue { position: absolute; z-index: 1; left: 50%; bottom: 0; width: 1px; height: 28px; background: rgba(255, 250, 238, 0.4); overflow: hidden; }
.scroll-cue::after { content: ""; position: absolute; inset: 0; background: var(--cream); animation: cue 2.6s var(--ease) infinite; }
@keyframes cue { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }
@media (max-width: 600px) { .hero-places { gap: 14px; font-size: 0.85rem; bottom: 44px; } }

/* ---------- Church tiles: colour, a ring, a name ---------- */

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 28px); }
@media (max-width: 880px) { .tiles { grid-template-columns: 1fr; } .tiles .tile { aspect-ratio: 4 / 3; } .tiles .tile .ring { --ring-size: 44%; } }
.tile { position: relative; display: grid; place-items: center; aspect-ratio: 1; width: var(--tile-size, auto); border-radius: var(--radius-lg); overflow: hidden; background: var(--tile-bg); color: var(--tile-fg); }
.tile .ring { position: relative; z-index: 1; --ring-size: 58%; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.08); transition: opacity 0.9s var(--ease), transform 1.6s var(--ease); }
.tile::after { content: ""; position: absolute; inset: 0; background: var(--tile-bg); opacity: 0; transition: opacity 0.9s var(--ease); }
.church:hover .tile img, .church:focus-visible .tile img { opacity: 1; transform: scale(1); }
.church:hover .tile::after, .church:focus-visible .tile::after { opacity: 0.55; }
.church:hover .tile, .church:focus-visible .tile { color: var(--cream); }
.t-peter { --tile-bg: var(--peter); --tile-fg: var(--cream); }
.t-andrew { --tile-bg: var(--andrew-soft); --tile-fg: var(--andrew-ink); }
.t-allsaints { --tile-bg: var(--allsaints); --tile-fg: var(--ink); }
.t-benefice { --tile-bg: var(--benefice); --tile-fg: var(--cream); }
.nav-church .tile .ring { --ring-size: 70%; }

.church { display: block; text-decoration: none; }
.church h3 { font-size: var(--fs-h3); margin-top: 24px; }
.church .label { margin-top: 6px; display: block; }
.church p { margin-top: 14px; color: var(--ink-2); font-size: var(--fs-small); max-width: 36ch; }
.church .text-link { margin-top: 20px; }

/* ---------- This Sunday: a numbered list (main.js renders .service-card) ---------- */

.sunday-list { counter-reset: svc; border-top: 1px solid var(--line-light); }
.sunday-list .service-card { counter-increment: svc; display: grid; grid-template-columns: 54px 1fr; column-gap: 8px; padding: 28px 0; border-bottom: 1px solid var(--line-light); cursor: pointer; transition: padding var(--dur) var(--ease); }
.sunday-list .service-card::before { content: counter(svc, decimal-leading-zero); grid-row: 1 / span 3; font-size: var(--fs-h3); line-height: 1.2; opacity: 0.5; }
.sunday-list .service-card:hover { padding-left: 10px; }
.sunday-list .sc-mark { display: none; }
.sunday-list .sc-time { grid-column: 2; font-size: var(--fs-h3); line-height: 1.2; }
.sunday-list .sc-head { grid-column: 2; grid-row: 3; display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; opacity: 0.7; }
.sunday-list .sc-body { grid-column: 2; grid-row: 2; }
.sunday-list .sname { display: block; font-size: var(--fs-body); margin-top: 4px; }
.sunday-list .sdesc { font-size: var(--fs-small); opacity: 0.72; margin-top: 6px; max-width: 46ch; }
.sunday-list .saddr { display: none; }
.sunday-list .sc-flag { display: inline-block; margin-left: 8px; padding: 2px 8px; border: 1px solid currentColor; border-radius: 999px; font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; vertical-align: middle; }
.sunday-list .cancelled { opacity: 0.55; cursor: default; }
.sunday-list .cancelled:hover { padding-left: 0; }
.tag-icon { width: 14px; height: 14px; flex: none; --glyph-sw: 1px; }

/* ---------- Slider (full-bleed photo slides) ---------- */

.slider { position: relative; }
.slider .slides { display: grid; grid-auto-flow: column; grid-auto-columns: min(86vw, 1180px); column-gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 0 var(--gutter); scroll-padding: 0 var(--gutter); }
.slider .slides::-webkit-scrollbar { display: none; }
.slide { position: relative; scroll-snap-align: start; height: min(78vh, 720px); min-height: 460px; border-radius: var(--radius-lg); overflow: hidden; color: var(--cream); display: flex; align-items: flex-end; text-decoration: none; }
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 2.4s var(--ease); }
.slide:hover img { transform: scale(1.03); }
.slide::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(28, 27, 25, 0) 25%, rgba(28, 27, 25, 0.58) 55%, rgba(28, 27, 25, 0.82) 100%); z-index: 1; }
.slide-body { position: relative; z-index: 2; padding: clamp(28px, 4vw, 56px); max-width: 640px; }
.slide-body h3 { font-size: var(--fs-h2); }
.slide-body p { margin-top: 14px; color: var(--cream); }
.slide-body .btn { margin-top: 28px; }
.slide-nav { position: absolute; inset: 50% 0 auto; display: flex; justify-content: space-between; padding: 0 calc(var(--gutter) + 20px); pointer-events: none; transform: translateY(-50%); z-index: 3; }
.slide-nav button { pointer-events: auto; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 250, 238, 0.86); color: var(--ink); cursor: pointer; font-size: 1.1rem; transition: opacity var(--dur) var(--ease), background var(--dur) var(--ease); }
.slide-nav button:hover { background: var(--cream); }
.slide-nav button:disabled { opacity: 0; pointer-events: none; }
@media (max-width: 720px) { .slide-nav { display: none; } }

/* ---------- Events (main.js renders .event-row) ---------- */

.event-list { border-top: 1px solid var(--line); }
.event-row { display: grid; grid-template-columns: 92px 1fr; gap: 12px 24px; align-items: start; padding: 28px 0; border-bottom: 1px solid var(--line); cursor: pointer; transition: padding var(--dur) var(--ease); }
.event-row:hover { padding-left: 10px; }
.event-row h4 { font-size: 1.3rem; line-height: 1.3; }
.event-row .meta { margin-top: 8px; color: var(--ink-2); font-size: var(--fs-small); max-width: 60ch; }
.event-date { display: flex; flex-direction: column; line-height: 1; }
.event-date .d { font-size: 2.6rem; letter-spacing: -0.03em; }
.event-date .m { font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--ink-3); margin-top: 8px; }
.church-tag { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; padding-top: 6px; }
.event-row.acc-caverswall .church-tag { color: var(--peter-ink); }
.event-row.acc-westoncoyney .church-tag { color: var(--andrew-ink); }
.event-row.acc-dilhorne .church-tag { color: var(--allsaints-ink); }
.event-row.acc-joint .church-tag { color: var(--benefice-ink); }
.event-row .church-tag { grid-column: 2; padding-top: 0; }
/* Whole-family events: "The whole church family │ St Peter's, Caverswall", the venue in its own colour */
.event-row .church-tag:has(.tag-at) { flex-wrap: wrap; row-gap: 6px; }
.church-tag .tag-at { display: inline-flex; align-items: center; gap: 8px; padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--line); }
.church-tag .tag-at.acc-caverswall { color: var(--peter-ink); }
.church-tag .tag-at.acc-westoncoyney { color: var(--andrew-ink); }
.church-tag .tag-at.acc-dilhorne { color: var(--allsaints-ink); }
.church-tag .tag-at.stacked { flex-basis: 100%; padding-left: 0; margin-left: 0; border-left: 0; }
/* A joint event, shown under one church, that's held at another (main.js markElsewhere):
   a soft pill in the colour of the church you'd actually go to, with its mark */
.elsewhere-note { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 6px 14px 6px 11px; border-radius: 18px; font-size: 0.88rem; line-height: 1.3; color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent); }
.elsewhere-note .tag-icon { flex: none; }
.elsewhere-note.acc-caverswall { --c: var(--peter-ink); }
.elsewhere-note.acc-westoncoyney { --c: var(--andrew-ink); }
.elsewhere-note.acc-dilhorne { --c: var(--allsaints-ink); }
.elsewhere-note.acc-joint { --c: var(--benefice-ink); }
@media (max-width: 720px) {
  .event-row { grid-template-columns: 64px 1fr; }
  .event-date .d { font-size: 2rem; }
}

/* ---------- Figures ---------- */

.figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; text-align: center; }
.figure .n { display: block; font-size: clamp(3rem, 2rem + 4vw, 5.2rem); line-height: 1; letter-spacing: -0.04em; }
.figure .label { display: block; margin-top: 16px; }
@media (max-width: 720px) { .figures { grid-template-columns: 1fr; gap: 40px; } }

/* ---------- Quote ---------- */

.quote { position: relative; overflow: hidden; text-align: center; }
.quote .ring { position: absolute; left: 50%; top: 50%; translate: -50% -50%; --ring-size: min(90vw, 760px); --ring-sw: 1px; opacity: 0.16; pointer-events: none; }
.quote blockquote { position: relative; margin: 0 auto; max-width: 880px; font-size: var(--fs-h2); line-height: 1.2; letter-spacing: -0.02em; }
.quote cite { position: relative; display: block; margin-top: 28px; font-style: normal; }

/* ---------- Image ---------- */

.photo { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 5; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo.wide { aspect-ratio: 4 / 3; }

/* ---------- Footer ---------- */

.site-footer { background: var(--ink); color: rgba(255, 250, 238, 0.72); padding: 96px 0 40px; font-size: var(--fs-small); }
.site-footer a { text-decoration: none; transition: color var(--dur) var(--ease); }
.site-footer a:hover { color: var(--cream); }
/* The mark takes the first row on its own; the strapline and link columns share the second, so their tops line up. */
.footer-top { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 22px 40px; }
.footer-brand { display: contents; color: var(--cream); }
.footer-brand .ring { --ring-size: 84px; grid-column: 1 / -1; }
.footer-brand p { max-width: 34ch; color: rgba(255, 250, 238, 0.72); }
.site-footer h5 { margin: 0 0 18px; font-weight: var(--weight-strong); font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: rgba(255, 250, 238, 0.45); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-legal { margin-top: 80px; padding-top: 28px; border-top: 1px solid var(--line-light); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; font-size: 0.82rem; color: rgba(255, 250, 238, 0.5); }
@media (max-width: 880px) { .footer-top { grid-template-columns: 1fr 1fr; row-gap: 40px; } .footer-brand { display: flex; flex-direction: column; gap: 22px; grid-column: 1 / -1; } }

/* ---------- Scroll reveal (main.js adds .in) ---------- */

html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html.js .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Page transitions ---------- */

/* Moving between pages is one movement, not a reload (the browser's cross-document
   View Transitions; each page head marks the arrival with .vt-arrived, and speculation
   rules have the next page ready before the click lands). The header holds still while
   its ring turns a quarter; the old page settles away and the new one rises out of the
   paper. A church tile opens out into that church's hero (calm.js names the pair). */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
html { background: var(--paper); }
.site-header { view-transition-name: site-header; }
.site-header .brand .ring { view-transition-name: brand-ring; }
.page-hero { view-transition-name: page-hero; }
::view-transition-group(*) { animation-duration: 0.8s; animation-timing-function: var(--ease); }
::view-transition-group(site-header), ::view-transition-group(brand-ring) { z-index: 2; }   /* the header stays on top of an opening hero */
::view-transition-old(root), ::view-transition-old(page-hero):only-child { animation: page-out 0.28s cubic-bezier(0.4, 0, 1, 1) both; }
::view-transition-new(root), ::view-transition-new(page-hero):only-child { animation: page-in 0.7s var(--ease) 0.22s both; }
/* A tile and a hero aren't the same shape: each fills the moving frame, cropped */
::view-transition-group(page-hero) { overflow: hidden; }
::view-transition-old(page-hero), ::view-transition-new(page-hero) { height: 100%; object-fit: cover; }
/* The docked card and the full-width bar dissolve at their own sizes, not stretched */
::view-transition-old(site-header), ::view-transition-new(site-header) { height: 100%; object-fit: none; object-position: 50% 0; }
/* Old and new ring turn together, a quarter apart (the mark repeats every quarter), so
   they stay in register while one colour hands over to the other */
::view-transition-old(brand-ring) { animation: ring-step-out 1.1s var(--ease) both; }
::view-transition-new(brand-ring) { animation: ring-step-in 1.1s var(--ease) both; }
@keyframes page-out { to { opacity: 0; translate: 0 -10px; } }
@keyframes page-in { from { opacity: 0; translate: 0 18px; } }
@keyframes ring-step-out { 60%, 100% { opacity: 0; } to { rotate: 90deg; } }
@keyframes ring-step-in { from { rotate: -90deg; opacity: 0; } 60% { opacity: 1; } }
/* Arriving, the header's ring is already drawn, and what's on screen is already
   revealed (main.js), so neither animates in a second time inside the page rise */
html.vt-arrived .site-header .ring .rg { opacity: 1; transform: none; transition: none; }
html.js.vt-arrived .reveal:not(.later) { opacity: 1; transform: none; transition: none; }

/* ---------- Notice banner (set in the admin; markup from notice.js) ---------- */

.site-notice { position: relative; z-index: 55; font-size: var(--fs-small); }
.site-notice .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.site-notice .sn-body { display: flex; align-items: center; justify-content: center; gap: 12px 16px; flex-wrap: wrap; flex: 1; text-align: center; }
.site-notice p { line-height: 1.45; }
.site-notice p a { color: inherit; text-underline-offset: 3px; }
.site-notice .sn-msg { display: inline-flex; align-items: center; gap: 12px; }
.site-notice .sn-mark { width: 22px; height: 22px; flex: none; --ring-sw: 1px; }
/* The admin's own image (notice.js): in the text colour unless they keep its colours */
.site-notice .sn-mark-img { width: auto; height: 32px; margin-block: -5px; aspect-ratio: 1; object-fit: contain; }   /* a touch taller than the benefice mark, without deepening the banner */
.site-notice span.sn-mark-img { background: currentColor; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.site-notice .sn-btn { padding: 6px 14px; border-radius: var(--radius); font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; text-decoration: none; }
.site-notice .sn-close { flex: none; background: none; border: 1px solid currentColor; color: inherit; border-radius: 50%; width: 28px; height: 28px; cursor: pointer; font-size: 0.7rem; opacity: 0.7; }

/* ---------- Event postcard (main.js) ---------- */

body.modal-open { overflow: hidden; }
.epc-veil { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: rgba(28, 27, 25, 0); visibility: hidden; transition: background var(--dur) var(--ease), visibility 0s linear var(--dur); }
.epc-veil.open { background: rgba(28, 27, 25, 0.5); visibility: visible; transition: background var(--dur) var(--ease); }
.epc { position: relative; width: min(900px, 100%); max-height: 88svh; overflow: auto; display: grid; grid-template-columns: 0.9fr 1.1fr; background: var(--paper); border-radius: var(--radius-lg); opacity: 0; transform: translateY(16px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.epc-veil.open .epc { opacity: 1; transform: none; }
.epc-img { position: relative; min-height: 260px; }
.epc-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.epc-body { padding: 44px 40px 36px; }
.epc-close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); cursor: pointer; }
.epc-stamp { display: none; }
.epc-date { font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--ink-3); }
.epc-body h3 { font-size: var(--fs-h3); margin-top: 12px; padding-right: 30px; }
.epc-meta { margin-top: 24px; display: grid; gap: 12px; }
.epc-meta .row { display: grid; grid-template-columns: 64px 1fr; gap: 14px; }
.epc-meta .lbl { font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--ink-3); padding-top: 4px; }
.epc-meta .val, .epc-desc { font-size: var(--fs-small); color: var(--ink-2); }
.epc-desc { margin-top: 18px; }
.epc-actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 18px; }
.epc-actions .link { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; text-decoration: underline; text-underline-offset: 4px; }
.epc-share { display: none; gap: 8px; margin-top: 16px; align-items: center; flex-wrap: wrap; }
.epc-share.open { display: flex; }
.epc-share a, .epc-share button { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--ink); cursor: pointer; }
.epc-share svg { width: 16px; height: 16px; }
.epc-share .share-tip { font-size: 0.8rem; opacity: 0; } .epc-share .share-tip.show { opacity: 1; }
.epc-signoff { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.epc-signoff .who { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.epc-signoff .who svg { width: 14px; height: 14px; --glyph-sw: 1px; }
@media (max-width: 720px) { .epc { grid-template-columns: 1fr; } .epc-img { min-height: 190px; } .epc-body { padding: 28px 22px; } }

/* ---------- Inner-page hero: a photograph, the title low and to the left ---------- */

.page-hero { position: relative; min-height: min(86svh, 820px); display: flex; align-items: flex-end; color: var(--cream); background: #3d3a35; overflow: hidden; }
.page-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.page-hero::after { content: ""; position: absolute; inset: 0; background:
  linear-gradient(180deg, rgba(28, 27, 25, var(--wash-top, 0.6)) 0%, rgba(28, 27, 25, calc(var(--wash-top, 0.6) * 0.75)) 12%, rgba(28, 27, 25, 0) 24%),
  linear-gradient(90deg, rgba(28, 27, 25, var(--wash-side, 0.45)) 0%, rgba(28, 27, 25, calc(var(--wash-side, 0.45) * 0.5)) 45%, rgba(28, 27, 25, 0) 70%),
  linear-gradient(180deg, rgba(28, 27, 25, 0.45) 0%, rgba(28, 27, 25, 0.12) 28%, rgba(28, 27, 25, var(--wash-low-mid, 0.45)) 58%, rgba(28, 27, 25, var(--wash-low, 0.75)) 100%); }
/* Phones: the words stack taller, so the wash starts higher */
@media (max-width: 720px) { .page-hero::after { background: linear-gradient(180deg, rgba(28, 27, 25, var(--wash-top, 0.6)) 0%, rgba(28, 27, 25, calc(var(--wash-top, 0.6) * 0.75)) 12%, rgba(28, 27, 25, 0) 24%), linear-gradient(180deg, rgba(28, 27, 25, 0.45) 0%, rgba(28, 27, 25, 0.22) 18%, rgba(28, 27, 25, 0.66) 42%, rgba(28, 27, 25, 0.84) 100%); } }
.page-hero .wrap { position: relative; z-index: 1; padding-top: calc(var(--header-h) + 48px); padding-bottom: clamp(48px, 7vw, 96px); display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 32px; }
.page-hero h1 { font-size: var(--fs-display); letter-spacing: -0.025em; }
.page-hero .lede { color: var(--cream); max-width: 560px; margin-top: 22px; }
.page-hero .label { color: var(--cream); display: block; margin-bottom: 18px; }
.page-hero .ring { --ring-size: clamp(96px, 11vw, 150px); }
.page-hero .btn-row { margin-top: 32px; }
@media (max-width: 720px) { .page-hero .wrap { grid-template-columns: 1fr; } .page-hero .ring { order: -1; --ring-size: 84px; } }

/* No photograph: a calm coloured band with the ring centred (legal pages, 404, What's On) */
.page-hero.plain { min-height: 0; display: block; text-align: center; color: var(--ink); background: var(--stone); }
.page-hero.plain::after { display: none; }
.page-hero.plain .wrap { display: block; padding-top: calc(var(--header-h) + clamp(56px, 8vw, 112px)); padding-bottom: clamp(64px, 8vw, 112px); }
.page-hero.plain .ring { margin-bottom: 36px; }
.page-hero.plain .lede { color: var(--ink-2); margin-left: auto; margin-right: auto; }
.page-hero.plain .label { color: var(--ink-3); }
.page-hero.plain .btn-row { justify-content: center; }
/* The header is cream over photographs; on a plain hero it starts in ink */
body.hero-plain .site-header:not(.docked) { color: var(--ink); }
body.hero-plain .site-header:not(.docked) .head-actions .btn { border-color: var(--line); }
body.hero-plain .site-header:not(.docked) .head-actions .btn:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }

/* ---------- Long-form text (legal pages, histories) ---------- */

.prose { max-width: 68ch; }
.prose h2 { font-size: var(--fs-h3); margin: 56px 0 16px; }
.prose h3 { font-size: 1.25rem; margin: 40px 0 12px; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul, .prose ol { padding-left: 1.2em; margin: 1em 0; }
.prose li + li { margin-top: 0.5em; }
.prose a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--ink); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: var(--fs-small); }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); }
.prose th { font-weight: var(--weight-strong); font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--ink-3); }

/* ---------- Numbered steps (01, 02, 03…) ---------- */

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; border-top: 1px solid var(--line); }
:is(.tone-peter, .tone-andrew, .tone-ink) .steps, :is(.tone-peter, .tone-andrew, .tone-ink) .steps li { border-color: var(--line-light); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 64px 1fr; column-gap: 8px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(step, decimal-leading-zero); grid-row: 1 / span 2; font-size: var(--fs-h3); line-height: 1.2; opacity: 0.5; }
.steps h3 { font-size: var(--fs-h3); line-height: 1.2; }
.steps p { margin-top: 8px; color: var(--ink-2); max-width: 52ch; }
:is(.tone-peter, .tone-andrew, .tone-ink) .steps p { color: rgba(255, 250, 238, 0.92); }

/* ---------- Facts: label on the left, detail on the right ---------- */

.facts { border-top: 1px solid var(--line); }
.facts .fact { display: grid; grid-template-columns: minmax(120px, 0.4fr) 1fr; gap: 8px 32px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.facts .fact > :first-child { padding-top: 4px; }
.facts .fact p, .facts .fact li { color: var(--ink-2); }
:is(.tone-peter, .tone-andrew, .tone-ink) .facts, :is(.tone-peter, .tone-andrew, .tone-ink) .facts .fact { border-color: var(--line-light); }
:is(.tone-peter, .tone-andrew, .tone-ink) .facts .fact :is(p, li) { color: rgba(255, 250, 238, 0.92); }
@media (max-width: 600px) { .facts .fact { grid-template-columns: 1fr; } }

/* A plain list with the church's glyph as the bullet (data-cms-list + data-icon) */
.marked-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.marked-list li { display: grid; grid-template-columns: 18px 1fr; gap: 14px; align-items: start; color: var(--ink-2); }
.marked-list li svg { width: 14px; height: 14px; margin-top: 0.45em; --glyph-sw: 1.1px; color: var(--ink); }
:is(.tone-peter, .tone-andrew, .tone-ink) .marked-list li { color: rgba(255, 250, 238, 0.92); }
:is(.tone-peter, .tone-andrew, .tone-ink) .marked-list li svg { color: var(--cream); }

/* ---------- Questions (details / summary) ---------- */

.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 26px 0; font-size: 1.25rem; line-height: 1.3; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 14px; height: 14px; background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat, linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat; transition: transform var(--dur) var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-body { padding: 0 0 28px; color: var(--ink-2); max-width: 64ch; }

/* ---------- The other churches: a quiet row of three to move between them ---------- */

.church-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 2vw, 24px); }
.church-switch a { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: center; padding: 14px; border-radius: var(--radius-lg); text-decoration: none; transition: background var(--dur) var(--ease); }
.church-switch a:hover { background: rgba(28, 27, 25, 0.05); }
.church-switch a[aria-current="page"] { background: rgba(28, 27, 25, 0.06); }
.church-switch .tile { --tile-size: 64px; }
.church-switch .tile .ring { --ring-size: 70%; }
.church-switch .label { display: block; margin-bottom: 2px; }
@media (max-width: 880px) { .church-switch { grid-template-columns: 1fr; } }

/* ---------- Church pages ---------- */

/* All Saints deep section: ochre ground, ink text.
   Mirrors .tone-peter / .tone-andrew (which are cream-on-colour) for a light colour.
   rgba(28,27,25,a) = var(--ink) at alpha, as --line already does. */
.tone-allsaints { background: var(--allsaints-deep); color: var(--ink); }
.tone-allsaints :is(.lede, .muted) { color: rgba(28, 27, 25, 0.92); }
.tone-allsaints .label { color: rgba(28, 27, 25, 0.86); }
.tone-allsaints .btn:not(.cream):hover { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.tone-allsaints .btn.fill:hover { background: var(--cream); border-color: var(--cream); color: var(--ink); }
.tone-allsaints :is(.steps, .steps li, .facts, .facts .fact) { border-color: rgba(28, 27, 25, 0.2); }
.tone-allsaints :is(.facts .fact p, .facts .fact li, .marked-list li) { color: rgba(28, 27, 25, 0.92); }
.tone-allsaints .steps p { color: rgba(28, 27, 25, 0.92); }
.tone-allsaints .marked-list li svg { color: var(--ink); }

/* Section that sits directly under another of the same tone (replaces the homepage's inline padding-top:0) */
.section.flush-top { padding-top: 0; }

/* Label inside a photo slide (replaces the homepage's inline label colour) */
.slide-body .label { color: var(--cream); }

/* Church pages: the Sunday service line set large in the deep section */
.service-line { font-size: var(--fs-h2); line-height: 1.15; letter-spacing: -0.02em; max-width: 18ch; }

/* Links inside running copy on deep tones keep an underline but inherit the tone's colour */
:is(.tone-peter, .tone-andrew, .tone-allsaints, .tone-ink) .muted a { text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* Benefice ring above a centred statement (churches page, fifth Sundays) */
.statement-ring { --ring-size: 88px; display: inline-block; margin-bottom: 8px; }

/* Outline buttons over a photo .page-hero: same cream hover as the homepage .hero
   (calm.css covers .hero but not .page-hero; drop this if the lead adds .page-hero to that rule) */
.page-hero:not(.plain) .btn:not(.cream):hover { background: var(--cream); border-color: var(--cream); color: var(--ink); }

/* ---------- About, legal, credits, 404 ---------- */

/* About: three short statements side by side, each under a small church ring */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(40px, 5vw, 80px); text-align: center; }
.trio-item .ring { --ring-size: 72px; margin-bottom: 28px; }
.trio-item p { margin: 14px auto 0; max-width: 34ch; color: var(--ink-2); }
.c-peter { color: var(--peter-mark); }
.c-andrew { color: var(--andrew-mark); }
.c-allsaints { color: var(--allsaints-mark); }
@media (max-width: 880px) { .trio { grid-template-columns: 1fr; gap: 56px; } }

/* About: the vicar's portrait swaps to the wide crop on small screens */
.photo picture { display: contents; }
@media (max-width: 880px) { .photo.vicar-photo { aspect-ratio: 16 / 10; } }
/* Admin-supplied introduction, read at lede size */
.lede-prose p { font-size: var(--fs-lede); line-height: 1.55; }

/* Legal pages: a quiet contents list beside the text on wide screens */
.legal { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: clamp(40px, 7vw, 120px); align-items: start; }
.legal-toc { position: sticky; top: calc(var(--header-h) + var(--line-h) + 24px); }
.legal-toc ol { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--line); }
.legal-toc li { border-bottom: 1px solid var(--line); }
.legal-toc a { display: block; padding: 11px 0; font-size: var(--fs-small); line-height: 1.35; color: var(--ink-2); text-decoration: none; transition: color var(--dur) var(--ease), padding var(--dur) var(--ease); }
.legal-toc a:hover { color: var(--ink); padding-left: 6px; }
.legal .prose h2[id] { scroll-margin-top: calc(var(--header-h) + var(--line-h) + 24px); }
.prose code { font-size: 0.9em; padding: 1px 6px; border-radius: 4px; background: var(--stone); color: var(--ink); }
@media (max-width: 960px) { .legal { grid-template-columns: 1fr; } .legal-toc { display: none; } }

/* Credits: one row per building, a small tile then its photographs */
.credit-place { display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: center; }
.credit-place .tile { --tile-size: 56px; }
.credit-place .tile .ring { --ring-size: 70%; }
.credit-place .tile img { opacity: 1; transform: none; }
.credit-place .label { display: block; margin-bottom: 2px; }
.credits-facts .fact { padding: 32px 0; align-items: start; }
.credits-facts .fact > .credit-place { padding-top: 0; }
.credit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.credit-list li { display: grid; gap: 4px; }
.credit-list li > a:first-child { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.credit-list li > a:first-child:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.credit-list li > span { font-size: var(--fs-small); color: var(--ink-2); }
.credit-list li > span a, .credits-note a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.credits-note { max-width: 68ch; }
@media (max-width: 600px) { .credits-facts .fact { gap: 20px; } }

/* 404: the plain hero fills the screen */
.page-hero.plain.full { min-height: 100svh; display: grid; align-items: center; }

/* data-cms-list is hidden when empty; keep it hidden despite display: grid */
.marked-list[hidden] { display: none; }
.h3 + .marked-list { margin-top: 20px; }

/* ---------- What's On + Contact ---------- */

/* ---------- Sticky side column (desktop only): a heading or details that stay in view
   beside a long list or a form ---------- */

@media (min-width: 881px) {
  .sticky { position: sticky; top: calc(var(--header-h) + var(--line-h) + 32px); align-self: start; }
}

/* ---------- Event filters (What's On; main.js toggles .active + aria-pressed) ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 8px; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 42px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--ink-2);
  font-size: 0.86rem; line-height: 1.2; cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
/* A small dot in each church's colour, so the pills match the tags in the list */
.filter-btn[data-filter]:not([data-filter="all"])::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--dot, var(--ink-3)); transition: background var(--dur) var(--ease); }
.filter-btn[data-filter="caverswall"] { --dot: var(--peter-mark); }
.filter-btn[data-filter="westoncoyney"] { --dot: var(--andrew-mark); }
.filter-btn[data-filter="dilhorne"] { --dot: var(--allsaints-mark); }
.filter-btn:hover { border-color: var(--ink); color: var(--ink); }
.filter-btn.active { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.filter-btn.active[data-filter="caverswall"] { background: var(--peter-deep); border-color: var(--peter-deep); }
.filter-btn.active[data-filter="westoncoyney"] { background: var(--andrew-deep); border-color: var(--andrew-deep); }
.filter-btn.active[data-filter="dilhorne"] { background: var(--allsaints-deep); border-color: var(--allsaints-deep); color: var(--ink); }
.filter-btn.active::before { background: currentColor; }

/* "Show more" (main.js adds button#show-more.btn.sm after #event-list; it sets the top margin) */
#show-more { width: 100%; }

/* Cancelled rows (church pages pass data-church, which adds them) */
.event-row.cancelled { cursor: default; opacity: 0.6; }
.event-row.cancelled:hover { padding-left: 0; }

/* ---------- The monthly pattern (What's On; main.js renders table.pattern into
   #pattern-holder: thead = "Sunday" + one column per time, tbody th = "1st Sunday"…,
   cells = .church-tag.acc-* + <br> + service name; the 5th Sunday spans all columns) ---------- */

.pattern-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pattern { width: 100%; border-collapse: collapse; }
.pattern th, .pattern td { text-align: left; vertical-align: top; padding: 28px 24px 28px 0; border-bottom: 1px solid var(--line); }
.pattern thead th {
  padding-top: 0; padding-bottom: 18px;
  font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase;
  font-weight: var(--weight-strong); color: var(--ink-3);
}
.pattern tbody th { width: 26%; font-size: var(--fs-h3); font-weight: var(--weight-display); line-height: 1.2; letter-spacing: -0.01em; white-space: nowrap; }
.pattern td { line-height: 1.5; }
.pattern td[colspan] { color: var(--ink-2); max-width: 62ch; }
.pattern .church-tag { padding-top: 0; margin-bottom: 8px; white-space: normal; }
.pattern .church-tag.acc-caverswall { color: var(--peter-ink); }
.pattern .church-tag.acc-westoncoyney { color: var(--andrew-ink); }
.pattern .church-tag.acc-dilhorne { color: var(--allsaints-ink); }
.pattern .church-tag.acc-joint { color: var(--benefice-ink); }
@media (max-width: 600px) {
  .pattern { font-size: var(--fs-small); }
  .pattern th, .pattern td { padding: 22px 14px 22px 0; }
  .pattern tbody th { width: auto; font-size: 1.1rem; white-space: normal; }
  .pattern .church-tag { letter-spacing: 0.06em; }
}

/* ---------- Contact form (main.js adds .invalid, .field-msg, .hp; select.js adds .cselect) ---------- */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 20px; }
.form-grid .full { grid-column: 1 / -1; }
/* Links that say what they're about land on the form (contact#contact-form), clear of the docked header */
#contact-form { scroll-margin-top: 40px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.form-grid label {
  display: block; margin-bottom: 10px;
  font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase;
  font-weight: var(--weight-strong); color: var(--ink-2);
}
.req-star { color: var(--benefice-ink); }

/* Large fields on a soft stone fill with a single rule beneath */
.form-grid :is(input, select, textarea), .cselect-btn {
  display: block; width: 100%; min-height: 60px; margin: 0;
  padding: 16px 18px;
  font: inherit; font-size: var(--fs-body); line-height: 1.5; color: var(--ink);
  background-color: var(--stone);
  border: 0; border-bottom: 1px solid var(--ink-3); border-radius: var(--radius) var(--radius) 0 0;
  -webkit-appearance: none; appearance: none;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.form-grid textarea { min-height: 200px; resize: vertical; }
.form-grid ::placeholder { color: var(--ink-3); opacity: 1; }
.form-grid :is(input, select, textarea):hover, .cselect-btn:hover { border-bottom-color: var(--ink); }
/* Focus: the field lightens and its rule thickens to ink */
.form-grid :is(input, select, textarea):focus, .cselect-btn:focus-visible, .cselect.open .cselect-btn {
  outline: none; background-color: var(--cream); border-bottom-color: var(--ink); box-shadow: 0 1px 0 0 var(--ink);
}
/* The native select (if select.js hasn't run): a drawn chevron */
.form-grid select {
  padding-right: 52px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 26px) 50%, calc(100% - 20px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat;
}

/* Errors: a clay-red rule and a short message beneath (role="alert") */
.form-grid :is(input, textarea).invalid, .cselect-btn[aria-invalid="true"] { border-bottom-color: var(--error, #9c2121); box-shadow: 0 1px 0 0 var(--error, #9c2121); }
.field-msg { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: var(--fs-small); font-weight: var(--weight-strong); color: var(--error, #9c2121); }
.field-msg::before { content: ""; width: 8px; height: 8px; flex: none; background: currentColor; clip-path: polygon(29.29% 0, 70.71% 0, 100% 29.29%, 100% 70.71%, 70.71% 100%, 29.29% 100%, 0 70.71%, 0 29.29%); }

.form-grid button[type="submit"] { min-width: 220px; }
.form-grid button[disabled] { opacity: 0.6; pointer-events: none; }
@media (max-width: 640px) { .form-grid button[type="submit"] { width: 100%; } }

/* The spam trap people never see: must stay off-screen */
.hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* After sending (main.js sets .show, or .show.form-problem) */
.form-success { display: none; margin-top: 28px; padding: 24px 28px; border-radius: var(--radius-lg); background: var(--andrew-deep); color: var(--cream); }
.form-success.show { display: block; }
.form-success.form-problem { background: var(--allsaints-soft); color: var(--ink); }
.form-success strong { display: block; margin-bottom: 6px; font-size: 1.15rem; }
.form-success a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

.form-note { margin-top: 28px; max-width: 56ch; font-size: var(--fs-small); color: var(--ink-2); }
.form-note a { text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* Links inside .facts (phone, email) */
.facts a { text-decoration: none; border-bottom: 1px solid var(--line); transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.facts a:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- Custom dropdown (select.js: .cselect > select + button.cselect-btn + .cselect-list) ---------- */

.cselect { position: relative; }
.cselect select { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: 0; pointer-events: none; }
.cselect-btn { position: relative; text-align: left; padding-right: 52px; cursor: pointer; }
.cselect-btn .cselect-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cselect-btn::after {
  content: ""; position: absolute; right: 22px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg);
  transition: transform var(--dur) var(--ease), margin-top var(--dur) var(--ease);
}
.cselect.open .cselect-btn::after { transform: rotate(225deg); margin-top: -2px; }
.cselect-list {
  display: none; position: absolute; z-index: 40; top: calc(100% + 8px); left: 0; right: 0;
  max-height: 300px; overflow: auto; padding: 6px;
  background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px -16px rgba(28, 27, 25, 0.22);
}
.cselect.open .cselect-list { display: block; }
.cselect-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--radius); font-size: var(--fs-small); cursor: pointer; transition: background var(--dur) var(--ease); }
.cselect-option:hover, .cselect-option.hi { background: var(--stone); }
.cselect-option[aria-selected="true"] { font-weight: var(--weight-strong); }
.cselect-option[aria-selected="true"]::after { content: ""; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--benefice-mark); }

/* ---------- Find us: three churches with a small tile, address and map link (Contact) ---------- */

.locs { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(32px, 4vw, 56px); }
@media (max-width: 880px) { .locs { grid-template-columns: 1fr; gap: 40px; } }
.loc { padding-top: 28px; border-top: 1px solid var(--line); }
.loc-head { display: grid; grid-template-columns: 72px 1fr; gap: 18px; align-items: center; text-decoration: none; }
.loc-head .tile { --tile-size: 72px; }
.loc-head .tile .ring { --ring-size: 70%; }
.loc-head h3 { font-size: var(--fs-h3); }
.loc-head .label { display: block; margin-top: 6px; }
.loc address { margin-top: 24px; font-style: normal; line-height: 1.7; }
.loc [data-service-line] { margin-top: 12px; font-size: var(--fs-small); }
.loc .text-link { margin-top: 20px; }

/* ---------- Regular groups (main.js data-cms-groups: Admin → Site details, "Through the week") ---------- */
.fact.group .group-when { color: var(--ink); }
.fact.group .group-when + p { margin-top: 4px; }
.fact.group .church-tag { margin-top: 10px; }
.fact.group .church-tag.acc-caverswall { color: var(--peter-ink); }
.fact.group .church-tag.acc-westoncoyney { color: var(--andrew-ink); }
.fact.group .church-tag.acc-dilhorne { color: var(--allsaints-ink); }
:is(.tone-peter, .tone-andrew, .tone-allsaints, .tone-ink) .fact.group .group-when { color: inherit; }
[data-hide-empty][hidden] { display: none; }

/* ---------- Small screens: thumb-sized links, an email address in its own case,
   and the church filters as one row you can swipe ---------- */
.btn[href^="mailto:"] { text-transform: none; letter-spacing: 0; font-size: var(--fs-small); }
@media (pointer: coarse) {
  .text-link { padding-block: 12px; margin-block: -12px; }
}
@media (max-width: 720px) {
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .filters::-webkit-scrollbar { display: none; }
  .filters .filter-btn { flex: none; }
}

/* ---------- Home splash (calm.js): three marks become one ---------- */
.calm-splash { display: none; }
html.js .calm-splash {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: var(--paper); color: var(--ink);
  animation: splash-failsafe 0.6s 8.5s forwards;   /* never left covering the page */
}
@keyframes splash-failsafe { to { opacity: 0; visibility: hidden; } }
.calm-splash > svg { width: min(92vw, 880px); overflow: visible; transition: scale 0.9s var(--ease); }
.calm-splash svg :is(path, polygon) { stroke-width: var(--sp-sw, 1.4px); }
.sp-g { transform: var(--t0); transition: transform 1.2s var(--ease) var(--m), opacity 0.6s var(--ease) var(--m); }
.sp-in { transform-box: fill-box; transform-origin: 50% 50%; opacity: 0; transform: scale(0.2) rotate(-90deg); transition: opacity 0.7s var(--ease) var(--d), transform 1s var(--ease) var(--d); }
.calm-splash.s1 .sp-in { opacity: 1; transform: none; }
.calm-splash.s2 .sp-g { transform: var(--t1); }
.calm-splash.s2 .sp-g:not(.travel) { opacity: 0; }
.sp-label { fill: currentColor; stroke: none; font: 500 5.2px var(--font); letter-spacing: 0.16em; opacity: 0; transition: opacity 0.6s var(--ease) var(--d); }
.calm-splash.s1 .sp-label { opacity: 0.55; }
.calm-splash.s2 .sp-label { opacity: 0; transition-delay: 0s; }
.sp-name { fill: currentColor; stroke: none; font: 400 11px var(--font); letter-spacing: -0.01em; opacity: 0; translate: 0 3px; transition: opacity 0.8s var(--ease), translate 0.8s var(--ease); }
.calm-splash.s3 .sp-name { opacity: 1; translate: 0 0; }
.calm-splash.stc.s3:not(.s4) .sp-name { opacity: 0; }
.sp-ring { transform-origin: 150px 50px; }
.calm-splash.s3 .sp-ring { animation: ring-turn var(--ring-turn) linear infinite; }   /* the hero ring's own pace, so the handover is seamless */
.calm-splash.out { opacity: 0; visibility: hidden; transition: opacity 0.8s var(--ease), visibility 0s 0.8s; }
.calm-splash.out > svg { scale: 1.05; }
/* Once the ring has formed it flies into the hero (calm.js moves it): the paper and the
   words fade from under it, and the hero ring waits hidden until it lands, then shows
   already drawn so the hand-over can't be seen */
html.js .calm-splash.fly { animation: none; pointer-events: none; background-color: rgb(247 244 239 / 0); transition: background-color 1s var(--ease) 0.2s; }
.calm-splash.fly :is(.sp-name, .sp-label) { opacity: 0; transition: opacity 0.4s var(--ease); }
.calm-splash.fly > svg { color: var(--cream); transition: color 1s var(--ease) 0.2s; }
.hero .ring.held { visibility: hidden; }
.ring.set .rg { opacity: 1; transform: none; transition: none; }
/* With the STC marks (calm.js initStcSplash): the three glyphs rise in over their names in
   their churches' colours, move into their places in the emblem (calm.js animates the
   move), turn black, and the rest of the emblem fades in under them before they hand over */
.calm-splash.stc .st-g { transform-box: view-box; transform-origin: 0 0; color: var(--c); transition: color 0.6s var(--ease), opacity 0.4s var(--ease); }
.calm-splash.stc .st-in { opacity: 0; translate: 0 6px; transition: opacity 0.7s var(--ease) var(--d), translate 1s var(--ease) var(--d); }
.calm-splash.stc.s1 .st-in { opacity: 1; translate: none; }
.calm-splash.stc.ink .st-g { color: currentColor; }
.calm-splash.stc .st-placed { opacity: 0; }
.calm-splash.stc .st-solo, .calm-splash.stc .st-placed { transition: opacity 0.35s var(--ease); }
.calm-splash.stc .st-g.has-twin.landed .st-solo { opacity: 0; }   /* landed: the glyph becomes the emblem's own (the tree loses its tucked-in roots) */
.calm-splash.stc .st-g.landed .st-placed { opacity: 1; }
.calm-splash.stc .st-emblem { opacity: 0; transition: opacity 0.6s var(--ease); }
.calm-splash.stc.s3 .st-emblem { opacity: 1; }
.calm-splash.stc.s4 .st-g { opacity: 0; }
.calm-splash.stc.s2 .sp-label { opacity: 0; transition-delay: 0s; }
.calm-splash.stc.now :is(.st-g, .st-emblem, .st-solo, .st-placed) { transition: none; }
.hero .ring.stc.held svg { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .calm-splash { display: none !important; } }

/* ---------- Spacing utilities ---------- */

.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; } .mt-5 { margin-top: 64px; }
.mb-4 { margin-bottom: 40px; } .mb-5 { margin-bottom: 64px; }

/* WhatsApp groups (Contact): a group, and the section, stay hidden until it has a link (main.js) */
[data-wa-section][hidden], .facts .fact[data-wa-item][hidden] { display: none; }
