/**
 * Header and footer chrome
 *
 * Scoped to .bnf-header and .bnf-footer.
 * Tokens come from theme.json.
 */

/* -------------------------------------------------------------------------
   Header — two-row brand + Navigation Block (visual refinement)
   ------------------------------------------------------------------------- */

.bnf-header {
	--bnf-header-max: 1360px;
	--bnf-header-gutter: clamp(2rem, 2.8vw, 2.5rem); /* 32–40px */
	--bnf-header-brand-height: 4.75rem; /* 76px */
	--bnf-header-nav-height: 4rem; /* 64px */
	position: relative;
	z-index: 40;
	background: var(--wp--preset--color--bnf-surface);
}

.bnf-header__brand-row,
.bnf-header__nav-row {
	background: var(--wp--preset--color--bnf-surface);
	/* Kill constrained-layout root padding so the shared 1360 grid can breathe. */
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* Shared institutional container — wider than theme wideSize (1240). */
.bnf-header .bnf-header__brand-inner.alignwide,
.bnf-header .bnf-header__nav-inner.alignwide {
	box-sizing: border-box;
	width: calc(100% - (2 * var(--bnf-header-gutter)));
	max-width: var(--bnf-header-max) !important;
	margin-left: auto !important;
	margin-right: auto !important;
	padding-left: 0;
	padding-right: 0;
}

.bnf-header__brand-row {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	min-height: var(--bnf-header-brand-height);
}

.bnf-header__brand-inner {
	align-items: center;
	gap: var(--wp--preset--spacing--lg);
	min-height: var(--bnf-header-brand-height);
}

.bnf-header__brand {
	flex: 0 1 auto;
	min-width: 0;
	align-items: center;
	gap: 0.875rem;
}

.bnf-header__logo img {
	width: auto !important;
	height: 3.5rem !important; /* 56px */
	max-width: 3.75rem;
	max-height: 3.5rem;
	object-fit: contain;
	object-position: left center;
}

.bnf-header__identity {
	min-width: 0;
}

.bnf-header__name {
	margin: 0;
	color: var(--wp--preset--color--bnf-navy);
	font-size: 0.96875rem; /* 15.5px */
	font-weight: 700;
	line-height: 1.2;
	max-width: 16rem;
}

.bnf-header__tagline,
.bnf-header__tagline.has-meta-font-size {
	margin: 0.2rem 0 0;
	color: var(--wp--preset--color--bnf-muted);
	font-size: 0.78125rem; /* 12.5px */
	line-height: 1.3;
}

.bnf-header__tools {
	flex: 0 0 auto;
	align-items: center;
	margin-left: auto;
	gap: 0.75rem;
}

.bnf-header__search .wp-block-search__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	min-width: 2.5rem;
	min-height: 2.5rem;
	padding: 0;
	margin: 0;
	border: 1px solid var(--wp--preset--color--bnf-border);
	border-radius: 6px;
	background: var(--wp--preset--color--bnf-surface);
	color: var(--wp--preset--color--bnf-navy);
	box-shadow: none;
}

.bnf-header__search .wp-block-search__button svg {
	width: 1.125rem;
	height: 1.125rem;
}

.bnf-header__search .wp-block-search__button:hover {
	border-color: var(--wp--preset--color--bnf-forest);
	color: var(--wp--preset--color--bnf-forest);
}

.bnf-header__donate {
	margin: 0;
	flex: 0 0 auto;
}

.bnf-header__donate .wp-block-button,
.bnf-header__donate .wp-element-button {
	flex-shrink: 0;
	white-space: nowrap;
}

.bnf-header__donate .wp-element-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 5.5rem; /* 88px */
	min-height: 2.5rem; /* 40px */
	padding: 0 1rem;
	font-size: 0.875rem;
	font-weight: 500;
	letter-spacing: 0.01em;
	line-height: 1;
	border-radius: 6px;
	background: var(--wp--preset--color--bnf-forest);
	color: var(--wp--preset--color--bnf-surface);
}

.bnf-header__donate .wp-element-button:hover {
	background: var(--wp--preset--color--bnf-forest-dark);
	color: var(--wp--preset--color--bnf-surface);
}

/* Compact scroll Menu — hidden until .is-scrolled on desktop (≥1025). */
.bnf-header__menu-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	min-height: 2.5rem;
	padding: 0 0.85rem;
	margin: 0;
	border: 1px solid var(--wp--preset--color--bnf-border);
	border-radius: 6px;
	background: var(--wp--preset--color--bnf-surface);
	color: var(--wp--preset--color--bnf-navy);
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0.01em;
	cursor: pointer;
	flex-shrink: 0;
}

