/*
 * Header and alert bar.
 *
 * The comp shows one header state: transparent, over the homepage hero photo,
 * with a white logo and white nav. Interior pages have no comp. Rather than
 * introduce a second logo for a light header, the header is solid --teal-900
 * everywhere, which the white logo and white nav already suit and which matches
 * the footer.
 *
 * The transparent-over-hero state is NOT here yet. It needs the hero section to
 * exist before it can be positioned or tested, so it lands with the hero.
 */

/*
 * Header alignment.
 *
 * The header uses exactly the same measure as the footer band — 2rem of outer
 * padding, then an inner row capped at --gb-container-width and centred — so
 * the logo lines up with the footer's first column and the DONATE pill lines up
 * with the right edge of the hours table.
 *
 * An earlier version padded the header by 5.8vw (matching the comp's 1920px
 * geometry) while the nav row stayed centred. That left the logo hard against
 * the outer padding with the menu and controls floating as one centred block,
 * and ~280px of dead space on the right at 1280px wide.
 */
.site-header {
	background-color: var(--teal-900);
	padding-inline: 2rem;
}

@media (max-width: 767px) {
	.site-header {
		padding-inline: 1.25rem;
	}
}

.site-header .inside-header {
	max-width: var(--gb-container-width);
	margin-inline: auto;
	padding-inline: 0;
	display: flex;
	align-items: center;
	gap: 1.5rem;
}

.site-logo {
	flex-shrink: 0;
	line-height: 0;
}

.site-logo img {
	width: min(300px, 55vw);
	height: auto;
}

/*
 * Nav sits between the logo and the right-hand cluster.
 *
 * The transparent background must NOT apply once the nav is stuck: GeneratePress
 * keeps the stuck bar as #site-navigation, so an unscoped `transparent` here
 * strips the teal off the sticky menu and leaves it see-through over the page.
 */
.site-header #site-navigation {
	flex: 1 1 auto;
}

/*
 * The transparent background is scoped to the in-header nav only.
 *
 * When the sticky menu engages, GeneratePress does not restyle this element —
 * it CLONES it as #sticky-navigation (classes is_stuck navigation-stick
 * navigation-clone), position:fixed, z-index:10000, appended outside
 * .site-header. The clone therefore never matches the descendant selector below
 * and correctly inherits .main-navigation's --teal-900. The :not() guards are
 * belt and braces in case a future GP version restyles in place instead.
 */
.site-header #site-navigation:not(.is_stuck):not(.navigation-stick) {
	background-color: transparent;
}

#site-navigation.is_stuck,
#site-navigation.navigation-stick,
#sticky-navigation {
	background-color: var(--teal-900);
}

/*
 * The nav row fills everything right of the logo. The menu takes auto side
 * margins so it centres in the gap between the logo and the controls, and the
 * controls are pushed to the container's right edge — which is the rhythm the
 * comp has (its gaps either side of the nav are 212px and 235px).
 *
 * Centring the whole row instead would drag the controls inward and strand
 * space on the right.
 */
.site-header #site-navigation .inside-navigation {
	max-width: none;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.75rem;
}

/*
 * The search icon keeps the same rhythm as the other controls.
 *
 * Measured glyph to glyph, the gap between search and Facebook was 52px against
 * 20px between Facebook, EN and DONATE — because GeneratePress gives the search
 * link 24px of horizontal padding, which stacks on top of the row's own gap.
 * Three things add up to that space: this padding, the row gap above, and the
 * cluster's margin-left (now 0, set on the block). Together they make 20px.
 */
.site-header .menu-bar-items a {
	padding-inline: 0.5rem;
}

.site-header #primary-menu {
	margin-inline: auto;
}

.main-navigation .main-nav > ul > li > a {
	padding-inline: 1rem;
}

/*
 * Between GeneratePress's 1025px mobile breakpoint and roughly 1300px there is
 * not enough room for a 300px logo, four uppercase ExtraBold nav items, the
 * search icon, Facebook, the EN pill and the DONATE pill. Left alone the menu
 * runs straight into the controls — measured at a 56px overlap at 1100px.
 * Everything tightens rather than anything wrapping or being dropped.
 */
