/*
Theme Name: San Isidro Elementary School
Description: A playful, warm theme for San Isidro Elementary School, City of Talisay, Cebu. Colours drawn from the school seal, an animated landscape banner that follows the time of day, and dashboard-managed announcements and events.
Version: 0.20.8
Requires at least: 6.2
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sies
*/

/* ---------- Tokens ---------- */

:root {
	/* Seal colours */
	--brand: #2b3190;
	--on-brand: #ffffff;
	--primary: #2b3190;
	--on-primary: #ffffff;
	--red: #c81d25;
	--leaf: #0b7f3b;
	--accent: #ffb81c;

	--bg: #fffaf1;
	--surface: #ffffff;
	--ink: #1c2145;
	--muted: #565b7a;
	--line: #ebe2d0;
	--tint: #eef1ff;
	--tint-warm: #fff1d6;

	/* Landscape */
	--sky-top: #74c8fb;
	--sky-bottom: #e4f6ff;
	--sun: #ffc93c;
	--sun-glow: rgba(255, 201, 60, 0.35);
	--sun-x: 110px;
	--sun-y: -120px;
	--cloud: #ffffff;
	--hill-back: #a5df8f;
	--hill-front: #62c06f;
	--tree: #2f9e5b;
	--trunk: #8a5a3c;
	--wall: #fff3d6;
	--roof: #e0503f;
	--window: #8fd3ff;
	--stars: 0;
	--birds: 1;
	--night: 0;


	/* Spacing scale: every gap on the site comes from these. */
	--s1: 8px;
	--s2: 16px;
	--s3: 24px;
	--s4: 40px;
	--s5: clamp(48px, 7vw, 88px);

	--radius: 20px;
	--radius-sm: 12px;
	--shadow: 0 12px 32px rgba(28, 33, 69, 0.12);
	--font-display: "Baloo 2", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
	--font-body: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
}

:root[data-theme="dawn"] {
	--bg: #fff5ea;
	--line: #f1dcc9;
	--tint: #f3eefe;
	--tint-warm: #ffe9d2;
	--sky-top: #f59f9c;
	--sky-bottom: #ffe4bd;
	--sun: #ff9a3d;
	--sun-glow: rgba(255, 154, 61, 0.45);
	--sun-x: 700px;
	--sun-y: 318px;
	--cloud: #fff1e6;
	--hill-back: #9fd096;
	--hill-front: #66b574;
	--birds: 0.8;
}

:root[data-theme="afternoon"] {
	--bg: #fffbf0;
	--tint-warm: #ffedc7;
	--sky-top: #3fa9f5;
	--sky-bottom: #d3f0ff;
	--sun: #ffd23f;
	--sun-glow: rgba(255, 210, 63, 0.45);
	--sun-x: 1340px;
	--sun-y: -170px;
	--hill-back: #9ad97f;
	--hill-front: #55b85f;
}

:root[data-theme="evening"] {
	--bg: #fff3ea;
	--line: #efd9cc;
	--tint: #f1ecfb;
	--tint-warm: #fde4d6;
	--sky-top: #4d418f;
	--sky-bottom: #ff9c73;
	--sun: #ff6b4a;
	--sun-glow: rgba(255, 107, 74, 0.45);
	--sun-x: 880px;
	--sun-y: 296px;
	--cloud: #ffd3c0;
	--hill-back: #5f9f7c;
	--hill-front: #37815a;
	--tree: #25704a;
	--window: #ffe08a;
	--stars: 0.45;
	--birds: 0.5;
}

:root[data-theme="night"] {
	--brand: #151b47;
	--primary: #a9b6ff;
	--on-primary: #10163a;
	--red: #ff8f8f;
	--leaf: #7fdca0;
	--accent: #ffd166;

	--bg: #0f1533;
	--surface: #1a2250;
	--ink: #eef1ff;
	--muted: #b8c0e4;
	--line: #2d3870;
	--tint: #212b61;
	--tint-warm: #2a2f5c;

	--sky-top: #080d2b;
	--sky-bottom: #2b3a80;
	--sun: #f6f2d2;
	--sun-glow: rgba(246, 242, 210, 0.1);
	--sun-x: 1340px;
	--sun-y: -170px;
	--cloud: #36457f;
	--hill-back: #234c78;
	--hill-front: #193b5c;
	--tree: #164a68;
	--trunk: #3b3350;
	--wall: #454f80;
	--roof: #7b4766;
	--window: #ffe08a;
	--stars: 1;
	--night: 1;
	--birds: 0;
	--shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* Without JavaScript, follow the device setting. */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme]) {
		--brand: #151b47;
		--primary: #a9b6ff;
		--on-primary: #10163a;
		--red: #ff8f8f;
		--leaf: #7fdca0;
		--accent: #ffd166;
		--bg: #0f1533;
		--surface: #1a2250;
		--ink: #eef1ff;
		--muted: #b8c0e4;
		--line: #2d3870;
		--tint: #212b61;
		--tint-warm: #2a2f5c;
		--sky-top: #080d2b;
		--sky-bottom: #2b3a80;
		--sun: #f6f2d2;
		--sun-glow: rgba(246, 242, 210, 0.1);
		--sun-x: 1340px;
		--sun-y: -170px;
		--cloud: #36457f;
		--hill-back: #234c78;
		--hill-front: #193b5c;
		--tree: #164a68;
		--trunk: #3b3350;
		--wall: #454f80;
		--roof: #7b4766;
		--window: #ffe08a;
		--stars: 1;
		--night: 1;
		--birds: 0;
		--shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
	}
}

/* ---------- Base ---------- */

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

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 1.0625rem;
	line-height: 1.65;
	transition: background-color 0.8s ease, color 0.8s ease;
}

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

h1,
h2,
h3,
h4 {
	margin: 0 0 var(--s2);
	font-family: var(--font-display);
	line-height: 1.15;
	text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
h3 { font-size: 1.25rem; }

p,
ul,
ol,
blockquote {
	margin: 0 0 var(--s2);
}

a {
	color: var(--primary);
	text-underline-offset: 0.18em;
}

a:hover {
	text-decoration-thickness: 2px;
}

:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 3px;
	border-radius: 6px;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.skip-link:focus {
	position: fixed;
	top: var(--s2);
	left: var(--s2);
	z-index: 1000;
	width: auto;
	height: auto;
	clip-path: none;
	padding: var(--s1) var(--s2);
	background: var(--surface);
	color: var(--ink);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow);
}

.wrap {
	width: min(1160px, 100% - 2 * var(--s2));
	margin-inline: auto;
}

.narrow {
	width: min(760px, 100% - 2 * var(--s2));
	margin-inline: auto;
}

/* ---------- Top bar ---------- */

.topbar {
	background: var(--brand);
	color: var(--on-brand);
	font-size: 0.875rem;
	transition: background-color 0.8s ease;
}

.topbar .wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--s1) var(--s3);
	padding-block: var(--s1);
}

.topbar a {
	color: inherit;
	font-weight: 700;
	text-decoration: none;
}

.topbar a:hover {
	text-decoration: underline;
}

.topbar-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--s1) var(--s2);
}

.appearance {
	display: inline-flex;
	padding: 3px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.16);
}

.appearance button {
	padding: 2px 12px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.appearance button[aria-pressed="true"] {
	background: #ffffff;
	color: #1c2145;
}

/* The switcher needs JavaScript. */
html:not(.js) .appearance {
	display: none;
}

/* Date and time */

.clock {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.clock svg {
	flex: none;
	width: 1.1em;
	height: 1.1em;
}

.topbar-id {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-right: auto;
	padding-left: var(--s2);
	border-left: 1px solid rgba(255, 255, 255, 0.35);
	opacity: 0.9;
}

.ph-flag-icon {
	flex: none;
	width: 26px;
	height: 13px;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.hero-clock {
	display: flex;
	margin: var(--s2) 0 var(--s1);
	color: var(--primary);
	font-size: 0.95rem;
}

.footer-clock {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--s1);
	margin: var(--s3) 0 0;
	color: var(--muted);
	font-size: 0.9rem;
}

.footer-login {
	margin-left: auto;
	font-weight: 700;
}

/* ---------- Header ---------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--surface);
	box-shadow: 0 2px 0 var(--line);
	transition: background-color 0.8s ease;
}

/* Logged-in editors see the WordPress toolbar above the page; the header sticks below it. */
.admin-bar .site-header {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .site-header {
		top: 46px;
	}
}

@media (max-width: 600px) {
	/* The toolbar scrolls away at this width. */
	.admin-bar .site-header {
		top: 0;
	}
}

/* Seal-colour stripe under the header. */
.site-header::after {
	content: "";
	display: block;
	height: 5px;
	background: linear-gradient(90deg, var(--red) 0 25%, var(--accent) 25% 50%, var(--leaf) 50% 75%, var(--primary) 75%);
}

.site-header .wrap {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--s1) var(--s2);
	padding-block: var(--s1);
}

.brand {
	display: flex;
	align-items: center;
	gap: var(--s2);
	margin-right: auto;
	color: var(--ink);
	text-decoration: none;
}

.brand-mark {
	display: grid;
	place-items: center;
	flex: none;
	position: relative;
	--pad: 4px;
	width: clamp(64px, 8vw, 88px);
	height: clamp(64px, 8vw, 88px);
	padding: var(--pad);
	border-radius: 50%;
	transition: transform 0.3s ease;
}

/* A band of light crossing the logo, over and over. It is clipped to a circle;
   for the bundled seal that circle is the blue badge, leaving the laurels alone. */
.brand-shine {
	position: absolute;
	inset: var(--pad);
	overflow: hidden;
	clip-path: circle(50%);
	pointer-events: none;
}

.has-seal .brand-shine {
	clip-path: circle(36.5% at 50.2% 39.6%);
}

.brand-shine i {
	position: absolute;
	inset: 0;
	background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.95) 50%, transparent 70%);
	transform: translateX(-100%);
	animation: shine 7s ease-in-out infinite;
}