.bnf-header__menu-toggle:hover {
	border-color: var(--wp--preset--color--bnf-forest);
	color: var(--wp--preset--color--bnf-forest);
}

.bnf-header__menu-toggle:focus-visible {
	outline: 2px solid var(--wp--preset--color--bnf-forest-dark);
	outline-offset: 3px;
}

.bnf-header__menu-toggle-icon {
	display: block;
	width: 1rem;
	height: 0.75rem;
	position: relative;
}

.bnf-header__menu-toggle-icon::before,
.bnf-header__menu-toggle-icon::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	height: 1.5px;
	background: currentColor;
	border-radius: 1px;
}

.bnf-header__menu-toggle-icon::before {
	top: 0;
	box-shadow: 0 0.3rem 0 currentColor;
}

.bnf-header__menu-toggle-icon::after {
	bottom: 0;
}

.bnf-header__menu-toggle[aria-expanded="true"] .bnf-header__menu-toggle-icon {
	width: 0.85rem;
	height: 0.85rem;
}

.bnf-header__menu-toggle[aria-expanded="true"] .bnf-header__menu-toggle-icon::before,
.bnf-header__menu-toggle[aria-expanded="true"] .bnf-header__menu-toggle-icon::after {
	top: 50%;
	bottom: auto;
	box-shadow: none;
	height: 1.5px;
}

.bnf-header__menu-toggle[aria-expanded="true"] .bnf-header__menu-toggle-icon::before {
	transform: translateY(-50%) rotate(45deg);
}

.bnf-header__menu-toggle[aria-expanded="true"] .bnf-header__menu-toggle-icon::after {
	transform: translateY(-50%) rotate(-45deg);
}

.bnf-header-sentinel {
	display: block;
	width: 100%;
	height: 1px;
	margin: 0;
	padding: 0;
	pointer-events: none;
	visibility: hidden;
}

.bnf-header-spacer {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	pointer-events: none;
}

.bnf-header-spacer[hidden] {
	display: none !important;
}

.bnf-header__nav-row {
	min-height: var(--bnf-header-nav-height);
}

/* Kill WP flow block-gap between brand row and nav row only (1.5rem / 24px). */
.bnf-header.is-layout-flow > .bnf-header__nav-row {
	margin-block-start: 0;
}

.bnf-header__nav-inner {
	align-items: center;
	min-height: var(--bnf-header-nav-height);
	width: 100%;
}

.bnf-header__nav {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	--wp--style--block-gap: 0;
}

.bnf-header__nav .wp-block-navigation,
.bnf-header__nav .wp-block-navigation__container {
	flex-wrap: nowrap;
	justify-content: flex-start;
	align-items: center;
	width: 100%;
	gap: 2.25rem; /* 36px between top-level items */
}

.bnf-header__nav .wp-block-navigation-item {
	flex-shrink: 0;
}

.bnf-header__nav .wp-block-navigation-item__content {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 1.2rem 0;
	color: var(--wp--preset--color--bnf-navy);
	font-size: 0.9375rem; /* 15px */
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.bnf-header__nav .wp-block-navigation-item__content:hover,
.bnf-header__nav .wp-block-navigation-item__content:focus-visible {
	color: var(--wp--preset--color--bnf-forest);
}

.bnf-header__nav .wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content,
.bnf-header__nav .wp-block-navigation-item [aria-current="page"] {
	color: var(--wp--preset--color--bnf-forest);
	box-shadow: inset 0 -2px 0 var(--wp--preset--color--bnf-forest);
}

/* Native submenu toggle — keep the WP button; show + / × instead of chevron SVG. */
.bnf-header__nav .wp-block-navigation-submenu__toggle,
.bnf-header__nav .wp-block-navigation__submenu-icon.wp-block-navigation-submenu__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
	width: 1rem; /* 16px */
	height: 1rem;
	min-width: 1rem;
	min-height: 1rem;
	margin-left: 0.45rem; /* ~7px from label */
	padding: 0;
	border: 0;
	background: transparent;
	color: currentColor;
	opacity: 0.85;
	font: inherit;
	line-height: 1;
	cursor: pointer;
	flex-shrink: 0;
}

/* Hide only the chevron glyph; button remains the interactive control. */
.bnf-header__nav .wp-block-navigation-submenu__toggle svg {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
	pointer-events: none;
}

