/*
 * CouncilWare Vista — Theme Styles
 *
 * Contents
 *   1.  Design tokens
 *   2.  Base & typography
 *   3.  Accessibility
 *   4.  Layout & block alignment
 *   5.  Header & logo lockup
 *   6.  Navigation
 *   7.  Content, archives & search
 *   8.  Forms, buttons & tables
 *   9.  Components & block patterns
 *   10. Footer
 *   11. Responsive
 *   12. Print
 */

/* ==========================================================================
   1. Design tokens
   Mirrors theme.json so the editor and the front end never drift apart.
   ========================================================================== */

:root {
	/* Scouting America brand palette */
	--scouting-blue: #003F87;
	--scouting-dark-blue: #003366;
	--scouting-pale-blue: #9AB3D5;
	--informative-blue: #067EEB;
	--scouting-red: #CE1126;
	--scouting-dark-red: #860D1A;
	--scouting-light-red: #C54250;
	--scouting-tan: #D6CEBD;
	--scouting-dark-tan: #AD9D7B;
	--scouting-light-tan: #E9E9E4;
	--scouting-dark-gray: #232528;
	--scouting-pale-gray: #969897;
	--matrix-yellow: #FFB225;
	--matrix-green: #039B03;
	--matrix-orange: #FF6200;

	/* Semantic mappings */
	--primary-navy: var(--scouting-blue);
	--dark-navy: var(--scouting-dark-blue);
	--deep-navy: #002A5C;
	--accent-orange: var(--matrix-orange);
	--accent-yellow: var(--matrix-yellow);
	--accent-green: var(--matrix-green);
	--accent-blue: var(--informative-blue);
	--light-blue: var(--scouting-pale-blue);
	--light-gray: var(--scouting-light-tan);
	--medium-gray: var(--scouting-pale-gray);
	--body-text: #333333;
	--muted-text: #5A5D61;

	/* Accessible CTA fills — brand hues darkened to clear 4.5:1 on white. */
	--cta-green: #02700B;
	--cta-green-hover: #015807;
	--hairline: rgba(35, 37, 40, 0.14);
	--surface: #FFFFFF;
	--surface-sunken: var(--scouting-light-tan);

	/* Typography */
	--font-sans: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
	--font-slab: 'Roboto Slab', Georgia, 'Times New Roman', serif;

	/* Spacing scale */
	--space-xs: 0.5rem;
	--space-s: 1rem;
	--space-m: 1.5rem;
	--space-l: 2rem;
	--space-xl: clamp(2.5rem, 5vw, 3rem);
	--space-xxl: clamp(3.5rem, 8vw, 6rem);

	/* Layout */
	--wrap-max: 1280px;
	--wrap-gutter: clamp(1.25rem, 4vw, 2.5rem);
	--measure: 72ch;

	/* Elevation */
	--shadow-subtle: 0 1px 2px rgba(0, 63, 135, 0.06), 0 1px 3px rgba(0, 63, 135, 0.08);
	--shadow-card: 0 2px 4px rgba(0, 63, 135, 0.06), 0 8px 24px rgba(0, 63, 135, 0.10);
	--shadow-lifted: 0 8px 16px rgba(0, 63, 135, 0.10), 0 24px 48px rgba(0, 63, 135, 0.14);

	/* Shape & motion */
	--radius-s: 4px;
	--radius-m: 8px;
	--radius-l: 16px;
	--radius-pill: 999px;
	--ease: cubic-bezier(0.2, 0, 0.2, 1);
	--speed: 200ms;

	/* Focus ring */
	--focus-ring: 3px;
	--focus-color: var(--accent-yellow);
}

/* ==========================================================================
   2. Base & typography
   ========================================================================== */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: 6rem;
}

body {
	font-family: var(--font-sans);
	color: var(--body-text);
	background-color: var(--surface);
	margin: 0;
	padding: 0;
	font-size: 1.125rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-sans);
	color: var(--dark-navy);
	margin: 0 0 var(--space-s);
	line-height: 1.15;
	text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.2rem + 3.4vw, 3.375rem); font-weight: 300; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.625rem, 1.1rem + 2.2vw, 2.625rem); font-weight: 300; letter-spacing: -0.02em; }
