/*
Theme Name: Severe Asthma Forum 2026
Description: One-page congress site for the 8th South Eastern European Severe Asthma Forum (SAF 2026), 11–12 December 2026, Hotel Palace, Zagreb. Built on a ruled grid in the SAF crimson and gold. Scaffolded by Studio Code.
Requires at least: 7.0
Tested up to: 7.1
Requires PHP: 7.2
Version: 1.2
Author: Matija Srček @ hdIT
Author URI: https://www.hdit.hr/
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: saf-2026
Tags: one-column, full-site-editing, block-styles, accessibility-ready
*/

/* WordPress inserts a margin-block-start equal to the block gap (24px unless
   theme.json sets styles.spacing.blockGap) between the template's top-level
   sections (header part, main, footer part) — a gap that exists even when no
   markup asks for it. Zero it so sections butt edge-to-edge and own their
   vertical rhythm via padding; this does not affect block gaps inside nested
   layouts. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* With that gap gone, main carries its own vertical padding so templates this
   theme does not author (WooCommerce shop, product, cart…) still clear the
   header and footer. A descendant selector, not a child one: WooCommerce wraps
   the single-product main in an extra group. Templates built from full-bleed
   sections opt out with is-flush and let the sections own the rhythm. */
.wp-site-blocks main {
	padding-block: var(--wp--preset--spacing--lg) var(--wp--preset--spacing--xl);
}
.wp-site-blocks main.is-flush {
	padding-block: 0;
}

/* Plain text pages (page.html, e.g. Pravila privatnosti): the h1 title leads,
   section headings step down below it. */
.saf-page .wp-block-post-content h2 {
	margin-block-start: var(--wp--preset--spacing--md);
	font-size: clamp(1.75rem, 1.4rem + 1vw, 2.25rem);
}
.saf-page .wp-block-post-content h3 {
	margin-block-start: var(--wp--preset--spacing--md);
	font-size: var(--wp--preset--font-size--label);
}

/* ============================================================
   Header — approved 2026-10-15 (assets/header.md in the project folder)
   ============================================================ */

/* SAF 2026 header: crimson field, gold title, outlined SAF monogram.
   Every element is in its final, visible state here; header.js adds the
   hidden start state only when it runs (progressive enhancement). */