.bnf-header__nav .wp-block-navigation-submenu__toggle::before {
	content: "+";
	display: block;
	font-size: 0.9375rem; /* 15px */
	font-weight: 400;
	line-height: 1;
}

.bnf-header__nav .wp-block-navigation-submenu__toggle[aria-expanded="true"]::before {
	content: "\00d7"; /* × */
	font-size: 1rem;
}

.bnf-header__nav .wp-block-navigation-item:not(.has-child) > .wp-block-navigation__submenu-icon,
.bnf-header__nav .wp-block-navigation-item:not(.has-child) > .wp-block-navigation-submenu__toggle {
	display: none;
}

/* Nested has-child items: keep label + native toggle on one row. */
.bnf-header__nav .wp-block-navigation__submenu-container > .wp-block-navigation-item.has-child {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
}

.bnf-header__nav .wp-block-navigation__submenu-container > .wp-block-navigation-item.has-child > .wp-block-navigation-item__content {
	flex: 1 1 auto;
}

/* Desktop dropdown panels */
.bnf-header__nav .wp-block-navigation .has-child .wp-block-navigation__submenu-container {
	min-width: 15.5rem;
	padding: 0.45rem 0;
	border: 1px solid var(--wp--preset--color--bnf-border);
	border-radius: 6px;
	background: var(--wp--preset--color--bnf-surface);
	box-shadow: 0 6px 20px rgba(15, 28, 22, 0.07);
	gap: 0;
}

.bnf-header__nav .wp-block-navigation .has-child .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	display: block;
	width: 100%;
	padding: 0.55rem 1rem;
	font-size: 0.875rem;
	font-weight: 400;
	white-space: normal;
	box-shadow: none;
}

.bnf-header__nav .wp-block-navigation .has-child .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
.bnf-header__nav .wp-block-navigation .has-child .wp-block-navigation__submenu-container .wp-block-navigation-item__content:focus-visible {
	color: var(--wp--preset--color--bnf-forest-dark);
	background: color-mix(in srgb, var(--wp--preset--color--bnf-forest) 8%, var(--wp--preset--color--bnf-surface));
}

/* Long About / Our Work menus: two columns when ≥7 children. */
@media (min-width: 1025px) {
	.bnf-header__nav .wp-block-navigation-item.has-child:has(> .wp-block-navigation__submenu-container > .wp-block-navigation-item:nth-child(7)) > .wp-block-navigation__submenu-container {
		display: grid;
		grid-template-columns: repeat(2, minmax(11.5rem, 1fr));
		min-width: 26rem;
		padding: 0.55rem 0.25rem;
	}

	/*
	 * About fills column-first (left column top to bottom, then right), so the
	 * menu order in WordPress is the visual and keyboard reading order and
	 * consecutive items stack. Columns balance for any item count.
	 */
	.bnf-header__nav .wp-block-navigation-item.has-child:has(> .wp-block-navigation-item__content[href$="/who-we-are/"]):has(> .wp-block-navigation__submenu-container > .wp-block-navigation-item:nth-child(7)) > .wp-block-navigation__submenu-container {
		display: block;
		column-count: 2;
		column-gap: 0;
	}

	.bnf-header__nav .wp-block-navigation-item.has-child:has(> .wp-block-navigation-item__content[href$="/who-we-are/"]) > .wp-block-navigation__submenu-container > .wp-block-navigation-item {
		break-inside: avoid;
	}
}

.bnf-header__search .wp-block-search__button:focus-visible,
.bnf-header__donate .wp-element-button:focus-visible,
.bnf-header__nav .wp-block-navigation-item__content:focus-visible,
.bnf-header .wp-block-navigation__responsive-container-open:focus-visible,
.bnf-header .wp-block-navigation__responsive-container-close:focus-visible,
.bnf-header .wp-block-navigation-submenu__toggle:focus-visible {
	outline: 2px solid var(--wp--preset--color--bnf-forest-dark);
	outline-offset: 3px;
}

/* The footer is forest-dark, so its focus ring uses the light surface colour. */
.bnf-footer a:focus-visible {
	outline: 2px solid var(--wp--preset--color--bnf-surface);
	outline-offset: 3px;
}

@media (min-width: 1025px) and (max-width: 1280px) {
	.bnf-header__nav .wp-block-navigation,
	.bnf-header__nav .wp-block-navigation__container {
		gap: 1.5rem; /* 24px — still within a compact institutional range */
	}

	.bnf-header__nav .wp-block-navigation-item__content {
		font-size: 0.875rem;
	}
}

