/*
 * nsemm/footer-starfield styles - the footer SHELL + LAYOUT.
 *
 * This stylesheet owns the decomposed footer's chrome and layout: the midnight
 * <footer> shell, the clickable animated starfield, the centred content well,
 * the About / Get in touch grid, the accessibility/safeguarding row, the
 * accreditation badge ROW container, the bottom copyright row and the locale +
 * credit line. It also styles the CORE blocks the composition leans on - the
 * core social-links icons and the core navigation menus (a11y row + bottom
 * policy links) - so they match the home-v6 wireframe exactly.
 *
 * Faithful to /var/www/nsemm-design/home-v6.html (footer v2, CSS ~763-849 +
 * grid/bottom ~284-297 + responsive ~691,717).
 *
 * The per-PART copy lives in the sibling bespoke blocks' own stylesheets:
 *   - nsemm/newsletter        -> the "Stay in the loop" form
 *   - nsemm/contact-copy      -> the copy-to-clipboard email + address
 *   - nsemm/accreditation-badges -> each .ft-badge-logo frame's inner styling
 *   - nsemm/footer-credit     -> the credit line text
 * so this shell never restyles their internals, only the containers and grid.
 *
 * COLOUR MAPPING: brand hex is never hard-coded. Local vars derive from the
 * theme.json WP preset custom properties so Brand-Sync keeps recolouring this
 * CSS at runtime. Shadows use color-mix, never rgba hex.
 */

:root {
	--blue: var(--wp--preset--color--university-blue);
	--gold: var(--wp--preset--color--knowledge-gold);
	--teal: var(--wp--preset--color--discovery-teal);
	--brown: var(--wp--preset--color--foundational-brown);
	--sandy: var(--wp--preset--color--sandy-brown);
	--midnight: var(--wp--preset--color--midnight);
	--bg: var(--wp--preset--color--white);
	--gold-dark: #D4AC00; /* hover shade, not in palette */
	--r-pill: 9999px;
	--r-card: 16px;
	--body: var(--wp--preset--font-family--readex-pro);
	--head: var(--wp--preset--font-family--sora);
}

