/* Fonts are served from this site (public/fonts), not from Google, so a visitor's
   address is never sent to Google just to read a page. Fraunces and Inter are
   open-licence (SIL OFL) variable fonts, Latin subset only. */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/fraunces-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/fraunces-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* St Martin of Tours, Chelsfield — shared styles
   Palette: cream / navy / gold / rose / sage / ink
   Type: Fraunces (display) + Inter (body)
   Deliberately distinct from other MediaWright builds: light header (not
   dark), pill buttons (not rectangular), rounded 14px cards with soft
   shadow (not flat bordered), navy/gold/rose (not slate/brass, not
   green/terracotta) — echoing the church's own old-meets-new contrast: a
   medieval nave beside the contemporary Brass Crosby Room extension. Gold
   is the general accent (links, primary buttons, card borders); rose is
   reserved for anything alert-shaped (safeguarding, form errors) so it
   reads as a distinct signal, not just "the other accent colour". */

:root {
  --chalk: #F3ECDC;
  --paper: #FBF7EF;
  --navy: #1F2A40;
  --navy-dark: #141B2B;
  --gold: #866017;
  --gold-dark: #6B4E13;
  --gold-bright: #C08A2E;
  --rose: #8C3B31;
  --rose-dark: #7A332A;
  --sage: #55673F;
  --sage-dark: #3F4C2E;
  --ink: #23241F;
  --ink-soft: #4B4A42;
  --line: rgba(31,42,64,0.16);
  --radius: 14px;
  --radius-sm: 8px;
  --max: 1120px;
  /* Overridden inline, right after the header, with its real measured
     height (see templates/page.html) — the sticky header's height isn't a
     fixed value: the primary nav wraps as the viewport narrows, so this
     fallback only matters before that inline script runs (or with JS
     disabled), and errs generous rather than under-shooting. */
  --header-offset: 190px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* The header is sticky (position: sticky; top: 0) and overlays whatever's
   scrolled underneath it — without this, jumping to any #anchor (a search
   result, a person's card, a heading ensureSectionIds gave an id to) lands
   that element flush at the very top of the viewport, right behind the
   header. :target is exactly "the element the current URL fragment points
   at", so this reaches every such anchor without enumerating selectors by
   hand. See kington-parishes' CLAUDE.md/style.css for the sibling site this
   pattern was ported from. */
:target { scroll-margin-top: var(--header-offset); }

body {
  margin: 0;
  background: var(--chalk);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display { font-family: 'Fraunces', serif; color: var(--navy); margin: 0 0 0.5em; line-height: 1.18; font-weight: 600; }
p { margin: 0 0 1em; }
img, svg.illustration, iframe.map-embed { max-width: 100%; height: auto; display: block; }

a { color: var(--gold-dark); text-underline-offset: 3px; }
a:hover { color: var(--navy); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 3px;
}

.visually-hidden {
  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: -999px;
  top: auto;
  background: var(--navy);
  color: #fff;
  padding: 12px 20px;
  z-index: 100;
  border-radius: var(--radius-sm);
}
.skip-link:focus {
  left: 16px;
  top: 16px;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; }

/* ---------- Header / Nav ---------- */
header.site {
  background: var(--paper);
  border-bottom: 3px solid var(--gold);
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 28px;
  max-width: var(--max);
  margin: 0 auto;
  flex-wrap: wrap;
}
.brand {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--navy);
  text-decoration: none;
}
.brand:hover {
  color: var(--gold-dark);
  text-decoration: underline;
  text-decoration-color: var(--gold);
}
nav.links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-weight: 600;
  font-size: 0.92rem;
}
nav.links a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 3px;
}
nav.links a:hover, nav.links a[aria-current="page"] {
  color: var(--navy);
  border-color: var(--gold);
}

.nav-toggle {
  display: none;
  align-items: center; gap: 6px;
  background: transparent;
  border: 1px solid var(--navy);
  border-radius: 999px;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 14px;
  cursor: pointer;
  order: 1;
}
.nav-toggle:hover { background: rgba(31,42,64,0.08); }
.nav-toggle svg { flex-shrink: 0; }

@media (max-width: 1100px) {
  .nav-toggle { display: inline-flex; }
  nav.links {
    display: none;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    order: 3;
    padding: 14px 0 4px;
    border-top: 1px solid var(--line);
    margin-top: 10px;
  }
  nav.links.nav-open { display: flex; }
  nav.links a { padding: 8px 4px; border-bottom: none; border-left: 3px solid transparent; padding-left: 10px; }
  nav.links a:hover, nav.links a[aria-current="page"] { border-left-color: var(--gold); border-color: transparent; }
  .header-search { order: 4; width: 100%; }
  .header-ctas { order: 2; margin-left: auto; }
}