/* -------------------------------------------------------------------------
   Desktop scroll: compact sticky + expandable Menu (≥1025 only)
   Normal top-of-page header styles above are unchanged.
   ------------------------------------------------------------------------- */
@media (min-width: 1025px) {
	/* Desktop: pack primary nav group to the right of the shared 1360 container (all states). */
	.bnf-header__nav-inner,
	.bnf-header__nav.wp-block-navigation,
	.bnf-header__nav .wp-block-navigation__container,
	.bnf-header__nav .wp-block-navigation__responsive-container-content {
		justify-content: flex-end;
	}

	/* The block is saved left-justified, so core's items-justified-right
	   anchoring never applies; the last panel would otherwise extend past
	   the viewport (even while hidden) and widen the page. */
	.bnf-header__nav .wp-block-navigation__container > .wp-block-navigation-item.has-child:last-child > .wp-block-navigation__submenu-container {
		left: auto;
		right: 0;
	}

	.bnf-header.is-scrolled {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		width: 100%;
		z-index: 100;
		background: var(--wp--preset--color--bnf-surface);
		border-bottom: 1px solid var(--wp--preset--color--bnf-border);
		box-shadow: none;
	}

	.bnf-header.is-scrolled .bnf-header__brand-row {
		border-bottom-width: 0 !important;
	}

	.bnf-header.is-scrolled:not(.is-nav-expanded) .bnf-header__brand-row,
	.bnf-header.is-scrolled:not(.is-nav-expanded) .bnf-header__brand-inner {
		min-height: 4rem; /* ~64px compact bar */
	}

	.bnf-header.is-scrolled:not(.is-nav-expanded) .bnf-header__logo img {
		height: 2.625rem !important; /* 42px */
		max-height: 2.625rem;
		max-width: 2.875rem;
	}

	.bnf-header.is-scrolled:not(.is-nav-expanded) .bnf-header__identity,
	.bnf-header.is-scrolled:not(.is-nav-expanded) .bnf-header__search,
	.bnf-header.is-scrolled:not(.is-nav-expanded) .bnf-header__nav-row {
		display: none !important;
	}

	.bnf-header.is-scrolled .bnf-header__menu-toggle {
		display: inline-flex;
	}

	/* Expanded while scrolled: restore identity, search, and the same nav row. */
	.bnf-header.is-scrolled.is-nav-expanded .bnf-header__identity {
		display: block !important;
	}

	.bnf-header.is-scrolled.is-nav-expanded .bnf-header__search {
		display: block !important;
	}

	.bnf-header.is-scrolled.is-nav-expanded .bnf-header__brand-row {
		border-bottom: 1px solid var(--wp--preset--color--bnf-border) !important;
	}

	.bnf-header.is-scrolled.is-nav-expanded .bnf-header__nav-row {
		display: block !important;
		min-height: var(--bnf-header-nav-height);
		border-bottom-width: 0 !important;
	}

	/* Expanded scrolled only: pack the nav group to the right of the shared 1360 container. */
	.bnf-header.is-scrolled.is-nav-expanded .bnf-header__nav-inner,
	.bnf-header.is-scrolled.is-nav-expanded .bnf-header__nav.wp-block-navigation,
	.bnf-header.is-scrolled.is-nav-expanded .bnf-header__nav .wp-block-navigation__container,
	.bnf-header.is-scrolled.is-nav-expanded .bnf-header__nav .wp-block-navigation__responsive-container-content {
		justify-content: flex-end;
	}

	.bnf-header.is-scrolled.is-nav-expanded .bnf-header__logo img {
		height: 3.5rem !important;
		max-height: 3.5rem;
		max-width: 3.75rem;
	}

	.bnf-header.is-scrolled.is-nav-expanded .bnf-header__brand-row,
	.bnf-header.is-scrolled.is-nav-expanded .bnf-header__brand-inner {
		min-height: var(--bnf-header-brand-height);
	}
}

/* Tablet and below: brand + hamburger share one row; overlay for links.
   Desktop compact Menu / spacer must not appear here. */
