/* St Mary's Prestwich — single site stylesheet.
   No frameworks, no build step: edit this file and redeploy.
   Layout switches from mobile (stacked) to desktop (side banner) at 64rem. */

/* ---------- Design tokens ---------- */
:root {
	--ink: #2e282a; /* body text */
	--bg: #fff9f9; /* page background */
	--hover: #ffedfd; /* nav/button hover background */
	--panel: #faf4f4; /* open mobile menu group background */
	--header-h: max(7vh, 3rem); /* mobile header height */
}

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

html {
	scrollbar-gutter: stable;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family:
		ui-sans-serif,
		system-ui,
		-apple-system,
		'Segoe UI',
		Roboto,
		'Helvetica Neue',
		Arial,
		sans-serif;
	line-height: 1.5;
}

h1 {
	font-size: 2.25rem;
	margin: 0 0 1rem;
}

h2 {
	font-size: 1.875rem;
	margin: 0 0 0.75rem;
}

h3 {
	font-size: 1.5rem;
	margin: 0 0 0.5rem;
}

p,
li {
	font-size: 1.125rem;
}

p {
	margin: 0 0 1.25rem;
}

ul {
	margin: 0 0 1.25rem;
}

li {
	margin-bottom: 0.25rem;
}

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

.no-underline {
	text-decoration: none;
}

img {
	max-width: 100%;
	height: auto;
}

section {
	margin-bottom: 2rem;
}

/* ---------- Accessibility ---------- */
:focus-visible {
	outline: 3px solid var(--ink);
	outline-offset: 2px;
}

.skip-link {
	position: absolute;
	left: 0.5rem;
	top: 0.5rem;
	z-index: 100;
	padding: 0.5rem 1rem;
	background: var(--bg);
	border: 1px solid var(--ink);
	transform: translateY(-300%);
}

.skip-link:focus {
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition: none !important;
		animation: none !important;
	}
}

/* ---------- Page layout ---------- */
/* Mobile: header, then landscape banner, then content, in normal flow. */
.site-header {
	min-height: var(--header-h);
}

.banner {
	position: relative;
	height: max(33vh, 15rem);
}

.content {
	max-width: 70ch;
	padding: 0.5rem 1rem 2rem;
}

.site-header > nav {
	height: 100%;
}

/* Desktop: portrait banner fills a fixed left column; nav and a scrolling
   content column sit on the right. */
@media (min-width: 64rem) {
	.page {
		display: grid;
		grid-template-columns: 33% 67%;
		grid-template-rows: 10vh 1fr;
		height: 100vh;
	}

	.banner {
		grid-column: 1;
		grid-row: 1 / 3;
		height: 100vh;
	}

	.site-header {
		grid-column: 2;
		grid-row: 1;
		min-height: 0;
	}

	main {
		grid-column: 2;
		grid-row: 2;
		overflow-y: auto;
	}

	.content {
		padding: 0.5rem 2.5rem 2rem;
	}
}

/* ---------- Banner ---------- */
.banner picture,
.banner img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top;
}

