/* Layout: one quiet column under a band in the liturgical colour of the season; reads like a well-kept parish noticeboard. */
:root {
  --ground: #F2F3F1;
  --surface: #FFFFFF;
  --stone: #E6E8E4;
  --rule: #D5D8D2;
  --ink: #1C2130;
  --ink-soft: #4B5263;
  --ink-faint: #7A8090;
  --season: #3D6A4C;
  --season-wash: #E2EBE4;
  --on-season: #FFFFFF;
  --display: "Libre Caslon Display", "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --body: "Alegreya Sans", "Gill Sans", "Segoe UI", system-ui, sans-serif;
  --caps: "Alegreya Sans SC", "Alegreya Sans", "Gill Sans", system-ui, sans-serif;
  --radius: 6px;
  /* One colour per village, muted like old vestments and glass */
  --v-cub: #8E2B2B; --v-ste: #1C6564; --v-win: #7F5B0F; --v-ast: #5A4590; --v-men: #2B5789; --v-che: #97461C; --v-wng: #7B3363; --v-sou: #4A6623;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #13161C; --surface: #1B1F27; --stone: #232833; --rule: #2F3540;
    --ink: #EAE8E3; --ink-soft: #AEB3BE; --ink-faint: #858B97;
    --season: #8DBF9C; --season-wash: #1D2922; --on-season: #13161C;
    --v-cub: #E58F88; --v-ste: #72C4C0; --v-win: #D8B55E; --v-ast: #B6A6E8; --v-men: #90B5E4; --v-che: #E7A472; --v-wng: #DE91C4; --v-sou: #A9C47C;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #13161C; --surface: #1B1F27; --stone: #232833; --rule: #2F3540;
  --ink: #EAE8E3; --ink-soft: #AEB3BE; --ink-faint: #858B97;
  --season: #8DBF9C; --season-wash: #1D2922; --on-season: #13161C;
    --v-cub: #E58F88; --v-ste: #72C4C0; --v-win: #D8B55E; --v-ast: #B6A6E8; --v-men: #90B5E4; --v-che: #E7A472; --v-wng: #DE91C4; --v-sou: #A9C47C;
  color-scheme: dark;
}
/* Liturgical seasons (set on <body> by script) */
.s-purple { --season: #5A3E78; --season-wash: #ECE6F2; }
.s-gold   { --season: #876717; --season-wash: #F2EDDD; }
.s-red    { --season: #8F2E2B; --season-wash: #F4E3E1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .s-purple { --season: #BCA3DA; --season-wash: #282033; }
  :root:not([data-theme="light"]) .s-gold   { --season: #D8B866; --season-wash: #2C2719; }
  :root:not([data-theme="light"]) .s-red    { --season: #E28C84; --season-wash: #321F1E; }
}
:root[data-theme="dark"] .s-purple { --season: #BCA3DA; --season-wash: #282033; }
:root[data-theme="dark"] .s-gold   { --season: #D8B866; --season-wash: #2C2719; }
:root[data-theme="dark"] .s-red    { --season: #E28C84; --season-wash: #321F1E; }

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--season); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--season); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; text-wrap: balance; margin: 0; line-height: 1.15; }
p { margin: 0; }
.wrap { max-width: 1140px; margin: 0 auto; padding-inline: 20px; }

/* Season band + header */
.band { height: 6px; background: var(--season); }
.masthead { border-bottom: 1px solid var(--rule); background: var(--surface); }
.masthead .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand svg { flex: none; }
.brand-name { font-family: var(--display); font-size: clamp(1.55rem, 4.2vw, 1.9rem); line-height: 1; }
.brand-name { display: inline-block; }
.brand-sub { display: inline-block; margin-left: 0.9em; font-family: var(--caps); font-size: 0.8rem; letter-spacing: 0.06em; color: var(--ink-faint); }
nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; }
nav a { font-family: var(--caps); font-weight: 500; letter-spacing: 0.05em; font-size: 0.95rem; color: var(--ink-soft); text-decoration: none; }
nav a:hover { color: var(--season); }


/* Banner of the eight churches */
.churches { background: var(--season-wash); border-bottom: 1px solid var(--rule); }
.churches ul { list-style: none; margin: 0; padding: 9px 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; }
.churches li { display: inline-flex; align-items: center; font-family: var(--caps); font-size: 0.86rem; letter-spacing: 0.04em; line-height: 1.4; }
.churches li + li::before { content: "✠"; color: var(--season); font-size: 0.7rem; margin: 0 0.75em; opacity: 0.8; }
.churches a { color: var(--ink-soft); text-decoration: none; white-space: nowrap; }
.churches a .vil { color: var(--ink); font-weight: 700; }
.churches a:hover, .churches a:hover .vil { color: var(--season); }
@media (max-width: 560px) { .churches li { font-size: 0.8rem; } .churches li + li::before { margin: 0 0.5em; } }
.notice { background: var(--season-wash); color: var(--ink); font-size: 0.92rem; }
.notice .wrap { padding-block: 9px; }

/* Hero: photograph of the Vale with a soft wash so the words stay readable */
.hero {
  --photo: url("/.netlify/images?url=/img/vale-of-aylesbury.jpg&w=1600&fm=webp");
  position: relative;
  background-color: var(--ground);
  background-image:
    linear-gradient(90deg, var(--ground) 0%, color-mix(in srgb, var(--ground) 88%, transparent) 34%, color-mix(in srgb, var(--ground) 20%, transparent) 72%, transparent 100%),
    var(--photo);
  background-size: cover, cover;
  background-position: center, center 62%;
  border-bottom: 1px solid var(--rule);
}
.hero h1, .hero .lede { text-shadow: 0 0 18px color-mix(in srgb, var(--ground) 70%, transparent); }
.hero .lede { color: var(--ink); }
.hero .map-card { background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
@media (max-width: 880px) {
  .hero { background-image:
    linear-gradient(180deg, color-mix(in srgb, var(--ground) 92%, transparent) 0%, color-mix(in srgb, var(--ground) 82%, transparent) 55%, color-mix(in srgb, var(--ground) 30%, transparent) 100%),
    var(--photo); }
}
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: center; padding-block: 56px 40px; }
.eyebrow { font-family: var(--caps); font-weight: 500; letter-spacing: 0.09em; font-size: 0.85rem; color: var(--season); display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); margin-top: 14px; letter-spacing: -0.005em; }
.hero .lede { margin-top: 18px; max-width: 34em; font-size: 1.15rem; color: var(--ink-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.btn { display: inline-flex; align-items: center; gap: 8px; font: 500 0.98rem var(--body); padding: 10px 18px; border-radius: var(--radius); border: 1px solid var(--season); background: var(--season); color: var(--on-season); text-decoration: none; cursor: pointer; }
.btn:hover { color: var(--on-season); filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--season); }
.btn.ghost:hover { background: var(--season-wash); color: var(--season); filter: none; }

.map-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 14px 10px; }
.map-card svg { width: 100%; height: auto; display: block; }
.map-card .vill { cursor: pointer; }
.map-card .vill text { font-family: var(--body); font-size: 12.5px; fill: var(--ink); }
.map-card .vill:hover text, .map-card .vill.on text { fill: var(--season); font-weight: 700; }
.map-cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; font-size: 0.82rem; color: var(--ink-faint); padding: 6px 4px 0; }
.key { display: inline-flex; align-items: center; gap: 6px; }
.key i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Sections */
section.block { padding-block: 44px; }
section.block + section.block { border-top: 1px solid var(--rule); }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 22px; }
.sec-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.25rem); }
.sec-head p { color: var(--ink-soft); }
.muted { color: var(--ink-faint); }

