/*
Theme Name: St Nicholas
Theme URI: https://stnicholaslondon.org/
Author: IOANK
Author URI: https://ioank.com/
Description: Custom theme for St Nicholas Greek Orthodox Cathedral, Shepherd's Bush. Keeps the parish's own look (blue, gold, the round icon) set in EB Garamond and Commissioner, both with full Greek, and adds services and notices that update the site by themselves.
Version: 2.6.0
Requires at least: 6.4
Requires PHP: 8.0
License: Proprietary
Text Domain: stnicholas
*/

/*
 * House rules (see README):
 * - Two fonts: EB Garamond for every heading (600, plus 400 italic for accent lines),
 *   Commissioner for all text (400 and 500). Both draw Greek.
 * - Sizes only from the --fs-* scale below.
 * - One gold on white. Pale gold only on blue.
 * - Sections are separated by space and the parchment band, not by lines.
 * - Image shapes: posters 3:4 shown whole in a frame, photos 3:2, page cards 4:5.
 * - No sideways scrolling on phones.
 */

/* ---------- Tokens ---------- */
:root {
	--blue: #2c5879;          /* header and footer, from the live site */
	--blue-deep: #234764;     /* menu panel, buttons */
	--gold: #b8893f;          /* the one gold on white: headings, accents */
	--gold-light: #e9c28a;    /* on blue only */
	--red: #a3262a;           /* the rule in the logo; feast days */
	--ink: #1d2a3f;           /* titles */
	--text: #3a4659;          /* body text */
	--muted: #66718a;         /* labels, secondary text */
	--rule: #e6e1d6;          /* the few lines that remain */
	--parch: #f7f2e8;         /* alternate section band, poster frames */
	--paper: #ffffff;

	--display: "EB Garamond", "GFS Didot", Georgia, serif;
	--body: "Commissioner", system-ui, -apple-system, "Segoe UI", sans-serif;

	/* Type scale: every size on the site comes from here. */
	--fs-xs: 0.75rem;                                       /* uppercase labels */
	--fs-sm: 0.875rem;                                      /* meta, buttons, small links */
	--fs-base: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);    /* body text */
	--fs-md: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);     /* ledes */
	--fs-lg: clamp(1.25rem, 1.18rem + 0.3vw, 1.4375rem);    /* card titles (serif) */
	--fs-xl: clamp(1.5rem, 1.35rem + 0.6vw, 1.75rem);       /* sub headings (serif) */
	--fs-2xl: clamp(1.875rem, 1.6rem + 1.1vw, 2.375rem);    /* section headings */
	--fs-3xl: clamp(2.125rem, 1.7rem + 2vw, 3.25rem);       /* page headings */

	--gutter: 20px;
	--max: 1200px;
	--space: clamp(56px, 7vw, 96px);
	--radius: 6px;
}
@media (min-width: 720px) { :root { --gutter: 32px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
	margin: 0; background: var(--paper); color: var(--text);
	font-family: var(--body); font-weight: 400; font-size: var(--fs-base); line-height: 1.65;
	text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--blue-deep); text-decoration-color: var(--gold); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 3px; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.15; text-wrap: balance; }