@media (max-width: 1300px) {
	/*
	 * max-width as well as width: GeneratePress emits its own logo width rule at
	 * a higher specificity than `.site-logo img`, so the width declaration alone
	 * lost and the logo stayed 300px right down to the mobile breakpoint. That
	 * was what pushed the controls onto a second row at ~1100px. max-width
	 * constrains the box whichever width rule wins.
	 */
	.site-logo img {
		width: min(220px, 38vw);
		max-width: min(220px, 38vw);
	}

	.site-header .inside-header {
		gap: 1rem;
	}

	.site-header #site-navigation .inside-navigation {
		gap: 0.5rem;
	}

	.main-navigation .main-nav > ul > li > a {
		padding-inline: 0.5rem;
		font-size: 1rem;
	}

	/*
	 * The pill keeps its height but loses some width here. Between the mobile
	 * breakpoint and ~1300px the nav row is within a few dozen pixels of
	 * wrapping, and a wrapped row doubles the header's height — so the space has
	 * to come from somewhere.
	 */
	.site-header .gbp-button--primary,
	#sticky-navigation .gbp-button--primary {
		padding-inline: 1.25rem;
	}

	.site-header .gb-element-vimhdr01 {
		column-gap: 0.85rem;
		margin-left: 0;
	}
}

/* The tightest band of all — just above the mobile breakpoint. */
@media (max-width: 1150px) {
	/* max-width for the same reason as the 1300px band — see the note there. */
	.site-logo img {
		width: min(190px, 32vw);
		max-width: min(190px, 32vw);
	}

	.main-navigation .main-nav > ul > li > a {
		padding-inline: 0.35rem;
		font-size: 0.9375rem;
	}

	.vim-lang-switcher #google_language_translator select.goog-te-combo,
	.vim-lang-switcher #google_language_translator select.gt_selector {
		font-size: 1rem !important;
		padding: 0.45rem 1.75rem 0.45rem 0.7rem !important;
	}
}

/*
 * Sub-menus size to their longest label rather than GeneratePress's fixed
 * width. "Community Impact & Financial Information" wraps to four lines in the
 * default 162px. Capped so a long label cannot run off the viewport.
 */
.main-navigation ul.sub-menu {
	width: max-content;
	min-width: 200px;
	max-width: min(340px, 90vw);
}

.main-navigation ul.sub-menu a {
	white-space: normal;
}

/*
 * The DONATE pill is shorter in the header than the same button style is in the
 * page body (Tom, 2026-08-24). Only the block padding changes — the width, the
 * radius and the two-button rule are untouched, and section CTAs keep the taller
 * proportions the comp gives them.
 *
 * Scoped to the header AND to #sticky-navigation, because GeneratePress does not
 * restyle the nav in place when it sticks: it clones it to #sticky-navigation
 * outside .site-header, so a `.site-header` selector alone would leave the stuck
 * bar's button at full height.
 */
.site-header .gbp-button--primary,
#sticky-navigation .gbp-button--primary {
	padding-block: 0.5rem;
}

/* GP renders the search trigger in .menu-bar-items; the comp puts it with the
   other header controls, so it needs the same colour treatment. */
.site-header .menu-bar-items a {
	color: var(--white);
}

.site-header .menu-bar-items a:hover,
.site-header .menu-bar-items a:focus {
	color: var(--accent);
}

/*
 * The mobile hamburger is styled as a button, matching the DONATE pill —
 * --accent behind a dark --ink glyph (Tom, 2026-08-24). Same two tokens as
 * .gbp-button--primary, so it stays in step if the palette moves.
 *
 * The hover/focus states are listed explicitly because GeneratePress ships its
 * own, and a single rule would be overridden the moment the toggle is touched.
 */