/* ── Footer shell ─────────────────────────────────────────────────────────── */
footer.nsemm-site-footer {
	background: var(--midnight);
	padding: 32px 40px 100px;
	color: color-mix(in srgb, #fff 88%, transparent);
	position: relative;
	overflow: hidden;
}

/* Subtle animated starfield: decorative, footer-only, respects reduced motion,
   low z-index so all footer content sits above it. Stars are clickable and pop
   into a tiny gold book icon then settle back into a star a couple of seconds
   later. pointer-events re-enabled per-star (the field stays click-through). */
.nsemm-site-footer .ft-stars {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	pointer-events: none;
}
.nsemm-site-footer .ft-star {
	position: absolute;
	border-radius: 50%;
	background: color-mix(in srgb, #fff 50%, transparent);
	cursor: pointer;
	pointer-events: auto;
	animation: ft-twinkle 4s ease-in-out infinite;
	transition: transform .45s cubic-bezier(.34, 1.56, .64, 1), background .35s ease;
}
.nsemm-site-footer .ft-star:hover {
	transform: scale(1.6);
}
@keyframes ft-twinkle {
	0%, 100% { opacity: .15; }
	50% { opacity: .8; }
}
/* Book icon: ALWAYS present in the DOM (just invisible / zero-scale by default)
   so both the appear AND the revert genuinely fade/scale rather than popping. */
.nsemm-site-footer .ft-star svg {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 9px;
	height: 9px;
	margin: -4.5px 0 0 -4.5px;
	stroke: var(--gold);
	stroke-width: 2;
	fill: none;
	stroke-linecap: round;
	stroke-linejoin: round;
	opacity: 0;
	transform: scale(0) rotate(0deg);
	transition: opacity .35s ease, transform .4s cubic-bezier(.34, 1.56, .64, 1);
	filter: drop-shadow(0 0 4px color-mix(in srgb, var(--gold) 60%, transparent));
	pointer-events: none;
}
/* Clicked: the dot fades out, the book icon fades + scales + spins in on top of
   it; reverting (class removed) runs the exact same transition backwards. */
.nsemm-site-footer .ft-star.is-n {
	background: transparent;
	animation: none;
	opacity: 1 !important;
}
.nsemm-site-footer .ft-star.is-n svg {
	opacity: 1;
	transform: scale(1) rotate(360deg);
}
@media (prefers-reduced-motion: reduce) {
	.nsemm-site-footer .ft-star {
		animation: none;
		opacity: .3;
		transition: background .2s;
	}
	.nsemm-site-footer .ft-star svg {
		transition: opacity .25s ease;
	}
	.nsemm-site-footer .ft-star.is-n svg {
		transform: scale(1) rotate(0deg);
	}
}

/* Content well: centred, above the starfield. */
.nsemm-site-footer .ft {
	max-width: 1240px;
	margin: 0 auto;
	position: relative;
	z-index: 1;
}

/* ── Grid: About / Get in touch ───────────────────────────────────────────── */
.nsemm-site-footer .ft-grid {
	display: grid;
	grid-template-columns: 1.6fr 1fr;
	gap: 64px;
	margin-bottom: 28px;
	align-items: start;
}
.nsemm-site-footer .ft-contact {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.nsemm-site-footer .ft-contact .ft-social {
	margin-top: 8px;
}

/* About column. The logo is a CORE site-logo; cap its height so it reads at the
   wireframe's 22px word-mark scale, and tint the description + charity badge. */
.nsemm-site-footer .ft-about .wp-block-site-logo img {
	max-height: 30px;
	width: auto;
}
.nsemm-site-footer .ft-about p {
	font-size: 14px;
	margin-top: 14px;
	line-height: 1.75;
	color: color-mix(in srgb, #fff 88%, transparent);
}
/* "Registered Charity No." badge: a core paragraph styled as the gold chip. */
.nsemm-site-footer .ft-about p.ft-badge {
	display: inline-block;
	margin-top: 16px;
	background: var(--gold);
	color: var(--brown);
	font-family: var(--head);
	font-size: 11px;
	font-weight: 700;
	padding: 5px 12px;
	border-radius: 8px;
	line-height: 1.3;
}

/* "Get in touch" heading: a core heading (level 2 — footer is a top-level
   landmark, so an h2 avoids an h2->h4 skip) tuned to the wireframe. */
.nsemm-site-footer .ft-col h2 {
	font-family: var(--head);
	font-weight: 700;
	font-size: 12px;
	color: #fff;
	text-transform: uppercase;
	letter-spacing: .08em;
	margin-bottom: 16px;
}

/* ── Social icons (CORE social-links, restyled to the wireframe pills) ─────── */
.nsemm-site-footer .ft-social {
	display: flex;
	gap: 10px;
	padding: 0;
}
.nsemm-site-footer .ft-social .wp-social-link {
	width: 34px;
	height: 34px;
	margin: 0;
	padding: 0;
	border-radius: 50%;
	background: color-mix(in srgb, #fff 8%, transparent);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .18s, transform .18s;
}
.nsemm-site-footer .ft-social .wp-social-link:hover {
	background: var(--gold);
	transform: translateY(-2px);
}
.nsemm-site-footer .ft-social .wp-social-link a {
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}
.nsemm-site-footer .ft-social .wp-social-link svg {
	width: 16px;
	height: 16px;
	fill: #fff;
	transition: fill .18s;
}
.nsemm-site-footer .ft-social .wp-social-link:hover svg {
	fill: var(--brown);
}

/* ── Accessibility + safeguarding row ─────────────────────────────────────── */
.nsemm-site-footer .ft-a11y-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 18px;
	margin-top: 0;
	margin-bottom: 16px;
}

/* The a11y/safeguarding links are now a CORE navigation menu (the "footer"
   location). Lay it out as the wireframe's inline link row and recolour it. */
.nsemm-site-footer .ft-a11y {
	display: flex;
	gap: 18px;
	flex-wrap: wrap;
}
.nsemm-site-footer .ft-a11y .wp-block-navigation__container {
	display: flex;
	gap: 18px;
	flex-wrap: wrap;
}
.nsemm-site-footer .ft-a11y .wp-block-navigation-item {
	margin: 0;
}
.nsemm-site-footer .ft-a11y .wp-block-navigation-item__content {
	font-size: 13px;
	color: color-mix(in srgb, #fff 88%, transparent);
	text-decoration: none;
	transition: color .15s;
}
.nsemm-site-footer .ft-a11y .wp-block-navigation-item__content:hover {
	color: var(--gold);
}

/* ── Accreditation badge ROW (the frames are the bespoke block) ───────────── */
.nsemm-site-footer .ft-badges {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}

/* ── Bottom copyright row ─────────────────────────────────────────────────── */
.nsemm-site-footer .ft-btm {
	border-top: 1px solid color-mix(in srgb, #fff 8%, transparent);
	padding: 28px 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 13px;
	flex-wrap: wrap;
	gap: 12px;
}
/* Copyright text: a core paragraph; strip its default block margins. */
.nsemm-site-footer .ft-btm > p {
	margin: 0;
	font-size: 13px;
	color: color-mix(in srgb, #fff 88%, transparent);
}
/* Bottom policy links: a CORE navigation menu ("footer-bottom" location),
   laid out as the wireframe's quiet right-aligned link cluster. */
.nsemm-site-footer .ft-btm-links .wp-block-navigation__container {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
}
.nsemm-site-footer .ft-btm-links .wp-block-navigation-item {
	margin: 0;
}
.nsemm-site-footer .ft-btm-links .wp-block-navigation-item__content {
	color: color-mix(in srgb, #fff 88%, transparent);
	text-decoration: none;
	margin-left: 20px;
	font-size: 13px;
	transition: color .15s;
}
.nsemm-site-footer .ft-btm-links .wp-block-navigation-item__content:hover {
	color: #fff;
}

/* ── DARK-MODE TOGGLE (footer mirror instance) ──
   Injected into the .ft-btm bottom row by the theme (render_block filter on this
   block) so the static save() markup stays untouched. Quiet muted-white glyph to
   match the bottom policy-link cluster, brightening to gold on hover; ≥44px hit
   target. The icon swap is attribute-driven exactly like the header instance.
   Because the footer is an always-dark island whose local aliases are re-pinned
   to light values under dark mode, the toggle here keeps the same look in both
   themes (correct: the footer is dark in both). */
.nsemm-site-footer .nsemm-theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	margin-right: 8px;
	padding: 0 8px;
	background: transparent;
	border: none;
	cursor: pointer;
	color: color-mix(in srgb, #fff 55%, transparent);
	line-height: 0;
	transition: color .15s;
}
.nsemm-site-footer .nsemm-theme-toggle:hover {
	color: var(--gold);
}
.nsemm-site-footer .nsemm-theme-toggle .nsemm-toggle-icon { display: block; }
.nsemm-site-footer .nsemm-theme-toggle .nsemm-toggle-sun { display: none; }
.nsemm-site-footer .nsemm-theme-toggle .nsemm-toggle-moon { display: block; }
html[data-theme="dark"] .nsemm-site-footer .nsemm-theme-toggle .nsemm-toggle-sun { display: block; }
html[data-theme="dark"] .nsemm-site-footer .nsemm-theme-toggle .nsemm-toggle-moon { display: none; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]):not([data-theme="dark"]) .nsemm-site-footer .nsemm-theme-toggle .nsemm-toggle-sun { display: block; }
	:root:not([data-theme="light"]):not([data-theme="dark"]) .nsemm-site-footer .nsemm-theme-toggle .nsemm-toggle-moon { display: none; }
}

/* ── Focus ring on the dark footer (on-brand gold, not the browser default) ── */
.nsemm-site-footer a:focus-visible,
.nsemm-site-footer button:focus-visible,
.nsemm-site-footer input:focus-visible {
	outline: 3px solid var(--gold);
	outline-offset: 3px;
	border-radius: 8px;
	box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold) 35%, transparent);
	transition: outline-offset .15s ease, box-shadow .15s ease;
}

/* ── Responsive (wireframe breakpoints: 1000px, 600px) ────────────────────── */
@media (max-width: 1000px) {
	.nsemm-site-footer .ft-grid {
		grid-template-columns: 1fr 1fr;
		gap: 32px;
	}
}
@media (max-width: 600px) {
	.nsemm-site-footer .ft-grid {
		grid-template-columns: 1fr;
	}
}