.saf-header {
	--saf-crimson: var(--wp--preset--color--primary);
	--saf-crimson-deep: var(--wp--preset--color--primary-deep);
	--saf-cream: var(--wp--preset--color--cream);
	--saf-gold: var(--wp--preset--color--gold);
	--saf-gold-text: linear-gradient(90deg, #E7D781 0%, #E0CE7A 30%, #C6AD61 45%, #DBC774 60%, #EEEAAD 80%, #D6C683 100%);
	--saf-display: var(--wp--preset--font-family--plus-jakarta-sans);
	--saf-light: var(--wp--preset--font-family--urbanist);

	/* Desktop: the layout of header-desktop-1, scaled to the header height. */
	--saf-h: clamp(320px, 25vw, 600px);
	--saf-mono-h: calc(var(--saf-h) * 1.16);
	--saf-mono-top: calc(var(--saf-h) * -0.07);
	--saf-mono-side: 6.5cqw;
	--saf-pad: 6cqw;

	container-type: inline-size;
	position: relative;
	isolation: isolate;
	overflow: hidden;
	box-sizing: border-box;
	height: var(--saf-h);
	margin: 0;
	background: var(--saf-crimson);
	color: var(--saf-cream);
}

.saf-header *,
.saf-header *::before,
.saf-header *::after { box-sizing: inherit; }

/* ---------- Monogram ---------- */

.saf-mono {
	position: absolute;
	z-index: -1;
	top: var(--saf-mono-top);
	right: var(--saf-mono-side);
	height: var(--saf-mono-h);
	width: auto;
	aspect-ratio: 1311 / 1663;
	overflow: visible;
}

.saf-mono__fill { fill: var(--saf-crimson-deep); }

.saf-mono__line {
	fill: none;
	stroke: url(#saf-mono-gold);
	/* header.js keeps the outline at 1.5px on screen; 4 units is the fallback. */
	stroke-width: var(--saf-sw, 4);
	stroke-linejoin: miter;
}

.saf-mono__glint { display: none; }

/* ---------- Text ---------- */

.saf-header__text {
	position: absolute;
	left: var(--saf-pad);
	bottom: calc(var(--saf-h) * 0.12);
	margin: 0;
}

.saf-title {
	position: relative; /* header.js measures the gold gradient against this box */
	margin: 0 0 0.62em;
	font-size: clamp(2rem, 3.45cqw, 4.6rem);
	line-height: 1.12;
	font-weight: normal;
	color: var(--saf-gold);
}

.saf-title > span {
	display: block;
	width: fit-content;
	background: var(--saf-gold-text);
	background-size: var(--saf-gw, 100%) 100%;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.saf-title__bold {
	font-family: var(--saf-display);
	font-weight: 800;
	letter-spacing: -0.01em;
}

.saf-title__bold sup {
	position: relative;
	top: -1.2em;
	font-size: 0.45em;
	line-height: 1;
	vertical-align: baseline;
	margin-right: 0.08em;
	letter-spacing: 0;
}

.saf-title__light {
	font-family: var(--saf-light);
	font-weight: 300;
	text-transform: uppercase;
	letter-spacing: 0.01em;
}

.saf-date {
	margin: 0;
	font-family: var(--saf-light);
	font-weight: 300;
	font-size: clamp(1.1875rem, 1.62cqw, 2.1rem);
	line-height: 1.25;
	color: var(--saf-cream);
}

.saf-date strong {
	font-family: var(--saf-display);
	font-weight: 800;
}

/* The block markup adds global heading and flow-layout styles; keep the
   header's own type and spacing. */
.saf-header .saf-title {
	margin: 0 0 0.62em;
	font-family: var(--saf-display);
	text-transform: none;
	letter-spacing: 0;
}

.saf-header .saf-date { margin: 0; }
.saf-header .saf-header__text { margin: 0; }
.saf-header > * + * { margin-block-start: 0; }

/* ---------- htd logo ---------- */

.saf-htd {
	position: absolute;
	right: calc(var(--saf-mono-side) + var(--saf-mono-h) * 0.7883 + 0.8cqw);
	bottom: calc(var(--saf-h) * 0.115);
	width: clamp(110px, 8.9cqw, 220px);
	line-height: 0;
}

.saf-htd { margin: 0; }
.saf-htd img { display: block; width: 100% !important; height: auto; }

.saf-htd a:focus-visible { outline: 2px solid var(--saf-cream); outline-offset: 6px; }

/* ---------- Variant: monogram on the left (header-desktop-2) ----------
   Wide screens only; below 1200px it falls back to the layouts below.
   Here the letters sit side by side: the A shifts right, the F moves up
   beside the A (offsets in monogram units). */

@media (min-width: 1200px) {
	.saf-header--mono-left {
		--saf-h: 19vw;
		--saf-k: 19vw;
	}

	.saf-header--mono-left .saf-mono {
		right: auto;
		left: calc(var(--saf-k) * 0.296);
		top: calc(var(--saf-k) * -0.113);
		height: calc(var(--saf-k) * 1.92);
	}

	.saf-header--mono-left .saf-mono--a { transform: translate(104px, 32px); }
	.saf-header--mono-left .saf-mono--f { transform: translate(300px, -885px); }

	.saf-header--mono-left .saf-header__text {
		left: calc(var(--saf-k) * 2.239);
		bottom: calc(var(--saf-k) * 0.15);
	}

	.saf-header--mono-left .saf-title { font-size: calc(var(--saf-k) * 0.19); }
	.saf-header--mono-left .saf-date { font-size: calc(var(--saf-k) * 0.088); }

	.saf-header--mono-left .saf-htd {
		right: 5cqw;
		bottom: calc(var(--saf-k) * 0.15);
		width: 7.5cqw;
	}
}

/* ---------- Tablet: bigger monogram, logo moves to the top ---------- */

@media (max-width: 999px) {
	.saf-header {
		--saf-h: clamp(380px, 52vw, 520px);
		--saf-mono-h: calc(var(--saf-h) * 1.3);
		--saf-mono-top: calc(var(--saf-h) * -0.14);
		--saf-mono-side: -10cqw;
		--saf-pad: 6cqw;
	}

	.saf-title { font-size: 4.2cqw; }
	.saf-date { font-size: max(2.2cqw, 1.1875rem); }

	.saf-htd {
		right: auto;
		left: var(--saf-pad);
		top: calc(var(--saf-h) * 0.12);
		bottom: auto;
		width: max(15cqw, 110px);
	}
}

/* ---------- Mobile: the portrait layout of header-mobile ---------- */

@media (max-width: 639px) {
	.saf-header {
		height: auto;
		aspect-ratio: 9 / 16;
		min-height: 560px;
		--saf-pad: 7.1cqw;
	}

	.saf-mono {
		top: -2.2cqw;
		left: -18.2cqw;
		right: auto;
		width: 131.5cqw;
		height: auto;
	}

	.saf-htd {
		top: 13.6cqw;
		right: 7.4cqw;
		left: auto;
		width: 20.5cqw;
		min-width: 0;
	}

	.saf-header__text {
		left: var(--saf-pad);
		right: auto;
		bottom: 16cqw;
		display: flex;
		align-items: flex-end;
		gap: 4.4cqw;
	}

	.saf-title {
		margin: 0;
		font-size: 6.5cqw;
		line-height: 1.2;
		max-width: 6.2em;
	}

	.saf-title > span { width: auto; }

	/* The date runs upwards inside the stem of the F, clear of its outline
	   (the stem spans 52.7–78.7cqw). */
	.saf-date {
		position: absolute;
		left: calc(56cqw - var(--saf-pad));
		bottom: 0;
		writing-mode: vertical-rl;
		transform: rotate(180deg);
		font-size: 3.05cqw;
		line-height: 1;
		white-space: nowrap;
		padding-left: 0.1em;
	}
}

/* ---------- Screen-reader copy made by header.js ---------- */

.saf-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ================= Motion (only after header.js adds .saf-anim) ================= */

.saf-header {
	--saf-ease-draw: cubic-bezier(.65, 0, .35, 1);
	--saf-ease-out: cubic-bezier(.16, 1, .3, 1);
}

.saf-mono--s { --saf-d: .35s; }
.saf-mono--a { --saf-d: .95s; }
.saf-mono--f { --saf-d: 1.55s; }

/* Split title: each letter carries its slice of the shared gold gradient. */
.saf-split .saf-title > span {
	background: none;
	-webkit-text-fill-color: currentColor;
}

.saf-w { display: inline-block; white-space: nowrap; }

.saf-ch {
	display: inline-block;
	background: var(--saf-gold-text);
	background-size: var(--saf-gw, 100%) 100%;
	background-position: calc(var(--saf-gx, 0px) * -1) 0;
	background-repeat: no-repeat;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

/* Start state */
.saf-anim .saf-ch {
	opacity: 0;
	transform: scale(2.6);
	transition:
		opacity .6s ease-out,
		transform 1.1s var(--saf-ease-out);
	transition-delay: calc(.25s + var(--i) * 34ms);
}

.saf-anim .saf-date .saf-w {
	opacity: 0;
	transform: translateY(.6em) scale(1.25);
	transition: opacity .8s ease-out, transform 1s var(--saf-ease-out);
	transition-delay: calc(1.6s + var(--i) * 70ms);
}

.saf-anim .saf-htd {
	opacity: 0;
	transform: scale(1.3);
	transition: opacity 1s ease-out, transform 1.4s var(--saf-ease-out);
	transition-delay: 2.1s;
}

.saf-anim .saf-mono__fill { fill-opacity: 0; }

.saf-anim .saf-mono__line {
	stroke-dasharray: 1 1;
	stroke-dashoffset: 1;
}

.saf-anim .saf-mono__glint {
	display: inline;
	fill: none;
	stroke: #FFF8D6;
	stroke-width: calc(var(--saf-sw, 4) * 2.4);
	stroke-linecap: round;
	stroke-dasharray: .045 1;
	stroke-dashoffset: .045;
	opacity: 0;
	filter: drop-shadow(0 0 3px #FFF1A8) drop-shadow(0 0 8px rgba(255, 236, 160, .7));
}

/* In view */
.saf-anim.is-in .saf-ch,
.saf-anim.is-in .saf-date .saf-w,
.saf-anim.is-in .saf-htd {
	opacity: 1;
	transform: none;
}

/* The mobile date is rotated; keep that rotation while it settles. */
@media (max-width: 639px) {
	.saf-anim .saf-date .saf-w { transform: translateX(-.6em) scale(1.25); }
	.saf-anim.is-in .saf-date .saf-w { transform: none; }
}

.saf-anim.is-in .saf-mono__line {
	animation: saf-draw 1.9s var(--saf-ease-draw) var(--saf-d) forwards;
}

.saf-anim.is-in .saf-mono__glint {
	animation: saf-glint 1.9s var(--saf-ease-draw) var(--saf-d) forwards;
}

.saf-anim.is-in .saf-mono__fill {
	animation: saf-fill 1.2s ease-out calc(var(--saf-d) + 1.5s) forwards;
}

@keyframes saf-draw {
	to { stroke-dashoffset: 0; }
}

/* The spark rides on the tip of the line being drawn. */
@keyframes saf-glint {
	0% { stroke-dashoffset: .045; opacity: 0; }
	6% { opacity: 1; }
	88% { opacity: 1; }
	100% { stroke-dashoffset: -.955; opacity: 0; }
}

@keyframes saf-fill {
	to { fill-opacity: 1; }
}

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

@media (max-width: 639px) {
	.saf-header .saf-title { margin: 0; }
}

/* ============================================================
   Ruled grid — the page's signature layout (DESIGN.md → Layout)
   ============================================================ */

:root {
	--saf-rule: 1px solid var(--wp--preset--color--crimson-dark);
	--saf-cell-pad: var(--wp--preset--spacing--md);
}

/* === sticky navigation row === */

.saf-sticky {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 50;
}

.saf-nav {
	background: var(--wp--preset--color--background);
	border-bottom: var(--saf-rule);
}

.saf-nav .saf-nav__mark {
	display: none;
	margin: 0;
	font-family: var(--wp--preset--font-family--urbanist);
	font-weight: 300;
	font-size: 1.25rem;
	line-height: 1;
	color: var(--wp--preset--color--body-text);
}

.saf-nav .saf-nav__mark strong {
	font-family: var(--wp--preset--font-family--plus-jakarta-sans);
	font-weight: 800;
}

.saf-nav .wp-block-navigation__container {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 0;
	width: 100%;
}

.saf-nav .wp-block-navigation {
	width: 100%;
	margin: 0;
}

.saf-nav .wp-block-navigation-item {
	border-right: var(--saf-rule);
}

.saf-nav .wp-block-navigation-item:last-child {
	border-right: 0;
}

.saf-nav .wp-block-navigation .wp-block-navigation-item__content {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 3.5rem;
	padding: 0 0.5rem;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 800;
	text-decoration: none;
	color: var(--wp--preset--color--crimson-dark);
	transition: color 0.2s ease, box-shadow 0.2s ease;
}

.saf-nav .wp-block-navigation .wp-block-navigation-item__content:hover,
.saf-nav .wp-block-navigation .wp-block-navigation-item__content.is-current {
	color: var(--wp--preset--color--body-text);
	box-shadow: inset 0 -3px var(--wp--preset--color--crimson-dark);
}

.saf-nav .wp-block-navigation .wp-block-navigation-item__content:focus-visible {
	outline: 2px solid var(--wp--preset--color--crimson-dark);
	outline-offset: -4px;
}

/* Anchored sections clear the sticky bar. */
[id] { scroll-margin-top: calc(var(--wp-admin--admin-bar--height, 0px) + 3.5rem); }

html { scroll-behavior: smooth; }

/* === the grid === */

.wp-block-group.is-style-ruled-grid {
	gap: 0;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	margin-block: 0;
}

.wp-block-group.is-style-ruled-grid > * {
	min-width: 0;
	margin: 0;
	padding: var(--saf-cell-pad);
	border-right: var(--saf-rule);
	border-bottom: var(--saf-rule);
}

/* Running text in a wide cell keeps a readable measure. */
.is-style-ruled-grid p,
.is-style-ruled-grid ul {
	max-width: 34em;
}

.is-style-ruled-grid > * > * + * {
	margin-block-start: var(--wp--preset--spacing--sm);
}

/* Section title cell: number label above the section name. */
.is-style-ruled-grid h2 {
	margin: 0;
	font-size: clamp(1.75rem, 0.6rem + 2.4vw, 3.5rem);
	overflow-wrap: anywhere;
}

.is-style-ruled-grid h3 {
	margin: 0;
}

.is-style-ruled-grid ul {
	padding-left: 1.1em;
}

.is-style-ruled-grid li + li {
	margin-top: 0.25em;
}

/* Committee name lists flow into as many columns as the cell fits. */
.is-style-ruled-grid ul.saf-names {
	max-width: none;
	columns: 3 13em;
	column-gap: var(--wp--preset--spacing--md);
}

.is-style-ruled-grid ul.saf-names li {
	break-inside: avoid;
}

/* === cell typography (block style variations) === */

.is-style-label {
	margin: 0;
	font-size: 0.75rem;
	font-weight: 800;
	line-height: 1.3;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--crimson-dark);
}

.is-style-fact {
	font-size: clamp(1.125rem, 0.8rem + 0.7vw, 1.5rem);
	font-weight: 800;
	line-height: 1.2;
	color: var(--wp--preset--color--body-text);
}

.is-style-fact a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

.is-style-placeholder {
	font-style: italic;
	color: var(--wp--preset--color--text-muted);
}

.is-style-ruled-grid .wp-element-button {
	white-space: nowrap;
}

/* === inline logos === */

.saf-logo-htd {
	width: min(100%, 15rem);
	margin: 0;
	line-height: 0;
}

.saf-logo-htd img {
	display: block;
	width: 100% !important;
	height: auto;
}

/* === buttons === */

.wp-block-button.is-style-on-crimson .wp-element-button {
	background-color: var(--wp--preset--color--cream);
	color: #8A0F30;
}

.wp-block-button.is-style-on-crimson .wp-element-button:hover {
	background-color: var(--wp--preset--color--gold-light);
	color: #8A0F30;
}

.wp-block-button.is-style-on-crimson .wp-element-button:focus-visible {
	outline-color: var(--wp--preset--color--cream);
}

/* ============================================================
   Programme — Tabs with one Table per day
   ============================================================ */

.saf-tabs .wp-block-tab-list {
	gap: 0;
	border-bottom: var(--saf-rule);
	margin-bottom: var(--wp--preset--spacing--md);
}

.saf-tabs .wp-block-tab-list button {
	margin: 0;
	padding: 0.875rem 1.5rem;
	border: 0;
	border-right: var(--saf-rule);
	border-radius: 0;
	background: none;
	font-family: var(--wp--preset--font-family--plus-jakarta-sans);
	font-size: var(--wp--preset--font-size--body);
	font-weight: 400;
	color: var(--wp--preset--color--text-muted);
	cursor: pointer;
}

.saf-tabs .wp-block-tab-list button[aria-selected="true"] {
	font-weight: 800;
	color: var(--wp--preset--color--crimson-dark);
	box-shadow: inset 0 -3px var(--wp--preset--color--crimson-dark);
}

.saf-tabs .wp-block-tab-list button:hover {
	color: var(--wp--preset--color--body-text);
}

.saf-tabs .wp-block-tab-list button:focus-visible {
	outline: 2px solid var(--wp--preset--color--crimson-dark);
	outline-offset: -4px;
}

/*
 * Programme style for Flexible Table (the plugin the programme is edited
 * with). The base look is in the plugin's Global settings: cell padding and
 * alignment, the rule under each row, the header row's colours. This adds what
 * those settings can't hold: the header type, column widths, the row looks and
 * the mobile layout. Rows take their look from their content: a merged cell
 * with bold text is a session or symposium, a merged cell with only italic text
 * is a break or discussion. Colours, sizes and highlights set in the editor (on
 * the block, on a cell, or on selected text) override this look, so these
 * rules never colour bold text the editor has coloured.
 */
.wp-block-flexible-table-block-table.is-style-programme {
	margin: 0;
	max-width: none;
	font-size: var(--wp--preset--font-size--small);
}

.wp-block-flexible-table-block-table.is-style-programme table {
	table-layout: fixed;
	line-height: 1.45;
}

/* Of the border set in Global settings, only the bottom edge shows: a rule under each row. */
.wp-block-flexible-table-block-table.is-style-programme table > :is(thead, tbody, tfoot) > tr > :is(th, td) {
	border-top-width: 0;
	border-right-width: 0;
	border-left-width: 0;
	overflow-wrap: break-word;
}

.wp-block-flexible-table-block-table.is-style-programme thead th {
	font-weight: 800;
	font-size: 0.75rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.wp-block-flexible-table-block-table.is-style-programme th:nth-child(1) { width: 11%; }
.wp-block-flexible-table-block-table.is-style-programme th:nth-child(2) { width: 24%; }

/* Talk rows: zebra in the two light grounds, times and HR/EN in muted. */
.wp-block-flexible-table-block-table.is-style-programme tbody tr {
	--saf-programme-text: var(--wp--preset--color--text-muted);
	--saf-programme-strong: var(--wp--preset--color--body-text);
	background: var(--wp--preset--color--background);
}

.wp-block-flexible-table-block-table.is-style-programme tbody tr:nth-child(even) {
	background: var(--wp--preset--color--sand);
}

/* Sessions, symposia and other full-width rows. */
.wp-block-flexible-table-block-table.is-style-programme tbody tr:has(td[colspan] strong) {
	--saf-programme-text: var(--wp--preset--color--crimson-dark);
	--saf-programme-strong: var(--wp--preset--color--crimson-dark);
	background: var(--wp--preset--color--crimson-tint);
}

.wp-block-flexible-table-block-table.is-style-programme tbody tr:has(td[colspan] strong) td {
	font-size: calc(1em * 17 / 14);
	line-height: 1.35;
}

/* Breaks and discussions. */
.wp-block-flexible-table-block-table.is-style-programme tbody tr:has(td[colspan] em):not(:has(td[colspan] strong)) {
	background: none;
}

.wp-block-flexible-table-block-table.is-style-programme tbody tr:has(td[colspan] em):not(:has(td[colspan] strong)) td {
	font-style: italic;
}

/* Default text colours, unless the block or the cell has its own. */
.wp-block-flexible-table-block-table.is-style-programme table:not(.has-text-color) tbody td {
	color: var(--saf-programme-text);
}

.wp-block-flexible-table-block-table.is-style-programme table:not(.has-text-color) tbody td:not([style^="color"], [style*=";color"], [style*="; color"]) strong:not(mark *, [class*="-color"], [style*="color"]) {
	color: var(--saf-programme-strong);
}

/* ============================================================
   Footer — the closing crimson band
   ============================================================ */

.saf-footer {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--cream);
	padding: var(--wp--preset--spacing--xl) clamp(1.25rem, 6vw, 6rem);
}

.saf-footer > * + * { margin-block-start: 0; }

/* Scales like the header monogram (--saf-h is the header height), a little
   larger, centred vertically in the footer; hidden where it would start to
   overlap the footer text. */
.saf-footer .saf-mono {
	--saf-h: clamp(320px, 25vw, 600px);
	--saf-foot-mono-h: calc(var(--saf-h) * 1.35);
	position: absolute;
	z-index: -1;
	top: calc(50% - var(--saf-foot-mono-h) / 2);
	right: 6.5vw;
	height: var(--saf-foot-mono-h);
	width: auto;
	aspect-ratio: 1311 / 1663;
	overflow: visible;
}

@media (max-width: 1259px) {
	.saf-footer .saf-mono { display: none; }
}

.saf-footer .saf-mono__fill { fill: var(--wp--preset--color--primary-deep); }

.saf-footer .saf-mono__line {
	fill: none;
	stroke: url(#saf-foot-gold);
	stroke-width: 1.5;
	vector-effect: non-scaling-stroke;
}

.saf-footer__inner {
	max-width: 46rem;
}

.saf-footer__inner > * + * { margin-block-start: var(--wp--preset--spacing--md); }

.saf-footer .saf-footer__title {
	margin: 0;
	font-family: var(--wp--preset--font-family--urbanist);
	font-weight: 300;
	font-size: clamp(2rem, 1.2rem + 2.6vw, 3.5rem);
	line-height: 1.05;
	text-transform: uppercase;
	color: var(--wp--preset--color--gold);
}

.saf-footer .saf-footer__title strong {
	display: block;
	font-family: var(--wp--preset--font-family--plus-jakarta-sans);
	font-weight: 800;
	text-transform: none;
	letter-spacing: -0.01em;
}

.saf-footer .saf-footer__date {
	margin-block-start: var(--wp--preset--spacing--sm);
	font-family: var(--wp--preset--font-family--urbanist);
	font-weight: 300;
	font-size: clamp(1.25rem, 1rem + 0.8vw, 1.75rem);
	line-height: 1.25;
	color: var(--wp--preset--color--cream);
}

.saf-footer .saf-footer__date strong {
	font-family: var(--wp--preset--font-family--plus-jakarta-sans);
	font-weight: 800;
}

.saf-footer .saf-logo-htd {
	width: clamp(9rem, 14vw, 13rem);
}

.saf-footer .saf-logo-htd a:focus-visible {
	outline: 2px solid var(--wp--preset--color--cream);
	outline-offset: 6px;
}

/* Small print sits on the light ground, in one ruled row. */
.saf-legal {
	margin: 0;
	padding: var(--wp--preset--spacing--sm) clamp(1.25rem, 6vw, 6rem);
	border-top: var(--saf-rule);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--text-muted);
	column-gap: var(--wp--preset--spacing--md);
	row-gap: var(--wp--preset--spacing--xs);
}

.saf-legal p { margin: 0; }

.saf-legal .wp-block-navigation a {
	color: var(--wp--preset--color--text-muted);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.saf-legal .wp-block-navigation a:hover { color: var(--wp--preset--color--crimson-dark); }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1099px) {
	:root { --saf-cell-pad: 1.5rem; }
}

@media (max-width: 781px) {
	:root { --saf-cell-pad: var(--wp--preset--spacing--sm); }

	.wp-block-group.is-style-ruled-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wp-block-group.is-style-ruled-grid > * {
		grid-column: 1 / -1;
		grid-row: auto;
		border-right: 0;
	}

	.wp-block-group.is-style-ruled-grid > .saf-half {
		grid-column: auto / span 1;
	}

	.wp-block-group.is-style-ruled-grid > .saf-half:nth-child(odd of .saf-half) {
		border-right: var(--saf-rule);
	}

	/* Nav: the SAF mark and the burger in one ruled row. */
	.saf-nav {
		display: flex;
		align-items: center;
		justify-content: space-between;
		min-height: 3.5rem;
		padding-inline: var(--saf-cell-pad);
	}

	.saf-nav .saf-nav__mark { display: block; }

	.saf-nav .wp-block-navigation { width: auto; }
}

/* Inside the mobile overlay the links are a plain ruled list. */
.saf-nav .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--background);
	padding: var(--wp--preset--spacing--md);
}

.saf-nav .is-menu-open .wp-block-navigation__container {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.saf-nav .is-menu-open .wp-block-navigation-item {
	width: 100%;
	border-right: 0;
	border-bottom: var(--saf-rule);
}

.saf-nav .is-menu-open .wp-block-navigation-item__content {
	justify-content: flex-start;
	font-size: var(--wp--preset--font-size--title);
	min-height: 3.75rem;
}

@media (max-width: 599px) {
	.wp-block-flexible-table-block-table.is-style-programme thead { display: none; }

	.wp-block-flexible-table-block-table.is-style-programme table,
	.wp-block-flexible-table-block-table.is-style-programme tbody,
	.wp-block-flexible-table-block-table.is-style-programme tr,
	.wp-block-flexible-table-block-table.is-style-programme td {
		display: block;
		width: auto;
	}

	/* Stacked cells: the rule moves from each cell to the row. */
	.wp-block-flexible-table-block-table.is-style-programme table > tbody > tr > td { border-bottom-width: 0; padding: 0.15rem 0.75rem; }
	.wp-block-flexible-table-block-table.is-style-programme tr { padding: 0.5rem 0; border-bottom: 1px solid var(--wp--preset--color--sand); }
	.wp-block-flexible-table-block-table.is-style-programme td:empty { display: none; }

	.saf-tabs .wp-block-tab-list button { flex: 1; padding-inline: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.saf-nav .wp-block-navigation .wp-block-navigation-item__content { transition: none; }
}