@media (max-width: 1024px) {
	.bnf-header__menu-toggle {
		display: none !important;
	}

	.bnf-header-spacer {
		display: none !important;
	}

	.bnf-header {
		position: relative;
	}

	.bnf-header__nav-row {
		position: absolute;
		top: 0;
		right: 0;
		left: 0;
		z-index: 5;
		height: 0;
		min-height: 0;
		padding: 0 !important;
		border: 0 !important;
		background: transparent;
		pointer-events: none;
		overflow: visible;
	}

	.bnf-header .bnf-header__nav-inner.alignwide {
		display: flex;
		align-items: center;
		justify-content: flex-end;
		min-height: 0;
		height: var(--bnf-header-brand-height);
		width: calc(100% - (2 * var(--bnf-header-gutter)));
		max-width: var(--bnf-header-max) !important;
		padding-left: 0;
		padding-right: 0;
		box-sizing: border-box;
	}

	.bnf-header .bnf-header__nav,
	.bnf-header .bnf-header__nav .wp-block-navigation__responsive-container-open {
		pointer-events: auto;
	}

	.bnf-header .bnf-header__nav {
		width: auto;
		flex: 0 0 auto;
	}

	/* Core only collapses to the overlay below 600px; keep the inline list
	   hidden up to 1024px so it cannot sit on top of the brand row. */
	.bnf-header .bnf-header__nav .wp-block-navigation__responsive-container:not(.is-menu-open) {
		display: none;
	}

	.bnf-header .bnf-header__nav .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
		align-items: center;
		justify-content: center;
		min-width: 2.5rem;
		min-height: 2.5rem;
		color: var(--wp--preset--color--bnf-navy);
	}

	.bnf-header__tools {
		padding-right: 3rem;
	}

	.bnf-header .bnf-header__nav .wp-block-navigation__responsive-container.is-menu-open {
		pointer-events: auto;
		padding: 1.25rem 1.25rem 2rem;
	}

	.bnf-header .bnf-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
		padding-block: 0.75rem;
		padding-inline: 0.25rem;
		white-space: normal;
	}

	.bnf-header .bnf-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
		border: 0;
		border-radius: 0;
		box-shadow: none;
		padding: 0 0 0 0.75rem;
		background: transparent;
	}

	.bnf-header .bnf-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
		padding-block: 0.55rem;
		font-weight: 400;
	}

	.bnf-header .bnf-header__nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-submenu__toggle {
		min-width: 2.5rem;
		min-height: 2.5rem;
	}
}

@media (max-width: 781px) {
	.bnf-header {
		--bnf-header-brand-height: 4.25rem;
		--bnf-header-gutter: 1.25rem;
	}

	.bnf-header__logo img {
		max-width: 48px;
		max-height: 48px;
	}

	.bnf-header__name {
		font-size: 0.8125rem;
		max-width: 9.5rem;
	}

	.bnf-header__tagline {
		display: none;
	}

	.bnf-header__tools {
		gap: 0.5rem;
	}

	.bnf-header__donate .wp-element-button {
		min-width: 4.75rem;
		padding: 0 0.85rem;
	}
}