/* Finishing touches: no lonely last words, proper kerning and ligatures, calm taps and selection. */
p, li, dd, dt, figcaption, blockquote, .section-sub, .door-text, .news-excerpt, .poster-cap, .svc-card-type, .svc-card-note { text-wrap: pretty; }
.card-title, .svc-card-title, .poster-cap, .page-title, .section-title { text-wrap: balance; }
body { font-kerning: normal; font-variant-ligatures: common-ligatures contextual; }
a, button, .btn, .slider-btn, .pdfv-btn, .doc-tab, .nav-toggle { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
::selection { background: var(--gold-light); color: var(--ink); }
p { margin: 0 0 1em; }
address { font-style: normal; }
strong, b { font-weight: 500; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--blue); color: #fff; padding: 10px 16px; border-radius: 6px; }
.skip-link:focus { top: 12px; color: #fff; }
.plain { list-style: none; margin: 0; padding: 0; }
.empty { color: var(--muted); max-width: 46ch; }

/* ---------- Shared pieces ---------- */
.display { font-family: var(--display); font-weight: 600; color: var(--gold); letter-spacing: -0.005em; }
.display em { display: block; font-weight: 400; font-style: italic; }
.section-title { font-size: var(--fs-2xl); line-height: 1.15; }
.section-head { margin-bottom: clamp(24px, 3vw, 36px); max-width: 60ch; }
.section-sub { margin: 10px 0 0; color: var(--text); }
.section-more { margin: clamp(28px, 3vw, 40px) 0 0; }

.label { display: block; font: 500 var(--fs-xs)/1.4 var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.card-title { display: block; font: 600 var(--fs-lg)/1.25 var(--display); color: var(--ink); margin: 0; }

.band { padding-block: var(--space); }
.band-parch { background: var(--parch); }

/* Key facts: label and value pairs, no lines. */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 24px; margin: 32px 0 0; }
.facts > div { min-width: 0; }
.facts dt { font: 500 var(--fs-xs)/1.4 var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 6px 0 0; color: var(--ink); line-height: 1.5; }
.facts a { font-weight: 500; text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 1.5px; text-underline-offset: 0.3em; }
.facts-stack { grid-template-columns: minmax(0, 1fr); margin: 0; gap: 24px; }
@media (max-width: 599px) { .facts { grid-template-columns: minmax(0, 1fr); gap: 16px; } }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 46px; padding: 0 24px; border-radius: 100px;
	font: 500 var(--fs-sm)/1 var(--body); text-decoration: none; border: 1.5px solid transparent;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-gold { background: var(--gold-light); color: var(--blue-deep); }
.btn-gold:hover { background: #fff; color: var(--blue-deep); }
.btn-line { border-color: var(--blue-deep); color: var(--blue-deep); }
.btn-line:hover { background: var(--blue-deep); color: #fff; }

/* ---------- Header ---------- */
.site-header { background: var(--blue); color: #fff; position: relative; z-index: 20; }
.site-header a { color: var(--gold-light); text-decoration: none; }
.site-header a:hover { color: #fff; }
.site-header :focus-visible { outline-color: var(--gold-light); }

.topbar { border-bottom: 1px solid rgba(255, 255, 255, 0.12); font-size: var(--fs-sm); }
.topbar-inner { display: flex; justify-content: center; gap: 22px; padding-block: 7px; }

.masthead { display: flex; align-items: center; justify-content: center; position: relative; padding-block: 22px 12px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.brand-logo { max-height: 96px; width: auto; }
.brand-icon { width: 84px; height: 84px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12); }
.brand-words { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.brand-el { font: 600 var(--fs-md)/1.15 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: #fff; }
.brand-en { font: 500 var(--fs-xs)/1.2 var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.85); }
.brand-rule { width: 100%; max-width: 380px; height: 2px; background: var(--red); }
.brand-en-short { display: none; }

.nav-toggle {
	position: absolute; right: var(--gutter); top: 50%; transform: translateY(-50%);
	display: inline-flex; align-items: center; justify-content: center;
	width: 48px; height: 48px; padding: 0; border: 0; border-radius: 8px;
	background: transparent; color: var(--gold-light); cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
}
.nav-toggle:hover, .nav-open .nav-toggle { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-toggle-bars { position: relative; width: 24px; height: 16px; }
.nav-toggle-bars span {
	position: absolute; left: 0; width: 100%; height: 2px; border-radius: 2px; background: currentColor;
	transition: transform .3s cubic-bezier(.2, .7, .2, 1), opacity .2s ease, top .3s cubic-bezier(.2, .7, .2, 1);
}
.nav-toggle-bars span:nth-child(1) { top: 0; }
.nav-toggle-bars span:nth-child(2) { top: 7px; }
.nav-toggle-bars span:nth-child(3) { top: 14px; }
.nav-open .nav-toggle-bars span:nth-child(1) { top: 7px; transform: rotate(45deg); }
.nav-open .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle-bars span:nth-child(3) { top: 7px; transform: rotate(-45deg); }

.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list .sub-menu { list-style: none; padding: 0; margin: 0; }
.site-header .nav-donate { background: var(--gold-light); color: var(--blue-deep); }
.site-header .nav-donate:hover { background: #fff; color: var(--blue-deep); }
.nav-extra { display: none; }

/* Phones and tablets: slim sticky bar; the menu opens as a calm full panel with no lines. */
@media (max-width: 999px) {
	.site-header { position: sticky; top: 0; }
	.topbar { display: none; }
	.site-nav {
		position: fixed; left: 0; right: 0; top: var(--header-h, 80px); bottom: 0;
		background: var(--blue-deep); overflow-y: auto; overscroll-behavior: contain;
		visibility: hidden; opacity: 0; transform: translateY(-8px);
		transition: opacity .25s ease, transform .3s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .3s;
	}
	.nav-open .site-nav { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
	.nav-open { overflow: hidden; }
	.nav-inner { display: flex; flex-direction: column; padding-block: 28px 48px; max-width: 560px; }
	.nav-list > li { opacity: 0; transform: translateY(6px); transition: opacity .35s ease, transform .35s ease; transition-delay: calc(var(--i, 0) * 35ms + 60ms); }
	.nav-open .nav-list > li { opacity: 1; transform: none; }
	.nav-list a { display: block; padding: 8px 0; font: 500 var(--fs-xl)/1.2 var(--display); color: #fff; }
	/* A parent item with children becomes a small group label. */
	.nav-list > .menu-item-has-children > a { font: 500 var(--fs-xs)/1.4 var(--body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-light); padding: 20px 0 4px; }
	.site-header .nav-list a:hover, .nav-list .current-menu-item > a, .nav-list .current_page_item > a { color: var(--gold-light); }
	.site-header .nav-donate { margin-top: 32px; width: 100%; min-height: 52px; font-size: var(--fs-base); }
	.nav-extra { display: grid; gap: 8px; margin-top: 28px; font-size: var(--fs-sm); }
	.nav-extra-links { display: grid; gap: 8px; margin-top: 12px; }
	.site-header .nav-extra-links a { color: rgba(255, 255, 255, 0.7); }
}

@media (max-width: 720px) {
	.masthead { justify-content: flex-start; padding-block: 12px; padding-right: calc(var(--gutter) + 60px); }
	.brand { flex-direction: row; text-align: left; gap: 12px; }
	.brand-icon { width: 48px; height: 48px; }
	.brand-words { align-items: stretch; min-width: 0; gap: 4px; }
	.brand-el, .brand-en { white-space: nowrap; }
	.brand-el { font-size: min(var(--fs-md), calc((100vw - 160px) / 21.5)); letter-spacing: 0.05em; }
	.brand-en { font-size: min(var(--fs-xs), calc((100vw - 160px) / 23)); letter-spacing: 0.1em; }
	.brand-en-full { display: none; }
	.brand-en-short { display: inline; }
}
@media (max-width: 379px) {
	.brand { gap: 10px; }
	.brand-icon { width: 40px; height: 40px; }
}

/* Desktop: centred menu under the mark, gold underline that grows on hover. */
@media (min-width: 1000px) {
	.nav-toggle { display: none; }
	.nav-inner { display: flex; align-items: center; justify-content: center; gap: 32px; padding-block: 6px 16px; }
	.nav-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 26px; }
	.nav-list > li { position: relative; }
	.nav-list a { position: relative; display: block; padding: 8px 0; font-size: var(--fs-base); }
	.nav-list > li > a::after {
		content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1.5px; background: currentColor;
		transform: scaleX(0); transition: transform .3s cubic-bezier(.2, .7, .2, 1);
	}
	.nav-list > li > a:hover::after, .nav-list > .current-menu-item > a::after, .nav-list > .current_page_item > a::after { transform: scaleX(1); }
	.nav-list .current-menu-item > a, .nav-list .current_page_item > a { color: #fff; }
	.nav-list .sub-menu {
		display: none; position: absolute; top: 100%; left: -16px; min-width: 220px;
		background: var(--blue-deep); padding: 8px 16px; border-radius: 8px;
	}
	.nav-list li:hover > .sub-menu, .nav-list li:focus-within > .sub-menu { display: block; }
	.site-header .nav-donate { margin: 0; min-height: 40px; padding: 0 24px; }
}

/* ---------- Welcome ---------- */
.hero { padding-block: clamp(32px, 6vw, 80px); }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; } }
.hero-title { font-size: var(--fs-3xl); line-height: 1.08; margin-bottom: 24px; }
.hero-intro { max-width: 34em; }
.hero-intro p:last-child { margin-bottom: 0; }
.hero-art { margin: 0; }
.hero-art img { width: 100%; max-width: 41rem; margin-inline: auto; }
@media (max-width: 959px) {
	.hero-grid { gap: 28px; }
	.hero-art { order: -1; padding-inline: 8%; }
	.hero-art img { max-width: 24rem; }
	.hero-title { margin-bottom: 16px; }
}

/* ---------- Services ---------- */
/* Homepage slider: swipe on phones, arrows on larger screens. */
.svc-track {
	position: relative; list-style: none; margin: 0; padding: 0 0 20px; display: flex; gap: 16px;
	overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-behavior: smooth;
	scrollbar-width: none;
}
.svc-track::-webkit-scrollbar { display: none; }
/* A thin line in the section's own colours shows where you are, in place of the browser's scroll bar. */
.slider-progress { position: relative; height: 2px; margin-top: 4px; background: rgba(29, 42, 63, 0.12); border-radius: 2px; overflow: hidden; }
.slider-progress span { position: absolute; top: 0; bottom: 0; left: 0; width: 25%; background: var(--gold); border-radius: 2px; transition: left .15s linear; }
.svc-track:focus-visible { outline-offset: 6px; }
.svc-track > .svc-card { flex: 0 0 min(82%, 320px); scroll-snap-align: start; }
@media (min-width: 700px) { .svc-track > .svc-card { flex-basis: calc((100% - 16px) / 2); } }
@media (min-width: 1000px) { .svc-track > .svc-card { flex-basis: calc((100% - 32px) / 3); } }
@media (min-width: 1300px) { .svc-track > .svc-card { flex-basis: calc((100% - 48px) / 4); } }
.slider-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.slider-btns { display: flex; gap: 10px; }
.slider-btn {
	display: inline-grid; place-items: center; width: 46px; height: 46px; padding: 0; border-radius: 50%;
	border: 1.5px solid var(--blue-deep); background: transparent; color: var(--blue-deep); cursor: pointer;
	transition: background-color .15s ease, color .15s ease, opacity .15s ease;
}
.slider-btn svg { width: 20px; height: 20px; }
.slider-btn:hover:not(:disabled) { background: var(--blue-deep); color: #fff; }
.slider-btn:disabled { opacity: 0.3; cursor: default; }

.svc-card {
	position: relative; display: flex; flex-direction: column;
	background: var(--paper); border: 1px solid var(--rule); border-left: 3px solid var(--gold);
	border-radius: var(--radius); padding: 20px 22px;
	transition: border-color .25s ease;
}
.band-parch .svc-card { border-color: transparent; border-left-color: var(--gold); }
.svc-card:hover { border-color: var(--gold); }
.svc-card.is-today { border-left-width: 5px; }
.svc-card p { margin: 0; }
.svc-card-date { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font: 500 var(--fs-sm)/1.4 var(--body); color: var(--ink); }
.svc-card-today { display: inline-block; padding: 1px 8px; border-radius: 3px; font: 500 var(--fs-xs)/1.6 var(--body); letter-spacing: 0.08em; text-transform: uppercase; background: var(--blue); color: #fff; }
.svc-card-title { font: 600 var(--fs-lg)/1.25 var(--display); color: var(--ink); margin-top: 10px; }
.svc-cross { color: var(--gold); margin-right: 2px; }
.svc-card-type { color: var(--text); margin-top: 6px !important; }
.svc-card-note { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px !important; }
.svc-card-time { display: flex; align-items: center; gap: 8px; margin-top: auto !important; padding-top: 14px; font: 500 var(--fs-sm)/1.4 var(--body); color: var(--blue); font-variant-numeric: tabular-nums; }
.svc-card-time svg, .svc-card-ics svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.svc-card-ics { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font: 500 var(--fs-sm)/1.4 var(--body); color: var(--blue); text-decoration: none; }
.svc-card-ics:hover { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 0.3em; }

/* Buttons with an icon, e.g. Full schedule and Sunday bulletin. */
.btn .icon { width: 18px; height: 18px; flex: none; }
.doc-links { display: flex; flex-wrap: wrap; gap: 10px; }
.page-head .doc-links { margin-top: 24px; }

/* Schedule page: two tabs, one document at a time. */
.page-head-tight { margin-bottom: 24px; }
.doc-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.doc-tab {
	display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 100px;
	border: 1.5px solid var(--blue-deep); color: var(--blue-deep); font: 500 var(--fs-sm)/1 var(--body); text-decoration: none;
	transition: background-color .15s ease, color .15s ease;
}
.doc-tab .icon { width: 18px; height: 18px; }
.doc-tab:hover { color: var(--blue-deep); background: var(--parch); }
.doc-tab[aria-current="page"] { background: var(--blue-deep); color: #fff; }
.docs { padding-bottom: var(--space); }
@media (max-width: 599px) {
	.doc-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.doc-tab { justify-content: center; padding: 0 10px; gap: 6px; white-space: nowrap; }
	.doc-tab-long { display: none; }
}
@media (min-width: 600px) { .doc-tab-short { display: none; } }

/* ---------- PDF viewer ---------- */
.doc-section { padding-block: clamp(32px, 5vw, 64px); scroll-margin-top: 88px; }
.doc-section .section-sub { margin-bottom: 24px; }
.pdfv { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); overflow: hidden; }
.pdfv-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 10px; border-bottom: 1px solid var(--rule); background: var(--paper); }
.pdfv-group { display: flex; align-items: center; gap: 4px; }
.pdfv-btn {
	display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 8px;
	background: transparent; color: var(--blue-deep); cursor: pointer; text-decoration: none; transition: background-color .15s ease;
}
.pdfv-btn .icon { width: 20px; height: 20px; }
.pdfv-btn:hover:not(:disabled) { background: var(--parch); color: var(--blue-deep); }
.pdfv-btn:disabled { opacity: 0.3; cursor: default; }
.pdfv-pages { display: flex; align-items: center; gap: 8px; font: 500 var(--fs-sm)/1 var(--body); color: var(--muted); }
.pdfv-num { width: 44px; height: 34px; border: 1px solid var(--rule); border-radius: 6px; text-align: center; font: 500 var(--fs-sm)/1 var(--body); color: var(--ink); font-variant-numeric: tabular-nums; background: var(--paper); }
.pdfv-num:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.pdfv-pct { min-width: 46px; text-align: center; font: 500 var(--fs-sm)/1 var(--body); color: var(--muted); font-variant-numeric: tabular-nums; }
.pdfv-full-off, .pdfv.is-full .pdfv-full-on { display: none; }
.pdfv.is-full .pdfv-full-off { display: contents; }
.pdfv-full-on { display: contents; }
.pdfv-stage { position: relative; background: var(--parch); padding: clamp(12px, 3vw, 32px); overflow: auto; text-align: center; outline: none; min-height: 240px; }
.band-parch .pdfv-stage { background: #efe8da; }
.pdfv-stage:focus-visible { box-shadow: inset 0 0 0 3px var(--blue); }
.pdfv-stage.is-zoomed { max-height: 85vh; text-align: left; }
.pdfv-sheet { display: inline-block; vertical-align: top; transition: opacity .14s ease; }
.pdfv-sheet canvas { display: block; max-width: none; background: #fff; border-radius: 2px; box-shadow: 0 1px 3px rgba(29, 42, 63, 0.12), 0 8px 24px -12px rgba(29, 42, 63, 0.25); }
.pdfv-sheet.is-turning { opacity: 0; }
.pdfv-sheet.is-loading canvas { width: min(100%, 560px); aspect-ratio: 1 / 1.414; height: auto; background: linear-gradient(100deg, #fff 40%, #f4efe4 50%, #fff 60%) 0 0 / 200% 100%; animation: pdfv-shimmer 1.4s linear infinite; }
@keyframes pdfv-shimmer { to { background-position: -200% 0; } }
.pdfv-fallback { display: none; margin: 0; }
.pdfv-fallback a { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.pdfv-fallback .icon { width: 20px; height: 20px; }
.pdfv:not(.is-ready) .pdfv-bar, .pdfv:not(.is-ready) .pdfv-sheet, .pdfv.is-error .pdfv-sheet { display: none; }
.pdfv:not(.is-ready) .pdfv-fallback, .pdfv.is-error .pdfv-fallback { display: block; padding: 24px 0; }
.pdfv:not(.is-ready) .pdfv-stage, .pdfv.is-error .pdfv-stage { min-height: 0; }
.pdfv.is-full { display: flex; flex-direction: column; border: 0; border-radius: 0; background: var(--paper); }
.pdfv.is-full .pdfv-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.pdfv.is-full .pdfv-stage.is-zoomed { max-height: none; display: block; }
@media (max-width: 599px) {
	.pdfv-bar { flex-wrap: nowrap; padding: 6px 4px; gap: 2px; }
	.pdfv-group { gap: 0; }
	.pdfv-pages { gap: 4px; }
	.pdfv-num { width: 36px; }
	.pdfv-btn { width: 36px; height: 40px; }
	.pdfv-btn .icon { width: 19px; height: 19px; }
	.pdfv-pct, .pdfv-zoom [data-act="fit"] { display: none; }
	.pdfv-stage { padding: 10px; }
}
.schedule-list-title { margin: clamp(40px, 5vw, 64px) 0 24px; }

/* Schedule page: the same cards, one under another. */
.schedule { padding-bottom: var(--space); }
.month-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
.month-jump a { padding: 8px 18px; border: 1px solid var(--rule); border-radius: 100px; text-decoration: none; color: var(--blue-deep); font: 500 var(--fs-sm) var(--body); }
.month-jump a:hover { border-color: var(--blue-deep); }
.schedule-month { max-width: 860px; margin-bottom: 56px; scroll-margin-top: 96px; }
.schedule-month-title { font: 400 italic var(--fs-xl)/1.2 var(--display); color: var(--gold); margin-bottom: 16px; }
.svc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 700px) { .svc-list .svc-card { padding: 22px 26px; } }

/* ---------- Announcements ---------- */
.notice-grid { display: grid; gap: 40px; max-width: 72ch; }
.notice .card-title { margin-bottom: 10px; }
.notice-body p:last-child { margin-bottom: 0; }

/* ---------- Our parish: three ways in ---------- */
.door-grid { display: grid; gap: 28px; }
@media (min-width: 700px) { .door-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
.door { display: block; color: inherit; text-decoration: none; }
.door-media { display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius); background: var(--parch); margin-bottom: 16px; }
.door-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; transition: transform .5s ease; }
.door:hover .door-media img { transform: scale(1.03); }
.door:hover .card-title { color: var(--blue); }
.door-text { display: block; margin-top: 6px; color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; }
@media (max-width: 699px) {
	.door { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: center; }
	.door-media { margin: 0; }
}

/* ---------- A word from the priest ---------- */
.word-grid { display: grid; gap: 28px; align-items: center; max-width: 880px; }
@media (min-width: 700px) { .word-grid { grid-template-columns: 160px minmax(0, 1fr); gap: 40px; } }
.word-photo { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; }
.word-body { margin: 0; }
.word-body blockquote { margin: 0 0 16px; font: 400 italic var(--fs-xl)/1.4 var(--display); color: var(--ink); }
.word-body blockquote p:last-child { margin-bottom: 0; }

/* ---------- Posters: whole, in equal 3:4 frames ---------- */
.poster-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
@media (min-width: 700px) { .poster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; } }
@media (min-width: 1100px) { .poster-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.poster { margin: 0; min-width: 0; }
.poster-link { display: block; text-decoration: none; }
.poster-frame { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: var(--radius); background: var(--parch); overflow: hidden; }
.band-parch .poster-frame { background: var(--paper); }
.poster-frame img {
	position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px);
	object-fit: contain; transition: transform .3s cubic-bezier(.2, .7, .2, 1);
}
.poster-link:hover .poster-frame img { transform: translateY(-3px); }
.poster-cap { margin-top: 10px; font: 600 var(--fs-md)/1.25 var(--display); color: var(--ink); }

.lightbox { border: 0; padding: 0; background: transparent; max-width: min(92vw, 760px); max-height: 92vh; overflow: visible; }
.lightbox::backdrop { background: rgba(14, 24, 38, 0.86); }
.lightbox img { max-height: 88vh; width: auto; max-width: 100%; margin: 0 auto; border-radius: 4px; }
.lightbox-close { position: absolute; top: -14px; right: -14px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; }

/* ---------- News: one picture shape ---------- */
.news-grid { display: grid; gap: 36px 28px; }
@media (min-width: 640px) { .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .news-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.news-link { display: block; color: inherit; text-decoration: none; }
.news-media { display: block; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius); background: var(--parch); margin-bottom: 16px; }
.news-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transition: transform .5s ease; }
.news-link:hover .news-media img { transform: scale(1.03); }
.news-link:hover .card-title { color: var(--blue); }
.news-media-empty { display: flex; height: 100%; align-items: center; justify-content: center; color: var(--gold); }
.news-media-empty svg { width: 22px; }
.news-excerpt { color: var(--muted); font-size: var(--fs-sm); line-height: 1.6; margin: 8px 0 0; }

/* News and Events page */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tabs a { padding: 9px 20px; border: 1px solid var(--rule); border-radius: 100px; text-decoration: none; color: var(--blue-deep); font: 500 var(--fs-sm)/1.2 var(--body); }
.tabs a:hover { border-color: var(--blue-deep); }
.tabs a[aria-current="page"] { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }
.archive { padding-bottom: var(--space); }
.pager { padding-top: 48px; }
.pager .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pager .page-numbers { padding: 8px 14px; border: 1px solid var(--rule); border-radius: 100px; text-decoration: none; font-size: var(--fs-sm); }
.pager .page-numbers.current { background: var(--blue-deep); color: #fff; border-color: var(--blue-deep); }

/* ---------- Visit us ---------- */
.visit-grid { display: grid; gap: 32px; }
@media (min-width: 900px) { .visit-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: start; } }
.visit .section-sub { max-width: 40ch; }
@media (min-width: 640px) { .visit .facts-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Footer ---------- */
.site-footer { background: var(--blue); color: #d4dfea; padding: 56px 0 24px; font-size: var(--fs-sm); }
.site-footer a { color: var(--gold-light); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer :focus-visible { outline-color: var(--gold-light); }
.footer-grid { display: grid; gap: 36px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 48px; } .footer-news { grid-column: 1 / -1; max-width: 420px; } }
@media (min-width: 1040px) { .footer-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 0.9fr); gap: 64px; } .footer-news { grid-column: auto; } }
.footer-links { columns: 2; column-gap: 32px; }
.footer-links li { break-inside: avoid; }
.footer-contact-list { margin-top: 14px; }
.footer-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.footer-brand img { width: 56px; height: 56px; border-radius: 50%; flex: none; }
.footer-name { font: 600 var(--fs-lg)/1.2 var(--display); color: #fff; margin: 0; }
.footer-parish address { line-height: 1.6; }
.footer-head { font: 500 var(--fs-xs)/1.4 var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: #fff; margin-bottom: 14px; }
.site-footer .plain li { margin-bottom: 8px; }
.footer-base {
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
	margin-top: 48px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.14);
	font-size: var(--fs-xs); color: #a9bccf;
}
.footer-base p { margin: 0; }

/* ---------- Inner pages ---------- */
.page-head { padding-block: clamp(32px, 5vw, 64px) 0; margin-bottom: clamp(28px, 4vw, 48px); }
.page-head-grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .page-head.has-image .page-head-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 64px; } }
.page-arch { margin: 0; }
.page-arch img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.page-title { font: 600 var(--fs-3xl)/1.08 var(--display); color: var(--gold); max-width: 20ch; }
.page-lede { font-size: var(--fs-md); color: var(--muted); max-width: 46ch; margin: 16px 0 0; }

.prose { max-width: 68ch; padding-bottom: var(--space); line-height: 1.75; }
.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0; }
.prose p + p { margin-top: 1em; }
.prose h2 { font: 600 var(--fs-2xl)/1.15 var(--display); color: var(--gold); margin-top: 1.6em; }
.prose h3 { font: 600 var(--fs-xl)/1.2 var(--display); color: var(--ink); margin-top: 1.5em; }
.prose h4 { font: 500 var(--fs-base)/1.4 var(--body); color: var(--ink); margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin-bottom: 0; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--gold); }
.prose blockquote { margin-left: 0; padding-left: 22px; border-left: 2px solid var(--gold); font: 400 italic var(--fs-xl)/1.4 var(--display); color: var(--ink); }
.prose img { border-radius: var(--radius); height: auto; }
.prose figure { margin-left: 0; margin-right: 0; }
.prose figcaption, .prose .wp-element-caption { font-size: var(--fs-sm); color: var(--muted); margin-top: 8px; }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose th { font-weight: 500; color: var(--ink); }
.prose hr { border: 0; height: 0; margin: 2.4em 0; }
.prose .wp-block-button__link { background: var(--blue-deep); color: #fff; border-radius: 100px; padding: 14px 26px; font: 500 var(--fs-sm)/1 var(--body); text-decoration: none; }
.prose .wp-block-button__link:hover { background: var(--blue); }
.prose .is-style-outline .wp-block-button__link { background: transparent; color: var(--blue-deep); border: 1.5px solid var(--blue-deep); }
.prose iframe { width: 100%; border: 0; border-radius: var(--radius); }
.prose .wp-block-columns { gap: 32px; }
.prose .wp-block-gallery { gap: 12px; }
.prose .wp-block-image img { width: 100%; }
/* Media & Text blocks: clergy and similar profiles, all photos the same size. */
.prose .wp-block-media-text { display: grid; gap: 24px 36px; align-items: start; margin-top: 3em; }
.prose > .wp-block-media-text:first-child { margin-top: 0; }
@media (min-width: 700px) {
	.prose .wp-block-media-text { grid-template-columns: 220px minmax(0, 1fr) !important; }
	.prose .wp-block-media-text__media { position: sticky; top: 112px; }
}
.prose .wp-block-media-text__media { margin: 0; }
.prose .wp-block-media-text__media img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; }
@media (max-width: 699px) { .prose .wp-block-media-text__media img { max-width: 260px; } }
.prose .wp-block-media-text__content { padding: 0 !important; }
.prose .wp-block-media-text__content > * + * { margin-top: 1em; }
.prose .wp-block-media-text__content h2 { margin-top: 0; }
.prose .is-style-rounded img, .prose .round img { border-radius: 50%; }
.prose input[type=text], .prose input[type=email], .prose input[type=tel], .prose textarea, .prose select {
	width: 100%; font: inherit; padding: 12px 14px; border: 1px solid #cfc8b8; border-radius: 8px; background: #fff;
}
.prose input[type=submit], .prose button[type=submit] {
	font: 500 var(--fs-sm) var(--body); background: var(--blue-deep); color: #fff; border: 0; border-radius: 100px; padding: 14px 28px; cursor: pointer;
}

.article-grid.has-image { display: grid; gap: 40px; align-items: start; }
@media (min-width: 900px) {
	.article-grid.has-image { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 64px; }
	.article-image { position: sticky; top: 32px; }
}
.article-image { margin: 0; max-width: 560px; }
.article-image img { width: 100%; height: auto; border-radius: var(--radius); }
.article-grid .article-nav { grid-column: 1 / -1; }
.article-nav { display: flex; justify-content: space-between; gap: 24px; padding: 0 0 var(--space); max-width: 70ch; font-weight: 500; }
.article-nav .next { margin-left: auto; text-align: right; }

/* ---------- Forms: contact, sacraments, newsletter ---------- */
.sn-form { display: grid; gap: 20px; max-width: 640px; margin-top: 1.6em; }
.field-row { display: grid; gap: 20px; }
@media (min-width: 600px) { .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field { display: grid; align-content: start; gap: 8px; min-width: 0; }
.field > label, .field > legend { font: 500 var(--fs-sm)/1.4 var(--body); color: var(--ink); padding: 0; }
.field .req { color: var(--muted); font-weight: 400; }
.sn-form :where(input:not([type=checkbox]):not([type=radio]), textarea, select) {
	scroll-margin-top: 140px;
	width: 100%; min-width: 0; height: 48px; font: 400 var(--fs-base)/1.4 var(--body); color: var(--ink);
	padding: 12px 14px; border: 1px solid #cfc8b8; border-radius: 8px; background: #fff;
	transition: border-color .15s ease, box-shadow .15s ease; appearance: none; -webkit-appearance: none;
}
.sn-form textarea { height: auto; min-height: 150px; resize: vertical; line-height: 1.6; }
.sn-form select {
	padding-right: 42px; cursor: pointer;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23234764' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 18px;
}
.sn-form input:focus, .sn-form textarea:focus, .sn-form select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(44, 88, 121, 0.18); }
.sn-form .field :is(input, textarea, select)[aria-invalid="true"] { border-color: var(--red); }
.field-error { font-size: var(--fs-sm); color: var(--red); margin: 0; }
.field-hint { font-size: var(--fs-sm); color: var(--muted); margin: 0; }
.sn-form .btn-send { background: var(--blue-deep); color: #fff; border: 0; cursor: pointer; justify-self: start; }
.sn-form .btn-send:hover { background: var(--blue); }
.sn-form .btn-send .icon { width: 18px; height: 18px; }
.sn-form button[disabled] { opacity: .6; cursor: progress; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.form-foot .field-hint { flex: 1 1 240px; }
.form-status { margin: 0; font-size: var(--fs-sm); }
.form-status:empty { display: none; }
.form-status.is-ok { color: var(--blue-deep); padding: 14px 16px; background: var(--parch); border-radius: 8px; font-size: var(--fs-base); }
.form-status.is-err { color: var(--red); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ts:empty { display: none; }

/* Newsletter in the footer */
.footer-note { margin: 0 0 14px; }
.newsletter { gap: 10px; margin: 0; max-width: 380px; }
.newsletter-row { display: flex; align-items: center; gap: 8px; }
.newsletter-row input { flex: 1 1 auto; min-width: 0; }
.newsletter-row .btn { flex: none; height: 46px; min-height: 0; white-space: nowrap; }
.site-footer .sn-form.newsletter input { height: 46px; border: 1px solid rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.08); color: #fff; font-size: var(--fs-sm); padding: 10px 14px; }
.site-footer .sn-form.newsletter input::placeholder { color: #a9bccf; }
.site-footer .sn-form.newsletter input:focus { border-color: var(--gold-light); box-shadow: none; }
.site-footer .newsletter .btn { flex: none; border: 0; cursor: pointer; padding: 0 18px; }
.site-footer .form-status { color: #fff; }
.site-footer .form-status.is-ok { background: rgba(255, 255, 255, 0.1); color: #fff; font-size: var(--fs-sm); }
.site-footer .form-status.is-err, .site-footer .field-error { color: var(--gold-light); }
.site-footer .sn-form.newsletter input[aria-invalid="true"] { border-color: var(--gold-light); }
.footer-base .footer-church { display: flex; flex-wrap: wrap; gap: 4px 20px; }

/* Contact details and trustees */
.prose .contact-facts { margin-top: 1.6em; }
@media (min-width: 600px) { .prose .contact-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.prose .trustees { display: grid; gap: 0; margin-top: 1.6em; }
.trustees > div { display: grid; gap: 4px 24px; padding: 16px 0; border-top: 1px solid var(--rule); }
.trustees > div:last-child { border-bottom: 1px solid var(--rule); }
@media (min-width: 640px) { .trustees > div { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); } }
.trustees dt { font: 500 var(--fs-xs)/1.5 var(--body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.trustees dd { margin: 0; color: var(--ink); line-height: 1.6; }

/* Map on Finding Us */
.map-embed { margin-top: 1.6em; aspect-ratio: 4 / 3; max-width: 100%; border-radius: var(--radius); overflow: hidden; background: var(--parch); }
@media (min-width: 700px) { .map-embed { aspect-ratio: 16 / 10; } }
.map-embed iframe { width: 100%; height: 100%; border: 0; display: block; }

@media print {
	.site-header, .site-footer, .hero-art, .month-jump { display: none; }
	body { font-size: 12pt; }
}

/* ---------- Large and very large screens: everything scales up together ---------- */
@media (min-width: 1600px) { html { font-size: 106.25%; } :root { --max: 1320px; --gutter: 40px; } }
@media (min-width: 2000px) { html { font-size: 118.75%; } :root { --max: 1520px; } }
@media (min-width: 2600px) { html { font-size: 137.5%; } :root { --max: 1800px; } }

/* ---------- Gentle motion: content eases in as it scrolls into view ---------- */
.js [data-rv] {
	opacity: 0; transform: translateY(16px);
	transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1);
	transition-delay: var(--d, 0ms);
}
.js [data-rv].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	.js [data-rv] { opacity: 1; transform: none; transition: none; }
	.svc-card, .svc-track, .poster-frame img, .news-media img, .door-media img, .nav-list > li, .site-nav, .nav-toggle-bars span { transition: none !important; }
	.poster-link:hover .poster-frame img, .news-link:hover .news-media img, .door:hover .door-media img { transform: none; }
}