/* This Sunday */
.sunday { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.sunday-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 16px 20px; background: var(--season-wash); border-bottom: 1px solid var(--rule); }
.sunday-head h3 { font-size: 1.45rem; }
.sunday-head span { color: var(--ink-soft); }
.sunday-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sunday-cell { padding: 14px 20px 16px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); min-width: 0; }
.sunday-cell:nth-child(4n) { border-right: 0; }
.sunday-cell:nth-last-child(-n+4) { border-bottom: 0; }
.sunday-cell h4 { margin: 0 0 6px; font: 700 0.86rem var(--caps); letter-spacing: 0.06em; color: var(--season); }
.svc { display: grid; grid-template-columns: 4.1em minmax(0, 1fr); gap: 2px 8px; font-size: 0.97rem; }
.svc + .svc { margin-top: 6px; }
.svc .t { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.svc .d { color: var(--ink-soft); min-width: 0; overflow-wrap: anywhere; }
.svc.notime { grid-template-columns: minmax(0, 1fr); }
.none { color: var(--ink-faint); font-style: italic; font-size: 0.95rem; }

/* Rota controls */
.controls { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.tabs { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--rule); }
.tab { appearance: none; border: 0; background: none; font: 400 1.25rem var(--display); color: var(--ink-soft); padding: 8px 18px 10px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: baseline; gap: 8px; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--season); }
.tab:hover { color: var(--ink); }
.pill { font: 700 0.68rem var(--caps); letter-spacing: 0.08em; text-transform: lowercase; padding: 2px 7px 3px; border-radius: 99px; background: var(--stone); color: var(--ink-soft); }
.pill.season { background: var(--season); color: var(--on-season); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { appearance: none; font: 500 0.92rem var(--body); padding: 6px 13px; border-radius: 99px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink-soft); cursor: pointer; }
.chip:hover { border-color: var(--season); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--season); border-color: var(--season); color: var(--on-season); }
.prov { font-size: 0.94rem; color: var(--ink-soft); background: var(--season-wash); border-radius: var(--radius); padding: 10px 14px; }