@media (max-width: 479px) {
	.bnf-header__donate .wp-element-button {
		min-width: 0;
		padding-inline: 0.7rem;
		font-size: 0.8125rem;
	}
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */

.bnf-footer {
	position: relative;
	overflow-x: clip;
	max-width: 100%;
	isolation: isolate;
	background-color: transparent;
	padding: 0;
	color: var(--wp--preset--color--bnf-surface);
}

/* Kill WP site-blocks blockGap (1.5rem / 24px) above the footer template part —
   that margin exposes the white body between page sections and the wave. */
.wp-site-blocks > footer.wp-block-template-part {
	margin-block-start: 0;
}

.bnf-footer__wave {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	line-height: 0;
	pointer-events: none;
	color: var(--wp--preset--color--bnf-forest-dark);
	/* Match the page section above so the SVG sky isn’t a white band. */
	background-color: var(--wp--preset--color--bnf-surface-soft);
}

.bnf-footer__wave svg {
	display: block;
	width: 100%;
	max-width: 100%;
	height: 4.75rem;
	fill: currentColor;
}

.bnf-footer__body,
.bnf-footer__legal {
	background-color: var(--wp--preset--color--bnf-forest-dark);
}

.bnf-footer__body {
	position: relative;
	z-index: 1;
	margin-top: -1px;
	padding-top: 0.5rem;
	padding-bottom: 2.15rem;
}

/* Explicit CSS Grid — overrides WP Columns flex so breakpoints never masonry or clip.
   Keep the approved wideSize container (1240) — never stretch edge-to-edge. */
.bnf-footer .bnf-footer__grid.wp-block-columns.is-layout-flex {
	display: grid !important;
	align-items: stretch;
	justify-content: stretch;
	margin-left: auto !important;
	margin-right: auto !important;
	gap: 0 !important;
	width: 100%;
	max-width: var(--wp--style--global--wide-size, 1240px);
	box-sizing: border-box;
}

.bnf-footer .bnf-footer__legal-inner.alignwide {
	width: 100%;
	max-width: var(--wp--style--global--wide-size, 1240px);
	margin-left: auto;
	margin-right: auto;
	box-sizing: border-box;
}

.bnf-footer__grid > .wp-block-column {
	box-sizing: border-box;
	min-width: 0;
	width: auto !important;
	max-width: none !important;
	flex-basis: auto !important;
	flex-grow: 0 !important;
	flex-shrink: 1 !important;
	padding: 0 1.45rem;
	margin: 0;
}

.bnf-footer__grid > .wp-block-column:first-child {
	padding-left: 0;
}

.bnf-footer__grid > .wp-block-column:last-child {
	padding-right: 0;
}

/*
 * Desktop ≥1280: approved 5-column proportions (25 | 17 | 17 | 25 | 16).
 * Matches the locked wideSize container — not equal 1fr strips.
 */
@media (min-width: 1280px) {
	.bnf-footer .bnf-footer__grid.wp-block-columns.is-layout-flex {
		grid-template-columns: minmax(0, 2.5fr) minmax(0, 1.7fr) minmax(0, 1.7fr) minmax(0, 2.5fr) minmax(0, 1.6fr);
		grid-template-areas: "brand quick involved contact follow";
	}

	.bnf-footer__brand { grid-area: brand; }
	.bnf-footer__quick { grid-area: quick; }
	.bnf-footer__involved { grid-area: involved; }
	.bnf-footer__contact { grid-area: contact; }
	.bnf-footer__follow { grid-area: follow; }

	.bnf-footer__grid > .wp-block-column:not(:last-child) {
		border-right: 1px solid rgba(255, 255, 255, 0.18);
	}
}

.bnf-footer__logo {
	margin: 0;
}

/* Cap logo to approved desktop size — never fill the Identity column. */
.bnf-footer__logo .custom-logo-link,
.bnf-footer__logo img,
.bnf-footer__logo .custom-logo {
	display: block;
	width: auto !important;
	max-width: 8.25rem !important; /* 132px — approved desktop baseline */
	height: auto !important;
	max-height: 7.5rem;
	object-fit: contain;
	object-position: left center;
}

.bnf-footer__tagline {
	margin: 0.4rem 0 0;
	max-width: none;
	color: rgba(255, 255, 255, 0.78);
	font-size: 0.6875rem;
	line-height: 1.35;
	white-space: nowrap;
}

.bnf-footer__heading {
	margin: 0 0 0.95rem;
	color: #ffffff;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.2;
	text-transform: uppercase;
}

.bnf-footer .wp-block-heading {
	color: #ffffff;
}

.bnf-footer__nav .wp-block-navigation__container,
.bnf-footer__nav .wp-block-page-list {
	gap: 0;
}

.bnf-footer__nav .wp-block-navigation-item__content {
	color: rgba(255, 255, 255, 0.86);
	font-size: 0.84375rem;
	font-weight: 500;
	line-height: 2;
	text-decoration: none;
	transition: color 0.18s ease, opacity 0.18s ease;
}

.bnf-footer__nav .wp-block-navigation-item__content:hover,
.bnf-footer__legal-nav .wp-block-navigation-item__content:hover {
	color: #ffffff;
	text-decoration: none;
	opacity: 0.82;
}

.bnf-footer__contact-row {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	margin: 0 0 0.65rem;
	color: rgba(255, 255, 255, 0.88);
	font-size: 0.84375rem;
	line-height: 1.55;
}

.bnf-footer__icon {
	flex: 0 0 1.05rem;
	margin-top: 0.2rem;
	color: #ffffff;
}

.bnf-footer__icon svg {
	display: block;
	width: 1.05rem;
	height: 1.05rem;
}

.bnf-footer__contact .bnf-footer__contact-row:last-child {
	margin-bottom: 0;
}

.bnf-footer__contact-link {
	min-width: 0;
	color: #ffffff;
	font-weight: 500;
	text-decoration: none;
	overflow-wrap: anywhere;
	transition: color 0.18s ease, opacity 0.18s ease;
}

.bnf-footer .bnf-footer__contact a.bnf-footer__contact-link:hover {
	color: #ffffff;
	opacity: 0.82;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.bnf-footer__pending {
	margin: 0;
	max-width: 16.5rem;
	color: rgba(255, 255, 255, 0.75);
	font-size: 0.8125rem;
	line-height: 1.55;
}

.bnf-footer__social {
	margin: 0;
	gap: 0.6rem;
}

.bnf-footer__social:not(:has(.wp-social-link)) {
	display: none;
}

.bnf-footer__social .wp-social-link {
	box-sizing: border-box;
	width: 36px;
	height: 36px;
	margin: 0;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.32);
	border-radius: 999px;
	transition: opacity 0.18s ease, border-color 0.18s ease;
}

/* Must outrank core's `.wp-block-social-links .wp-block-social-link.wp-social-link { display: inline-block }`. */
.bnf-footer__social.wp-block-social-links .wp-block-social-link.wp-social-link {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	line-height: 0;
}

.bnf-footer__social .wp-social-link:hover,
.bnf-footer__social .wp-social-link:focus-visible {
	opacity: 0.8;
	border-color: rgba(255, 255, 255, 0.7);
}

/* Covers the linked <a> and the pending <span>; the span also has to outrank core's `span:not(.screen-reader-text)` margin/font-size rule. */
.bnf-footer__social.wp-block-social-links .wp-social-link .wp-block-social-link-anchor {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	font-size: inherit;
	line-height: 0;
	border-radius: 999px;
}

.bnf-footer__social .wp-social-link svg {
	display: block;
	flex: none;
	width: 16px;
	height: 16px;
	margin: 0;
}

.bnf-footer__social .wp-block-social-link-anchor:focus-visible {
	outline: 2px solid var(--wp--preset--color--bnf-surface);
	outline-offset: 3px;
	border-radius: 999px;
}

.bnf-footer__social .wp-social-link:focus-within {
	border-color: rgba(255, 255, 255, 0.7);
}

/* Icons without a verified URL yet: same look, not interactive. */
.bnf-footer__social .wp-social-link.is-pending:hover {
	opacity: 1;
	border-color: rgba(255, 255, 255, 0.32);
	transform: none;
}

.bnf-footer__brand,
.bnf-footer__quick,
.bnf-footer__involved,
.bnf-footer__contact,
.bnf-footer__follow {
	position: relative;
	z-index: 1;
}

.bnf-footer__brand {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.bnf-footer__legal {
	position: relative;
	z-index: 1;
	padding-top: 0.85rem;
	padding-bottom: 1.15rem;
	border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.bnf-footer__legal-inner {
	align-items: center;
	justify-content: flex-start;
	gap: 0.2rem 0;
}

.bnf-footer__legal p,
.bnf-footer__legal-nav .wp-block-navigation-item__content {
	margin: 0;
	color: rgba(255, 255, 255, 0.72);
	font-size: 0.75rem;
	line-height: 1.4;
	text-decoration: none;
	transition: color 0.18s ease, opacity 0.18s ease;
}

.bnf-footer__legal-nav .wp-block-navigation__container {
	gap: 0;
}

.bnf-footer__copyright::after,
.bnf-footer__legal-nav .wp-block-navigation-item:not(:last-child)::after {
	content: "|";
	margin: 0 0.55rem;
	color: rgba(255, 255, 255, 0.4);
	font-weight: 400;
}

.bnf-footer__legal .bnf-footer__credit {
	margin-left: auto;
	padding-left: 1.5rem;
	white-space: nowrap;
}

.bnf-footer .bnf-footer__legal .bnf-footer__credit a {
	color: rgba(255, 255, 255, 0.86);
	font-weight: 600;
	text-decoration: none;
	transition: color 0.18s ease, opacity 0.18s ease;
}

.bnf-footer .bnf-footer__legal .bnf-footer__credit a:hover {
	color: #ffffff;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* 1024–1279: intentional 3-column reflow (no five-column squeeze). */
@media (min-width: 1024px) and (max-width: 1279px) {
	.bnf-footer .bnf-footer__grid.wp-block-columns.is-layout-flex {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		grid-template-areas:
			"brand quick involved"
			"contact follow follow";
		row-gap: 1.65rem !important;
	}

	.bnf-footer__brand { grid-area: brand; }
	.bnf-footer__quick { grid-area: quick; }
	.bnf-footer__involved { grid-area: involved; }
	.bnf-footer__contact { grid-area: contact; }
	.bnf-footer__follow { grid-area: follow; }

	.bnf-footer__grid > .wp-block-column {
		padding: 0 1.25rem;
		border-right: 0;
	}

	.bnf-footer__brand,
	.bnf-footer__quick,
	.bnf-footer__contact {
		border-right: 1px solid rgba(255, 255, 255, 0.18);
	}

	.bnf-footer__brand,
	.bnf-footer__contact {
		padding-left: 0;
	}

	.bnf-footer__involved,
	.bnf-footer__follow {
		padding-right: 0;
	}

	.bnf-footer__brand {
		justify-content: flex-start;
	}

	.bnf-footer__logo .custom-logo-link,
	.bnf-footer__logo img,
	.bnf-footer__logo .custom-logo {
		max-width: 7rem !important; /* 112px — slightly reduced */
		max-height: 6.5rem;
	}

	.bnf-footer__tagline {
		white-space: normal;
		max-width: 16rem;
	}
}

/* 768–1023: intentional 2-column rows. */
@media (min-width: 768px) and (max-width: 1023px) {
	.bnf-footer__wave svg {
		height: 3.75rem;
	}

	.bnf-footer .bnf-footer__grid.wp-block-columns.is-layout-flex {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-template-areas:
			"brand quick"
			"involved contact"
			"follow follow";
		row-gap: 1.65rem !important;
	}

	.bnf-footer__brand { grid-area: brand; }
	.bnf-footer__quick { grid-area: quick; }
	.bnf-footer__involved { grid-area: involved; }
	.bnf-footer__contact { grid-area: contact; }
	.bnf-footer__follow { grid-area: follow; }

	.bnf-footer__grid > .wp-block-column {
		padding: 0 1.25rem 0 0;
		border-right: 0;
	}

	.bnf-footer__brand,
	.bnf-footer__involved {
		border-right: 1px solid rgba(255, 255, 255, 0.18);
	}

	.bnf-footer__quick,
	.bnf-footer__contact,
	.bnf-footer__follow {
		padding-right: 0;
	}

	.bnf-footer__brand {
		justify-content: flex-start;
	}

	.bnf-footer__logo .custom-logo-link,
	.bnf-footer__logo img,
	.bnf-footer__logo .custom-logo {
		max-width: 6.75rem !important; /* 108px */
		max-height: 6.25rem;
	}

	.bnf-footer__tagline {
		white-space: normal;
		max-width: 15rem;
	}
}

@media (max-width: 781px) {
	.bnf-header,
	.bnf-footer {
		max-width: 100%;
		overflow-x: clip;
	}
}

@media (max-width: 767px) {
	.bnf-footer__wave svg {
		height: 3.25rem;
	}

	.bnf-footer__body {
		padding-bottom: 0.35rem;
	}

	.bnf-footer .bnf-footer__grid.wp-block-columns.is-layout-flex {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"brand"
			"quick"
			"involved"
			"contact"
			"follow";
		row-gap: 0 !important;
	}

	.bnf-footer__brand { grid-area: brand; }
	.bnf-footer__quick { grid-area: quick; }
	.bnf-footer__involved { grid-area: involved; }
	.bnf-footer__contact { grid-area: contact; }
	.bnf-footer__follow { grid-area: follow; }

	.bnf-footer__grid > .wp-block-column {
		display: block;
		width: 100% !important;
		max-width: none !important;
		margin: 0 0 1.45rem;
		padding: 0;
		border-right: 0;
	}

	.bnf-footer__brand {
		justify-content: flex-start;
	}

	.bnf-footer__logo .custom-logo-link,
	.bnf-footer__logo img,
	.bnf-footer__logo .custom-logo {
		max-width: 6.25rem !important; /* 100px — compact mobile */
		max-height: 5.75rem;
	}

	.bnf-footer__tagline {
		white-space: normal;
		max-width: 14rem;
	}

	.bnf-footer__legal {
		padding-top: 0.85rem;
		padding-bottom: 1.25rem;
	}

	.bnf-footer__legal-inner {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
	}

	.bnf-footer__copyright {
		flex: 1 1 100%;
	}

	.bnf-footer__copyright::after {
		display: none;
	}

	.bnf-footer__legal .bnf-footer__credit {
		flex: 1 1 100%;
		margin-left: 0;
		padding-left: 0;
		margin-top: 0.35rem;
	}
}