/* Phones: the brand takes the first row, then Menu (left) and the two pills
   (right) share the second, instead of stacking into four rows. */
@media (max-width: 600px) {
  .nav-row { padding: 14px 16px; gap: 12px; }
  .brand { flex: 1 1 100%; }
  .header-ctas { gap: 8px; }
  .header-ctas .btn-safeguarding, .header-ctas .btn-donate { padding: 12px 14px 10px; font-size: 0.88rem; }
}

/* The Benefice line under the church title, above the menu (full row of its own). --ink-soft #4B4A42 on --paper #FBF7EF is about 8:1. */
.header-benefice { flex: 1 1 100%; order: 0; margin: -10px 0 0; font-size: 0.92rem; font-style: italic; color: var(--ink-soft); line-height: 1.4; }

/* ---------- Header search ---------- */
.header-search { position: relative; flex: 1 1 220px; max-width: 320px; }
.header-search form {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon { position: absolute; left: 12px; color: var(--ink-soft); pointer-events: none; }
.header-search input[type="search"] {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  color: var(--ink);
}
.header-search input[type="search"]:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 1px; }
.site-search-results {
  list-style: none;
  margin: 6px 0 0;
  padding: 6px;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgba(20,27,43,0.18);
  z-index: 50;
  max-height: 360px;
  overflow-y: auto;
}
.site-search-results a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
}
.site-search-results a:hover, .site-search-results a:focus-visible { background: var(--chalk); }
.site-search-heading { display: block; font-weight: 600; color: var(--navy); }
.site-search-page { display: block; font-size: 0.82rem; color: var(--ink-soft); }
.site-search-empty { padding: 8px 10px; color: var(--ink-soft); }