.site-header .menu-toggle,
.site-header .menu-toggle:hover,
.site-header .menu-toggle:focus {
	background-color: var(--accent);
	color: var(--ink);
	/* Square, not a pill — Tom's call, 2026-08-24. */
	border-radius: 0;
	padding: 0.5rem 0.9rem;
	line-height: 1;
}

.site-header .menu-toggle:hover,
.site-header .menu-toggle:focus {
	background-color: var(--accent-dark);
}

/*
 * The glyph is coloured on the icon itself, not on the button.
 *
 * GeneratePress ships an inline rule for the header nav —
 * `.header-wrap .main-navigation:not(.toggled):not(.navigation-stick) .menu-toggle`
 * — which is (0,5,0) and forces white on the button. Rather than escalate
 * specificity to outrank it (and have to keep outranking it), the colour goes
 * straight onto the icon: a direct rule always beats an inherited value, however
 * specific the ancestor's rule is.
 */
.site-header .menu-toggle .gp-icon {
	color: var(--ink);
}

.site-header .menu-toggle:focus-visible {
	outline: 3px solid var(--white);
	outline-offset: 2px;
}

/*
 * Mobile header: full width, logo left, controls hard right.
 *
 * GeneratePress puts the search and hamburger in their own
 * .mobile-menu-control-wrapper, which sits between the logo and the real
 * #site-navigation. That nav still carries flex:1 1 auto even with its menu
 * hidden, so it ate the right-hand half of the row and left the controls
 * stranded just after the logo with dead space beside them.
 */
@media (max-width: 1024px) {

	.site-header .inside-header {
		justify-content: space-between;
	}

	/* Collapse the empty nav so it stops claiming the space. */
	.site-header #site-navigation {
		flex: 0 1 auto;
	}

	.site-header .mobile-menu-control-wrapper {
		order: 3;
		margin-left: auto;
		gap: 0.75rem;
		align-items: center;
	}
}

/*
 * Between the mobile breakpoint and 1300px the menu gets its own row beneath
 * the icons and buttons (Tom, 2026-08-24). There is room for both, but only by
 * squeezing the nav to the point where it reads as cramped — dropping it to a
 * second row is deliberate here rather than something to be avoided.
 */
@media (min-width: 1025px) and (max-width: 1300px) {

	.site-header #site-navigation .inside-navigation {
		flex-wrap: wrap;
		row-gap: 0.25rem;
	}

	.site-header #site-navigation .main-nav {
		order: 3;
		flex: 1 0 100%;
		margin-inline: 0;
	}

	.site-header .menu-bar-items {
		order: 1;
	}

	.site-header .gb-element-vimhdr01 {
		order: 2;
	}

	/*
	 * The menu is right-justified under the button group rather than centring
	 * in the gap.
	 *
	 * ⚠️ #primary-menu is GeneratePress's wrapper DIV, not the list — the list
	 * is #menu-primary-menu. justify-content on the wrapper does nothing,
	 * because the wrapper is display:block; it has to go on the flex list
	 * inside it.
	 */
	.site-header #primary-menu {
		margin-inline: 0;
	}

	.site-header #primary-menu > ul {
		justify-content: flex-end;
	}
}

/*
 * ─────────────────────────────────────────────────────────────────────────
 * The off-canvas panel (mobile menu).
 *
 * GeneratePress Premium supplies the drawer; generate_menu_plus_settings has
 * it as style "slide", side "right", close button "inside", mobile only.
 * inc/slideout.php widens it and adds the language slot at the bottom.
 *
 * Everything here is scoped to #generate-slideout-menu on purpose.
 * GeneratePress emits its own slideout rules — ".slideout-navigation
 * .main-navigation .main-nav ul li a" and friends — at three and four classes
 * deep from the Customizer's colour settings, and those are inline in the
 * document head while this file arrives as a <link>. An id selector outranks
 * all of them without a single !important, and keeps doing so if GP adds a
 * class to the chain in a future release.
 * ─────────────────────────────────────────────────────────────────────────
 */