h3 { font-size: clamp(1.375rem, 1.1rem + 1.1vw, 2rem); font-weight: 400; }
h4 { font-size: clamp(1.125rem, 1rem + 0.7vw, 1.75rem); font-weight: 500; letter-spacing: 0.01em; }
h5 { font-size: clamp(1rem, 0.95rem + 0.35vw, 1.375rem); font-weight: 700; }
h6 { font-size: 1rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

p {
	margin: 0 0 var(--space-m);
}

a {
	color: var(--accent-blue);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
	transition: color var(--speed) var(--ease);
}

a:hover {
	color: var(--primary-navy);
}

hr,
.wp-block-separator {
	border: 0;
	border-top: 1px solid var(--hairline);
	margin: var(--space-xl) auto;
}

::selection {
	background-color: var(--accent-yellow);
	color: var(--dark-navy);
}

/* Media never overflows its container. */
img,
video,
iframe,
embed,
object,
svg {
	max-width: 100%;
	height: auto;
}

img {
	vertical-align: middle;
}

/* ==========================================================================
   3. Accessibility
   ========================================================================== */

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/*
 * Skip links must be hidden until focused — not hidden permanently.
 * The previous rule hid them unconditionally, which defeated the feature.
 */
.genesis-skip-link li {
	height: 0;
	list-style: none;
	width: 0;
}

.genesis-skip-link a,
.skip-link {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.genesis-skip-link a:focus,
.screen-reader-text:focus,
.skip-link:focus {
	background-color: var(--surface);
	border-radius: var(--radius-s);
	box-shadow: var(--shadow-lifted);
	clip: auto !important;
	clip-path: none;
	color: var(--dark-navy);
	display: block;
	font-size: 1rem;
	font-weight: 600;
	height: auto;
	left: 1rem;
	line-height: normal;
	margin: 0;
	padding: 0.9rem 1.5rem;
	text-decoration: none;
	top: 1rem;
	width: auto;
	z-index: 100000;
}

/* A single, consistent focus ring for every interactive element. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
	outline: var(--focus-ring) solid var(--focus-color);
	outline-offset: 2px;
	border-radius: 2px;
}

/* Dark surfaces need a light ring to stay visible. */
.nav-primary a:focus-visible,
.site-footer a:focus-visible,
.safeguarding-banner a:focus-visible {
	outline-color: var(--accent-yellow);
	outline-offset: -2px;
}

/* Respect the user's motion preference. */
@media (prefers-reduced-motion: reduce) {

	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	/* Scale-on-hover reads as motion; swap it for a colour shift. */
	.nav-secondary .genesis-nav-menu a:hover,
	.menu-secondary a:hover,
	.footer-social-icons a:hover,
	.card:hover {
		transform: none !important;
	}
}

/* Honour forced-colors / high-contrast modes. */
@media (forced-colors: active) {

	.menu-toggle .toggle-bars span {
		background-color: CanvasText;
	}

	.button,
	.wp-block-button__link {
		border: 1px solid ButtonText;
	}
}

/* ==========================================================================
   4. Layout & block alignment
   ========================================================================== */

.wrap {
	max-width: var(--wrap-max);
	margin-inline: auto;
	padding-inline: var(--wrap-gutter);
}

.site-inner {
	padding-block: var(--space-xl);
}

.home .site-inner,
.page-template-page-elementor .site-inner,
.page-template-page-beaver-builder .site-inner,
.page-template-page-landing .site-inner,
.page-template-page-full-width .site-inner {
	padding-block: 0;
}

/*
 * Wide and full alignment. The theme supports align-wide, but nothing
 * previously implemented it — wide/full blocks rendered at content width.
 */
.entry-content > .alignwide,
.entry-content > .wp-block-group.alignwide,
.entry-content > .wp-block-cover.alignwide {
	margin-inline: calc(50% - 50vw);
	max-width: 100vw;
	width: auto;
}

.entry-content > .alignfull {
	margin-inline: calc(50% - 50vw);
	max-width: 100vw;
	width: 100vw;
}

@supports (width: 100cqw) {

	.entry-content > .alignfull {
		margin-left: calc(50% - 50vw);
		margin-right: calc(50% - 50vw);
	}
}

/* Inside a constrained wrap, re-centre wide blocks at the wide size. */
.site-inner .entry-content > .alignwide {
	margin-inline: auto;
	max-width: var(--wrap-max);
	width: 100%;
}

.alignfull > .wp-block-group__inner-container,
.alignfull > .wp-block-cover__inner-container {
	max-width: var(--wrap-max);
	margin-inline: auto;
	padding-inline: var(--wrap-gutter);
}

.alignleft {
	float: left;
	margin: 0 var(--space-m) var(--space-s) 0;
}

.alignright {
	float: right;
	margin: 0 0 var(--space-s) var(--space-m);
}

.aligncenter {
	display: block;
	margin-inline: auto;
}

/* Keep running text at a comfortable measure even in a wide column. */
.entry-content > p,
.entry-content > ul,
.entry-content > ol,
.entry-content > blockquote {
	max-width: var(--measure);
}

.entry-content > h2,
.entry-content > h3,
.entry-content > h4 {
	margin-top: var(--space-xl);
}

/* ==========================================================================
   5. Header & logo lockup
   ========================================================================== */

.site-header {
	background-color: var(--surface);
	padding-block: 1rem;
	border-bottom: 1px solid var(--hairline);
}

/*
 * flex-wrap is a safety net, not decoration. If the logo lockup plus the
 * button cluster plus search ever exceed the row — a long council name, a
 * third CTA, a wide zoom level — the cluster drops to its own line instead
 * of running off the right edge of the page.
 */
.site-header .wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: var(--space-s) var(--space-m);
}

.header-right {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: var(--space-s);
	flex: 1 1 auto;
	min-width: 0;
}

/* Never let the button cluster push past the wrap. */
.menu-secondary {
	max-width: 100%;
}

.title-area {
	max-width: 320px;
	flex-shrink: 0;
	margin: 0;
}

.site-title {
	margin: 0;
	line-height: 1;
	font-size: inherit;
	font-weight: inherit;
}

.site-description {
	display: none;
}

/*
 * Logo lockup — the council name sits directly beneath the Scouting America
 * wordmark with no divider, sized to the wordmark's own width, so the pair
 * reads as a single signature rather than two stacked elements.
 */
.site-title .logo-lockup {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 0.2rem;
	max-width: 100%;
	text-decoration: none;
}

.site-title .logo-lockup img,
.custom-logo-link img {
	display: block;
	max-height: 88px;
	max-width: 240px;
	width: auto;
	height: auto;
}

/*
 * The name takes the full width of the mark above it. Tying the two to the
 * same measure is what makes them read as one unit — a centred line of text
 * floating at its own arbitrary width reads as a second, separate element.
 */
.site-title .site-title-text {
	display: block;
	width: 100%;
	font-family: var(--font-sans);
	font-size: clamp(0.6875rem, 0.55rem + 0.35vw, 0.875rem);
	font-weight: 700;
	letter-spacing: 0.11em;
	line-height: 1.25;
	text-transform: uppercase;
	color: var(--dark-navy);
	text-decoration: none !important;
	text-align: center;
	text-wrap: balance;
	transition: color var(--speed) var(--ease);
}

.site-title .logo-lockup:hover .site-title-text,
.site-title .logo-lockup:focus-visible .site-title-text,
.site-title .site-title-text:hover,
.site-title .site-title-text:focus-visible {
	color: var(--scouting-red);
}

/* No custom logo set: the name stands alone and carries more weight. */
.site-title .site-title-text--solo {
	font-size: clamp(1.125rem, 0.9rem + 0.9vw, 1.5rem);
	letter-spacing: 0.04em;
	max-width: none;
}

/* Long council names get tighter tracking so they stay on one line. */
.site-title .logo-lockup[data-length="long"] .site-title-text {
	letter-spacing: 0.05em;
	font-size: clamp(0.625rem, 0.5rem + 0.3vw, 0.8125rem);
}

.header-utility {
	display: flex;
	align-items: center;
	gap: var(--space-xs);
}

.header-utility .widget {
	margin: 0;
}

/* Secondary (utility) navigation in the header. */
.nav-secondary {
	background-color: transparent;
	width: auto;
}

.nav-secondary .wrap {
	max-width: none;
	padding: 0;
	margin: 0;
}

.nav-secondary .genesis-nav-menu {
	display: flex;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: 0.5rem;
}

/*
 * Wrapped in :where() so this contributes zero specificity.
 *
 * Location-based rules like this one must never outrank component classes.
 * Written plainly, `.nav-secondary .genesis-nav-menu a` (0,2,1) beats
 * `.btn-donate > a` (0,1,1), so a Donate button in this menu inherited navy
 * text on a green fill — a 2.0:1 contrast ratio. :where() makes the button
 * classes win wherever they are used, which is the whole point of having them.
 */
:where(.nav-secondary .genesis-nav-menu) a {
	padding: 0.5rem 0.9rem;
	font-size: 0.9375rem;
	font-weight: 500;
	text-transform: uppercase;
	color: var(--dark-navy);
	letter-spacing: 0.05em;
	transition: color var(--speed) var(--ease);
	text-decoration: none;
}

:where(.nav-secondary .genesis-nav-menu) a:hover {
	color: var(--accent-orange);
}

/* --------------------------------------------------------------------------
   Menu call-to-action buttons
   --------------------------------------------------------------------------
   The theme provides the palette; the editor picks which button is which.

   Add one of these to a menu item's "CSS Classes" field
   (Appearance -> Menus -> Screen Options -> CSS Classes):

     btn-navy     btn-red      btn-green
     btn-yellow   btn-outline  btn-ghost

   Nothing here ties a colour to a position, so "Donate" is green because
   someone chose green for that item — not because the theme hard-codes the
   second button in the header to be green.

   The bare colour names (yellow / navy / green) are the pre-1.3 spelling and
   remain supported so existing menus keep working.
   -------------------------------------------------------------------------- */

.menu-secondary a,
.menu-utility [class*="btn-"] > a {
	padding: 0.6rem 1.15rem;
	border: 1px solid transparent;
	border-radius: var(--radius-s);
	font-family: var(--font-sans);
	font-size: 0.875rem;
	font-weight: 600;
	text-transform: uppercase;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	letter-spacing: 0.04em;
	line-height: 1.2;
	min-height: 44px;
	white-space: nowrap;
	text-decoration: none !important;
	transition: background-color var(--speed) var(--ease), border-color var(--speed) var(--ease), color var(--speed) var(--ease);
}

/* Colour modifiers. */
.btn-navy > a,
.menu-secondary .navy > a {
	background-color: var(--dark-navy);
	border-color: var(--dark-navy);
	color: #FFFFFF;
}

.btn-navy > a:hover,
.menu-secondary .navy > a:hover {
	background-color: var(--deep-navy);
	border-color: var(--deep-navy);
	color: #FFFFFF;
}

.btn-red > a {
	background-color: var(--scouting-red);
	border-color: var(--scouting-red);
	color: #FFFFFF;
}

.btn-red > a:hover {
	background-color: var(--scouting-dark-red);
	border-color: var(--scouting-dark-red);
	color: #FFFFFF;
}

/*
 * Green uses --cta-green, not --accent-green. The brand green (#039B03)
 * against white text measures 3.7:1, which fails WCAG AA for text this size.
 * #02700B measures 6.0:1 and reads as the same green at a glance.
 */
.btn-green > a,
.menu-secondary .green > a {
	background-color: var(--cta-green);
	border-color: var(--cta-green);
	color: #FFFFFF;
}

.btn-green > a:hover,
.menu-secondary .green > a:hover {
	background-color: var(--cta-green-hover);
	border-color: var(--cta-green-hover);
	color: #FFFFFF;
}

.btn-yellow > a,
.menu-secondary .yellow > a {
	background-color: var(--accent-yellow);
	border-color: var(--accent-yellow);
	color: var(--dark-navy);
}

.btn-yellow > a:hover,
.menu-secondary .yellow > a:hover {
	background-color: #E89C13;
	border-color: #E89C13;
	color: var(--dark-navy);
}

/* Outline: the quiet partner to a solid primary action. */
.btn-outline > a {
	background-color: transparent;
	border-color: var(--primary-navy);
	color: var(--primary-navy);
}

.btn-outline > a:hover {
	background-color: var(--primary-navy);
	border-color: var(--primary-navy);
	color: #FFFFFF;
}

.btn-ghost > a {
	background-color: transparent;
	border-color: transparent;
	color: var(--primary-navy);
}

.btn-ghost > a:hover {
	background-color: var(--surface-sunken);
	color: var(--dark-navy);
}

/* --------------------------------------------------------------------------
   Role classes
   --------------------------------------------------------------------------
   btn-donate and btn-join-us were already in use in this site's menus, so
   they are supported as named roles with sensible defaults. They are only
   defaults: add a colour class alongside (e.g. "btn-donate btn-navy") and the
   colour class wins, because it is defined later with equal specificity.

   Pairing a solid primary with an outline secondary is the point. Two solid
   fills side by side compete and neither reads as the main action.
   -------------------------------------------------------------------------- */

.btn-donate > a {
	background-color: var(--cta-green);
	border-color: var(--cta-green);
	color: #FFFFFF;
}

.btn-donate > a:hover {
	background-color: var(--cta-green-hover);
	border-color: var(--cta-green-hover);
	color: #FFFFFF;
}

.btn-join-us > a,
.btn-join > a {
	background-color: transparent;
	border-color: var(--primary-navy);
	color: var(--primary-navy);
}

.btn-join-us > a:hover,
.btn-join > a:hover {
	background-color: var(--primary-navy);
	border-color: var(--primary-navy);
	color: #FFFFFF;
}

/* On the tinted strip an outline button needs a solid backdrop to read. */
.utility-bar .btn-join-us > a,
.utility-bar .btn-join > a,
.utility-bar .btn-outline > a {
	background-color: var(--surface);
}

.utility-bar .btn-join-us > a:hover,
.utility-bar .btn-join > a:hover,
.utility-bar .btn-outline > a:hover {
	background-color: var(--primary-navy);
	color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   Utility strip (header-layout-utility-bar)
   -------------------------------------------------------------------------- */

.utility-bar {
	background-color: var(--surface-sunken);
	border-bottom: 1px solid var(--hairline);
	font-size: 0.8125rem;
}

.utility-bar .wrap {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: var(--space-m);
	min-height: 40px;
	flex-wrap: wrap;
}

.nav-utility {
	min-width: 0;
}

.menu-utility {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	list-style: none;
	margin: 0;
	padding: 0;
}


/*
 * :not([class*="btn-"]) matters. Without it this rule and the button colour
 * rules have identical specificity, this one wins on source order, and a
 * "Donate" button in the strip renders dark green text on a dark green fill.
 */
.menu-utility > li:not([class*="btn-"]) > a {
	display: inline-block;
	padding: 0.35rem 0.75rem;
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.4;
	color: var(--muted-text);
	text-decoration: none;
	transition: color var(--speed) var(--ease);
}

.menu-utility > li:not([class*="btn-"]) > a:hover {
	color: var(--primary-navy);
}

.menu-utility > li:not([class*="btn-"]) + li:not([class*="btn-"]) {
	border-left: 1px solid var(--hairline);
}

/* A button class inside the strip drops the divider and shrinks to fit. */
.menu-utility > [class*="btn-"] {
	border-left: 0;
	margin-left: 0.5rem;
}

.menu-utility > [class*="btn-"] > a {
	min-height: 32px;
	padding: 0.25rem 0.75rem;
	font-size: 0.75rem;
}

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

.header-search {
	position: relative;
	flex-shrink: 1;
	min-width: 0;
}

.header-search form {
	display: flex;
	align-items: center;
	position: relative;
}

.header-search input[type="search"] {
	border: 1px solid var(--medium-gray);
	padding: 0.65rem 1rem 0.65rem 2.4rem;
	border-radius: var(--radius-pill);
	width: 220px;
	max-width: 100%;
	font-size: 1rem;
	font-family: inherit;
	color: var(--body-text);
	background-color: var(--surface);
	transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

/* In the strip the field is secondary chrome, so it sits smaller and quieter. */
.utility-bar .header-search input[type="search"] {
	width: 200px;
	padding: 0.3rem 0.75rem 0.3rem 2rem;
	font-size: 0.8125rem;
	border-radius: var(--radius-s);
	border-color: var(--hairline);
}

.utility-bar .header-search form::before {
	left: 0.6rem;
	width: 0.8rem;
	height: 0.8rem;
}

.header-search input[type="search"]::placeholder {
	color: var(--muted-text);
	opacity: 1;
}

.header-search input[type="search"]:focus {
	border-color: var(--primary-navy);
	box-shadow: 0 0 0 3px rgba(0, 63, 135, 0.12);
	outline: none;
}

.header-search input[type="search"]:focus-visible {
	outline: var(--focus-ring) solid var(--focus-color);
	outline-offset: 1px;
}

/*
 * Hide the form's own submit control — the field submits on Enter.
 * Scoped to the form so it does not also swallow the .search-toggle button,
 * which lives in .header-search but outside the form.
 */
.header-search form .search-submit,
.header-search form input[type="submit"],
.header-search form button {
	display: none !important;
}

/*
 * Drawn as an inline SVG rather than a Font Awesome glyph. The theme's own
 * chrome no longer depends on the 258 KB icon webfont, so the header renders
 * correctly on first paint and before Font Awesome has downloaded.
 */
.header-search form::before {
	content: "";
	position: absolute;
	left: 0.85rem;
	width: 1rem;
	height: 1rem;
	background-color: var(--medium-gray);
	pointer-events: none;
	-webkit-mask: var(--icon-search) center / contain no-repeat;
	mask: var(--icon-search) center / contain no-repeat;
}

:root {
	--icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.6-3.6'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Collapsible search (header-layout-compact)
   --------------------------------------------------------------------------
   Keeps the widest element out of the header until it is asked for. Without
   JavaScript the panel stays open, so search still works.
   -------------------------------------------------------------------------- */

.search-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	min-height: 44px;
	padding: 0;
	background-color: transparent;
	border: 1px solid var(--medium-gray);
	border-radius: var(--radius-s);
	color: var(--dark-navy);
	cursor: pointer;
	transition: background-color var(--speed) var(--ease), border-color var(--speed) var(--ease);
}

.search-toggle:hover {
	background-color: var(--surface-sunken);
	border-color: var(--dark-navy);
}

.search-toggle__icon {
	width: 1.1rem;
	height: 1.1rem;
	background-color: currentColor;
	-webkit-mask: var(--icon-search) center / contain no-repeat;
	mask: var(--icon-search) center / contain no-repeat;
}

.search-toggle[aria-expanded="true"] .search-toggle__icon {
	-webkit-mask: var(--icon-close) center / contain no-repeat;
	mask: var(--icon-close) center / contain no-repeat;
}

:root {
	--icon-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
}

/* JS marks the control as enhanced; until then the field is simply visible. */
.header-search--collapsible:not(.is-enhanced) .search-toggle {
	display: none;
}

.header-search--collapsible.is-enhanced .header-search__panel {
	position: absolute;
	top: calc(100% + 0.6rem);
	right: 0;
	z-index: 120;
	display: none;
	padding: 0.75rem;
	background-color: var(--surface);
	border: 1px solid var(--hairline);
	border-radius: var(--radius-m);
	box-shadow: var(--shadow-lifted);
}

.header-search--collapsible.is-enhanced.is-open .header-search__panel {
	display: block;
}

.header-search--collapsible.is-enhanced .header-search__panel input[type="search"] {
	width: 260px;
}

/* ==========================================================================
   6. Navigation
   ========================================================================== */

/*
 * The primary bar sticks to the top of the viewport once the header
 * scrolls past. Pure CSS — no fixed positioning, so no layout jump.
 * `.is-stuck` is added by an IntersectionObserver purely for the shadow.
 */
.nav-primary {
	background-color: var(--primary-navy);
	padding: 0;
	position: sticky;
	top: 0;
	z-index: 100;
	transition: box-shadow var(--speed) var(--ease);

	/* Auto-fit sizing — theme.js writes --nav-scale. */
	--nav-scale: 1;
	--nav-font-max: 15px;
	--nav-font-min: 11px;
	--nav-pad-max: 14px;
	--nav-pad-min: 6px;
}

.nav-primary.is-stuck {
	box-shadow: 0 4px 16px rgba(0, 42, 92, 0.28);
}

.admin-bar .nav-primary { top: 32px; }

@media screen and (max-width: 782px) {
	.admin-bar .nav-primary { top: 46px; }
}

/* Sentinel element used to detect when the bar becomes stuck. */
.nav-sticky-sentinel {
	height: 1px;
	margin-bottom: -1px;
	pointer-events: none;
}

.nav-primary .wrap {
	display: flex;
	justify-content: center;
	align-items: center;
	min-width: 0;
}

.genesis-nav-menu {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
}

.genesis-nav-menu li {
	position: relative;
}

/*
 * No vertical padding on the list. Any gap here leaves a strip of navy
 * beneath the active indicator, which detaches it from the bottom of the bar
 * and makes it read as a text underline. The links supply the bar's height.
 */
.nav-primary ul {
	padding-block: 0;
	flex-wrap: nowrap;
	min-width: 0;
}

/*
 * Top-level items keep their natural width instead of flex-shrinking.
 * Without this the browser silently squeezes them and theme.js can never
 * detect that the menu no longer fits.
 */
.nav-primary .genesis-nav-menu > li {
	flex: 0 0 auto;
}

/*
 * Shared menu link metrics. Deliberately no colour here.
 *
 * This rule used to set `color: #FFFFFF`, which is only correct inside the
 * navy primary bar — but .genesis-nav-menu is the class on *every* Genesis
 * menu, so white leaked into the secondary and utility menus on white
 * backgrounds and outranked the .btn-* classes. Colour now lives with the
 * bar that actually has a dark background.
 */
:where(.genesis-nav-menu) a {
	padding: 0.75rem 0.9rem;
	font-size: 0.8125rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	display: block;
	text-decoration: none;
}

.nav-primary .genesis-nav-menu a {
	color: #FFFFFF;
}

/*
 * Navigation never underlines — not at rest, not on hover, not on focus.
 * The active state is communicated by the indicator bar and a colour change.
 *
 * This carries real specificity on purpose. The base metrics rule above is
 * wrapped in :where() so component classes can beat it, which also means it
 * cannot defend itself against Genesis's or a plugin's generic `a:hover`
 * underline. This rule is the guard.
 */
.genesis-nav-menu a,
.genesis-nav-menu a:hover,
.genesis-nav-menu a:focus,
.menu-utility a,
.menu-utility a:hover,
.menu-utility a:focus,
.menu-secondary a,
.menu-secondary a:hover,
.menu-secondary a:focus {
	text-decoration: none;
}

/*
 * Top-level sizing. Before theme.js measures the menu, a viewport-based
 * clamp keeps things sane; afterwards --nav-scale is derived from the
 * menu's real width, so the same rules fit 5 items or 12.
 */
.nav-primary .genesis-nav-menu > li > a {
	position: relative;
	white-space: nowrap;
	letter-spacing: 0.03em;
	font-size: clamp(11px, 1.35vw - 2.3px, 15px);
	padding-inline: clamp(6px, 0.7vw - 1px, 14px);
	transition: color var(--speed) var(--ease);
}

.nav-primary.nav-measured .genesis-nav-menu > li > a {
	font-size: max(var(--nav-font-min), calc(var(--nav-font-max) * var(--nav-scale)));
	padding-inline: max(var(--nav-pad-min), calc(var(--nav-pad-max) * var(--nav-scale)));
	column-gap: max(4px, calc(8px * var(--nav-scale)));
}

/* If even the smallest step overflows, wrap onto a second row cleanly. */
.nav-primary.nav-overflows .genesis-nav-menu {
	flex-wrap: wrap;
	justify-content: center;
}

.nav-primary.nav-overflows .genesis-nav-menu > li > a {
	white-space: normal;
	text-align: center;
}

/* Hairline separators between top-level items. */
.nav-primary .genesis-nav-menu > li + li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	height: 16px;
	width: 1px;
	background-color: rgba(255, 255, 255, 0.28);
}

.genesis-nav-menu a:hover,
.genesis-nav-menu .current-menu-item > a,
.genesis-nav-menu .current-menu-ancestor > a {
	color: var(--accent-yellow);
}

/*
 * Current-section indicator.
 *
 * Spans the full width of the menu item and sits flush against the bottom
 * of the bar, so it reads as a tab indicator for the nav element rather than
 * an underline on the words. A bar inset to roughly the text width, floating
 * above the bar's bottom edge, is indistinguishable from text-decoration.
 *
 * scaleX is used rather than animating width so the transition runs on the
 * compositor instead of triggering layout on every frame.
 */
.nav-primary .genesis-nav-menu > li > a::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background-color: var(--accent-orange);
	transform: scaleX(0);
	transform-origin: center;
	transition: transform var(--speed) var(--ease);
}

.nav-primary .genesis-nav-menu > li:hover > a::before,
.nav-primary .genesis-nav-menu > li:focus-within > a::before,
.nav-primary .genesis-nav-menu > .current-menu-item > a::before,
.nav-primary .genesis-nav-menu > .current-menu-ancestor > a::before {
	transform: scaleX(1);
}

/* Dropdowns. */
.genesis-nav-menu .sub-menu {
	position: absolute;
	left: -9999px;
	opacity: 0;
	z-index: 99;
	background-color: var(--deep-navy);
	width: 260px;
	padding: 0.5rem 0;
	margin: 0;
	list-style: none;
	text-align: left;
	border-radius: 0 0 var(--radius-m) var(--radius-m);
	box-shadow: var(--shadow-card);
	transition: opacity var(--speed) var(--ease);
}

.genesis-nav-menu li:hover > .sub-menu,
.genesis-nav-menu li:focus-within > .sub-menu {
	left: 0;
	opacity: 1;
}

.genesis-nav-menu .sub-menu .sub-menu {
	top: -0.5rem;
	border-radius: var(--radius-m);
}

.genesis-nav-menu .sub-menu li:hover > .sub-menu,
.genesis-nav-menu .sub-menu li:focus-within > .sub-menu {
	left: 100%;
}

.nav-primary .sub-menu a {
	font-size: 0.9375rem;
	text-transform: none;
	letter-spacing: 0;
	padding: 0.6rem 1.25rem;
	font-weight: 400;
	white-space: normal;
	transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}

.nav-primary .sub-menu a:hover {
	background-color: rgba(255, 255, 255, 0.08);
	color: var(--accent-yellow);
}

.nav-primary .sub-menu a::before {
	display: none;
}

/*
 * Carets are drawn with borders instead of icon-font glyphs, so they are
 * pixel-crisp at any size and never flash as a fallback character while
 * Font Awesome loads.
 */
.genesis-nav-menu .menu-item-has-children > a {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.genesis-nav-menu .menu-item-has-children > a::after {
	content: "";
	flex: 0 0 auto;
	width: 0.4em;
	height: 0.4em;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-0.15em) rotate(45deg);
	transform-origin: center;
	transition: transform var(--speed) var(--ease);
}

.genesis-nav-menu .menu-item-has-children:hover > a::after,
.genesis-nav-menu .menu-item-has-children:focus-within > a::after {
	transform: translateY(0.1em) rotate(225deg);
}

.genesis-nav-menu .sub-menu .menu-item-has-children > a::after {
	margin-left: auto;
	transform: rotate(-45deg);
}

.genesis-nav-menu .sub-menu .menu-item-has-children:hover > a::after,
.genesis-nav-menu .sub-menu .menu-item-has-children:focus-within > a::after {
	transform: translateX(3px) rotate(-45deg);
}

/* Mobile toggle — hidden until the breakpoint. */
.menu-toggle {
	display: none;
	align-items: center;
	gap: 0.6rem;
	width: 100%;
	background: transparent;
	border: 0;
	color: #FFFFFF;
	font-family: var(--font-sans);
	font-size: 0.9375rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 0.9rem 0;
	min-height: 48px;
	cursor: pointer;
}

.menu-toggle .toggle-bars {
	display: inline-flex;
	flex-direction: column;
	gap: 4px;
}

.menu-toggle .toggle-bars span {
	display: block;
	width: 22px;
	height: 2px;
	background-color: #FFFFFF;
	transition: transform var(--speed) var(--ease), opacity var(--speed) var(--ease);
}

.nav-primary.active .menu-toggle .toggle-bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-primary.active .menu-toggle .toggle-bars span:nth-child(2) { opacity: 0; }
.nav-primary.active .menu-toggle .toggle-bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.sub-menu-toggle {
	display: none;
}

/* ==========================================================================
   7. Content, archives & search
   ========================================================================== */

.entry {
	margin-bottom: var(--space-xl);
}

.entry-title {
	font-family: var(--font-slab);
	font-weight: 700;
	font-size: clamp(1.625rem, 1.2rem + 1.8vw, 2.25rem);
	letter-spacing: -0.01em;
	margin-bottom: var(--space-xs);
}

.entry-title a {
	color: var(--dark-navy);
	text-decoration: none;
}

.entry-title a:hover {
	color: var(--primary-navy);
	text-decoration: underline;
}

.entry-meta {
	color: var(--muted-text);
	font-size: 0.9375rem;
	margin-bottom: var(--space-m);
}

.entry-meta a {
	color: var(--muted-text);
}

.breadcrumb {
	font-size: 0.9375rem;
	color: var(--muted-text);
	margin-bottom: var(--space-l);
	padding-bottom: var(--space-xs);
	border-bottom: 1px solid var(--hairline);
}

.archive-description,
.author-box {
	background-color: var(--surface-sunken);
	border-radius: var(--radius-m);
	padding: var(--space-m);
	margin-bottom: var(--space-xl);
}

/* Pagination. */
.archive-pagination ul,
.pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	list-style: none;
	padding: 0;
	margin: var(--space-xl) 0 0;
}

