/*
 * Header template part (patterns/header.php). Values from the old
 * main-header.tsx and menu-toggle.tsx.
 *
 * The header itself carries no transform, filter or backdrop-filter: any of
 * those would trap the fixed menu overlay inside the header box. Its white
 * scrolled background lives on ::before instead.
 */
.sp-header {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 101;
	overflow-x: clip;
}
.sp-header::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--wp--preset--color--white);
	box-shadow: 0 4px 16px color-mix(in srgb, var(--wp--preset--color--black) 8%, transparent);
	transform: translateX(100%);
	transition: transform 0.55s var(--wp--custom--ease--out), opacity 0.2s ease-out;
	pointer-events: none;
}
.sp-scrolled .sp-header::before {
	transform: translateX(0);
}
/* Capability pages: a white bar at xl and up, whatever the scroll. */
@media (min-width: 1280px) {
	.sp-header.sp-header--capability::before {
		transform: none;
		transition: opacity 0.2s ease-out;
	}
}
/* A section can hide the header while it is pinned (old setIsHeaderSuppressed):
   its script toggles html.sp-header-hidden. Never while the menu is open. */
.sp-header {
	transition: opacity 0.28s ease-in-out;
}
html.sp-header-hidden .sp-header:not(:has(.is-menu-open)) {
	opacity: 0;
	pointer-events: none;
}

/* Menu open: the overlay has its own bar, so the header background steps aside. */
.sp-header:has(.is-menu-open)::before {
	opacity: 0;
}

.sp-header__inner {
	position: relative;
	align-items: center;
	padding-block: 0;
}
@media (min-width: 768px) {
	.sp-header__inner { padding-block: 16px; }
}

/* ---- Logo: light on dark heroes, dark on light pages, when scrolled or open ---- */
.sp-logo {
	position: relative;
	display: block;
	width: 101px;
	height: 24px;
}
.sp-logo .wp-block-image {
	margin: 0;
	transition: opacity 0.3s ease-in-out;
}
.sp-logo .sp-logo__dark {
	position: absolute;
	inset: 0;
	opacity: 0;
}
.sp-header--light-page .sp-logo .sp-logo__dark,
.sp-scrolled .sp-header .sp-logo .sp-logo__dark {
	opacity: 1;
}
.sp-header--light-page .sp-logo .sp-logo__light,
.sp-scrolled .sp-header .sp-logo .sp-logo__light {
	opacity: 0;
}
/* Capability pages keep the light logo below xl until scrolled. */
@media (max-width: 1279.98px) {
	.sp-header--capability:not(.x) .sp-logo .sp-logo__dark { opacity: 0; }
	.sp-header--capability:not(.x) .sp-logo .sp-logo__light { opacity: 1; }
	.sp-scrolled .sp-header--capability .sp-logo .sp-logo__dark { opacity: 1; }
	.sp-scrolled .sp-header--capability .sp-logo .sp-logo__light { opacity: 0; }
}

/* ---- Menu button (the navigation block's open button) ---- */
.sp-menu.wp-block-navigation .wp-block-navigation__responsive-container-open {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-width: 128px;
	margin-right: -16px;
	padding: 16px;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--black-light);
	font-family: var(--wp--preset--font-family--poppins);
	font-size: var(--wp--preset--font-size--small);
	line-height: 20px;
	font-weight: 400;
	border: 0;
	border-radius: 0;
	cursor: pointer;
	transition: background-color 0.3s, color 0.3s;
}
@media (min-width: 640px) {
	.sp-menu.wp-block-navigation .wp-block-navigation__responsive-container-open { min-width: 190px; }
}
@media (min-width: 768px) {
	.sp-menu.wp-block-navigation .wp-block-navigation__responsive-container-open { margin-right: 0; }
}
/* Two-line icon, drawn in CSS so the button stays one editable label. */
.sp-menu.wp-block-navigation .wp-block-navigation__responsive-container-open::before {
	content: "";
	width: 24px;
	height: 20px;
	flex: none;
	background:
		linear-gradient(currentColor, currentColor) center calc(50% - 3.5px) / 100% 1px no-repeat,
		linear-gradient(currentColor, currentColor) center calc(50% + 3.5px) / 100% 1px no-repeat;
	color: var(--wp--preset--color--black);
}