#generate-slideout-menu.slideout-navigation {
	/*
	 * The drawer has to read as a layer over the page rather than as a second
	 * page. The scrim behind it (GeneratePress's .slideout-overlay) is already
	 * 80% black; this is the edge that separates the two.
	 */
	box-shadow: -0.5rem 0 2rem rgba(10, 39, 43, 0.45);
}

/*
 * One measure for the whole panel.
 *
 * min-height rather than height, so a menu longer than the viewport scrolls
 * (the panel itself is overflow:auto) instead of being clipped. 100% resolves
 * against the panel's own 100vh. border-box because the padding is on the same
 * element as the height.
 */
#generate-slideout-menu .inside-navigation {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	min-height: 100%;
	max-width: none;
	padding: 0.75rem 1.5rem 1.75rem;

	/*
	 * ⚠️ Both of these are undoing GeneratePress, not stating a default.
	 * .inside-navigation is already a flex row in main.min.css with
	 * align-items:center and a justify-content that follows the nav alignment
	 * setting. Turning the direction to column leaves those pointing the wrong
	 * way: align-items:center becomes horizontal, which shrink-wraps every row
	 * in the panel and floats it in the middle — the Facebook icon and the
	 * language row both measured 28px and 174px wide against a 282px measure
	 * before this was added.
	 */
	align-items: stretch;
	justify-content: flex-start;
}

/*
 * Close button, top right, its glyph on the panel's right-hand measure.
 *
 * GeneratePress ships it full width, left aligned, with 24px of horizontal
 * padding it takes from the nav's menu-item spacing. The negative margin pulls
 * the padding — which is tap target, not space — back out of the measure so the
 * X lines up with the menu text below it rather than sitting inset from it.
 */
#generate-slideout-menu button.slideout-exit {
	width: auto;
	align-self: flex-end;
	padding: 0.5rem;
	margin: 0 -0.5rem 0.25rem 0;
	font-size: 1.5rem;
	line-height: 0;
}

#generate-slideout-menu button.slideout-exit:hover,
#generate-slideout-menu button.slideout-exit:focus {
	color: var(--accent);
}

#generate-slideout-menu button.slideout-exit:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 2px;
}

/*
 * margin-bottom:auto absorbs the free space below the menu, which is what pins
 * the panel's footer to the bottom edge on a short menu — and does nothing at
 * all once the menu is long enough to fill the panel. No min-height guesswork.
 */
#generate-slideout-menu .main-nav {
	width: 100%;
	margin-bottom: auto;
}

#generate-slideout-menu .main-nav > ul {
	margin: 0;
}

/*
 * Top-level rows.
 *
 * A hairline between items rather than around them: the panel is 330px wide and
 * boxed rows at that width read as a stack of buttons. GeneratePress gives
 * these links line-height:48px from the nav's own settings, which is a tap
 * target expressed as leading — replaced here with real padding so a label that
 * wraps to two lines keeps its rhythm.
 */
#generate-slideout-menu .slideout-menu > li > a {
	display: block;
	padding: 0.9rem 0;
	line-height: 1.35;
}

#generate-slideout-menu .slideout-menu > li + li {
	border-top: 1px solid rgba(255, 255, 255, 0.14);
}

/*
 * The disclosure arrow is a tap target of its own — GeneratePress binds the
 * sub-menu toggle to it — so it takes padding rather than a margin, and the
 * padding is pulled back out of the measure the same way the close button's is.
 */
#generate-slideout-menu .slideout-menu .dropdown-menu-toggle {
	float: right;
	padding: 0 0.5rem 0 1rem;
	margin-right: -0.5rem;
	line-height: inherit;
}

/*
 * Sub-menus.
 *
 * Indented behind a rule rather than by whitespace alone: at this width the
 * indent has to be small enough not to cost the label its line, and 1rem of
 * plain indent does not read as a level on its own. GeneratePress already
 * drops these to 1rem/600 through the primary sub-menu typography settings.
 */