.archive-pagination li a,
.archive-pagination li.active a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 0.75rem;
	border: 1px solid var(--hairline);
	border-radius: var(--radius-s);
	color: var(--primary-navy);
	font-weight: 600;
	text-decoration: none;
	transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}

.archive-pagination li a:hover {
	background-color: var(--surface-sunken);
}

.archive-pagination li.active a {
	background-color: var(--primary-navy);
	border-color: var(--primary-navy);
	color: #FFFFFF;
}

/* Search results — a familiar, scannable results list. */
.search .entry {
	margin-bottom: var(--space-l);
	max-width: 650px;
}

.search h2 {
	font-family: var(--font-sans);
	font-size: 1.25rem;
	line-height: 1.3;
	margin-bottom: 0.25rem;
	font-weight: 400;
	letter-spacing: 0;
}

.search h2 a:link,
.search h2 a:visited {
	color: var(--informative-blue);
	text-decoration: none;
}

.search h2 a:hover {
	text-decoration: underline;
}

.search .search-link {
	color: var(--matrix-green);
	font-size: 0.9375rem;
	margin-bottom: 0.25rem;
	display: block;
	word-break: break-all;
}

.search .entry-content p {
	color: #4D5156;
	font-size: 1rem;
	line-height: 1.58;
}