/* Rota grid (wide) */
.grid-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
table.rota { border-collapse: collapse; width: 100%; min-width: 980px; font-size: 0.9rem; table-layout: fixed; }
table.rota col.c-when { width: 8.5rem; }
table.rota td { overflow-wrap: anywhere; }
table.rota th, table.rota td { border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); padding: 10px 10px; vertical-align: top; text-align: left; }
table.rota tr > *:last-child { border-right: 0; }
table.rota tbody tr:last-child > * { border-bottom: 0; }
table.rota thead th { font: 700 0.82rem var(--caps); letter-spacing: 0.06em; color: var(--ink-soft); background: var(--stone); }
table.rota thead tr.side th { font-family: var(--caps); font-weight: 500; color: var(--ink-faint); background: var(--surface); text-align: center; }
table.rota th.when { width: 8.5rem; background: var(--surface); }
table.rota tbody th { font-weight: 400; }
.when .day { font-family: var(--display); font-size: 1.12rem; color: var(--ink); line-height: 1.15; display: block; }
.when .note { font-size: 0.82rem; color: var(--ink-faint); display: block; margin-top: 2px; }
table.rota .svc { grid-template-columns: minmax(0, 1fr); font-size: 0.9rem; }
table.rota .svc .t { display: inline; }
tr.past { opacity: 0.45; }
tr.next th.when { box-shadow: inset 3px 0 0 var(--season); }
.nextflag { display: inline-block; margin-top: 6px; }