.brand:hover .brand-mark {
	transform: rotate(-6deg) scale(1.05);
}

.brand-mark img,
.brand-mark svg {
	width: 100%;
	height: 100%;
	object-fit: contain;
	/* By day a white outline round the logo's own shape; at night the outline plus a soft glow (filters are in header.php). */
	filter: url(#sies-logo-stroke);
}

:root[data-theme="night"] .brand-mark img {
	filter: url(#sies-logo-night);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme]) .brand-mark img {
		filter: url(#sies-logo-night);
	}
}

/* The preloader shows the seal plain at night: no glow there. */
:root[data-theme="night"] .intro .brand-mark img {
	filter: none;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme]) .intro .brand-mark img {
		filter: none;
	}
}

.logo-filter {
	position: absolute;
}

.brand-name {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: clamp(1.05rem, 2.4vw, 1.35rem);
	line-height: 1.1;
}

.brand-place {
	display: block;
	margin-top: 2px;
	color: var(--muted);
	font-family: var(--font-body);
	font-weight: 700;
	font-size: 0.8rem;
	letter-spacing: 0.02em;
}

/* Login: a button in the header that opens the three ways in. */

.login-menu {
	position: relative;
	order: 3;
}

.login-menu summary {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: var(--s1) var(--s2);
	border-radius: 999px;
	background: var(--accent);
	color: #1c2145;
	font-family: var(--font-display);
	font-weight: 800;
	list-style: none;
	cursor: pointer;
	transition: transform 0.2s ease;
}

.login-menu summary::-webkit-details-marker {
	display: none;
}

.login-menu summary:hover {
	transform: translateY(-2px);
}

.login-menu summary svg,
.login-account svg {
	width: 20px;
	height: 20px;
}

/* Signed in: "My dashboard" and "Logout" side by side. */
.login-account {
	display: flex;
	align-items: center;
	gap: 8px;
	order: 3;
}