.search .entry .entry-meta {
	display: none;
}

/* Comments. */
.comment-respond,
.entry-comments {
	margin-top: var(--space-xl);
	padding-top: var(--space-l);
	border-top: 1px solid var(--hairline);
}

.comment-list,
.comment-list ul {
	list-style: none;
	padding-left: 0;
}

.comment-list .comment {
	padding: var(--space-m) 0;
	border-bottom: 1px solid var(--hairline);
}

.comment-list .children {
	padding-left: var(--space-m);
	border-left: 2px solid var(--surface-sunken);
}

.comment-author .avatar {
	border-radius: 50%;
	margin-right: 0.75rem;
	float: left;
}

/* ==========================================================================
   8. Forms, buttons & tables
   ========================================================================== */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
	width: 100%;
	max-width: 100%;
	padding: 0.75rem 1rem;
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--body-text);
	background-color: var(--surface);
	border: 1px solid var(--medium-gray);
	border-radius: var(--radius-s);
	transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

input:focus,
select:focus,
textarea:focus {
	border-color: var(--primary-navy);
	box-shadow: 0 0 0 3px rgba(0, 63, 135, 0.12);
	outline: none;
}

label {
	display: block;
	font-weight: 600;
	font-size: 0.9375rem;
	margin-bottom: 0.35rem;
	color: var(--dark-navy);
}