/* Rota cards (narrow / single church) */
.cards { display: flex; flex-direction: column; gap: 12px; }
.day-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); }
.day-card.past { opacity: 0.5; }
.day-card.next { border-color: var(--season); box-shadow: 0 0 0 1px var(--season); }
.day-card .when { padding: 14px 16px; border-right: 1px solid var(--rule); }
.day-card .list { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.church-line { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 4px 12px; }
.church-line .cn { font: 700 0.84rem var(--caps); letter-spacing: 0.05em; color: var(--season); padding-top: 2px; }
.single .church-line { grid-template-columns: minmax(0, 1fr); }
.single .church-line .cn { display: none; }
.rota-grid { display: block; }
.rota-cards { display: none; }
.is-single .rota-grid { display: none; }
.is-single .rota-cards { display: flex; }
@media (max-width: 999px) {
  .rota-grid { display: none; }
  .rota-cards { display: flex; }
}
.empty-state { background: var(--surface); border: 1px dashed var(--rule); border-radius: var(--radius); padding: 22px; color: var(--ink-soft); }

/* Events */
.events { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; align-items: start; }
.event { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: 14px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px; }
.event.has-img { align-content: start; }
.event .ev-img { grid-column: 1 / -1; display: block; margin: -16px -16px 2px; aspect-ratio: 16 / 9; max-width: none; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: var(--stone); border-bottom: 1px solid var(--rule); }
.event .ev-img img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; transition: transform .3s; }
@media (prefers-reduced-motion: no-preference) { .event .ev-img:hover img { transform: scale(1.03); } }
.cal { text-align: center; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; align-self: start; }
.cal .m { background: var(--season); color: var(--on-season); font: 700 0.72rem var(--caps); letter-spacing: 0.1em; padding: 3px 0; }
.cal .d { font-family: var(--display); font-size: 1.7rem; line-height: 1.25; padding: 4px 0 2px; }
.cal .w { font-size: 0.72rem; color: var(--ink-faint); padding-bottom: 4px; }
.event h3 { font-size: 1.22rem; }
.event .where { font-family: var(--caps); font-size: 0.86rem; letter-spacing: 0.05em; color: var(--season); margin-top: 3px; }
.event p { font-size: 0.96rem; color: var(--ink-soft); margin-top: 6px; }
.event .series { font: 700 0.8rem var(--caps); letter-spacing: 0.05em; color: var(--ink-soft); margin-top: 2px; }