/* ---------- Buttons ---------- */
.btn, .btn-donate, .btn-safeguarding, .btn-primary {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1; /* without this, body's line-height:1.65 pads unevenly and the text sits noticeably above center */
  padding: 13px 24px 11px;
  border-radius: 999px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  text-align: center;
}
.btn-donate {
  background: var(--rose);
  color: #fff;
}
.btn-donate:hover { background: var(--rose-dark); color: #fff; }
/* Header Safeguarding pill: white on --sage #55673F is 6.18:1; hover white on
   --sage-dark #3F4C2E is 8.6:1 (both pass AA for normal text). */
.btn-safeguarding { background: var(--sage); color: #fff; }
.btn-safeguarding:hover { background: var(--sage-dark); color: #fff; }
/* Navy ring: 14.8:1 on the cream header (3:1 needed); the gold one was too faint there. */
.btn-safeguarding:focus-visible, .btn-donate:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); color: #fff; }
.btn-outline {
  display: inline-flex; align-items: center; min-height: 44px; box-sizing: border-box;
  line-height: 1;
  padding: 12px 22px 10px;
  border-radius: 999px;
  border: 2px solid var(--navy);
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
}
.btn-outline:hover { background: var(--navy); color: #fff; }

.header-ctas { display: flex; gap: 10px; align-items: center; }

/* ---------- Page header / hero ---------- */
.page-header {
  background: var(--navy);
  color: #F3ECDC;
  padding: 56px 0 48px;
  position: relative;
  overflow: hidden;
}
.page-header::after {
  content: "";
  position: absolute;
  right: -60px; bottom: -60px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: rgba(192,138,46,0.14);
}
.page-header h1 { color: #fff; font-size: clamp(2rem, 4.2vw, 2.9rem); }
.page-header p.lede { max-width: 62ch; font-size: 1.12rem; color: #E3D9C4; }
.page-header p.lede a { color: #fff; text-decoration: underline; text-decoration-color: var(--gold-bright); }
.page-header p.lede a:hover { color: var(--gold-bright); }

.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
  padding: 72px 0 64px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  left: -120px; top: -140px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: rgba(140,59,49,0.18);
  filter: blur(40px);
}
.hero h1 { color: #fff; font-size: clamp(2.2rem, 5vw, 3.4rem); max-width: 20ch; position: relative; }
.hero p.lede { max-width: 60ch; font-size: 1.18rem; color: #E3D9C4; position: relative; }
.hero .hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 24px; position: relative; }
.hero .hero-ctas .btn-outline { border-color: #fff; color: #fff; }
.hero .hero-ctas .btn-outline:hover { background: #fff; color: var(--navy); }

.hero-photo {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(10,15,26,0.35);
  border: 1px solid rgba(255,255,255,0.14);
}
.hero-photo img { width: 100%; height: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

section { padding: 56px 0; }
section.alt { background: var(--paper); }
section h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.section-intro { max-width: 68ch; color: var(--ink-soft); }

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 22px;
  margin-top: 30px;
  list-style: none;
  padding: 0;
}
.card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 2px 0 var(--line), 0 10px 24px rgba(31,42,64,0.06);
  border-top: 4px solid var(--gold);
}
.card h3 { font-size: 1.2rem; margin-bottom: 0.35em; }
.card p:last-child { margin-bottom: 0; }
.icon-badge {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  border: 1px solid var(--line);
}
.icon-badge svg { width: 24px; height: 24px; }
/* People cards: a round 96px photo (square-cropped from portraits of any shape). */
/* Gallery: responsive grid of photos (the page shows a plain message while there are none). */
.gallery-empty { max-width: 60ch; font-size: 1.1rem; color: var(--ink-soft); }
.gallery-grid { display: flex; flex-direction: column; gap: 32px; }
/* Justified rows: each photo's width is proportional to its shape (--ratio, set per figure), so
   every photo in a row comes out the same height. The empty ::after keeps a short last row from
   stretching its photos to fill the width. */
.gallery-row { display: flex; flex-wrap: wrap; gap: 20px; }
.gallery-row::after { content: ''; flex-grow: 1000; }
.gallery-row--wide .gallery-item { flex: calc(var(--ratio) * 100) 1 calc(var(--ratio) * 240px); }
.gallery-row--tall .gallery-item { flex: calc(var(--ratio) * 100) 1 calc(var(--ratio) * 340px); }
/* The first landscape photo is a full-width banner; the rest sit in rows below it. */
.gallery-row--wide .gallery-item:first-child { flex-basis: 100%; }
.gallery-item { margin: 0; min-width: 0; }
.gallery-item img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); }
.gallery-item figcaption { margin-top: 8px; font-size: 0.9rem; color: var(--ink-soft); }
/* History page: contents list, and the rector list folded inside a details element. */
.contents { padding: 24px 0 0; }
.contents-label { font-weight: 700; color: var(--navy); margin: 0 0 6px; }
.contents-list { list-style: none; margin: 0; padding: 0; columns: 2 14em; column-gap: 32px; }
.contents-list li { break-inside: avoid; }
.contents-list a { display: inline-block; padding: 6px 0; }
.rector-details > summary { cursor: pointer; font-weight: 600; color: var(--gold-dark); min-height: 44px; display: flex; align-items: center; }
.rector-details[open] > summary { margin-bottom: 8px; }
/* History page: the recorded rectors, in columns that collapse to one on a phone. */
.rector-list { list-style: none; margin: 0 0 1.2em; padding: 0; columns: 2 16em; column-gap: 32px; }
.rector-list li { break-inside: avoid; padding: 3px 0; }
.rector-year { color: var(--ink-soft); font-variant-numeric: tabular-nums; margin-left: 0.35em; }
.person-photo { display: block; width: 96px; height: 96px; border-radius: 50%; object-fit: cover; object-position: center 20%; margin-bottom: 14px; border: 1px solid var(--line); background: #fff; }
.tags {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sage-dark);
  margin-bottom: 6px;
}
.card .meta { font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; margin-bottom: 4px; }

.fact-list { list-style: none; padding: 0; margin: 0; }
/* Label on the left, text wrapping beside it (a hanging indent). Not display:flex: every text run or inline element in a flex row becomes its own column and spills sideways. */
.fact-list li { position: relative; padding: 10px 0 10px 9.6em; border-bottom: 1px solid var(--line); }
.fact-list li > .fact-label { position: absolute; left: 0; top: 10px; width: 9em; }
@media (max-width: 560px) {
  .fact-list li { padding-left: 0; }
  .fact-list li > .fact-label { position: static; display: block; width: auto; margin-bottom: 2px; }
}
.fact-list li:last-child { border-bottom: none; }
.fact-list dt, .fact-list .fact-label { font-weight: 700; color: var(--navy); min-width: 9em; }

.links-row { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 8px; }
.links-row a { text-decoration: underline; }

.jump-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.jump-row a {
  color: #F3ECDC;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  padding: 6px 16px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.jump-row a:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* ---------- Forms ---------- */
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-weight: 700; margin-bottom: 6px; color: var(--navy); }
.form-field input[type="email"], .form-field input[type="text"] {
  width: 100%;
  max-width: 420px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
}
.hp-field { position: absolute; left: -9999px; top: -9999px; }
.form-consent { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0; max-width: 480px; }
.form-consent input { margin-top: 4px; }
.form-message { padding: 12px 16px; border-radius: var(--radius-sm); margin-top: 16px; max-width: 480px; }
.form-message.is-error { background: #F6E4E0; color: var(--rose-dark); border: 1px solid var(--rose); }
.form-message.is-success { background: #E8EDE1; color: var(--sage-dark); border: 1px solid var(--sage); }

.copy-block textarea {
  width: 100%;
  min-height: 90px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  padding: 14px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.92rem;
  background: var(--navy-dark);
  color: #E3D9C4;
}

/* ---------- Footer ---------- */
footer.site {
  background: var(--navy-dark);
  color: #D7CFB8;
  padding: 48px 0 20px;
  margin-top: 40px;
}
.foot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.foot-heading { font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.82rem; margin-bottom: 10px; }
footer.site p { margin: 0 0 6px; }
footer.site a { color: #D7CFB8; text-decoration: none; }
footer.site a:hover { color: #fff; text-decoration: underline; }
.foot-note { color: #B8AE92; font-size: 0.88rem; }
footer.site .foot-note a { text-decoration: underline; text-underline-offset: 2px; } /* a link inside a sentence must not rely on colour alone (WCAG 1.4.1) */
.foot-social { margin-top: 12px; }
.foot-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  color: #D7CFB8;
}
.foot-social a:hover, .foot-social a:focus-visible {
  color: #fff;
  border-color: #fff;
  text-decoration: none; /* an icon-only link — the border/color change is the non-text hover cue, an underline under a bare icon isn't a visible signal */
}
.fine {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 18px;
  font-size: 0.82rem;
  color: #B8AE92;
}
/* Higher specificity than "footer.site a { text-decoration: none; }" above
   (0,1,1 vs its 0,1,2 would otherwise silently lose) — the underline is
   what satisfies axe's link-in-text-block rule (this text/link color pair
   alone is under 3:1), so it has to actually win. */
footer.site .fine a { text-decoration: underline; color: #D7CFB8; }
footer.site .fine a:hover { color: #fff; }
.build-number { white-space: nowrap; }
.page-header .build-number { color: #E3D9C4; } /* same pairing as .page-header p.lede */

/* ---------- Safeguard strip / emergency box ---------- */
.safeguard-strip {
  background: var(--rose);
  color: #fff;
  padding: 14px 0;
}
.safeguard-strip .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.safeguard-strip p { margin: 0; }
.safeguard-strip a { color: #fff; text-decoration: underline; font-weight: 700; }
.email-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
/* Phone and email links on safeguarding cards are the page's main actions: at least 44px tall (WCAG 2.5.5), phone numbers larger than the rest. */
.card .email-link, .card .tap-phone, .card .tap-link { display: inline-flex; align-items: center; min-height: 44px; }
.card .tap-phone { font-size: 1.15rem; font-weight: 700; }
.after-emergency { margin-top: 32px; }
/* The four safeguarding contacts sit in a 2 x 2 grid on wider screens, one column on phones. */
.team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) { .team-grid { grid-template-columns: 1fr; } }
.email-link .email-icon { width: 1.15em; height: 1.15em; flex: none; }
.emergency-box {
  background: #F6E4E0;
  border: 1px solid var(--rose);
  border-radius: var(--radius);
  padding: 18px 22px;
  color: var(--rose-dark);
}

/* ---------- Homepage: spotlight band and "Coming up" cards ---------- */
.spotlight { background: #F6E4E0; border-bottom: 1px solid var(--rose); color: var(--rose-dark); padding: 22px 0; }
.spotlight h2 { color: var(--rose-dark); margin-bottom: 0.3em; }
.spotlight p:last-child { margin-bottom: 0; }
.spotlight a { color: var(--rose-dark); font-weight: 700; text-decoration: underline; }
.whats-next .card .wn-when { color: var(--ink-soft); font-weight: 600; margin-bottom: 2px; }
.whats-next .card .wn-where { color: var(--ink-soft); margin-bottom: 0; }
/* The links are the cards' actions: at least 44px tall (WCAG 2.5.5), as on the safeguarding cards. */
.whats-next .card .wn-link a { display: inline-flex; align-items: center; min-height: 44px; }
/* On a phone the photo would push the cards a full screen down; the Service times and Find us buttons stay. */
@media (max-width: 600px) { .hero-photo { display: none; } }

/* ---------- Special services box (services.html) ---------- */
.special-notices .card { border-top-color: var(--rose); }

/* ---------- Noticeboard ---------- */
#noticeboard .card { border-top-color: var(--sage); }
.archive-empty { color: var(--ink-soft); }

/* ---------- Google Maps embed ---------- */
.map-embed-wrap {
  margin-top: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(31,42,64,0.06);
}
iframe.map-embed { width: 100%; height: 360px; border: 0; }

/* ---------- Calendar ---------- */
.cal-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.cal-month-label { margin: 0; flex: 1; min-width: 160px; font-size: 1.4rem; }
.cal-nav, .cal-today-btn {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
  color: var(--navy);
}
.cal-nav { padding: 8px 14px; font-size: 1.1rem; line-height: 1; }
.cal-nav:hover, .cal-today-btn:hover { background: var(--chalk); }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-weekday { text-align: center; font-size: 0.78rem; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-day {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-height: 84px;
  padding: 6px;
  text-align: left;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}
.cal-day:hover { border-color: var(--gold); }
.cal-day--outside .cal-day-num { color: #6F6A5C; } /* 5.05:1 on --paper */
.cal-day--today { border-color: var(--sage); border-width: 2px; }
.cal-day--selected { background: var(--navy); border-color: var(--navy); }
.cal-day--selected .cal-day-num, .cal-day--selected .cal-chip { color: #fff; }
.cal-day-num { font-weight: 700; }
.cal-day-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-left: 5px; }
.cal-day--selected .cal-day-dot { background: var(--gold-bright); }
.cal-day-chips { display: flex; flex-direction: column; gap: 2px; }
.cal-chip { font-size: 0.68rem; color: var(--ink-soft); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip--more { font-weight: 700; }
.cal-agenda { margin-top: 26px; background: var(--paper); border-radius: var(--radius); padding: 22px; }
.cal-agenda-heading { margin-top: 0; }
.cal-agenda-dayname { margin: -0.25rem 0 0.75rem; font-style: italic; }
.cal-agenda-list { list-style: none; padding: 0; margin: 0; }
.cal-agenda-list li { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cal-agenda-list li:last-child { border-bottom: none; }
.cal-agenda-time { font-weight: 700; color: var(--gold-dark); min-width: 5.5em; }
.cal-agenda-location { color: var(--ink-soft); }
.cal-agenda-empty { color: var(--ink-soft); margin: 0; }

@media (max-width: 640px) {
  .cal-day { min-height: 64px; }
  .cal-chip { display: none; }
  .cal-day-chips { display: none; }
}

/* ---------- 404 page ---------- */
.notfound { min-height: 60vh; display: flex; align-items: center; padding: 60px 0; }
.notfound-card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 48px;
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  box-shadow: 0 10px 30px rgba(31,42,64,0.08);
}
.notfound-card h1 { font-size: 2.2rem; }
.notfound-spire { color: var(--navy); display: block; margin: 0 auto 4px; }
.notfound-code { font-family: 'Fraunces', serif; font-size: 3.4rem; font-weight: 700; line-height: 1; margin: 0 0 8px; color: var(--gold); letter-spacing: 0.06em; }
.notfound-lede { color: var(--ink-soft); }
.notfound-card h2 { font-size: 1.15rem; margin: 36px 0 14px; }
.notfound-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; text-align: left; }
.notfound-links a { display: block; height: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--navy); text-decoration: none; }
.notfound-links a:hover, .notfound-links a:focus-visible { border-color: var(--gold-bright); box-shadow: 0 2px 10px rgba(31,42,64,0.12); }
.notfound-links strong { display: block; }
.notfound-links span { font-size: 0.92rem; color: var(--ink-soft); }
@media (max-width: 480px) { .notfound-card { padding: 32px 22px; } .notfound-links { grid-template-columns: 1fr; } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Updates / changelog ---------- */
.changelog-entry { padding: 16px 0; border-bottom: 1px solid var(--line); }
.changelog-entry:last-child { border-bottom: none; }
.changelog-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 4px; }
.changelog-build { font-weight: 700; color: var(--navy); }

/* ---------- Utility ---------- */
/* minmax(0, ...) lets a column shrink below its widest child instead of pushing the page sideways on phones. */
.two-col { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 40px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: minmax(0, 1fr); } }
/* Long links and code (the help guide, the changelog) wrap rather than widen the page; code blocks scroll inside themselves. */
main a, main code { overflow-wrap: anywhere; }
main pre { max-width: 100%; overflow-x: auto; }
.small-print { font-size: 0.88rem; color: var(--ink-soft); }

/* Groups page: the "check the calendar" note above the cards. */
.group-note { max-width: 70ch; margin: 0 0 24px; font-size: 1.05rem; color: var(--ink-soft); }