textarea {
	min-height: 9rem;
	resize: vertical;
}

/*
 * Buttons — one definition shared by core blocks, Genesis and utilities.
 *
 * Deliberately scoped to submit buttons and explicit button classes rather
 * than every `button` element. Page builders and plugins use bare <button>
 * for icon controls, sliders and toggles; giving those call-to-action chrome
 * is a common source of "rough around the edges".
 */
.button,
button[type="submit"],
input[type="button"],
input[type="reset"],
input[type="submit"],
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.875rem 1.75rem;
	min-height: 48px;
	font-family: var(--font-sans);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-decoration: none;
	color: #FFFFFF;
	background-color: var(--primary-navy);
	border: 1px solid transparent;
	border-radius: var(--radius-s);
	cursor: pointer;
	transition: background-color var(--speed) var(--ease), border-color var(--speed) var(--ease), color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.button:hover,
button[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover,
.wp-block-button__link:hover {
	background-color: var(--deep-navy);
	color: #FFFFFF;
	box-shadow: var(--shadow-subtle);
}

button[type="submit"]:disabled,
.button:disabled,
input[type="submit"]:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	box-shadow: none;
}

/* Outline button style. */
.is-style-outline .wp-block-button__link,
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background) {
	background-color: transparent;
	border-color: currentColor;
	color: var(--primary-navy);
}