#generate-slideout-menu.main-navigation .slideout-menu ul {
	padding: 0 0 0.35rem;
	box-shadow: none;
}

#generate-slideout-menu .slideout-menu ul li a {
	display: block;
	padding: 0.5rem 0 0.5rem 1rem;
	line-height: 1.35;
	border-left: 2px solid rgba(255, 255, 255, 0.2);
}

/*
 * The panel's Donate button.
 *
 * The class is added to the anchor by vim_slideout_donate_button(), so this is
 * the site's one primary button style rather than a second copy of it. Only the
 * two things GeneratePress's own slideout rules take away are restored: the ink
 * label colour (its rule is four classes deep and would otherwise force white
 * on accent, which is the 2.09:1 combination the palette exists to avoid) and
 * the block display the pill needs to fill the panel's measure.
 */
#generate-slideout-menu .slideout-menu > li.vim-slideout-donate {
	border-top: 0;
	margin-top: 1.5rem;
}

#generate-slideout-menu .slideout-menu > li.vim-slideout-donate > a {
	display: flex;
	padding: 0.875rem 1.5rem;
	color: var(--ink);
}

#generate-slideout-menu .slideout-menu > li.vim-slideout-donate:hover > a,
#generate-slideout-menu .slideout-menu > li.vim-slideout-donate > a:hover,
#generate-slideout-menu .slideout-menu > li.vim-slideout-donate > a:focus {
	background-color: var(--accent-dark);
	color: var(--ink);
}

/*
 * The panel's footer.
 *
 * The hairline is put on whatever block follows the menu rather than on a named
 * one, so it stays correct if the client retires the social Element or adds
 * something above it — the rule describes "the first thing after the menu",
 * which is what the line actually separates.
 */
#generate-slideout-menu .inside-navigation > .main-nav + * {
	margin-top: 1.75rem;
	padding-top: 1.25rem;
	border-top: 1px solid rgba(255, 255, 255, 0.14);
}

/* The language slot, filled by assets/lang-switcher.js. */
.vim-slideout-lang {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 1rem;
}

/*
 * The label is deliberately quieter than a menu item: it names the control
 * beside it, and at menu weight it reads as a fifth navigation row. 0.72 white
 * on --teal-900 is 8.3:1, comfortably past AA for text this size.
 */
.vim-slideout-lang__label {
	font-size: 0.875rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: rgba(255, 255, 255, 0.72);
}

/*
 * The slot renders empty and hidden, and the script only unhides it once it has
 * actually moved a switcher in — so `hidden` has to beat the display above, the
 * same way it does on the alert bar.
 */
[data-vim-slideout-lang][hidden] {
	display: none !important;
}

/*
 * Language switcher — the comp's white "EN ▾" pill.
 *
 * Google Language Translator renders a <select> plus a "Powered by Google"
 * block that Google's own script injects. The plugin's showbranding=No does not
 * remove it, so it is hidden here, matching how Avila is configured.
 */
.vim-lang-switcher {
	position: relative;
	display: flex;
	align-items: center;
}

/*
 * Collapse the gadget's stray text nodes and the boxes the plugin puts around
 * the select, without hiding the select itself. Left alone these leave the
 * wrapper ~29px taller than the pill, which throws the chevron off centre.
 */
.vim-lang-switcher .goog-te-gadget {
	font-size: 0;
	line-height: 0;
	color: transparent;
}

.vim-lang-switcher .goog-te-gadget > span {
	display: none;
}

.vim-lang-switcher #google_language_translator,
.vim-lang-switcher .goog-te-gadget,
.vim-lang-switcher .goog-te-gadget > div {
	margin: 0 !important;
	padding: 0 !important;
	line-height: 0 !important;
	display: flex;
	align-items: center;
}