/* Outlined, in the page's own ink, so it reads clearly by day and at night. */
.login-dash {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: calc(var(--s1) - 2px) calc(var(--s2) - 2px);
	border: 2px solid var(--primary);
	border-radius: 999px;
	background: var(--surface);
	color: var(--ink);
	font-family: var(--font-display);
	font-weight: 800;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

/* Hover: it fills with the outline's colour. */
.login-dash:hover,
.login-dash:focus-visible {
	background: var(--primary);
	color: var(--on-primary);
}

/* Icon and word on one line, centred on each other. */
.login-account svg {
	display: block;
	flex: none;
}

.login-account span {
	display: block;
}

.login-logout {
	display: inline-flex;
	align-items: center;
	line-height: 1.2;
	gap: 6px;
	padding: calc(var(--s1) - 2px) calc(var(--s2) - 2px);
	border: 2px solid #a8101a;
	border-radius: 999px;
	background: #a8101a;
	color: #ffffff;
	font-family: var(--font-display);
	font-weight: 800;
	letter-spacing: 0.01em;
	text-decoration: none;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Hover: a deeper red. */
.login-logout:hover,
.login-logout:focus-visible {
	border-color: #7d0a12;
	background: #7d0a12;
	color: #ffffff;
}

.login-dash:focus-visible,
.login-logout:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 2px;
}

.login-menu ul {
	position: absolute;
	top: calc(100% + var(--s1));
	right: 0;
	z-index: 60;
	width: 280px;
	margin: 0;
	padding: var(--s1);
	border: 2px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
	list-style: none;
	animation: intro-rise 0.2s ease both;
}

.login-menu li {
	margin: 0;
}

.login-menu a {
	display: block;
	padding: 10px var(--s2);
	border-radius: var(--radius-sm);
	color: var(--ink);
	text-decoration: none;
}

.login-menu a:hover,
.login-menu a:focus-visible {
	background: var(--tint);
}

.login-menu strong {
	display: block;
	font-family: var(--font-display);
}

.login-menu small {
	color: var(--muted);
}

.menu-toggle {
	display: none;
	padding: var(--s1) var(--s2);
	border: 2px solid var(--primary);
	border-radius: 999px;
	background: transparent;
	color: var(--primary);
	font: inherit;
	font-weight: 800;
	cursor: pointer;
}

.site-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav a {
	position: relative;
	display: block;
	padding: var(--s1) 11px;
	border-radius: 999px;
	color: var(--ink);
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.05rem;
	text-decoration: none;
	transition: color 0.2s ease, background-color 0.2s ease;
}

/* Crayon underline that grows on hover. */
.site-nav a::after {
	content: "";
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 3px;
	height: 4px;
	border-radius: 4px;
	background: var(--accent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.25s ease;
}

.site-nav a:hover {
	color: var(--primary);
}

.site-nav a:hover::after {
	transform: scaleX(1);
}

/* The current page keeps its underline. It stays a link in looks, so it is never mistaken for a button. */
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a,
.site-nav .current-menu-ancestor > a,
.site-nav .is-current > a {
	color: var(--primary);
}

.site-nav .current-menu-item > a::after,
.site-nav .current_page_item > a::after,
.site-nav .current-menu-ancestor > a::after,
.site-nav .is-current > a::after {
	transform: scaleX(1);
}

/* Pages grouped under a heading open in a small panel below it. */

.site-nav li {
	position: relative;
	margin: 0;
}

.site-nav .caret {
	display: inline-block;
	width: 7px;
	height: 7px;
	margin: 0 0 3px 7px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s ease;
}

.site-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 60;
	display: block;
	min-width: 230px;
	padding: var(--s1);
	border: 2px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.site-nav li:hover > .sub-menu,
.site-nav li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.site-nav li:hover > a .caret,
.site-nav li:focus-within > a .caret {
	transform: rotate(225deg) translate(-3px, -3px);
}

.site-nav .sub-menu a {
	padding: 10px var(--s2);
	border-radius: var(--radius-sm);
	font-size: 1rem;
	white-space: nowrap;
}

.site-nav .sub-menu a::after {
	display: none;
}

.site-nav .sub-menu a:hover,
.site-nav .sub-menu .is-current > a,
.site-nav .sub-menu .current-menu-item > a {
	background: var(--tint);
}

@media (max-width: 960px) {
	.js .menu-toggle {
		display: inline-block;
	}

	.site-nav {
		flex-basis: 100%;
	}

	.js .site-nav:not(.is-open) {
		display: none;
	}

	.site-nav ul {
		flex-direction: column;
		padding-bottom: var(--s1);
	}

	.topbar-id {
		display: none;
	}

	.topbar .wrap {
		justify-content: center;
	}
}

/* ---------- Banner ---------- */

.hero {
	position: relative;
	padding: var(--s5) 0 clamp(190px, 25vw, 300px);
	background: linear-gradient(var(--sky-top), var(--sky-bottom));
	overflow: hidden;
	transition: background 0.8s ease;
}

.landscape {
	position: absolute;
	inset: auto 0 0 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.landscape * {
	transition: fill 0.8s ease, opacity 0.8s ease, transform 1.6s ease;
}

.ls-sun { fill: var(--sun); opacity: calc(1 - var(--night)); transition: opacity 0.8s ease; }
.ls-moon { fill: var(--sun); opacity: var(--night); transition: opacity 0.8s ease; }
.ls-crater { fill: #d9d4ac; }

/* Things that are only out by day (the kite on inner pages). */
.ls-day { opacity: calc(1 - var(--night)); transition: opacity 0.8s ease; }

/* The owl sits in the big tree and blinks. Only out at night. */
.ls-owl { opacity: var(--night); transition: opacity 0.8s ease; }
.ls-owl-branch { fill: none; stroke: #5b4a3a; stroke-width: 5; stroke-linecap: round; }
.ls-owl-body { fill: #b98d5f; }
.ls-owl-wing { fill: #8c6740; }
.ls-owl-belly { fill: #f1dfbd; }
.ls-owl-feather { fill: none; stroke: #c9a877; stroke-width: 1.2; stroke-linecap: round; }
.ls-owl-eye { fill: #ffffff; }
.ls-owl-pupil { fill: #1c2145; }
.ls-owl-glint { fill: #ffffff; }
.ls-owl-beak { fill: #ffb81c; }
.ls-owl-feet { fill: none; stroke: #ffb81c; stroke-width: 2; stroke-linecap: round; }
.ls-owl-eyes { transform-box: fill-box; transform-origin: 50% 50%; animation: owl-blink 5s ease-in-out infinite; }
@keyframes owl-blink { 0%, 91%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.08); } }
.ls-glow { fill: var(--sun-glow); }
.ls-cloud { fill: var(--cloud); }
.ls-hill-back { fill: var(--hill-back); }
.ls-hill-front { fill: var(--hill-front); }
.ls-tree { fill: var(--tree); }
.ls-trunk { fill: var(--trunk); }
.ls-wall { fill: var(--wall); }
.ls-roof { fill: var(--roof); }
.ls-window { fill: var(--window); }
.ls-door { fill: var(--trunk); }
.ls-flag { fill: var(--accent); }
.ls-stars { fill: #fff; opacity: var(--stars); }
.ls-birds { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; opacity: var(--birds); }
.ls-plane { fill: var(--surface); stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; }
.ls-kite { fill: var(--red); }
.ls-kite-tail { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }

/* The Philippine flag on its pole (sies_ph_flag_pole()). */
.ph-flag-pole { fill: #c9ccd8; }
.ph-flag-finial { fill: #f5c518; }
.ph-flag .ls-wave { animation-duration: 3s; }

/* The sun (or moon) travels to its place for the time of day. */
.ls-sun-group { transform: translate(var(--sun-x), var(--sun-y)); }

.ls-pulse { transform-box: fill-box; transform-origin: center; animation: pulse 7s ease-in-out infinite; }
.ls-drift-a { animation: drift 80s linear infinite alternate; }
.ls-drift-b { animation: drift 120s linear infinite alternate-reverse; }
.ls-sway { transform-box: fill-box; transform-origin: 50% 100%; animation: sway 6s ease-in-out infinite; }
.ls-wave { transform-box: fill-box; transform-origin: 0 50%; animation: wave 2.4s ease-in-out infinite; }
.ls-fly { animation: fly 38s linear infinite; }
.ls-fly-slow { animation: fly 62s linear infinite; animation-delay: -20s; }
.ls-fly-b { animation: fly 46s linear infinite; animation-delay: -12s; }
.ls-fly-c { animation: fly 54s linear infinite; animation-delay: -34s; }
.ls-fly-d { animation: fly-back 70s linear infinite; animation-delay: -8s; }
.ls-flap { animation: flap 0.9s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.ls-glide { animation: glide 26s ease-in-out infinite; }
.ls-bob { transform-box: fill-box; transform-origin: 50% 100%; animation: bob 5s ease-in-out infinite; }
.ls-twinkle circle { animation: twinkle 3s ease-in-out infinite; }
.ls-twinkle circle:nth-child(2n) { animation-delay: -1s; }
.ls-twinkle circle:nth-child(3n) { animation-delay: -2s; }

@keyframes pulse { 50% { transform: scale(1.08); } }
@keyframes drift { from { transform: translateX(-10%); } to { transform: translateX(10%); } }
@keyframes sway { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
@keyframes wave { 50% { transform: skewY(8deg) scaleX(0.92); } }
@keyframes fly { from { transform: translateX(-10%); } to { transform: translateX(115%); } }
@keyframes flap { to { transform: scaleY(0.55); } }
@keyframes fly-back { from { transform: translateX(115%); } to { transform: translateX(-15%); } }
@keyframes glide {
	0% { transform: translate(-8%, 30px) rotate(-6deg); }
	50% { transform: translate(55%, -20px) rotate(4deg); }
	100% { transform: translate(115%, 40px) rotate(-6deg); }
}
@keyframes bob { 0%, 100% { transform: rotate(-5deg) translateY(0); } 50% { transform: rotate(6deg) translateY(-10px); } }
@keyframes twinkle { 50% { opacity: 0.25; } }

.hero .wrap {
	position: relative;
	z-index: 2;
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
	gap: var(--s4);
	align-items: center;
}

.hero.has-no-photos .wrap {
	grid-template-columns: minmax(0, 640px);
}

.hero-card {
	padding: clamp(24px, 4vw, 40px);
	background: var(--surface);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	transition: background-color 0.8s ease;
}

.hero-card h1 {
	margin-bottom: var(--s2);
}

.hero-card .lead {
	margin-bottom: var(--s3);
	color: var(--muted);
	font-size: 1.15rem;
}

.eyebrow {
	display: inline-block;
	margin-bottom: var(--s2);
	padding: 4px 14px;
	border-radius: 999px;
	background: var(--tint-warm);
	color: var(--ink);
	font-size: 0.875rem;
	font-weight: 800;
	letter-spacing: 0.03em;
}

.motto {
	margin: var(--s3) 0 0;
	padding-top: var(--s2);
	border-top: 2px dashed var(--line);
	color: var(--muted);
	font-family: var(--font-display);
	font-weight: 700;
}

/* Photo frames */

.hero-photos {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--s2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.polaroid {
	margin: 0;
	padding: 10px 10px 6px;
	background: #ffffff;
	border-radius: 6px;
	box-shadow: var(--shadow);
	transform: rotate(var(--tilt, 0deg));
	animation: float 7s ease-in-out infinite;
	transition: transform 0.3s ease;
}

.hero-photos li:nth-child(1) .polaroid { --tilt: -4deg; }
.hero-photos li:nth-child(2) .polaroid { --tilt: 3deg; animation-delay: -2s; margin-top: var(--s3); }
.hero-photos li:nth-child(3) .polaroid { --tilt: 2deg; animation-delay: -4s; }
.hero-photos li:nth-child(4) .polaroid { --tilt: -3deg; animation-delay: -5.5s; margin-top: var(--s3); }

.polaroid:hover {
	transform: rotate(0) scale(1.04);
	animation-play-state: paused;
}

.polaroid img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 4.4;
	object-fit: cover;
	object-position: 50% 30%;
	border-radius: 3px;
}

.polaroid figcaption {
	padding-top: 4px;
	color: #1c2145;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 0.85rem;
	text-align: center;
}

@keyframes float {
	0%, 100% { translate: 0 0; }
	50% { translate: 0 -8px; }
}

@media (max-width: 860px) {
	.hero .wrap {
		grid-template-columns: minmax(0, 1fr);
	}

	.hero-photos {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: var(--s1);
	}

	.hero-photos li .polaroid {
		margin-top: 0;
		padding: 5px 5px 3px;
	}

	.polaroid figcaption {
		display: none;
	}
}

/* Inner page banner */

.page-hero {
	padding: var(--s4) 0 clamp(72px, 9vw, 104px);
}

.page-hero .wrap {
	display: block;
}

.page-hero h1 {
	margin: 0;
	color: #ffffff;
	text-shadow: 0 2px 0 rgba(28, 33, 69, 0.35), 0 6px 18px rgba(28, 33, 69, 0.35);
}

.crumb {
	display: inline-block;
	margin-bottom: var(--s1);
	padding: 2px 12px;
	border-radius: 999px;
	background: var(--surface);
	color: var(--ink);
	font-size: 0.85rem;
	font-weight: 700;
	text-decoration: none;
}

/* ---------- Buttons ---------- */

.button,
.wp-block-button__link {
	display: inline-block;
	padding: 12px 24px;
	border: 2px solid var(--primary);
	border-radius: 999px;
	background: var(--primary);
	color: var(--on-primary);
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.05rem;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 0 rgba(28, 33, 69, 0.15);
}

.button.is-ghost {
	background: transparent;
	color: var(--primary);
}

.button-row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s2);
}

/* ---------- Sections ---------- */

.section {
	padding: var(--s5) 0;
}

/* A section that leads straight into the next one: no padding of its own underneath. */
.section.is-joined {
	padding-bottom: 0;
}

.section.is-tinted {
	background: var(--tint);
	transition: background-color 0.8s ease;
}

.section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--s1) var(--s3);
	margin-bottom: var(--s3);
}

.section-head h2 {
	margin: 0;
}

.section-head a {
	font-weight: 800;
}

.kicker {
	display: block;
	margin-bottom: var(--s1);
	color: var(--red);
	font-size: 0.875rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* Quick links: sit across the bottom edge of the banner. */

.quick {
	position: relative;
	z-index: 3;
	margin-top: calc(-1 * var(--s4));
}

.quick ul {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: var(--s2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.quick a > span:last-child {
	min-width: 0;
	overflow-wrap: anywhere;
}

.quick a {
	display: flex;
	align-items: center;
	gap: var(--s2);
	height: 100%;
	padding: var(--s2) var(--s3);
	background: var(--surface);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	color: var(--ink);
	text-decoration: none;
	transition: transform 0.2s ease, background-color 0.8s ease;
}

.quick a:hover {
	transform: translateY(-4px);
}

.quick-icon {
	display: grid;
	place-items: center;
	flex: none;
	width: 48px;
	height: 48px;
	border-radius: 14px;
	background: var(--icon-bg, var(--tint));
	color: var(--icon-fg, var(--primary));
}

.quick-icon svg {
	width: 26px;
	height: 26px;
}

.quick li:nth-child(1) .quick-icon { --icon-bg: var(--tint-warm); --icon-fg: var(--red); }
.quick li:nth-child(3) .quick-icon { --icon-bg: var(--tint-warm); --icon-fg: var(--leaf); }

.quick strong {
	display: block;
	font-family: var(--font-display);
	font-size: 1.1rem;
	line-height: 1.2;
}

.quick small {
	color: var(--muted);
	font-size: 0.875rem;
}

/* Two-column layouts */

.split {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
	gap: var(--s4);
	align-items: start;
}

@media (max-width: 860px) {
	.split {
		grid-template-columns: minmax(0, 1fr);
	}
}

.facts {
	position: relative;
	margin: 0;
	padding: 0 var(--s3) var(--s3);
	overflow: hidden;
	background: var(--surface);
	border: 2px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	transition: background-color 0.8s ease, border-color 0.8s ease;
}

/* A band in the school's blue with soft circles, and the seal's four colours under it. */
.facts-head {
	position: relative;
	margin: 0 calc(-1 * var(--s3)) var(--s3);
	padding: var(--s3) var(--s3) calc(var(--s3) + 6px);
	background:
		radial-gradient(circle at 88% 20%, rgba(255, 255, 255, 0.16) 0 34px, transparent 35px),
		radial-gradient(circle at 72% 105%, rgba(255, 255, 255, 0.1) 0 26px, transparent 27px),
		linear-gradient(135deg, #2b3190, #4450c8);
	color: #ffffff;
}

.facts-head::after {
	content: "";
	position: absolute;
	inset: auto 0 0;
	height: 6px;
	background: linear-gradient(90deg, #ffb81c 0 25%, #c81d25 25% 50%, #0b7f3b 50% 75%, #6f7cff 75%);
}

.facts-kicker {
	display: block;
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.85;
}

.facts h3 {
	margin: 2px 0 0;
	color: #ffffff;
	font-size: 1.6rem;
}

.facts dl {
	display: grid;
	gap: 6px;
	margin: 0;
}

.facts dl > div {
	position: relative;
	padding: 10px 10px 10px 62px;
	min-height: 60px;
	border-radius: var(--radius-sm, 12px);
	transition: background-color 0.2s ease;
}

.facts dl > div:hover {
	background: color-mix(in srgb, var(--fact) 10%, transparent);
}

.fact-icon {
	position: absolute;
	top: 10px;
	left: 8px;
	width: 42px;
	height: 42px;
	padding: 9px;
	border-radius: 14px;
	background: color-mix(in srgb, var(--fact) 18%, var(--surface));
	color: var(--fact);
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--fact) 35%, transparent);
}

.facts dt {
	color: var(--muted);
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.facts dd {
	margin: 0;
	font-weight: 700;
	line-height: 1.35;
}

.facts-id {
	font-family: var(--font-display);
	font-size: 1.25rem;
	letter-spacing: 0.08em;
}

.facts-foot {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: var(--s2) 0 0;
	padding-top: var(--s2);
	border-top: 2px dashed var(--line);
	color: var(--muted);
	font-size: 0.85rem;
	font-weight: 700;
}

.facts-foot .ph-flag-icon {
	box-shadow: 0 0 0 1px var(--line);
}

.values {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: var(--s2);
	margin: var(--s4) 0 0;
	padding: 0;
	list-style: none;
}

.values li {
	padding: var(--s2) var(--s2) var(--s3);
	background: var(--surface);
	border-radius: var(--radius);
	border-top: 6px solid var(--value, var(--primary));
	box-shadow: var(--shadow);
	text-align: center;
	transition: background-color 0.8s ease, transform 0.25s ease;
}

.values li:hover {
	transform: translateY(-4px);
}

.values li:nth-child(1) { --value: var(--accent); }
.values li:nth-child(2) { --value: var(--red); }
.values li:nth-child(3) { --value: var(--leaf); }
.values li:nth-child(4) { --value: var(--primary); }

.values strong {
	display: block;
	margin-top: var(--s1);
	font-family: var(--font-display);
	font-size: 1.25rem;
}

.values span {
	color: var(--muted);
	font-size: 0.95rem;
}

/* The illustrations (template-parts/value-art.php). */
.value-art {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 10;
	border-radius: calc(var(--radius) - 6px);
	background:
		radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--value) 30%, transparent), transparent 70%),
		color-mix(in srgb, var(--value) 14%, var(--surface));
}

.va-ground { fill: color-mix(in srgb, var(--value) 30%, var(--surface)); }
.va-main { fill: var(--value); }
.va-light { fill: #fffaf0; }
.va-soft { fill: color-mix(in srgb, var(--value) 35%, #ffffff); }
.va-soft-strong { fill: #6f7cff; }
.va-ink { fill: #1c2145; }
.va-ink-line { fill: none; stroke: #1c2145; stroke-width: 3; stroke-linecap: round; }
.va-glow { fill: #ffffff; opacity: 0.55; }
.va-rays { stroke: #ffd166; stroke-width: 3; stroke-linecap: round; opacity: 0.8; }
.va-sparkle { fill: #ffd166; }
.va-heart { fill: #ff4f6a; }
.va-skin { fill: #f2c29b; }
.va-skin-line { fill: none; stroke: #f2c29b; stroke-width: 5; stroke-linecap: round; }
.va-smile { fill: none; stroke: #1c2145; stroke-width: 1.5; stroke-linecap: round; }
.va-sun { fill: #ffc93c; }
.va-sun-line { fill: none; stroke: #ffc93c; stroke-width: 2.5; stroke-linecap: round; }
.va-trunk { fill: #8c6740; }
.va-stem { fill: none; stroke: #3d8b3d; stroke-width: 3; stroke-linecap: round; }
.va-shine { fill: #ffffff; opacity: 0.3; }
.va-flower { fill: #ff4f6a; }

/* Small motions, off when motion is reduced. */
.va-heart { transform-box: fill-box; transform-origin: center; animation: va-beat 2.4s ease-in-out infinite; }
.va-rays { transform-box: fill-box; transform-origin: 50% 100%; animation: va-glow 4s ease-in-out infinite; }
.va-sparkle path { transform-box: fill-box; transform-origin: center; animation: twinkle 2.6s ease-in-out infinite; }
.va-sparkle path:nth-child(2) { animation-delay: -0.9s; }
.va-sparkle path:nth-child(3) { animation-delay: -1.7s; }

@keyframes va-beat { 0%, 60%, 100% { transform: scale(1); } 30% { transform: scale(1.15); } }
@keyframes va-glow { 50% { opacity: 0.4; } }


/* Cards */

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
	gap: var(--s3);
	margin: 0;
	padding: 0;
	list-style: none;
}

.stack {
	display: grid;
	gap: var(--s2);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Announcement and event cards: a strip of colour along the top, a soft shadow,
   and a lift on hover, like the cards on the Contact page. */
.card {
	--card: var(--primary);
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: calc(var(--s3) + 6px) var(--s3) var(--s3);
	overflow: hidden;
	background: var(--surface);
	border: 2px solid var(--line);
	border-radius: var(--radius);
	box-shadow: 0 6px 18px rgba(28, 33, 69, 0.06);
	transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.8s ease, border-color 0.2s ease;
}

.card::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	z-index: 1;
	height: 6px;
	background: var(--card);
}

/* The colours take turns down the list. */
li:nth-child(4n + 1) > .card { --card: var(--red); }
li:nth-child(4n + 2) > .card { --card: var(--accent); }
li:nth-child(4n + 3) > .card { --card: var(--leaf); }

.card:hover {
	transform: translateY(-4px);
	border-color: var(--card);
	box-shadow: var(--shadow);
}

.card > div {
	display: flex;
	flex: 1;
	flex-direction: column;
}

.card-more {
	margin-top: auto;
	padding-top: var(--s1);
	font-weight: 800;
}

.card-more a {
	text-decoration: none;
}

.card-more a:hover {
	text-decoration: underline;
}

.card-more span[aria-hidden] {
	display: inline-block;
	transition: transform 0.2s ease;
}

.card:hover .card-more span[aria-hidden] {
	transform: translateX(4px);
}

.card-thumb {
	margin: calc(-1 * var(--s3) - 6px) calc(-1 * var(--s3)) var(--s2);
}

.card-thumb img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0;
}

.card h3 {
	margin-bottom: var(--s1);
}

.card h3 a {
	color: var(--ink);
	text-decoration: none;
}

.card h3 a:hover {
	color: var(--primary);
	text-decoration: underline;
}

.card p:last-child {
	margin-bottom: 0;
}

.card.is-row {
	flex-direction: row;
	align-items: flex-start;
	gap: var(--s2);
	padding: calc(var(--s2) + 6px) var(--s2) var(--s2);
}

.meta {
	margin-bottom: var(--s1);
	color: var(--muted);
	font-size: 0.875rem;
	font-weight: 700;
}

.date-badge {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	align-self: flex-start;
	flex: none;
	min-width: 64px;
	margin-bottom: var(--s2);
	padding: 6px 10px;
	border-radius: 14px;
	background: var(--accent);
	color: #1c2145;
	font-family: var(--font-display);
	font-weight: 800;
	line-height: 1.05;
}

.is-row .date-badge {
	margin-bottom: 0;
}

.date-badge .day {
	font-size: 1.6rem;
}

.date-badge .month {
	font-size: 0.75rem;
	text-transform: uppercase;
}

.empty {
	margin: 0;
	padding: var(--s4) var(--s3);
	border: 2px solid var(--line);
	border-top: 6px solid var(--accent);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: 0 6px 18px rgba(28, 33, 69, 0.06);
	color: var(--muted);
	font-weight: 700;
	text-align: center;
}

.notice {
	margin-bottom: var(--s3);
	padding: var(--s2) var(--s3);
	border: 2px dashed var(--accent);
	border-radius: var(--radius);
	background: var(--surface);
}

.notice > :last-child {
	margin-bottom: 0;
}

/* ---------- Announcement card ---------- */

/* Floats at the bottom left of every page. Its colours are fixed, so it looks
   the same at every time of day and always stands out from the page. */

.announce {
	position: fixed;
	left: var(--s2);
	bottom: var(--s2);
	z-index: 55;
	width: min(460px, 100vw - 2 * var(--s2));
	font-family: var(--font-display);
}

.announce-card {
	position: relative;
	display: flex;
	align-items: center;
	gap: var(--s2);
	padding: var(--s2) 44px var(--s2) var(--s2);
	overflow: hidden;
	border: 3px solid #ffb81c;
	border-radius: var(--radius);
	background: linear-gradient(135deg, #c81d25, #8f0f17 60%, #5c0a10);
	color: #ffffff;
	box-shadow: 0 14px 34px rgba(28, 33, 69, 0.4);
}

.announce:not(.is-closed) {
	animation: announce-in 0.7s cubic-bezier(0.2, 1.3, 0.4, 1) 0.6s both;
}

/* A gold ring that keeps spreading out from the card to catch the eye. */
.announce:not(.is-closed)::before {
	content: "";
	position: absolute;
	inset: 0;
	border: 4px solid #ffb81c;
	border-radius: var(--radius);
	animation: announce-glow 2.2s ease-out 1.4s infinite;
	pointer-events: none;
}

/* A band of light that sweeps across now and then. */
.announce-card::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, 0.28) 50%, transparent 60%);
	transform: translateX(-100%);
	animation: shine 4.5s ease-in-out 2s infinite;
	pointer-events: none;
}

.announce-icon {
	display: grid;
	place-items: center;
	flex: none;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: #ffb81c;
	color: #1c2145;
	box-shadow: 0 0 0 4px rgba(255, 184, 28, 0.3);
}

.announce-icon svg {
	width: 28px;
	height: 28px;
	transform-origin: 30% 60%;
	animation: announce-ring 2.4s ease-in-out infinite;
}

.announce-main {
	flex: 1;
	min-width: 0;
}

.announce-label {
	display: flex;
	align-items: center;
	gap: var(--s1);
	margin: 0 0 2px;
	color: #ffd166;
	font-size: 0.8rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.announce-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #ffd166;
	animation: announce-pulse 1.6s ease-out infinite;
}

.announce-position {
	flex: none;
	margin-left: auto;
	white-space: nowrap;
	color: rgba(255, 255, 255, 0.8);
	letter-spacing: 0;
}

.announce-items {
	margin: 0;
	padding: 0;
	list-style: none;
}

.announce-items li {
	margin: 0 0 var(--s1);
}

.announce-items li:last-child {
	margin-bottom: 0;
}

/* With JavaScript one announcement shows at a time. */
.js .announce-items li {
	display: none;
	margin: 0;
}

.js .announce-items li.is-active {
	display: block;
	animation: intro-rise 0.4s ease both;
}

.announce-text {
	display: block;
	font-size: 1.15rem;
	font-weight: 800;
	line-height: 1.25;
}

.announce-read {
	position: relative;
	z-index: 1;
	display: inline-block;
	margin-top: var(--s1);
	padding: 4px 14px;
	border-radius: 999px;
	background: #ffb81c;
	color: #1c2145;
	font-size: 0.9rem;
	font-weight: 800;
	text-decoration: none;
	white-space: nowrap;
}

.announce-read:hover {
	background: #ffffff;
}

.announce-nav {
	position: relative;
	z-index: 1;
	display: flex;
	flex: none;
	gap: 4px;
}

.announce button {
	border: 0;
	cursor: pointer;
}

.announce-nav button,
.announce-close {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.16);
	color: #ffffff;
	font: 700 22px/1 var(--font-body);
}

.announce-nav button:hover,
.announce-close:hover {
	background: rgba(255, 255, 255, 0.34);
}

.announce-close {
	position: absolute;
	z-index: 1;
	top: 6px;
	right: 6px;
	width: 30px;
	height: 30px;
}

.announce :focus-visible {
	outline-color: #ffffff;
}

/* Closed: a small button that brings the card back. */

.announce.is-closed {
	width: auto;
}

.announce.is-closed .announce-card {
	display: none;
}

.announce-reopen {
	position: relative;
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border: 3px solid #ffb81c !important;
	border-radius: 50%;
	background: #c81d25;
	color: #ffffff;
	box-shadow: var(--shadow);
}

.announce-reopen[hidden] {
	display: none;
}

.announce-reopen svg {
	width: 28px;
	height: 28px;
}

.announce-count {
	position: absolute;
	top: -6px;
	right: -6px;
	min-width: 22px;
	padding: 0 6px;
	border-radius: 999px;
	background: #ffb81c;
	color: #1c2145;
	font: 800 0.8rem/22px var(--font-body);
}

html:not(.js) .announce-close {
	display: none;
}

@keyframes announce-in {
	from {
		opacity: 0;
		transform: translateY(40px) scale(0.92);
	}
}

@keyframes announce-glow {
	0% {
		opacity: 0.9;
		transform: scale(1);
	}
	100% {
		opacity: 0;
		transform: scale(1.07, 1.3);
	}
}

@keyframes announce-pulse {
	0% {
		box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.8);
	}
	100% {
		box-shadow: 0 0 0 9px rgba(255, 209, 102, 0);
	}
}

@keyframes announce-ring {
	0%,
	70%,
	100% {
		transform: rotate(0);
	}
	76%,
	88% {
		transform: rotate(-16deg);
	}
	82%,
	94% {
		transform: rotate(12deg);
	}
}

/* Shared by the announcement card and the logo. */
@keyframes shine {
	0% {
		transform: translateX(-100%);
	}
	35%,
	100% {
		transform: translateX(100%);
	}
}

@media (max-width: 600px) {
	/* Leaves room for the accessibility button on the right. */
	.announce {
		left: 12px;
		bottom: 12px;
		width: calc(100vw - 24px - 68px);
	}

	.announce-card {
		gap: 12px;
		padding: 12px 46px 12px 12px;
	}

	.announce-icon {
		width: 40px;
		height: 40px;
	}

	.announce-icon svg {
		width: 22px;
		height: 22px;
	}

	.announce-text {
		font-size: 1rem;
	}

	.announce-nav {
		display: none;
	}
}

@media (max-width: 380px) {
	.announce-icon,
	.announce-position {
		display: none;
	}

	.announce-label {
		font-size: 0.72rem;
		letter-spacing: 0.04em;
	}
}

/* ---------- Content ---------- */

.entry {
	padding: var(--s5) 0;
}

.entry-content > * {
	max-width: 100%;
}

/* Pages span the full site width. Running text stops at a readable line length. */
.entry-content > p,
.entry-content > ul,
.entry-content > ol,
.entry-content > blockquote {
	max-width: 85ch;
}

.entry-content > .wp-block-image {
	margin: var(--s3) 0;
}

.entry-content > .wp-block-image img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 640px;
	object-fit: cover;
	border-radius: var(--radius);
}

.entry-content > h2 {
	margin-top: var(--s4);
}

.entry-content > h2:first-child {
	margin-top: 0;
}

.entry-content img {
	border-radius: var(--radius-sm);
}

.entry-content li {
	margin-bottom: var(--s1);
}

.entry-content blockquote {
	margin-inline: 0;
	padding: var(--s2) var(--s3);
	border-left: 6px solid var(--accent);
	border-radius: 0 var(--radius) var(--radius) 0;
	background: var(--tint);
}

.entry-content blockquote p:last-of-type {
	margin-bottom: 0;
}

.entry-content cite {
	display: block;
	margin-top: var(--s1);
	color: var(--muted);
	font-size: 0.9rem;
	font-style: normal;
	font-weight: 700;
}

.wp-block-gallery {
	gap: var(--s2) !important;
}

.source-note {
	margin-top: var(--s4);
	padding: var(--s2) var(--s3);
	border-left: 6px solid var(--primary);
	border-radius: 0 var(--radius) var(--radius) 0;
	background: var(--tint);
}

.source-note p {
	margin: 0;
}

/* Contact cards: a coloured icon, a small label, the detail, and one clear action. */

.contact-list {
	display: grid;
	/* Three cards on the first row, two wider ones on the second. */
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: var(--s3);
	max-width: none !important;
	margin: var(--s3) 0;
	padding: 0;
	list-style: none;
}

.contact-list li {
	--card: var(--primary);
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: var(--s2);
	margin: 0;
	padding: var(--s3);
	overflow: hidden;
	border: 2px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: 0 6px 18px rgba(28, 33, 69, 0.06);
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
	animation: sies-tile-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* A strip in the card's own colour along the top. */
.contact-list li::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 6px;
	background: var(--card);
}

.contact-list li:has(.contact-action):hover {
	transform: translateY(-4px);
	border-color: var(--card);
	box-shadow: var(--shadow);
}

.contact-list li {
	grid-column: span 2;
}

.contact-list li:nth-child(n + 4) {
	grid-column: span 3;
}

.contact-list li:nth-child(4):last-child {
	grid-column: span 6;
}

@media (max-width: 860px) {
	.contact-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--s2);
	}

	.contact-list li,
	.contact-list li:nth-child(n + 4) {
		grid-column: auto;
	}

	.contact-list li:last-child:nth-child(odd) {
		grid-column: span 2;
	}
}

@media (max-width: 600px) {
	.contact-list {
		grid-template-columns: minmax(0, 1fr);
	}

	.contact-list li,
	.contact-list li:last-child:nth-child(odd) {
		grid-column: auto;
		padding: var(--s2);
	}
}

.contact-list li:nth-child(1) { --card: var(--red); }
.contact-list li:nth-child(2) { --card: var(--leaf); animation-delay: 0.07s; }
.contact-list li:nth-child(3) { --card: var(--primary); animation-delay: 0.14s; }
.contact-list li:nth-child(4) { --card: var(--accent); animation-delay: 0.21s; }
.contact-list li:nth-child(5) { --card: #1877f2; animation-delay: 0.28s; }

.contact-icon {
	display: grid;
	place-items: center;
	flex: none;
	width: 52px;
	height: 52px;
	border-radius: 16px;
	background: color-mix(in srgb, var(--card) 16%, var(--surface));
	color: var(--card);
}

.contact-list li:nth-child(4) .contact-icon {
	color: var(--ink);
}

.contact-icon svg {
	width: 28px;
	height: 28px;
}

.contact-body {
	min-width: 0;
}

.contact-list strong {
	display: block;
	color: var(--muted);
	font-family: var(--font-body);
	font-size: 0.8rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.contact-value {
	display: block;
	margin-top: 2px;
	font-family: var(--font-display);
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.contact-value .pending {
	font-family: var(--font-body);
	font-size: 1rem;
	font-weight: 400;
}

.contact-action {
	display: inline-block;
	margin-top: var(--s1);
	font-weight: 800;
	text-decoration: none;
}

.contact-action:hover {
	text-decoration: underline;
}

.contact-action span {
	display: inline-block;
	transition: transform 0.2s ease;
}

.contact-list li:hover .contact-action span {
	transform: translateX(4px);
}

@keyframes sies-tile-in {
	from {
		opacity: 0;
		transform: translateY(16px) scale(0.97);
	}
}

.pending {
	color: var(--muted);
	font-style: italic;
}

.resource-list {
	padding-left: 1.2em;
}

.pagination,
.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s1);
	margin-top: var(--s4);
}

.page-numbers {
	padding: 6px 14px;
	border: 2px solid var(--line);
	border-radius: 999px;
	font-weight: 700;
	text-decoration: none;
}

.page-numbers.current {
	background: var(--primary);
	border-color: var(--primary);
	color: var(--on-primary);
}

/* ---------- Facebook panel ---------- */

.fb-panel {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: var(--s4);
	align-items: center;
	padding: clamp(24px, 4vw, 40px);
	background: var(--surface);
	border: 2px solid var(--line);
	border-radius: var(--radius);
	transition: background-color 0.8s ease;
}

.fb-feed {
	display: grid;
	place-items: center;
	min-height: 180px;
	padding: var(--s2);
	border-radius: var(--radius-sm);
	background: var(--tint);
	text-align: center;
}

.fb-feed iframe {
	width: 100%;
	max-width: 500px;
	height: 520px;
	border: 0;
	border-radius: var(--radius-sm);
	background: #fff;
}

.fb-feed p {
	color: var(--muted);
}

/* ---------- Visit band ---------- */

.visit {
	background: var(--brand);
	color: var(--on-brand);
	transition: background-color 0.8s ease;
}

.visit .wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--s3);
	padding-block: var(--s4);
}

.visit h2 {
	margin-bottom: var(--s1);
}

.visit p {
	margin: 0;
	opacity: 0.9;
}

.visit .button {
	border-color: var(--accent);
	background: var(--accent);
	color: #1c2145;
}

/* ---------- Footer ---------- */

.site-footer {
	padding: var(--s5) 0 var(--s3);
	background: var(--surface);
	font-size: 0.95rem;
	transition: background-color 0.8s ease;
}

.footer-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
	gap: var(--s4);
}

@media (max-width: 760px) {
	.footer-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--s3);
	}
}

.footer-brand {
	display: flex;
	gap: var(--s2);
	align-items: flex-start;
}

.footer-brand .brand-mark {
	width: 116px;
	height: 116px;
}

.site-footer h2 {
	margin-bottom: var(--s1);
	font-size: 1.15rem;
}

.site-footer ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer li {
	margin-bottom: var(--s1);
}

.footer-note {
	margin: var(--s4) 0 0;
	padding-top: var(--s2);
	border-top: 2px solid var(--line);
	color: var(--muted);
	font-size: 0.85rem;
}

/* ---------- Intro animation ---------- */

.intro {
	position: fixed;
	inset: 0;
	z-index: 999;
	display: grid;
	place-items: center;
	background: linear-gradient(var(--sky-top), var(--sky-bottom));
	/* Hides itself even if JavaScript never runs. */
	overflow: hidden;
	animation: intro-out 0.7s cubic-bezier(0.7, 0, 0.3, 1) 3.5s forwards;
}

.intro-mark {
	padding: var(--s3);
	color: var(--ink);
	font-family: var(--font-display);
	font-weight: 800;
	text-align: center;
}

.intro-mark p {
	margin: 0;
	animation: intro-rise 0.6s ease both;
}

.intro-welcome {
	margin-bottom: var(--s2) !important;
	color: var(--primary);
	font-size: clamp(1.3rem, 4vw, 1.9rem);
	letter-spacing: 0.04em;
	animation-delay: 0.1s !important;
}

.intro-name {
	display: inline-block;
	padding: 6px 22px;
	border-radius: 999px;
	background: var(--surface);
	box-shadow: var(--shadow);
	font-size: clamp(1.3rem, 4.5vw, 1.9rem);
	line-height: 1.2;
	animation-delay: 0.6s !important;
}

.intro-place {
	margin-top: var(--s2) !important;
	font-family: var(--font-body);
	font-size: 1.1rem;
	animation-delay: 0.9s !important;
}

.intro-id {
	display: inline-block;
	margin-top: var(--s1) !important;
	padding: 2px 14px;
	border-radius: 999px;
	background: var(--accent);
	color: #1c2145;
	font-size: 0.95rem;
	letter-spacing: 0.04em;
	animation-delay: 1.15s !important;
}

/* The seal with slowly turning rays behind it and four dots circling it. */
.intro-emblem {
	position: relative;
	display: grid;
	place-items: center;
	width: 220px;
	height: 220px;
	margin: 0 auto var(--s3);
}

.intro-rays {
	position: absolute;
	inset: -70px;
	border-radius: 50%;
	background: repeating-conic-gradient(rgba(255, 255, 255, 0.5) 0 7deg, transparent 7deg 20deg);
	-webkit-mask: radial-gradient(circle, transparent 36%, #000 38%, transparent 70%);
	mask: radial-gradient(circle, transparent 36%, #000 38%, transparent 70%);
	opacity: calc(1 - 0.75 * var(--night));
	animation: spin 24s linear infinite, intro-fade 1s ease 0.3s both;
}

.intro-orbit {
	position: absolute;
	inset: -16px;
	animation: spin 6s linear infinite, intro-fade 0.8s ease 0.5s both;
}

.intro-orbit i {
	position: absolute;
	width: 16px;
	height: 16px;
	border: 3px solid #ffffff;
	border-radius: 50%;
}

.intro-orbit i:nth-child(1) { top: -8px; left: calc(50% - 8px); background: #c81d25; }
.intro-orbit i:nth-child(2) { right: -8px; top: calc(50% - 8px); background: #ffb81c; }
.intro-orbit i:nth-child(3) { bottom: -8px; left: calc(50% - 8px); background: #0b7f3b; }
.intro-orbit i:nth-child(4) { left: -8px; top: calc(50% - 8px); background: #2b3190; }

/* Loading bar in the seal's colours. */
.intro-bar {
	width: 200px;
	height: 10px;
	margin: var(--s3) auto 0;
	overflow: hidden;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.55);
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7);
}

.intro-bar i {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, #c81d25, #ffb81c, #0b7f3b, #2b3190);
	transform-origin: 0 50%;
	animation: intro-load 2.9s cubic-bezier(0.3, 0.6, 0.3, 1) 0.4s both;
}

/* Two clouds drifting across. */
.intro-cloud {
	position: absolute;
	width: 130px;
	height: 44px;
	border-radius: 44px;
	background: var(--cloud);
	box-shadow: 34px -20px 0 6px var(--cloud), 78px -8px 0 -2px var(--cloud);
	opacity: 0.9;
}

.intro-cloud-a {
	top: 16%;
	left: 8%;
	animation: intro-drift 9s ease-in-out infinite alternate;
}

.intro-cloud-b {
	right: 10%;
	bottom: 18%;
	scale: 0.8;
	animation: intro-drift 11s ease-in-out infinite alternate-reverse;
}

.intro-mark {
	position: relative;
	z-index: 1;
}

.intro-mark .brand-mark {
	--pad: 0px;
	position: relative;
	width: 200px;
	height: 200px;
	margin: 0;
	border-radius: 0;
	animation: intro-pop 0.9s cubic-bezier(0.2, 1.4, 0.4, 1) 0.2s both;
}

.sies-intro-seen .intro,
.intro.is-done {
	display: none;
}

@keyframes intro-pop {
	from { transform: scale(0.2) rotate(-25deg); opacity: 0; }
	to { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes intro-rise {
	from { transform: translateY(14px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

/* The loader lifts away like a curtain. */
@keyframes intro-out {
	to { transform: translateY(-100%); visibility: hidden; }
}

@keyframes intro-fade {
	from { opacity: 0; scale: 0.6; }
}

@keyframes intro-load {
	from { transform: scaleX(0); }
}

@keyframes intro-drift {
	from { translate: -30px 0; }
	to { translate: 60px 0; }
}

@keyframes spin {
	to { rotate: 360deg; }
}

/* ---------- Map ---------- */

.map-card {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
	margin: var(--s4) 0 0;
	overflow: hidden;
	border: 2px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
}

.section .map-card {
	margin-top: 0;
}

.map-stage {
	position: relative;
	min-height: 440px;
	overflow: hidden;
	background: #cfe6c9;
}

/* The drawing */
.map-art {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	transition: transform 1.2s cubic-bezier(0.6, 0, 0.2, 1), opacity 0.8s ease 0.3s;
}

.map-land { fill: #dcedc8; }
.map-park { fill: #b5dba0; }
.map-water { fill: #a9d8f5; }
.map-roads path { fill: none; stroke: #ffffff; stroke-width: 12; stroke-linecap: round; }
.map-roads .map-road-main { stroke: #ffe08a; stroke-width: 16; stroke-dasharray: 1400; animation: map-draw 2.4s ease-out both; }
.map-blocks rect { fill: #f4e6cf; }
.map-cloud { fill: #ffffff; opacity: 0.85; }
.map-cloud-a { animation: drift 16s ease-in-out infinite alternate; }
.map-cloud-b { animation: drift 22s ease-in-out infinite alternate-reverse; }

:root[data-theme="night"] .map-land { fill: #1d2a5c; }
:root[data-theme="night"] .map-park { fill: #1f4a52; }
:root[data-theme="night"] .map-water { fill: #16335f; }
:root[data-theme="night"] .map-roads path { stroke: #3a4a8c; }
:root[data-theme="night"] .map-roads .map-road-main { stroke: #a9895a; }
:root[data-theme="night"] .map-blocks rect { fill: #2b3975; }
:root[data-theme="night"] .map-cloud { fill: #36457f; }
:root[data-theme="night"] .map-stage { background: #1d2a5c; }

/* The pin drops in, then its rings keep pulsing. */
.map-marker {
	position: absolute;
	left: 50%;
	top: 40.5%;
	width: 0;
	height: 0;
	transition: opacity 0.5s ease;
}

.map-pin {
	position: absolute;
	left: -24px;
	bottom: 0;
	width: 48px;
	max-width: none;
	height: 64px;
	filter: drop-shadow(0 6px 6px rgba(28, 33, 69, 0.35));
	animation: map-drop 0.9s cubic-bezier(0.3, 1.5, 0.5, 1) 0.6s both, map-hop 2.6s ease-in-out 1.6s infinite;
}

.map-pin path { fill: #c81d25; stroke: #ffffff; stroke-width: 3; }
.map-pin circle { fill: #ffffff; }

.map-ring {
	position: absolute;
	left: -14px;
	top: -8px;
	width: 28px;
	height: 16px;
	border: 3px solid #c81d25;
	border-radius: 50%;
	animation: map-ring 2.2s ease-out 1.4s infinite both;
}

.map-ring + .map-ring {
	animation-delay: 2.5s;
}

/* The real map fades and zooms in over the drawing, like coming down from above. */
.map-frame {
	position: absolute;
	inset: 0;
	opacity: 0;
	transform: scale(1.5);
	transition: opacity 0.9s ease, transform 1.6s cubic-bezier(0.2, 0.8, 0.2, 1);
	pointer-events: none;
}

.map-frame iframe {
	width: 100%;
	height: 100%;
	border: 0;
}

.map-card.is-open .map-art {
	transform: scale(2.4);
}

.map-card.is-open .map-marker {
	opacity: 0;
}

.map-card.is-loaded .map-art {
	opacity: 0;
}

.map-card.is-loaded .map-frame {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

/* The text beside it */
.map-info {
	align-self: center;
	padding: var(--s4) var(--s3);
}

.map-info h2 {
	margin: 0 0 var(--s1);
}

.map-address {
	margin: 0 0 var(--s1);
	font-weight: 800;
}

.map-hint {
	color: var(--muted);
}

.map-views {
	display: inline-flex;
	gap: 4px;
	padding: 4px;
	border: 2px solid var(--line);
	border-radius: 999px;
	background: var(--bg);
}

.map-views[hidden],
.map-more[hidden],
.map-info .button-row[hidden] {
	display: none;
}

.map-views button {
	padding: 8px 16px;
	border: 0;
	border-radius: 999px;
	background: none;
	color: var(--ink);
	font: 700 0.95rem var(--font-body);
	cursor: pointer;
}

.map-views button[aria-pressed="true"] {
	background: var(--primary);
	color: var(--on-primary);
}

.map-more {
	margin: var(--s2) 0 0;
	font-weight: 700;
}

@keyframes map-draw {
	from { stroke-dashoffset: 1400; }
	to { stroke-dashoffset: 0; }
}

@keyframes map-drop {
	from { transform: translateY(-220px); opacity: 0; }
}

@keyframes map-hop {
	0%, 60%, 100% { translate: 0 0; }
	75% { translate: 0 -12px; }
	88% { translate: 0 -3px; }
}

@keyframes map-ring {
	from { transform: scale(0.4); opacity: 1; }
	to { transform: scale(3.4); opacity: 0; }
}

@media (max-width: 860px) {
	.map-card {
		grid-template-columns: minmax(0, 1fr);
	}

	.map-info {
		padding: var(--s3);
	}
}

/* ---------- Day: one smooth lift for every box and button ---------- */

/* The quick links rise gently on hover. In the day themes every box you can click
   and every button moves the same way, at the same speed. Boxes that only show
   information stay still, so movement always means "this can be pressed".
   (At night they glow as well; see the next section.) */

/* A news or event card, and a contact card with an action, is clickable all over:
   its link is stretched across the whole box. */
.card,
.contact-list li {
	position: relative;
}

.card h3 a::after,
.contact-action::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

/* The address, number or email stays selectable, for copying. */
.contact-value {
	position: relative;
	z-index: 1;
}

/* Seconds tick without the text shifting about. */
.clock-text {
	font-variant-numeric: tabular-nums;
}

:root:not([data-theme="night"]) :is(.quick a, .card, .contact-list li:has(.contact-action), .map-card:not(.is-open)),
:root:not([data-theme="night"]) :is(.button, .wp-block-button__link, .login-menu summary, .menu-toggle, .announce-read, .crumb, .page-numbers) {
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.8s ease;
}

:root:not([data-theme="night"]) :is(.quick a, .card, .contact-list li:has(.contact-action), .map-card:not(.is-open)):hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow);
}

:root:not([data-theme="night"]) :is(.button, .wp-block-button__link, .login-menu summary, .menu-toggle, .announce-read, .crumb, .page-numbers):is(:hover, :focus-visible) {
	transform: translateY(-4px);
	box-shadow: 0 10px 22px rgba(28, 33, 69, 0.18);
}

/* ---------- Night: cards that stand out from the dark page ---------- */

/* By day a white card on a cream page separates by itself. At night card and page
   are both dark blue, so cards get a lighter surface, a pale edge and a soft glow. */

:root[data-theme="night"] {
	--card-bg: linear-gradient(155deg, #2c3885 0%, #1e2860 55%, #182050 100%);
	--card-line: rgba(169, 182, 255, 0.36);
	--card-glow: 0 18px 44px rgba(0, 0, 0, 0.5), 0 0 36px rgba(110, 130, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

:root[data-theme="night"] :is(.hero-card, .quick a, .facts, .card, .fb-panel, .map-card, .contact-list li, .portal-card) {
	border: 1.5px solid var(--card-line);
	background: var(--card-bg);
	box-shadow: var(--card-glow);
}

:root[data-theme="night"] :is(.login-menu ul, .a11y-panel, .portal-box, .portal-stats li, .portal-learners li, .portal-nav ul, .fb-feed, .date-badge) {
	border-color: var(--card-line);
	background: var(--card-bg);
	box-shadow: var(--card-glow);
}

:root[data-theme="night"] .portal-guardians fieldset {
	border-color: var(--card-line);
	border-top-color: var(--person);
	background: rgba(10, 15, 45, 0.35);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

:root[data-theme="night"] .portal-guardians fieldset:focus-within {
	border-color: var(--person);
	box-shadow: 0 0 0 1px var(--person), 0 0 26px color-mix(in srgb, var(--person) 40%, transparent);
}

:root[data-theme="night"] .portal-guardians fieldset :is(input[type="text"], select),
:root[data-theme="night"] .portal-guardians .sgp-photo-frame {
	background-color: rgba(10, 15, 45, 0.55);
}

:root[data-theme="night"] .portal-tips {
	background: rgba(255, 209, 102, 0.1);
}

:root[data-theme="night"] .portal-family {
	border-color: var(--card-line);
	border-left-color: var(--primary);
	background: rgba(10, 15, 45, 0.35);
}

:root[data-theme="night"] .portal-family-codes div {
	background: rgba(10, 15, 45, 0.55);
}

:root[data-theme="night"] .portal-upload {
	border-color: var(--card-line);
	background: rgba(10, 15, 45, 0.35);
}

:root[data-theme="night"] :is(.values li, .entry-content blockquote, .notice, .source-note, .portal-flash, .portal-error, .portal-waiting, .sgp-credential, .page-numbers, .empty, .crumb, .eyebrow) {
	background: var(--card-bg);
	box-shadow: var(--card-glow);
}

/* The welcome card carries the seal's four colours along its top edge. */
:root[data-theme="night"] .hero-card {
	position: relative;
	overflow: hidden;
}

:root[data-theme="night"] .hero-card::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 6px;
	background: linear-gradient(90deg, var(--red) 0 25%, var(--accent) 25% 50%, var(--leaf) 50% 75%, var(--primary) 75%);
}

/* Quick links: each tile has its own colour on its top edge and its icon. */
:root[data-theme="night"] .quick li {
	--tile: var(--primary);
}

:root[data-theme="night"] .quick li:nth-child(1) { --tile: var(--red); }
:root[data-theme="night"] .quick li:nth-child(2) { --tile: var(--accent); }
:root[data-theme="night"] .quick li:nth-child(3) { --tile: var(--leaf); }

:root[data-theme="night"] .quick a {
	border-top: 4px solid var(--tile);
}

:root[data-theme="night"] .quick a:hover {
	border-color: var(--tile);
	box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), 0 0 30px color-mix(in srgb, var(--tile) 40%, transparent);
}

:root[data-theme="night"] .quick .quick-icon {
	background: color-mix(in srgb, var(--tile) 22%, transparent);
	color: var(--tile);
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--tile) 45%, transparent);
}

:root[data-theme="night"] .card:hover {
	border-color: var(--card);
	box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), 0 0 30px color-mix(in srgb, var(--card) 40%, transparent);
}

/* Contact cards light up in their own colour, like the quick links. */
:root[data-theme="night"] .contact-list li:has(.contact-action):hover {
	border-color: var(--card);
	box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), 0 0 30px color-mix(in srgb, var(--card) 40%, transparent);
}

:root[data-theme="night"] .contact-list li:nth-child(1) { --card: var(--red); }
:root[data-theme="night"] .contact-list li:nth-child(2) { --card: var(--leaf); }
:root[data-theme="night"] .contact-list li:nth-child(4) { --card: var(--accent); }
:root[data-theme="night"] .contact-list li:nth-child(5) { --card: #6ea8ff; }

/* Every button gets the same glow on hover, in its own colour. */
:root[data-theme="night"] :is(.button, .wp-block-button__link, .login-menu summary, .menu-toggle, .announce-read, .a11y-toggle) {
	transition: box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* Not the switches made of several choices in one pill (Auto / Light / Dark, Satellite /
   Street map, the dashboard links): a glow there would spill over the neighbouring choice. */
:root[data-theme="night"] :is(.button, .wp-block-button__link, .menu-toggle):is(:hover, :focus-visible) {
	box-shadow: 0 0 0 1px var(--primary), 0 0 26px color-mix(in srgb, var(--primary) 55%, transparent);
}

:root[data-theme="night"] :is(.login-menu summary, .announce-read):is(:hover, :focus-visible) {
	box-shadow: 0 0 0 1px var(--accent), 0 0 26px color-mix(in srgb, var(--accent) 60%, transparent);
}

:root[data-theme="night"] .portal-card.is-family .button:is(:hover, :focus-visible) {
	box-shadow: 0 0 0 1px var(--red), 0 0 26px color-mix(in srgb, var(--red) 55%, transparent);
}

:root[data-theme="night"] .a11y-toggle:is(:hover, :focus-visible) {
	box-shadow: 0 0 26px rgba(110, 150, 255, 0.8);
}

:root[data-theme="night"] :is(.site-nav .sub-menu a, .login-menu a):is(:hover, :focus-visible),
:root[data-theme="night"] .site-nav .sub-menu .is-current > a {
	background: rgba(169, 182, 255, 0.24);
	box-shadow: inset 4px 0 0 var(--accent);
	color: #ffffff;
}

:root[data-theme="night"] .login-menu a:is(:hover, :focus-visible) small {
	color: #ffffff;
}

:root[data-theme="night"] :is(.site-nav .sub-menu, .login-menu ul) {
	border-color: var(--card-line);
	background: var(--card-bg);
	box-shadow: var(--card-glow);
}

/* Night: the quick links rise and light up in their own colour on hover. Every
   other box and button does the same, at the same speed. --hover is the colour
   each one lights up in; it defaults to the site's blue. */

:root[data-theme="night"] :is(.quick a, .card, .contact-list li:has(.contact-action), .map-card:not(.is-open)) {
	--hover: var(--primary);
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.8s ease;
}

:root[data-theme="night"] .quick a { --hover: var(--tile); }
:root[data-theme="night"] :is(.card, .contact-list li, .portal-card) { --hover: var(--card); }
:root[data-theme="night"] .values li { --hover: var(--value); }
:root[data-theme="night"] .portal-stats li { --hover: var(--stat); }
:root[data-theme="night"] :is(.empty, .portal-learners li) { --hover: var(--accent); }
:root[data-theme="night"] .portal-learners li.is-ready { --hover: var(--leaf); }

:root[data-theme="night"] :is(.quick a, .card, .contact-list li:has(.contact-action), .map-card:not(.is-open)):hover {
	transform: translateY(-4px);
	border-color: var(--hover);
	box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), 0 0 30px color-mix(in srgb, var(--hover) 40%, transparent);
}

/* Buttons rise too; their glow is set above. */
:root[data-theme="night"] :is(.button, .wp-block-button__link, .login-menu summary, .menu-toggle, .announce-read, .crumb, .page-numbers) {
	transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

:root[data-theme="night"] :is(.button, .wp-block-button__link, .login-menu summary, .menu-toggle, .announce-read, .crumb, .page-numbers):is(:hover, :focus-visible) {
	transform: translateY(-4px);
}

:root[data-theme="night"] :is(.crumb, .page-numbers):is(:hover, :focus-visible) {
	box-shadow: 0 0 0 1px var(--primary), 0 0 26px color-mix(in srgb, var(--primary) 55%, transparent);
}

/* ---------- Small screens ---------- */

@media (max-width: 960px) {
	/* Logo and name on the left, Menu button on the right, in one row. */
	.site-header .wrap {
		gap: var(--s1) var(--s2);
	}

	.brand {
		flex: 1;
		min-width: 0;
		margin-right: 0;
	}

	.menu-toggle {
		flex: none;
		order: 4;
	}

	.login-menu {
		order: 3;
	}

	.site-nav {
		order: 5;
	}

	/* The open menu is a list of large, easy-to-tap rows. */
	.site-nav ul {
		gap: 4px;
		padding: var(--s1) 0 var(--s2);
		border-top: 2px solid var(--line);
	}

	.site-nav a {
		padding: 12px var(--s2);
		border-radius: var(--radius-sm);
	}

	.site-nav a::after {
		display: none;
	}

	.site-nav a:hover,
	.site-nav .is-current > a,
	.site-nav .current-menu-item > a {
		background: var(--tint);
	}

	.site-nav .caret {
		display: none;
	}

	.site-nav .sub-menu {
		position: static;
		min-width: 0;
		margin: 0 0 var(--s1) var(--s2);
		padding: 0 0 0 var(--s1);
		border: 0;
		border-left: 3px solid var(--line);
		border-radius: 0;
		background: none;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}
}

@media (max-width: 600px) {
	.topbar {
		font-size: 0.8rem;
	}

	.topbar .wrap {
		padding-block: 6px;
	}

	.topbar-clock {
		flex-basis: 100%;
		justify-content: center;
		margin: 0;
	}

	.topbar-links {
		flex-wrap: nowrap;
		justify-content: space-between;
		gap: var(--s1);
		width: 100%;
	}

	.hero-clock {
		white-space: normal;
	}

	.appearance {
		margin-left: auto;
	}

	.appearance button {
		padding: 2px 10px;
	}

	.brand {
		gap: 12px;
	}

	.brand-mark {
		--pad: 2px;
		width: 52px;
		height: 52px;
	}

	.brand-name {
		font-size: 1.02rem;
	}

	.brand-place {
		font-size: 0.74rem;
	}

	.menu-toggle {
		padding: 6px 14px;
	}

	.login-menu summary {
		padding: 8px;
	}

	.login-logout {
		padding: 6px 12px;
		font-size: 0.9rem;
	}

	/* Phones, signed in: "My dashboard" and "Logout" get their own row under the header. */
	.login-account {
		order: 6;
		flex-basis: 100%;
		justify-content: center;
		gap: 8px;
		padding-top: 6px;
		border-top: 1px dashed var(--line);
	}

	.login-dash {
		padding: 6px 12px;
		font-size: 0.9rem;
	}

	.login-account svg {
		width: 18px;
		height: 18px;
	}

	/* Inner banners: the moon moves to the top right corner, clear of long page titles. */
	.page-hero .ls-sky-spot {
		transform: translate(1406px, 34px) scale(0.36);
	}

	/* Long titles wrap before they reach the owl and the flag. */
	.page-hero h1 {
		max-width: 66%;
	}

	.login-menu summary span {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
	}

	/* Banner */
	.hero {
		padding-top: var(--s3);
	}

	.hero-card {
		padding: var(--s3);
	}

	.button-row .button {
		flex: 1 1 100%;
		text-align: center;
	}

	.hero-photos {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--s2);
	}

	/* Pages */
	.entry {
		padding: var(--s4) 0;
	}

	.intro-emblem {
		width: 170px;
		height: 170px;
	}

	.intro-mark .brand-mark {
		width: 150px;
		height: 150px;
	}

	.intro-rays {
		inset: -50px;
	}

	.intro-cloud {
		scale: 0.6;
	}

	/* Quick links: one clear column, text never squeezed out of its tile. */
	.quick ul {
		grid-template-columns: minmax(0, 1fr);
		gap: 12px;
	}

	.quick a {
		padding: var(--s2);
	}

	/* Map */
	.map-card {
		grid-template-columns: minmax(0, 1fr);
	}

	.map-stage {
		min-height: 340px;
	}

	/* Room at the end of the page, so the floating buttons never sit on the last lines. */
	.site-footer {
		padding-bottom: 104px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.announce-card::after,
	.announce:not(.is-closed)::before,
	.brand-shine {
		display: none;
	}

	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}

	.intro {
		display: none;
	}
}