.is-style-outline .wp-block-button__link:hover {
	background-color: var(--primary-navy);
	border-color: var(--primary-navy);
	color: #FFFFFF;
}

/* Registered block styles. */
.wp-block-button.is-style-navy > .wp-block-button__link {
	background-color: var(--dark-navy);
	color: #FFFFFF;
}

.wp-block-button.is-style-navy > .wp-block-button__link:hover {
	background-color: var(--deep-navy);
}

.wp-block-button.is-style-orange > .wp-block-button__link {
	background-color: var(--accent-orange);
	color: #FFFFFF;
}

.wp-block-button.is-style-orange > .wp-block-button__link:hover {
	background-color: #E05800;
}

/*
 * Chrome-free buttons. These are structural controls, not calls to action,
 * so they opt out of the shared button appearance entirely.
 */
.menu-toggle,
.sub-menu-toggle,
.header-search form button {
	background-color: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: inherit;
	text-transform: none;
	letter-spacing: inherit;
}

.menu-toggle:hover,
.menu-toggle:focus,
.sub-menu-toggle:hover,
.sub-menu-toggle:focus {
	background-color: transparent;
	box-shadow: none;
	color: inherit;
}

/* Tables. */
table,
.wp-block-table table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: var(--space-m);
	font-size: 1rem;
}

th,
td {
	padding: 0.75rem 1rem;
	text-align: left;
	border-bottom: 1px solid var(--hairline);
	vertical-align: top;
}

thead th {
	background-color: var(--primary-navy);
	color: #FFFFFF;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	font-size: 0.875rem;
}

tbody tr:nth-child(even) {
	background-color: var(--surface-sunken);
}

.wp-block-table {
	overflow-x: auto;
}

/* Quotes. */
blockquote,
.wp-block-quote {
	margin: var(--space-l) 0;
	padding: 0 0 0 var(--space-m);
	border-left: 4px solid var(--accent-orange);
	font-size: 1.25rem;
	line-height: 1.5;
	color: var(--dark-navy);
	font-style: normal;
}

