/*
Theme Name: St Andrew & St Paul
Theme URI: https://standrewstpaul.com/
Description: Child theme of Twenty Twenty-Five for The Church of St. Andrew and St. Paul. Brand colours and typography, header/footer, and event templates. No third-party code.
Author: Anthony Bachour
Template: twentytwentyfive
Version: 1.14.6
Requires at least: 6.7
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: standrewstpaul
*/

/* =========================================================
   Base
   ========================================================= */
:root {
	--sasp-rule: 1px solid var(--wp--preset--color--accent-6);
	--sasp-radius: 3px;
	--sasp-section: clamp(2.75rem, 2rem + 3vw, 4.5rem);
}

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: #cce9e1; color: var(--wp--preset--color--contrast); }

h1, h2, h3, h4 { text-wrap: balance; }
p, li { text-wrap: pretty; }


a:where(:not(.wp-element-button)) {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}
a:where(:not(.wp-element-button)):hover { text-decoration-thickness: 2px; }

/* Visible, consistent keyboard focus */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-1);
	outline-offset: 3px;
	border-radius: 2px;
}

/* =========================================================
   Header
   ========================================================= */
.sasp-header {
	padding-block: 1.1rem 0;
	border-bottom: var(--sasp-rule);
	background: var(--wp--preset--color--base);
}
.sasp-header__top { gap: var(--wp--preset--spacing--30); }
.sasp-header .wp-block-site-title { font-size: clamp(1.35rem, 0.95rem + 1.2vw, 2.05rem); }
.sasp-header__actions { gap: 0.75rem; flex-shrink: 0; }
.sasp-header__top > .wp-block-site-title { flex: 1 1 auto; min-width: 0; }
.sasp-header__donate .wp-block-button__link { padding: 0.55em 1.15em; font-size: 0.875rem; white-space: nowrap; }
/* Search and social icons beside Donate (desktop); on phones they live in the menu panel instead */
.sasp-header__search { margin: 0; }
.sasp-header__search .wp-block-search__inside-wrapper { width: 200px; padding: 0; border: var(--sasp-rule); border-radius: var(--sasp-radius); background: var(--wp--preset--color--base); }
.sasp-header__search .wp-block-search__input { min-height: 0; padding: 0.45em 0.7em; border: 0; font-size: 0.85rem; background: transparent; }
.sasp-header__search .wp-block-search__button { margin: 0; padding: 0.35em 0.6em; border: 0; color: var(--wp--preset--color--accent-4); background: none; }
.sasp-header__search .wp-block-search__button svg { width: 20px; height: 20px; fill: currentColor; }
.sasp-header__search .wp-block-search__inside-wrapper:focus-within { border-color: var(--wp--preset--color--accent-1); }
.sasp-header__search .wp-block-search__button:hover { color: var(--wp--preset--color--accent-1); }
.sasp-header__social { gap: 0.35rem !important; margin: 0 0.25rem; }
.sasp-header__social .wp-social-link a:hover { color: var(--wp--preset--color--accent-1); }
@media (max-width: 1023px) { .sasp-header__search .wp-block-search__inside-wrapper { width: 160px; } }
@media (max-width: 781px) { .sasp-header__search, .sasp-header__social { display: none !important; } }

.sasp-header nav.sasp-nav--desktop {
	margin-top: 0.85rem;
	padding-block: 0.6rem;
	border-top: var(--sasp-rule);
	column-gap: 1.75rem;
	row-gap: 0.25rem;
	font-size: 0.875rem;
	letter-spacing: 0.01em;
}
.sasp-header .sasp-nav .wp-block-navigation-item__content { padding-block: 0.2rem; }
.sasp-header .sasp-nav--desktop > .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content {
	border-bottom: 2px solid transparent;
}
.sasp-header .sasp-nav--desktop > .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:hover,
.sasp-header .sasp-nav--desktop .current-menu-item > .wp-block-navigation-item__content {
	border-bottom-color: var(--wp--preset--color--brand-green);
}
nav.sasp-nav--desktop .wp-block-navigation__submenu-container {
	min-width: 240px !important;
	padding-block: 0.4rem !important;
	border: var(--sasp-rule) !important;
	border-radius: var(--sasp-radius);
	box-shadow: 0 8px 24px rgb(0 0 0 / 10%);
	font-weight: 400;
}
nav.sasp-nav--desktop .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: 0.45rem 1rem !important; }
nav.sasp-nav--desktop .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover { background: var(--wp--preset--color--accent-5); }

/* One menu per breakpoint: hamburger on phones, full bar on larger screens */
.sasp-header .sasp-nav--mobile { display: none; }
@media (max-width: 781px) {
	.sasp-header { padding-bottom: 1rem; }
	.sasp-header .sasp-nav--desktop { display: none; }
	.sasp-header .sasp-nav--mobile { display: flex; }
	.sasp-header .wp-block-site-title { font-size: 1.15rem; line-height: 1.2; }
	.sasp-header__donate .wp-block-button__link { padding: 0.5em 0.9em; font-size: 0.8rem; }
}


/* =========================================================
   Phone menu (disclosure navigation in a modal panel)
   ========================================================= */
html.sasp-mnav-locked { overflow: hidden; }
.sasp-mnav__open, .sasp-mnav__close, .sasp-mnav__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	border: 0;
	border-radius: var(--sasp-radius);
	background: transparent;
	color: var(--wp--preset--color--contrast);
	cursor: pointer;
}
.sasp-mnav__open:hover, .sasp-mnav__close:hover, .sasp-mnav__toggle:hover { background: var(--wp--preset--color--accent-5); }