/*
 * The plugin ships `#google_language_translator select.goog-te-combo { … }`
 * with !important on the visual properties, so matching its specificity is not
 * enough — these have to be !important too. Kept scoped to .vim-lang-switcher
 * so nothing leaks if the widget is ever placed elsewhere.
 *
 * 🚨 Two selects, because the plugin changed which one it renders. Up to 7.0.1
 * it was Google's own `select.goog-te-combo`; from 7.0.2 (2026-10-27) it is
 * GTranslate's `select.gt_selector`, and every rule keyed only to the old class
 * silently stopped matching, leaving a default grey dropdown in the header.
 */
.vim-lang-switcher #google_language_translator select.goog-te-combo,
.vim-lang-switcher #google_language_translator select.gt_selector {
	margin: 0 !important;
	border: 0 !important;
	border-radius: 999px !important;
	background-color: var(--white) !important;
	color: var(--teal-900) !important;
	font-family: inherit !important;
	font-size: var(--fs-body, 1rem) !important;
	font-weight: 800 !important;
	font-stretch: 75% !important;
	line-height: 1 !important;
	padding: 0.5rem 2rem 0.5rem 0.9rem !important;
	height: auto !important;
	width: auto !important;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	box-shadow: none !important;
}

.vim-lang-switcher #google_language_translator select.goog-te-combo:focus-visible,
.vim-lang-switcher #google_language_translator select.gt_selector:focus-visible {
	outline: 3px solid var(--accent) !important;
	outline-offset: 2px;
}

/* The chevron. Drawn with clip-path rather than a data URI so the colour stays
   a token — custom properties do not resolve inside url(). */
.vim-lang-switcher::after {
	content: "";
	position: absolute;
	right: 0.8rem;
	top: 50%;
	width: 0.6rem;
	height: 0.4rem;
	transform: translateY(-50%);
	background-color: var(--teal-900);
	clip-path: polygon(0 0, 100% 0, 50% 100%);
	pointer-events: none;
}

/* Google's translation banner pushes the whole document down; the header would
   otherwise slide under it. */
body > .skiptranslate {
	display: none !important;
}

body {
	top: 0 !important;
}

/*
 * Alert bar.
 *
 * Rendered by the Alerts post type (inc/alerts.php), not by block markup — so
 * these styles live here rather than in a block's css attribute. When no alert
 * is active the shortcode returns an empty string and nothing below applies:
 * there is no empty bar and no leftover spacing.
 */
.vim-alert {
	position: relative;
	background-color: var(--ink);
	color: var(--white);
	padding: 0.625rem 2rem;
}

@media (max-width: 767px) {
	.vim-alert {
		padding-inline: 1.25rem;
	}
}

.vim-alert__inner {
	max-width: var(--gb-container-width);
	margin-inline: auto;
	padding-right: 2rem;
}

.vim-alert__message {
	display: flex;
	align-items: center;
	justify-content: center;
	column-gap: 0.6em;
	margin: 0;
	font-size: 1rem;
	line-height: 1.4;
	text-align: center;
	color: var(--white);
}

.vim-alert__icon {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	line-height: 0;
}

.vim-alert__icon svg {
	width: 1.35em;
	height: 1.35em;
	display: block;
	color: var(--warning);
}

.vim-alert__message a {
	color: var(--accent);
	text-decoration: underline;
}

.vim-alert__message a:hover,
.vim-alert__message a:focus {
	color: var(--white);
}

.vim-alert__dismiss {
	position: absolute;
	right: 0.5rem;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.35rem;
	border: 0;
	background-color: transparent;
	color: var(--white);
	line-height: 0;
	cursor: pointer;
}

.vim-alert__dismiss svg {
	width: 1.1rem;
	height: 1.1rem;
	display: block;
}

.vim-alert__dismiss:hover {
	color: var(--accent);
}

.vim-alert__dismiss:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* The bar is a block, but `hidden` must still beat any display it is given. */
[data-vim-alert][hidden] {
	display: none !important;
}

/*
 * Keyboard focus must stay visible against both the teal header and the ink
 * alert bar. GeneratePress ships no focus ring of its own on these.
 */
.site-header a:focus-visible,
.main-navigation a:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: -3px;
}