blockquote cite,
.wp-block-quote cite {
	display: block;
	margin-top: var(--space-xs);
	font-size: 0.9375rem;
	font-style: normal;
	color: var(--muted-text);
}

.wp-block-pullquote {
	border-top: 2px solid var(--accent-orange);
	border-bottom: 2px solid var(--accent-orange);
	padding: var(--space-l) 0;
	text-align: center;
}

code,
kbd,
pre {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.9em;
	background-color: var(--surface-sunken);
	border-radius: var(--radius-s);
}

code {
	padding: 0.15em 0.4em;
}

pre {
	padding: var(--space-m);
	overflow-x: auto;
}

/* ==========================================================================
   9. Components & block patterns
   ========================================================================== */

/* Generic card surface used by the pattern library. */
.card,
.news-card {
	background-color: var(--surface);
	border: 1px solid var(--hairline);
	border-radius: var(--radius-m);
	overflow: hidden;
	box-shadow: var(--shadow-subtle);
	transition: box-shadow var(--speed) var(--ease), transform var(--speed) var(--ease);
	display: flex;
	flex-direction: column;
	height: 100%;
}

.card:hover,
.news-card:hover {
	box-shadow: var(--shadow-card);
	transform: translateY(-2px);
}

.card__body,
.news-card__body {
	padding: var(--space-m);
	flex-grow: 1;
}

/* Registered block style: core/group -> Card. */
.wp-block-group.is-style-card {
	background-color: var(--surface);
	border: 1px solid var(--hairline);
	border-radius: var(--radius-m);
	padding: var(--space-m);
	box-shadow: var(--shadow-subtle);
	transition: box-shadow var(--speed) var(--ease);
}

.wp-block-group.is-style-card:hover {
	box-shadow: var(--shadow-card);
}

/* Registered block style: core/image -> Soft Rounded. */
.wp-block-image.is-style-rounded-soft img {
	border-radius: var(--radius-l);
}

/* Cover and hero blocks. */
.wp-block-cover {
	min-height: clamp(320px, 45vh, 560px);
}

.wp-block-cover .wp-block-cover__inner-container {
	max-width: var(--wrap-max);
	margin-inline: auto;
	padding-inline: var(--wrap-gutter);
}

.front-page-hero {
	background-color: var(--accent-yellow);
}

.front-page-1,
.front-page-2,
.front-page-3 {
	padding-block: var(--space-xxl);
}

.front-page-2 {
	background-color: var(--surface-sunken);
}

/* Program grid. */
.program-card {
	text-align: center;
	position: relative;
	overflow: hidden;
	border-radius: var(--radius-m);
}

.program-card img {
	width: 100%;
	display: block;
	transition: transform 400ms var(--ease);
}

.program-card:hover img {
	transform: scale(1.04);
}

/* A scrim guarantees label contrast over any photograph. */
.program-card::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(0deg, rgba(0, 42, 92, 0.75) 0%, rgba(0, 42, 92, 0.15) 60%, rgba(0, 42, 92, 0) 100%);
	pointer-events: none;
}

.program-label {
	position: absolute;
	bottom: var(--space-m);
	left: 50%;
	transform: translateX(-50%);
	z-index: 1;
	color: #FFFFFF;
	font-weight: 700;
	font-size: clamp(1.125rem, 0.9rem + 0.9vw, 1.5rem);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	width: 100%;
	padding-inline: var(--space-s);
}

/* Safeguarding banner. */
.safeguarding-banner {
	background-color: var(--dark-navy);
	color: #FFFFFF;
	padding-block: var(--space-xxl);
	display: flex;
	align-items: center;
	gap: var(--space-xl);
}

.safeguarding-banner h2,
.safeguarding-banner h3 {
	color: #FFFFFF;
}

/* Email signup banner. */
.email-signup-banner {
	background-color: var(--light-blue);
	padding: var(--space-xl);
	border-radius: var(--radius-l);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-m);
	flex-wrap: wrap;
}

.before-footer {
	padding-block: var(--space-xl);
}

/* Testimonial bubbles. */
.testimonial-bubble {
	background: var(--surface);
	border: 1px solid var(--hairline);
	border-radius: var(--radius-l);
	padding: var(--space-l);
	position: relative;
	margin-bottom: var(--space-xl);
	box-shadow: var(--shadow-subtle);
}

.testimonial-bubble::after {
	content: '';
	position: absolute;
	bottom: -20px;
	left: 40px;
	border-width: 20px 20px 0;
	border-style: solid;
	border-color: var(--surface) transparent;
}

/* Legacy utility button classes. */
.button-hub       { background-color: var(--accent-yellow); color: var(--dark-navy); }
.button-volunteer { background-color: var(--primary-navy); color: #FFFFFF; }
.button-donate    { background-color: var(--accent-green); color: #FFFFFF; }

/* ==========================================================================
   10. Footer
   ========================================================================== */

.site-footer {
	background-color: var(--primary-navy);
	color: #FFFFFF;
	padding: var(--space-xxl) 0 var(--space-l);
	position: relative;
	overflow: hidden;
}

.site-footer::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image: url('../images/trail-graphic-horizontal-3.png');
	background-size: contain;
	background-position: center center;
	background-repeat: repeat;
	/* Dialled back from 0.5 — at half opacity the trail graphic competed
	   with the link text and hurt contrast. */
	opacity: 0.16;
	z-index: 0;
	pointer-events: none;
}

.site-footer .wrap {
	position: relative;
	z-index: 1;
}

.site-footer a {
	color: #FFFFFF;
}

.footer-widgets .wrap {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--space-xl);
}

.footer-widgets .widget-title {
	color: #FFFFFF;
	font-size: 1.0625rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	border-bottom: 2px solid var(--accent-orange);
	padding-bottom: 0.6rem;
	margin-bottom: var(--space-m);
	display: inline-block;
}

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

.footer-widgets li + li {
	margin-top: 0.4rem;
}

.footer-widgets li a {
	color: rgba(255, 255, 255, 0.88);
	font-size: 1rem;
	text-decoration: none;
	transition: color var(--speed) var(--ease);
}

.footer-widgets li a:hover {
	color: var(--accent-yellow);
}

.footer-social-icons ul {
	display: flex;
	justify-content: center;
	gap: var(--space-s);
	margin: var(--space-xl) 0;
	list-style: none;
	padding: 0;
}

.footer-social-icons a {
	background: #FFFFFF;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--primary-navy);
	font-size: 1.25rem;
	transition: transform var(--speed) var(--ease), background-color var(--speed) var(--ease), color var(--speed) var(--ease);
	text-decoration: none;
}

.footer-social-icons a:hover {
	transform: translateY(-2px);
	background-color: var(--accent-orange);
	color: #FFFFFF;
	text-decoration: none;
}