/* Without JavaScript the panel is simply part of the page */
.sasp-mnav:not(.is-ready) .sasp-mnav__open,
.sasp-mnav:not(.is-ready) .sasp-mnav__close,
.sasp-mnav:not(.is-ready) .sasp-mnav__toggle { display: none; }

/* With JavaScript (html.sasp-js, set inline in <head>), paint the closed menu from the start: the deferred
   script then only wires it up, so the expanded list never flashes in the header and nothing shifts. */
html.sasp-js .sasp-mnav:not(.is-ready) .sasp-mnav__panel { display: none; }
html.sasp-js .sasp-mnav:not(.is-ready) .sasp-mnav__open { display: inline-flex; }

.sasp-mnav.is-ready .sasp-mnav__panel {
	position: fixed;
	inset: 0;
	z-index: 100000;
	overflow-y: auto;
	padding: 0 1.25rem 2.5rem;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}
.sasp-mnav.is-ready .sasp-mnav__panel[hidden] { display: none; }
.admin-bar .sasp-mnav.is-ready .sasp-mnav__panel { top: var(--wp-admin--admin-bar--height, 0px); }

.sasp-mnav__bar {
	position: sticky;
	top: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-block: 0.75rem;
	background: var(--wp--preset--color--base);
	border-bottom: var(--sasp-rule);
}
.sasp-mnav__title { font-family: var(--wp--preset--font-family--open-sans); font-weight: 600; font-size: 1.05rem; line-height: 1.2; }