/* Coming up: church filter, clusters */
.ev-chips { margin-bottom: 18px; }
.ev-more-wrap { display: flex; justify-content: center; margin-top: 16px; }
.event .lead { font-size: 0.9rem; color: var(--ink-faint); margin-top: 2px; }
.ev-toggle { appearance: none; display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font: 500 0.9rem var(--body); color: var(--season); background: none; border: 1px solid var(--rule); border-radius: 99px; padding: 5px 12px; cursor: pointer; }
.ev-toggle:hover { border-color: var(--season); background: var(--season-wash); }
.ev-toggle .arrow { transition: transform .2s; }
.ev-toggle[aria-expanded="true"] .arrow { transform: rotate(180deg); }
.ev-list { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.ev-item { appearance: none; width: 100%; display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: 1px 10px; text-align: left; padding: 8px 6px; background: none; border: 0; border-bottom: 1px solid var(--rule); color: var(--ink); font: inherit; cursor: pointer; border-radius: 0; }
.ev-item:hover { background: var(--season-wash); }
.ev-item .ev-when { grid-row: span 2; font-size: 0.82rem; line-height: 1.3; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.ev-item .ev-vil { font: 700 0.8rem var(--caps); letter-spacing: 0.05em; }
.ev-item .ev-what { font-size: 0.9rem; color: var(--ink-soft); min-width: 0; overflow-wrap: anywhere; }
.event a.more { display: inline-block; margin-top: 8px; font-size: 0.92rem; }

/* Calling */
.calling { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 44px; align-items: start; }
.calling-words { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.together { margin: 0; position: relative; }
.together img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--rule); }
.together figcaption { margin-top: 10px; font-size: 0.9rem; color: var(--ink-faint); font-style: italic; }
.calling blockquote { margin: 0; font-family: var(--display); font-size: clamp(1.35rem, 2.3vw, 1.7rem); line-height: 1.35; color: var(--ink); border-left: 2px solid var(--season); padding-left: 22px; }
.calling .prose { display: flex; flex-direction: column; gap: 14px; max-width: 38em; color: var(--ink-soft); font-size: 1.08rem; }

/* People */
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.person { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.person-top { display: flex; gap: 16px; align-items: center; }
.portrait { width: 96px; height: 96px; border-radius: 50%; flex: none; overflow: hidden; background: var(--season-wash); color: var(--season); display: grid; place-items: center; font-family: var(--display); font-size: 1.9rem; border: 1px solid var(--rule); }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; display: block; }
.person h3 { font-size: 1.35rem; }
.person .role { font-family: var(--caps); font-weight: 500; letter-spacing: 0.05em; font-size: 0.9rem; color: var(--season); margin-top: 3px; }
.person .bio { color: var(--ink-soft); font-size: 0.99rem; }
.mail { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 12px; border-top: 1px solid var(--rule); }
.mail .addr { font-size: 0.92rem; color: var(--ink-soft); overflow-wrap: anywhere; user-select: all; }
.mail.direct { flex-direction: column; align-items: stretch; gap: 6px; }
.mail .via { font-size: 0.92rem; color: var(--ink-soft); }
.mail .line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.mail .lbl { font: 700 0.74rem var(--caps); letter-spacing: 0.08em; color: var(--season); width: 3.6em; }
.mail a.addr { color: var(--ink); text-decoration-color: var(--rule); font-variant-numeric: tabular-nums; }
.mail a.addr:hover { color: var(--season); }
.btn.small { padding: 6px 12px; font-size: 0.9rem; }
.copy { appearance: none; border: 1px solid var(--rule); background: none; color: var(--ink-soft); font: 500 0.85rem var(--body); padding: 5px 10px; border-radius: var(--radius); cursor: pointer; }
.copy:hover { border-color: var(--season); color: var(--ink); }
.example { align-self: flex-start; }

/* Contact */
.contact { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; }
.contact-main { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.contact-main h3 { font-size: 1.5rem; }
.contact-main .big { font-size: clamp(0.98rem, 3.6vw, 1.15rem); overflow-wrap: anywhere; }
.links { display: flex; flex-direction: column; gap: 0; }
.links a { display: flex; justify-content: space-between; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.links a:first-child { border-top: 1px solid var(--rule); }
.links a span { color: var(--ink-faint); }
.links a:hover { color: var(--season); }



/* Find us */
.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.place { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.place h3 { font-size: 1.35rem; }
.place .ded { font-family: var(--caps); font-size: 0.86rem; letter-spacing: 0.04em; color: var(--ink-soft); }
.place address { font-style: normal; font-size: 0.95rem; color: var(--ink-soft); margin-top: 6px; }
.place .pc { font-weight: 700; color: var(--ink); letter-spacing: 0.03em; }
.place .note { font-size: 0.88rem; color: var(--ink-faint); font-style: italic; }
.place-links { margin-top: auto; padding-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.92rem; }
/* Giving */
.intro { max-width: 40em; color: var(--ink-soft); font-size: 1.05rem; margin-bottom: 20px; }
.give-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.give { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; }
.give > div { display: flex; flex-direction: column; min-width: 0; }
.give .vil { font-family: var(--display); font-size: 1.2rem; line-height: 1.2; }
.give .ded { font-size: 0.88rem; color: var(--ink-faint); }
.give .soon { font: 500 0.82rem var(--caps); letter-spacing: 0.05em; color: var(--ink-faint); white-space: nowrap; }
.give .btn { white-space: nowrap; }
/* Safeguarding */
.safe { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.safe .prose { display: flex; flex-direction: column; gap: 14px; color: var(--ink-soft); font-size: 1.05rem; max-width: 38em; }
.safe-box { background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--season); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.safe-box h3 { font-size: 1.35rem; }
.safe-box p { color: var(--ink-soft); font-size: 0.98rem; }
.safe-contact { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--rule); }
.safe-contact .who { font-weight: 500; }
.safe-contact a { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.safe-box .urgent { background: var(--season-wash); color: var(--ink); border-radius: 4px; padding: 10px 12px; }
@media (max-width: 880px) { .safe { grid-template-columns: minmax(0, 1fr); gap: 22px; } }

/* Print a copy of the rota */
.print-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-top: 4px; }
.print-row label { font-size: 0.94rem; color: var(--ink-soft); }
.print-row select { font: 500 0.94rem var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 7px 10px; max-width: 100%; }
.print-row .btn svg { flex: none; }

.sheet-overlay { position: fixed; inset: 0; z-index: 60; overflow: auto; background: color-mix(in srgb, var(--ground) 88%, transparent); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); padding: 0 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
.sheet-bar { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 -16px; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px; background: var(--surface); border-bottom: 1px solid var(--rule); }
.sheet-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sheet-info strong { font-family: var(--display); font-weight: 400; font-size: 1.2rem; }
.sheet-info span { font-size: 0.88rem; color: var(--ink-soft); }
.sheet-actions { display: flex; gap: 8px; }

/* The printed page: always ink on white paper, whatever the screen theme */
.sheet-page { --v-cub: #8E2B2B; --v-ste: #1C6564; --v-win: #7F5B0F; --v-ast: #5A4590; --v-men: #2B5789; --v-che: #97461C; --v-wng: #7B3363; --v-sou: #4A6623;
  --p-ink: #1c2130; --p-soft: #4b5263; --p-faint: #7a8090; --p-rule: #cfd3cc; --p-accent: #3d5a46; --p-wash: #eef1ec;
  background: #ffffff; color: var(--p-ink); width: min(100%, 780px); margin: 20px auto; padding: 32px 36px; border-radius: 4px; box-shadow: 0 2px 22px rgba(20, 24, 32, 0.18); font-family: var(--body); }
.sheet-page.landscape { width: min(100%, 1160px); padding: 26px 28px; }
.ps-head { display: flex; align-items: center; gap: 14px; padding-bottom: 12px; border-bottom: 2px solid var(--p-accent); margin-bottom: 14px; }
.ps-head svg { flex: none; color: var(--p-accent); }
.ps-eyebrow { font: 700 0.78rem var(--caps); letter-spacing: 0.1em; color: var(--p-accent); margin: 0; }
.ps-head h1 { font-family: var(--display); font-weight: 400; font-size: 1.9rem; line-height: 1.15; margin: 2px 0 0; color: var(--p-ink); }
.ps-head.church h1 { font-size: 2.2rem; }
.ps-sub { font-family: var(--display); font-size: 1.3rem; color: var(--p-soft); margin: 4px 0 0; }
.ps-prov { background: var(--p-wash); border-radius: 3px; padding: 6px 10px; font-size: 0.86rem; color: var(--p-ink); margin: 0 0 12px; }
.ps-scroll { overflow-x: auto; }
.ps-table { width: 100%; min-width: 900px; border-collapse: collapse; table-layout: fixed; font-size: 0.8rem; line-height: 1.35; }
.ps-table col.w { width: 7.2rem; }
.ps-table th, .ps-table td { border: 1px solid var(--p-rule); padding: 6px 6px; vertical-align: top; text-align: left; overflow-wrap: anywhere; }
.ps-table thead th { font: 700 0.74rem var(--caps); letter-spacing: 0.05em; background: var(--p-wash); color: var(--p-ink); }
.ps-table thead tr.side th { background: #fff; color: var(--p-faint); text-align: center; font-weight: 500; }
.ps-table thead tr.side th:first-child { border-left-color: #fff; border-top-color: #fff; }
.ps-table tbody th { font-weight: 400; }
.ps-table .d, .ps-row .d { display: block; font-family: var(--display); font-size: 1rem; color: var(--p-ink); line-height: 1.2; }
.ps-table .n, .ps-row .n { display: block; font-size: 0.72rem; color: var(--p-faint); margin-top: 2px; }
.sheet-page .svc { display: block; font-size: inherit; }
.sheet-page .svc + .svc { margin-top: 4px; }
.sheet-page .svc .t { font-weight: 700; color: var(--p-ink); margin-right: 4px; }
.sheet-page .svc .d { display: inline; font-family: var(--body); font-size: inherit; color: var(--p-soft); }
.ps-list { display: flex; flex-direction: column; }
.ps-row { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--p-rule); }
.ps-row .d { font-size: 1.15rem; }
.ps-row .n { font-size: 0.8rem; }
.ps-svcs { font-size: 1.02rem; line-height: 1.45; }
.ps-also { font-size: 0.86rem; color: var(--p-soft); margin: 14px 0 0; }
.ps-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--p-rule); font-size: 0.74rem; color: var(--p-faint); }
@media (max-width: 560px) {
  .sheet-page { padding: 20px 16px; }
  .ps-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .ps-head.church h1 { font-size: 1.6rem; }
}

@media print {
  html.printing, html.printing body { background: #ffffff !important; }
  html.printing { padding: 0 !important; overflow: visible !important; color-scheme: light !important; }
  html.printing body > *:not(#print-sheet) { display: none !important; }
  html.printing #print-sheet { position: static; display: block !important; overflow: visible; background: none; backdrop-filter: none; padding: 0; }
  html.printing .sheet-bar { display: none !important; }
  html.printing .sheet-page { width: auto !important; margin: 0; padding: 0; box-shadow: none; border-radius: 0; }
  html.printing .ps-scroll { overflow: visible; }
  html.printing .ps-table { min-width: 0; font-size: 7.6pt; }
  html.printing .ps-table col.w { width: 22mm; }
  html.printing .ps-table tr, html.printing .ps-row { break-inside: avoid; }
  html.printing * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
footer { background: var(--surface); border-top: 1px solid var(--rule); margin-top: 20px; }
footer .wrap { padding-block: 26px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; font-size: 0.9rem; color: var(--ink-faint); }
footer a { color: var(--ink-soft); }

.loading { color: var(--ink-faint); font-style: italic; }

@media (max-width: 880px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); padding-block: 36px 28px; gap: 26px; }
  .map-card { max-width: 460px; }
  .calling, .contact { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .sunday-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sunday-cell:nth-child(4n) { border-right: 1px solid var(--rule); }
  .sunday-cell:nth-child(2n) { border-right: 0; }
  .sunday-cell:nth-last-child(-n+4) { border-bottom: 1px solid var(--rule); }
  .sunday-cell:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 560px) {
  .wrap { padding-inline: 16px; }
  nav ul { gap: 4px 14px; }
  .sunday-grid { grid-template-columns: minmax(0, 1fr); }
  .sunday-cell { border-right: 0 !important; }
  .sunday-cell:nth-last-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .sunday-cell:last-child { border-bottom: 0; }
  .day-card { grid-template-columns: minmax(0, 1fr); }
  .day-card .when { border-right: 0; border-bottom: 1px solid var(--rule); padding: 10px 16px; }
  .church-line { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .tab { font-size: 1.1rem; padding: 8px 12px 10px; }
}
@media (prefers-reduced-motion: no-preference) {
  .chip, .tab, .btn { transition: background-color .15s, color .15s, border-color .15s; }
}

.skip-link { position: absolute; left: 16px; top: 12px; transform: translateY(-180%); z-index: 10; padding: 10px 16px; background: var(--surface); color: var(--ink); }
.skip-link:focus { transform: translateY(0); }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