.footer-credits {
	text-align: center;
	font-size: 0.9375rem;
	color: rgba(255, 255, 255, 0.85);
}

.footer-copyright {
	text-align: center;
	margin: var(--space-m) 0 0;
	padding-top: var(--space-m);
	border-top: 1px solid rgba(255, 255, 255, 0.18);
	font-size: 0.9375rem;
	color: rgba(255, 255, 255, 0.85);
}

/* ==========================================================================
   11. Responsive
   ========================================================================== */

@media only screen and (max-width: 1180px) {
	.header-search input[type="search"] { width: 170px; }
	.header-right { gap: 0.75rem; }
	.menu-secondary a { margin-inline: 0.2rem; padding: 0.6rem 0.8rem; font-size: 0.875rem; }
	.header-utility { gap: 0.35rem; }
}

@media only screen and (max-width: 1024px) {
	.footer-widgets .wrap { grid-template-columns: repeat(2, 1fr); }
	.site-title .logo-lockup img { max-height: 76px; }
}

/* Tablet and below — stack the header, switch to the mobile menu. */
@media only screen and (max-width: 960px) {

	.site-header .wrap {
		flex-direction: column;
		align-items: center;
		gap: var(--space-s);
	}

	.title-area {
		max-width: none;
		text-align: center;
	}

	.header-right {
		flex-grow: 0;
		width: 100%;
		flex-wrap: wrap;
		justify-content: center;
		gap: 0.6rem;
	}

	.header-utility {
		flex-wrap: wrap;
		justify-content: center;
	}

	.header-search input[type="search"] { width: 240px; }

	/* The strip centres and its search takes the full row on small screens. */
	.utility-bar .wrap {
		justify-content: center;
		gap: 0.5rem;
		padding-block: 0.5rem;
	}

	.menu-utility {
		justify-content: center;
	}

	.utility-bar .header-search {
		width: 100%;
		max-width: 320px;
	}

	.utility-bar .header-search input[type="search"] {
		width: 100%;
		padding-block: 0.5rem;
		font-size: 1rem;
	}

	.nav-secondary .genesis-nav-menu { justify-content: center; }

	/* Primary nav becomes a toggle-driven accordion. */
	.nav-primary {
		position: static;
	}

	.nav-primary .wrap {
		display: block;
	}

	.menu-toggle { display: flex; }

	.nav-primary .genesis-nav-menu {
		display: none;
		flex-direction: column;
		padding: 0 0 0.6rem;
		max-height: 70vh;
		overflow-y: auto;
		overscroll-behavior: contain;
	}

	.nav-primary.active .genesis-nav-menu { display: flex; }

	.nav-primary.nav-measured .genesis-nav-menu > li > a,
	.nav-primary .genesis-nav-menu > li > a {
		font-size: 1rem;
		padding: 0.85rem 0;
		white-space: normal;
		min-height: 48px;
	}

	.nav-primary .genesis-nav-menu > li > a::before { display: none; }
	.nav-primary .genesis-nav-menu > li + li::before { display: none; }

	.nav-primary .genesis-nav-menu > li {
		border-top: 1px solid rgba(255, 255, 255, 0.15);
	}

	/* Parent items: link plus a separate accordion toggle. */
	.genesis-nav-menu .menu-item-has-children {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
	}

	.genesis-nav-menu .menu-item-has-children > a { flex: 1; }
	.genesis-nav-menu .menu-item-has-children > a::after { display: none; }

	.sub-menu-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		background: transparent;
		border: 0;
		color: #FFFFFF;
		width: 48px;
		height: 48px;
		min-height: 48px;
		padding: 0;
		cursor: pointer;
		font-size: 0.875rem;
	}

	.sub-menu-toggle::before {
		content: "";
		width: 0.55rem;
		height: 0.55rem;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transform: translateY(-0.15rem) rotate(45deg);
		transition: transform var(--speed) var(--ease);
	}

	.sub-menu-toggle[aria-expanded="true"]::before {
		transform: translateY(0.1rem) rotate(225deg);
	}

	/*
	 * Sub-menus flow in-document instead of floating.
	 *
	 * :where() keeps the hover/focus-within selectors at zero specificity.
	 * Written normally they outweigh `.sub-menu-open` below, and tapping the
	 * accordion toggle would focus it, match :focus-within, and immediately
	 * re-apply display:none — so the panel could never open.
	 */
	.genesis-nav-menu .sub-menu,
	.genesis-nav-menu li:where(:hover, :focus-within) > .sub-menu {
		position: static;
		left: auto;
		opacity: 1;
		display: none;
		width: 100%;
		flex-basis: 100%;
		background-color: rgba(0, 0, 0, 0.2);
		border-radius: 0;
		box-shadow: none;
		padding: 0.3rem 0;
	}

	.genesis-nav-menu li.sub-menu-open > .sub-menu { display: block; }

	.genesis-nav-menu .sub-menu .sub-menu { top: auto; }
	.genesis-nav-menu .sub-menu li:hover > .sub-menu { left: auto; }

	.nav-primary .sub-menu a { padding: 0.7rem 1.5rem; }
	.nav-primary .sub-menu .sub-menu a { padding-left: 2.5rem; }

	.safeguarding-banner {
		flex-direction: column;
		text-align: center;
		gap: var(--space-m);
	}
}

@media only screen and (max-width: 600px) {

	.footer-widgets .wrap { grid-template-columns: 1fr; gap: var(--space-m); }
	.email-signup-banner { flex-direction: column; text-align: center; padding: var(--space-l) var(--space-m); }

	.site-header { padding-block: 0.75rem; }
	.site-title .logo-lockup img { max-height: 60px; }

	.menu-secondary a { font-size: 0.8125rem; padding: 0.55rem 0.7rem; }

	.header-search { width: 100%; max-width: 320px; }
	.header-search form { width: 100%; }
	.header-search input[type="search"] { width: 100%; }

	.footer-social-icons ul { flex-wrap: wrap; gap: 0.75rem; }
	.footer-social-icons a { width: 44px; height: 44px; font-size: 1.125rem; }

	.alignleft,
	.alignright {
		float: none;
		display: block;
		margin: 0 0 var(--space-m);
	}
}

/* ==========================================================================
   12. Print
   ========================================================================== */

@media print {

	.site-header,
	.nav-primary,
	.nav-secondary,
	.site-footer,
	.before-footer,
	.header-search,
	.archive-pagination {
		display: none !important;
	}

	body {
		font-size: 12pt;
		color: #000000;
		background: #FFFFFF;
	}

	.site-inner {
		padding: 0;
	}

	a[href^="http"]::after {
		content: " (" attr(href) ")";
		font-size: 0.85em;
		word-break: break-all;
	}
}