.sasp-mnav__list, .sasp-mnav__sub { margin: 0; padding: 0; list-style: none; }
.sasp-mnav__item { border-bottom: var(--sasp-rule); }
.sasp-mnav__row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.sasp-mnav__link {
	flex: 1;
	padding-block: 0.85rem;
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--open-sans);
	font-weight: 600;
	font-size: 1.15rem;
	line-height: 1.25;
	text-decoration: none;
}
.sasp-mnav__toggle svg { transition: transform 0.15s ease; }
.sasp-mnav__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.sasp-mnav__toggle[aria-expanded="true"] { color: var(--wp--preset--color--accent-1); }
.sasp-mnav__sub { margin: 0 0 0.85rem; padding-left: 0.9rem; border-left: 2px solid var(--wp--preset--color--accent-6); }
.sasp-mnav__sub[hidden] { display: none; }
.sasp-mnav__sublink {
	display: block;
	padding-block: 0.5rem;
	color: var(--wp--preset--color--accent-4);
	font-size: 1rem;
	text-decoration: none;
}
.sasp-mnav__link:hover, .sasp-mnav__sublink:hover { color: var(--wp--preset--color--accent-2); text-decoration: underline; }
.sasp-mnav [aria-current="page"] { color: var(--wp--preset--color--accent-2); font-weight: 600; }
.sasp-mnav__footer { margin-top: 1.75rem; color: var(--wp--preset--color--accent-4); font-size: 0.9rem; line-height: 1.6; }
.sasp-mnav__footer .sasp-mnav__donate { display: block; margin-bottom: 1.25rem; text-align: center; color: var(--wp--preset--color--base); text-decoration: none; }
.sasp-mnav__footer a:not(.wp-element-button) { color: var(--wp--preset--color--accent-2); }
.sasp-mnav__search { display: flex; margin: 0 0 1.25rem; border: var(--sasp-rule); border-radius: var(--sasp-radius); }
.sasp-mnav__search input { flex: 1; min-width: 0; padding: 0.6em 0.75em; border: 0; font: inherit; font-size: 1rem; background: transparent; }
.sasp-mnav__search button { padding: 0 0.85em; border: 0; color: var(--wp--preset--color--accent-4); background: none; cursor: pointer; }
.sasp-mnav__social { display: flex; gap: 1.25rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.sasp-mnav__social a { display: inline-flex; color: var(--wp--preset--color--accent-4) !important; }

/* =========================================================
   Home hero
   ========================================================= */
.sasp-hero { padding-block: clamp(4rem, 3rem + 6vw, 7.5rem); text-align: center; }
.sasp-hero .wp-block-cover__inner-container { max-width: 760px; }
.sasp-eyebrow {
	margin: 0 auto 0.75rem;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0.85;
}
.sasp-hero .sasp-hero__title {
	margin: 0;
	color: #fff;
	font-size: clamp(2.5rem, 1.8rem + 3.2vw, 4.25rem);
	line-height: 1.05;
}
.sasp-hero__meta { margin: 1.1rem auto 0; font-size: 1.05rem; line-height: 1.6; opacity: 0.92; }
.sasp-hero__actions { justify-content: center; gap: 0.75rem; margin-top: 1.9rem; }
.sasp-hero .is-style-outline .wp-block-button__link { color: #fff; border-color: rgb(255 255 255 / 70%); }
.sasp-hero .is-style-outline .wp-block-button__link:hover { background: rgb(255 255 255 / 12%); border-color: #fff; }

/* =========================================================
   Page body & sections
   ========================================================= */
main.wp-block-group { padding-block: var(--wp--preset--spacing--50) var(--sasp-section); }
main.sasp-main--home { padding-top: var(--wp--preset--spacing--40); }

/* Converted Cornerstone sections */
.wp-block-post-content > .wp-block-group + .wp-block-group:not(.has-background) { margin-top: var(--wp--preset--spacing--50); }
.wp-block-post-content > .wp-block-group.alignfull.has-background {
	padding-block: var(--sasp-section);
	margin-block: var(--sasp-section);
	border-block: 1px solid #e6e1d0;
}
.wp-block-post-content > .wp-block-group.alignfull.has-background + .wp-block-group.alignfull.has-background {
	margin-top: calc(-1 * var(--sasp-section));
	padding-top: 0;
	border-top: 0;
}
.wp-block-post-content > .wp-block-group.alignfull.has-background:last-child { margin-bottom: calc(-1 * var(--sasp-section)); }
main .wp-block-spacer { max-height: 48px; }
.wp-block-post-content > .wp-block-group:first-child > .wp-block-spacer:first-child,
.wp-block-post-content > .wp-block-spacer:first-child { display: none; }

.wp-block-columns { gap: clamp(1.5rem, 1rem + 2vw, 3rem); }
.wp-block-heading + .wp-block-heading { margin-top: 0.4em; }
.wp-block-post-content :is(p, ul, ol) + :is(h3, h4) { margin-top: 2.25rem; }
.wp-block-post-content :is(p, ul, ol) + h2 { margin-top: 2.75rem; }

/* Language tab labels (EN / FR columns) */
.sasp-tab-label {
	margin-bottom: 0.25rem;
	color: var(--wp--preset--color--accent-1);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

/* =========================================================
   Media
   ========================================================= */
.wp-block-post-content .wp-block-image img,
.wp-block-gallery.has-nested-images figure.wp-block-image img,
.wp-block-post-featured-image img { border-radius: var(--sasp-radius); }
.wp-block-image.alignwide img { width: 100%; max-height: 520px; object-fit: cover; }
.wp-block-gallery.has-nested-images { --wp--style--unstable-gallery-gap: 0.75rem; gap: 0.75rem; }
.wp-block-embed.is-type-video iframe { border-radius: var(--sasp-radius); }

/* =========================================================
   Details (accordions)
   ========================================================= */
.wp-block-details { border-bottom: var(--sasp-rule); padding-block: 0.15rem; }
.wp-block-details:first-of-type { border-top: var(--sasp-rule); }
.wp-block-details summary {
	position: relative;
	padding: 0.85rem 2rem 0.85rem 0;
	cursor: pointer;
	font-weight: 600;
	list-style: none;
}
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after {
	content: "+";
	position: absolute;
	right: 0.25rem;
	top: 50%;
	transform: translateY(-50%);
	color: var(--wp--preset--color--accent-1);
	font-size: 1.35rem;
	font-weight: 400;
	line-height: 1;
}
.wp-block-details[open] summary::after { content: "–"; }
.wp-block-details[open] > :last-child { margin-bottom: 1rem; }

/* =========================================================
   Events
   ========================================================= */
.sasp-event-details {
	display: grid;
	gap: 0.3rem;
	margin-block: 0 var(--wp--preset--spacing--40);
	padding: 1.1rem 1.25rem;
	border-left: 3px solid var(--wp--preset--color--brand-green);
	border-radius: 0 var(--sasp-radius) var(--sasp-radius) 0;
	background: var(--wp--preset--color--accent-5);
}
.sasp-event-details p { margin: 0; }
.sasp-event-details strong { font-weight: 600; }

.sasp-events { display: grid; gap: 1.1rem; }
.sasp-events__month {
	margin: var(--wp--preset--spacing--40) 0 0;
	padding-bottom: 0.35rem;
	border-bottom: var(--sasp-rule);
	font-size: var(--wp--preset--font-size--large);
}
.sasp-event { display: grid; grid-template-columns: 4.25rem 1fr; gap: 1.1rem; align-items: start; }
.sasp-event__date {
	display: grid;
	place-items: center;
	padding: 0.45rem 0;
	border-radius: var(--sasp-radius);
	background: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--base);
	line-height: 1.1;
	text-transform: uppercase;
}
.sasp-event__day { font-size: 1.5rem; font-weight: 700; }
.sasp-event__mon { font-size: 0.7rem; letter-spacing: 0.1em; }
.sasp-event__title { margin: 0; font-size: 1.25rem; }
.sasp-event__title a { text-decoration: none; color: var(--wp--preset--color--contrast); }
.sasp-event__title a:hover { color: var(--wp--preset--color--accent-2); text-decoration: underline; }
.sasp-event__meta { margin: 0.15rem 0 0; color: var(--wp--preset--color--accent-4); font-size: var(--wp--preset--font-size--small); }
.sasp-events__empty { color: var(--wp--preset--color--accent-4); font-style: italic; }

/* Event cards (replace EventON tile/slider views) */
.sasp-tiles {
	display: grid;
	/* At most 4 per row: blocks show up to 8, so rows stay even on wide screens */
	grid-template-columns: repeat(auto-fill, minmax(max(220px, calc((100% - 3 * 1.25rem) / 4)), 1fr));
	gap: 1.25rem;
	margin-block: var(--wp--preset--spacing--30);
	text-align: left;
}
.sasp-tile__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border: var(--sasp-rule);
	border-radius: var(--sasp-radius);
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
	transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.sasp-tile__link:hover { border-color: #cec7af; box-shadow: 0 6px 18px rgb(0 0 0 / 8%); }
.sasp-tile__link:hover .sasp-tile__title { color: var(--wp--preset--color--accent-2); }
.sasp-tiles .sasp-tile__img { display: block; width: 100% !important; height: 165px !important; max-width: none; object-fit: cover; }
.sasp-tiles .sasp-tile__img--empty { background: var(--wp--preset--color--accent-5); }
.sasp-tile__date { padding: 0.85rem 1rem 0; color: var(--wp--preset--color--accent-1); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.sasp-tile__title { padding: 0.25rem 1rem; font-family: var(--wp--preset--font-family--open-sans); font-weight: 600; font-size: 1.1rem; line-height: 1.25; }
.sasp-tile__time { padding: 0 1rem 1rem; margin-top: auto; color: var(--wp--preset--color--accent-4); font-size: 0.85rem; }
.sasp-tiles__more { text-align: right; font-weight: 600; font-size: 0.95rem; }

/* =========================================================
   Footer
   ========================================================= */
.sasp-footer { padding-block: clamp(3rem, 2.5rem + 2vw, 4.5rem) 1.5rem; font-size: 0.95rem; line-height: 1.65; }
.sasp-footer a:where(:not(.wp-element-button)) { color: inherit; }
.sasp-footer .wp-block-site-title { font-size: 1.6rem; }
.sasp-footer .wp-block-site-title a { color: #fff; }
.sasp-footer__lede { opacity: 0.85; }
.sasp-footer .sasp-footer__heading {
	margin-bottom: 0.9rem;
	color: #fff;
	font-family: var(--wp--preset--font-family--open-sans);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0.75;
}
.sasp-footer .is-style-outline .wp-block-button__link { color: #fff; border-color: rgb(255 255 255 / 55%); font-size: 0.875rem; }
.sasp-footer .is-style-outline .wp-block-button__link:hover { background: rgb(255 255 255 / 10%); border-color: #fff; }
.sasp-footer__social { margin-top: 1.25rem; }
.sasp-footer__bar {
	margin-top: clamp(2rem, 1.5rem + 2vw, 3rem);
	padding-top: 1.25rem;
	border-top: 1px solid rgb(255 255 255 / 14%);
	font-size: 0.825rem;
	opacity: 0.8;
}
.sasp-footer__bar p { margin: 0; }
.sasp-footer__ministers { font-style: italic; opacity: 0.85; }
.sasp-footer__links { margin: 0; padding: 0; list-style: none; }
.sasp-footer__links li { margin: 0 0 0.35rem; }
/* Map fills the height of the text columns beside it */
.sasp-footer__mapcol { display: flex; flex-direction: column; }
.sasp-footer__mapcol > .sasp-footer__map { flex: 1; }
.sasp-footer__map { overflow: hidden; border-radius: 4px; line-height: 0; min-height: 240px; }
.sasp-footer__map iframe { width: 100%; height: 100%; min-height: 240px; border: 0; filter: grayscale(0.35); }
/* Tablet / small laptop: map moves to its own row under the three text columns */
@media (min-width: 782px) and (max-width: 1199px) {
	.sasp-footer__cols { flex-wrap: wrap !important; }
	.sasp-footer__cols > .sasp-footer__mapcol { flex-basis: 100% !important; }
}
@media (max-width: 1199px) { .sasp-footer__map, .sasp-footer__map iframe { min-height: 220px; height: 220px; } }

/* =========================================================
   Accessibility & print
   ========================================================= */
html { scroll-behavior: smooth; }
:target { scroll-margin-top: 1.5rem; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { transition: none !important; }
}
@media print {
	.sasp-header, .sasp-footer, .sasp-hero__actions, .wp-block-buttons { display: none !important; }
	a { color: inherit; text-decoration: underline; }
	.has-background { background: none !important; }
}

/* =========================================================
   Content refinements
   ========================================================= */
/* Scripture quotations */
.wp-block-quote:is(.sasp-scripture, .is-style-scripture) {
	max-width: 36rem;
	margin: var(--wp--preset--spacing--50) auto;
	padding: 0;
	border: 0;
	text-align: center;
	font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.55rem);
	line-height: 1.45;
}
.wp-block-quote:is(.sasp-scripture, .is-style-scripture) p { margin-inline: auto; }
.wp-block-quote:is(.sasp-scripture, .is-style-scripture)::before {
	content: "";
	display: block;
	width: 2.5rem;
	margin: 0 auto 1.25rem;
	border-top: 2px solid var(--wp--preset--color--brand-green);
}
.wp-block-quote:is(.sasp-scripture, .is-style-scripture) cite {
	display: block;
	margin-top: 0.75rem;
	color: var(--wp--preset--color--accent-4);
	font-family: var(--wp--preset--font-family--open-sans);
	font-size: 0.8rem;
	font-style: normal;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}
/* "Heading | button" rows: align the button to the right, level with the heading */
.wp-block-columns:has(> .wp-block-column > .wp-block-buttons:only-child) { align-items: center !important; }
.wp-block-column > .wp-block-buttons:only-child { justify-content: flex-end; }
@media (max-width: 781px) { .wp-block-column > .wp-block-buttons:only-child { justify-content: flex-start; } }

/* External links: quiet "opens elsewhere" cue on in-text links (not buttons, menus or icons) */
.wp-block-post-content a[target="_blank"]:not(.wp-element-button):not(.wp-block-navigation-item__content):not(:has(img))::after,
.sasp-footer p a[target="_blank"]::after {
	content: "\2197";
	display: inline-block;
	margin-left: 0.15em;
	font-size: 0.75em;
	text-decoration: none;
	vertical-align: 0.15em;
	opacity: 0.7;
}

/* =========================================================
   Tables
   ========================================================= */
.wp-block-table { margin-block: 1.5rem; overflow-x: auto; }
.wp-block-table table, .wp-block-html table { width: 100%; max-width: 100%; border-collapse: collapse; font-size: 0.95rem; line-height: 1.55; }
.wp-block-table :is(th, td), .wp-block-html table :is(th, td) {
	padding: 0.75rem 0.9rem;
	border: 0;
	border-bottom: var(--sasp-rule);
	text-align: left;
	vertical-align: top;
	overflow-wrap: anywhere;
}
.wp-block-table thead th {
	border-bottom: 2px solid var(--wp--preset--color--contrast);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.wp-block-table td:first-child { width: 32%; font-weight: 600; }
.has-background .wp-block-table :is(th, td) { border-bottom-color: #ded9c8; }

/* Phones: each row becomes a short stacked card (label above description) */
@media (max-width: 600px) {
	.wp-block-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.wp-block-table tr { display: block; padding-block: 0.7rem; border-bottom: var(--sasp-rule); }
	.wp-block-table :is(td, th) { display: block; width: auto !important; padding: 0.1rem 0; border: 0; }
}

/* =========================================================
   Search results (compact list)
   ========================================================= */
.sasp-search .wp-block-query-title { margin-bottom: 1rem; font-size: var(--wp--preset--font-size--x-large); }
.sasp-search__form { margin-bottom: var(--wp--preset--spacing--40); }
.sasp-results__list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.sasp-results__list > li { margin: 0; }
.sasp-result { gap: 1.1rem !important; padding-block: 1.1rem; border-bottom: var(--sasp-rule); }
.sasp-results__list > li:first-child .sasp-result { border-top: var(--sasp-rule); }
.sasp-result__thumb { flex: 0 0 112px; margin: 0 !important; }
.sasp-result__thumb img { width: 112px !important; height: 84px !important; object-fit: cover; border-radius: var(--sasp-radius); }
.sasp-result__body { flex: 1; min-width: 0; }
.sasp-result__title { margin: 0 0 0.3rem; font-size: 1.3rem; line-height: 1.25; }
.sasp-result__title a { color: var(--wp--preset--color--contrast); text-decoration: none; }
.sasp-result__title a:hover { color: var(--wp--preset--color--accent-2); text-decoration: underline; }
.sasp-result__excerpt { margin: 0; color: var(--wp--preset--color--accent-4); font-size: 0.95rem; }
.sasp-result__excerpt p { margin: 0; }
.sasp-result__excerpt .wp-block-post-excerpt__more-text { display: none; }
.sasp-results__pages { margin-top: var(--wp--preset--spacing--40); font-weight: 600; }
@media (max-width: 600px) {
	.sasp-result__thumb { flex-basis: 76px; }
	.sasp-result__thumb img { width: 76px !important; height: 60px !important; }
	.sasp-result__title { font-size: 1.15rem; }
}

/* =========================================================
   Shop
   ========================================================= */
.sasp-shop__group { margin-top: var(--wp--preset--spacing--50); padding-bottom: 0.4rem; border-bottom: var(--sasp-rule); font-size: var(--wp--preset--font-size--large); }
.sasp-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2rem 1.5rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.sasp-product { display: flex; flex-direction: column; margin: 0; }
.sasp-product__card { display: flex; flex: 1; flex-direction: column; color: var(--wp--preset--color--contrast); text-decoration: none; border-radius: var(--sasp-radius); outline-offset: 4px; }
/* Covers sit on a square panel as objects (books and CDs have different shapes; nothing is cropped) */
.sasp-product__media { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; padding: 12%; border-radius: var(--sasp-radius); background: var(--wp--preset--color--accent-5); container-type: inline-size; transition: background-color 0.2s; }
.sasp-product__img { display: block; width: auto !important; max-width: 100%; height: auto; max-height: 100cqi; box-shadow: 0 1px 2px rgb(0 0 0 / 0.12), 0 6px 18px rgb(0 0 0 / 0.16); transition: transform 0.25s ease, box-shadow 0.25s ease; }
.sasp-product__img--empty { width: 70% !important; aspect-ratio: 1 / 1; box-shadow: none; }
.sasp-product__card:is(:hover, :focus-visible) .sasp-product__media { background: color-mix(in srgb, var(--wp--preset--color--accent-5) 88%, var(--wp--preset--color--contrast)); }
.sasp-product__card:is(:hover, :focus-visible) .sasp-product__img { transform: translateY(-4px); box-shadow: 0 2px 4px rgb(0 0 0 / 0.12), 0 12px 28px rgb(0 0 0 / 0.2); }
.sasp-product__card:is(:hover, :focus-visible) .sasp-product__title { color: var(--wp--preset--color--accent-2); text-decoration: underline; text-underline-offset: 0.15em; }
@media (prefers-reduced-motion: reduce) { .sasp-product__img { transition: none; } .sasp-product__card:hover .sasp-product__img { transform: none; } }
.sasp-product__body { display: flex; flex: 1; flex-direction: column; padding-top: 1rem; }
.sasp-product__title { margin: 0; font-size: 1.15rem; line-height: 1.3; }
.sasp-product__by { display: block; margin: 0.25rem 0 0; color: var(--wp--preset--color--accent-4); font-size: 0.875rem; line-height: 1.4; }
.sasp-product__price { display: block; margin: 0.5rem 0 0; font-weight: 700; }
.sasp-buy { display: inline-block; text-align: center; text-decoration: none; }
.sasp-order { margin: 0; padding: 0.7rem 0.85rem; border-radius: var(--sasp-radius); background: var(--wp--preset--color--accent-5); font-size: 0.875rem; line-height: 1.5; }
/* Shop page: wide layout; title and intro start at the grid's left edge */
body.sasp-shop-page .wp-block-post-title,
body.sasp-shop-page .wp-block-post-content > :not(.alignfull) { max-width: var(--wp--style--global--wide-size); }
body.sasp-shop-page .wp-block-post-content > p:first-child { max-width: 50rem; margin-left: max(0px, calc((100% - var(--wp--style--global--wide-size)) / 2)) !important; font-size: var(--wp--preset--font-size--large); line-height: 1.6; }
body.sasp-shop-page .wp-block-post-title { font-size: clamp(2.5rem, 2rem + 2.5vw, 4rem); }
@media (min-width: 1000px) { .sasp-shop-page .sasp-shop { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 781px) {
	.sasp-shop-page .sasp-shop { grid-template-columns: repeat(2, 1fr); gap: 1.75rem 1rem; }
	.sasp-shop-page .sasp-product__title { font-size: 1rem; }
	body.sasp-shop-page .wp-block-post-content > p:first-child { font-size: 1.125rem; }
}
.sasp-buybox { margin: 0.5rem 0 1.75rem; padding: 1.1rem 1.25rem; border: var(--sasp-rule); border-radius: var(--sasp-radius); }
.sasp-buybox__price { margin: 0 0 0.75rem; font-size: 1.5rem; font-weight: 700; }
.sasp-buybox .sasp-order { padding: 0; background: none; font-size: 0.95rem; }
.sasp-buybox__note { margin: 0.85rem 0 0; color: var(--wp--preset--color--accent-4); font-size: 0.85rem; }
.sasp-product-page .wp-block-post-featured-image img { border: var(--sasp-rule); }
/* "Buy in our shop →" links at the end of Music › Recordings and Get to Know Us › History */
.sasp-shop-link { margin-top: 1.25rem; font-weight: 600; }
.sasp-shop-link a { text-decoration-color: var(--wp--preset--color--brand-green); }

/* =========================================================
   Official logo (per the church's 2017 Branding Guidelines)
   ========================================================= */
.sasp-header .sasp-logo { flex-shrink: 1; min-width: 0; margin: 0; line-height: 0; }
.sasp-header .sasp-logo a { display: inline-block; }
.sasp-header .sasp-logo img { width: clamp(210px, 150px + 7vw, 260px) !important; height: auto; }
@media (max-width: 781px) { .sasp-header .sasp-logo img { width: 180px !important; } }
@media (max-width: 380px) { .sasp-header .sasp-logo img { width: 158px !important; } }
/* Phones: give the official logo room to stay legible */
@media (max-width: 781px) {
	.sasp-header { padding-inline: 16px !important; }
	.sasp-header > .wp-block-group.alignwide { padding-inline: 0 !important; }
	.sasp-header__top { gap: 10px !important; }
	.sasp-header__actions { gap: 4px !important; }
	.sasp-header__donate .wp-block-button__link { padding: 0.45em 0.75em !important; font-size: 0.8rem !important; }
}
.sasp-footer__logo { margin: 0 0 1.1rem !important; line-height: 0; }
.sasp-footer__logo img { width: 250px !important; max-width: 100%; height: auto; border-radius: 0 !important; }

/* =========================================================
   Brand alignment (2017 Branding Guidelines): Open Sans throughout,
   Palatino for scripture/quotes, green + black, gold only on black.
   ========================================================= */
.sasp-hero .sasp-hero__title { font-weight: 700; letter-spacing: -0.02em; }
.sasp-footer .sasp-footer__heading { color: var(--wp--preset--color--brand-gold); }
.sasp-footer a:not(.wp-element-button):hover { color: var(--wp--preset--color--brand-gold); }
.sasp-scripture, .sasp-scripture p, .is-style-scripture, .is-style-scripture p { font-family: var(--wp--preset--font-family--palatino); }

/* Former h5/h6 labels that were renumbered for a correct outline keep their small-caps look */
:is(h2, h3, h4, h5, h6):is(.sasp-label, .is-style-label) { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.08em; line-height: 1.4; text-transform: uppercase; }
/* WCAG 2.2 target size (2.5.8): submenu arrow buttons get a 24×24 hit area; the icon stays small */
nav.sasp-nav--desktop .wp-block-navigation__submenu-icon {
	width: 24px !important;
	height: 24px !important;
	margin-inline-start: 0 !important;
	padding: 7px !important;
	box-sizing: border-box;
}
nav.sasp-nav--desktop .wp-block-navigation__submenu-icon svg { width: 10px; height: 10px; }
/* Desktop nav: the green bar (top level) / tinted row (submenus) is the hover cue — no text underline on top */
nav.sasp-nav--desktop .wp-block-navigation-item__content:is(:hover, :focus) { text-decoration: none !important; }

/* Product page: short description (liner notes) and related items */
.sasp-product-summary { margin: 0 0 1.5rem; padding-bottom: 1.25rem; border-bottom: var(--sasp-rule); }
.sasp-product-summary p { margin: 0 0 0.85rem; }
.sasp-related { margin-top: var(--wp--preset--spacing--60, 3rem); padding-top: 1.5rem; border-top: var(--sasp-rule); }
.sasp-related__title { margin: 0; font-size: 1.35rem; }
.sasp-related .sasp-shop { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* Photo banners and photo bands (from the old pages' section background images) */
.wp-block-image.sasp-banner { margin-block: 0; }
.wp-block-image.sasp-banner img { display: block; width: 100%; height: clamp(180px, 26vw, 380px); object-fit: cover; object-position: 50% 45%; }
/* Photo row: the old pages' strip of photos, edge to edge */
.wp-block-gallery.sasp-photo-row { margin-block: 0; gap: 0 !important; }
.wp-block-gallery.sasp-photo-row .wp-block-image { margin: 0 !important; flex: 1 1 0 !important; width: auto !important; }
.wp-block-gallery.sasp-photo-row .wp-block-image img { height: clamp(140px, 20vw, 320px) !important; width: 100%; object-fit: cover; }

/* Columnize: one list/text flowed into two columns (old "columnize" element) */
@media (min-width: 782px) {
	.sasp-columnize { column-count: 2; column-gap: 3rem; }
	.sasp-columnize > * { max-width: none !important; }
	.sasp-columnize li, .sasp-columnize p { break-inside: avoid; }
}

/* Images in columns fill their column (phones especially) */
.wp-block-column > .wp-block-image img { width: 100%; height: auto; }

/* A page that opens with a banner: photo flush under the header (the parent template pads <main> inline) */
main:has(> .wp-block-post-content > :is(.sasp-banner, .sasp-photo-row):first-child) { padding-top: 0 !important; }
main.sasp-main--home { margin-top: 0 !important; padding-top: 0 !important; }
/* Plain pages (title, no banner): TT5's page template stacks 70 + 50 + 70px above the title */
main.wp-block-group:has(> .alignfull > .wp-block-post-title:first-child) { margin-top: 0 !important; }
main.wp-block-group > .alignfull:has(> .wp-block-post-title:first-child) { padding-top: var(--wp--preset--spacing--40) !important; }
.wp-block-cover.sasp-photo-band { min-height: 0; padding-block: clamp(3rem, 6vw, 5.5rem); color: #fff; }
.sasp-photo-band :is(h1, h2, h3, h4, p, li, cite, figcaption) { color: #fff; }
.sasp-photo-band a:not(.wp-element-button) { color: #fff; }
.sasp-photo-band .is-style-scripture::before { border-top-color: var(--wp--preset--color--brand-gold); }
.sasp-photo-band .is-style-scripture cite { color: rgb(255 255 255 / 80%); }
.sasp-photo-band .wp-block-button.is-style-outline .wp-block-button__link { color: #fff; border-color: rgb(255 255 255 / 75%); }

/* Give Back: partner logos (each links to the organization's video) */
.wp-block-gallery.sasp-logo-grid { gap: 1.5rem !important; margin-block: 2rem; }
.wp-block-gallery.sasp-logo-grid .wp-block-image { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; background: #fff; border: 1px solid rgb(0 0 0 / 10%); padding: 1rem; }
.wp-block-gallery.sasp-logo-grid .wp-block-image img { height: 110px !important; width: 100% !important; object-fit: contain !important; }
.wp-block-gallery.sasp-logo-grid .wp-block-image figcaption { position: static !important; background: none !important; color: inherit !important; font-size: .9rem; text-align: center; padding: .6rem 0 0 !important; max-height: none !important; }
.wp-block-gallery.sasp-logo-grid .wp-block-image a:hover img, .wp-block-gallery.sasp-logo-grid .wp-block-image a:focus-visible img { opacity: .8; }
@media (max-width: 599px) { .wp-block-gallery.sasp-logo-grid.columns-4 .wp-block-image { width: calc(50% - .75rem) !important; } }

/* Photo mosaic (home "church life"): first photo large, eight around it; a swipeable row on phones */
.wp-block-gallery.sasp-photo-mosaic { gap: 0.75rem !important; margin-block: 0; }
.wp-block-gallery.sasp-photo-mosaic figure.wp-block-image { position: relative; width: auto !important; margin: 0 !important; }
.wp-block-gallery.sasp-photo-mosaic figure.wp-block-image img { width: 100% !important; height: 100% !important; object-fit: cover; }
.wp-block-gallery.sasp-photo-mosaic:focus-visible { outline: 2px solid var(--wp--preset--color--primary); outline-offset: 4px; }
@media (min-width: 782px) {
	.wp-block-gallery.sasp-photo-mosaic { display: grid !important; grid-template-columns: repeat(4, 1fr); }
	.wp-block-gallery.sasp-photo-mosaic figure.wp-block-image { aspect-ratio: 3 / 2; }
	.wp-block-gallery.sasp-photo-mosaic figure.wp-block-image:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
	.wp-block-gallery.sasp-photo-mosaic figure.wp-block-image:first-child img { position: absolute; inset: 0; }
}
@media (max-width: 781px) {
	.wp-block-gallery.sasp-photo-mosaic {
		flex-wrap: nowrap !important;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		margin-inline: calc(-1 * var(--wp--style--root--padding-right, 1rem)) calc(-1 * var(--wp--style--root--padding-left, 1rem)) !important;
		padding-inline: var(--wp--style--root--padding-left, 1rem);
		scroll-padding-inline: var(--wp--style--root--padding-left, 1rem);
	}
	.wp-block-gallery.sasp-photo-mosaic::-webkit-scrollbar { display: none; }
	.wp-block-gallery.sasp-photo-mosaic figure.wp-block-image { flex: 0 0 82% !important; aspect-ratio: 4 / 3; scroll-snap-align: start; }
}

/* Wide sections (two-column rows from the old pages): headings and event lists line up with the columns,
   and each subsection that ends with its events list is set off from the next one */
.is-layout-constrained:has(> .wp-block-columns.alignwide) > :is(h2, h3, h4, h5, h6, .wp-block-sasp-events) { max-width: var(--wp--style--global--wide-size); }
.is-layout-constrained:has(> .wp-block-columns.alignwide) > .wp-block-sasp-events + :is(.wp-block-columns, .wp-block-heading, .wp-block-group) {
	margin-block-start: clamp(2.5rem, 5vw, 4rem); padding-block-start: clamp(2.5rem, 5vw, 4rem); border-top: 1px solid rgb(0 0 0 / 12%);
}
/* A left-aligned heading directly above a wide section lines up with it */
.is-layout-constrained > :is(h1, h2, h3).wp-block-heading:not(.has-text-align-center):has(+ .alignwide) { max-width: var(--wp--style--global--wide-size); }

/* =========================================================
   404
   ========================================================= */
.sasp-404__search { max-width: 30rem; margin-block: 1.5rem 2rem !important; }
.sasp-404 > .sasp-404__search { max-width: var(--wp--style--global--content-size); }
.sasp-404__search .wp-block-search__inside-wrapper { max-width: 30rem; gap: 0.5rem; }
.sasp-404__search .wp-block-search__input { padding: 0.6em 0.8em; border: 1px solid #c9c3ad; border-radius: var(--sasp-radius); font: inherit; }
.sasp-404__search .wp-block-search__button { margin-left: 0; border-radius: var(--sasp-radius); }
.sasp-404__links { padding-left: 1.2em; }

/* Get Involved › The Guild (work/guild-layout.php): wide group photo cropped to a band, rows of two columns */
.sasp-guild__photo img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; object-position: 50% 35%; border-radius: var(--sasp-radius); }
@media (max-width: 781px) { .sasp-guild__photo img { aspect-ratio: 3 / 2; } }
.wp-block-columns.sasp-guild { margin-top: var(--wp--preset--spacing--40); column-gap: 3rem; }
/* Two-column lists: no top margin on the first item, so both columns start level */
.sasp-columnize ul { margin-top: 0; }
.sasp-columnize li { margin: 0 0 0.6rem; }
.wp-block-columns.sasp-guild + .is-style-label { margin-top: var(--wp--preset--spacing--50); }
/* The root block gap (20px) showed as a white strip above the footer when a page ends with a coloured band;
   main's bottom padding already spaces white pages */
.wp-site-blocks > footer.wp-block-template-part { margin-block-start: 0; }
/* Subtitle under a centred section title (e.g. Music › The Choir) */
.wp-block-heading.sasp-subtitle { margin-top: 0.35rem; color: var(--wp--preset--color--accent-4); font-size: var(--wp--preset--font-size--large); font-weight: 400; }
.wp-block-heading.sasp-subtitle + * { margin-top: var(--wp--preset--spacing--40); }
/* Home: the hero and the scripture band sit on the same width as the header and photo mosaic (edge to edge on phones) */
@media (min-width: 782px) {
	main.sasp-main--home .wp-block-cover.alignfull:is(.sasp-hero, .sasp-photo-band) {
		max-width: var(--wp--style--global--wide-size) !important;
		margin-inline: auto !important;
		border-radius: var(--sasp-radius);
		overflow: hidden;
	}
	main.sasp-main--home .wp-block-cover.alignfull.sasp-hero { margin-top: var(--wp--preset--spacing--30) !important; }
}
/* Home: the hero, photo mosaic, scripture band and events had 20px between them (image wall); use the section rhythm */
main.sasp-main--home :is(.sasp-hero, .sasp-photo-band) + *,
main.sasp-main--home * + .sasp-photo-band { margin-top: var(--sasp-section) !important; }
/* Event tiles: 2 per row on tablets (3 would leave a 3-3-2 grid) */
@media (min-width: 520px) and (max-width: 999px) { .sasp-tiles { grid-template-columns: repeat(2, 1fr); } }
/* Images narrower than their column (e.g. Special Services tiles once the columns got wider) sit centred, not flush left */
.wp-block-column > .wp-block-image:not(.alignleft):not(.alignright) { text-align: center; } /* linked: <a> is inline-block */
.wp-block-column > .wp-block-image:not(.alignleft):not(.alignright) img { display: block; margin-inline: auto; }
/* Image tiles from a columns block, laid out as one even grid (Home › Special Services; class set by work/section-tweaks.php) */
.wp-block-columns.sasp-fill-images { display: grid !important; grid-template-columns: repeat(5, 1fr); gap: 1.25rem; }
.sasp-fill-images > .wp-block-column { display: contents; }
.sasp-fill-images .wp-block-spacer { display: none; }
.sasp-fill-images .wp-block-image { margin: 0; }
.sasp-fill-images .wp-block-image a { display: block; }
.sasp-fill-images .wp-block-image img { width: 100%; height: auto; border-radius: var(--sasp-radius); }
@media (max-width: 999px) { .wp-block-columns.sasp-fill-images { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 599px) { .wp-block-columns.sasp-fill-images { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; } }
/* Home: the photo section follows the hero, which already sets the gap above it */
main.sasp-main--home .wp-block-post-content > .sasp-photo-section:first-child { margin-top: 0 !important; }