.banner-overlay {
	position: absolute;
	inset: 0;
	display: grid;
	align-items: center;
	padding: 0.5rem 1.5rem;
	background: linear-gradient(to right, #09090b, transparent);
}

.banner-title,
.banner-subtitle {
	color: #fff;
	margin: 0;
}

.banner-title {
	font-size: clamp(1.5rem, 6vw, 2.8rem);
	font-weight: 700;
	line-height: 1.2;
	margin-bottom: 1.5rem;
}

.banner-subtitle {
	font-size: clamp(1rem, 4vw, 1.5rem);
}

@media (min-width: 64rem) {
	.banner-overlay {
		padding-left: 3rem;
		padding-right: 3rem;
	}

	.banner-title,
	.banner-subtitle {
		max-width: 80%;
	}
}

/* ---------- Navigation (shared) ---------- */
/* Menus are <details>/<summary> disclosures: they work with no JavaScript,
   are keyboard operable, and report open/closed state to screen readers. */
.nav-list,
.nav-list ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nav-list li {
	margin: 0;
	font-size: inherit;
}

nav a {
	display: block;
	border: 1px solid transparent;
	padding: 0.25rem;
	text-decoration: underline;
}

nav a:hover {
	background-color: var(--hover);
	border-color: var(--ink);
}

nav summary {
	cursor: pointer;
	border: 1px solid transparent;
	padding: 0.25rem;
	list-style: none; /* hide the default disclosure triangle... */
}

nav summary::-webkit-details-marker {
	display: none; /* ...and in older WebKit */
}

nav summary:hover {
	background-color: var(--hover);
	border-color: var(--ink);
}

/* Match the old nav affordance: ↓ closed, ↲ open. */
.nav-group > summary::after {
	content: ' \2193';
	font-family: ui-monospace, monospace;
}

.nav-group[open] > summary::after {
	content: ' \21B2';
}

/* Bold the current page and its parent menu. */
nav a[aria-current='page'],
.nav-group-active > summary {
	font-weight: 600;
}

/* ---------- Desktop navigation ---------- */
.nav-desktop {
	display: none;
}

@media (min-width: 64rem) {
	.nav-desktop {
		display: flex;
		align-items: center;
		height: 100%;
		margin-left: 1.75rem;
		font-size: 1rem;
	}

	.nav-desktop .nav-list {
		display: flex;
		align-items: center;
	}

	.nav-desktop .nav-list > li {
		padding: 0 0.25rem;
	}

	.nav-desktop .nav-group {
		position: relative;
	}

	.nav-desktop .nav-group > ul {
		position: absolute;
		left: 0;
		top: calc(100% + 0.25rem);
		z-index: 10;
		min-width: 100%;
		width: max-content;
		background: var(--bg);
		border: 1px solid var(--ink);
		text-align: center;
	}

	.nav-desktop .nav-group > ul a {
		font-size: 0.85em;
		padding: 0.5em;
	}
}

@media (min-width: 80rem) {
	.nav-desktop {
		font-size: 1.125rem;
	}
}

/* ---------- Mobile navigation ---------- */
.nav-mobile {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	min-height: var(--header-h);
	padding-right: 1.25rem;
	font-size: 1.5rem;
}

.menu-root > summary::after {
	content: ' \2630'; /* ☰ */
}

.menu-root[open] > summary::after {
	content: ' \2715'; /* ✕ */
}

/* The open menu covers the viewport below the header, like the old site. */
.menu-root > .nav-list {
	position: fixed;
	top: var(--header-h);
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 20;
	overflow-y: auto;
	background: var(--bg);
	padding: 0.5rem 0 2rem;
	text-align: center;
}

.menu-root .nav-list > li {
	padding: 0.25rem 0;
}

.menu-root a {
	padding: 0.5rem 0.25rem;
}

.menu-root .nav-group > summary {
	padding: 0.5rem 0.25rem;
}

.menu-root .nav-group[open] {
	background: var(--panel);
	border: 1px solid #6b7280;
}

.menu-root .nav-group > ul {
	font-size: 1.25rem;
	padding-bottom: 0.5rem;
}

/* This must come after the .nav-mobile rules above to win the cascade. */
@media (min-width: 64rem) {
	.nav-mobile {
		display: none;
	}
}

/* ---------- Content patterns ---------- */
/* Upcoming events (home, notices, adult education). */
.events ul {
	list-style: none;
	padding: 0;
}

.events li {
	margin-bottom: 0.75rem;
}

/* Who's Who cards. */
.person {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	margin-bottom: 2.5rem;
}

.person img {
	max-height: 12rem;
	width: auto;
	margin-inline: auto;
}

.person-details {
	min-width: 16rem;
}

/* Centred inline images (choir photo, heritage fund logo). */
.img-center {
	display: block;
	width: 70%;
	margin: 2rem auto;
}

.img-logo {
	display: block;
	width: min(40%, 20rem);
	margin: 1.25rem auto 2rem;
}

/* The funeral prayer. */
.prayer {
	text-align: center;
	padding: 2rem 0;
}

.prayer h2 {
	font-size: 1.125rem;
	font-weight: 600;
}

.prayer p {
	font-style: italic;
}
