/*
 * Site header — reproduces the homepage export header (template.html 1908–1963):
 * white bar, 1280px box incl. 32px gutters, 14px vertical padding, 48px logo,
 * 14px desktop navigation with click dropdowns, pill search ≥1140px,
 * icon search below 1140px, native mobile navigation below 940px and a
 * 7px ochre embroidered strip.
 */

.sk-site-header {
	position: relative;
	z-index: 20;
	margin: 0;
	background: var(--wp--custom--design--surface);
	color: var(--wp--custom--design--ink);
	font-family: var(--wp--preset--font-family--body);
}

.sk-site-header .sk-site-header__inner {
	box-sizing: border-box;
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 20px;
	max-width: var(--wp--custom--layout--content-size);
	margin: 0 auto;
	padding: 14px var(--wp--custom--layout--gutter);
}

.sk-site-header .sk-site-header__stitch {
	--sk-embroidery-color: var(--wp--custom--design--ochre);
	--sk-embroidery-size: 7px;
	height: 7px !important;
	margin: 0;
}

/* Logo */

.sk-site-header .sk-site-header__logo {
	flex: none;
	margin: 0;
}

.sk-site-header .sk-site-header__logo a {
	display: block;
	text-decoration: none;
}

.sk-site-header .sk-site-header__logo img {
	display: block;
	width: auto !important;
	height: 48px !important;
}

/* Desktop navigation */

.sk-site-header nav.sk-site-header__navigation {
	flex: 1;
	min-width: 0;
	margin: 0;
	color: var(--wp--custom--design--ink);
	font-family: var(--wp--preset--font-family--body);
	font-size: 14px;
	font-weight: 500;
}

.sk-site-header .sk-site-header__navigation .wp-block-navigation__container {
	flex-wrap: nowrap;
	gap: 0;
	font-size: inherit;
}

.sk-site-header .sk-site-header__navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content {
	box-sizing: border-box;
	display: flex;
	height: 44px;
	align-items: center;
	margin: 0;
	padding: 0 8px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--wp--custom--design--ink);
	font: inherit;
	line-height: normal;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}

.sk-site-header .sk-site-header__navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-submenu__toggle {
	padding-right: 25px;
}

.sk-site-header .sk-site-header__navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:hover,
.sk-site-header .sk-site-header__navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-submenu__toggle[aria-expanded="true"] {
	background: var(--wp--custom--design--soft);
	color: var(--wp--custom--design--ink);
}

.sk-site-header .sk-site-header__navigation .wp-block-navigation__submenu-icon {
	position: absolute;
	top: 50%;
	right: 8px;
	display: flex;
	width: 14px;
	height: 14px;
	align-items: center;
	justify-content: center;
	margin: -7px 0 0;
	padding: 0;
	color: var(--wp--custom--design--muted);
	pointer-events: none;
}

.sk-site-header .sk-site-header__navigation .wp-block-navigation__submenu-icon svg {
	display: none;
}

.sk-site-header .sk-site-header__navigation .wp-block-navigation__submenu-icon::before {
	content: var(--sk-icon-chevron-down);
	font-family: "sk-lucide";
	font-size: 14px;
	font-style: normal;
	font-weight: 400;
	line-height: 1;
}

.sk-site-header .sk-site-header__navigation .wp-block-navigation-submenu__toggle[aria-expanded="true"] + .wp-block-navigation__submenu-icon::before {
	content: var(--sk-icon-chevron-up);
}

/* Desktop dropdown panel */

.sk-site-header .sk-site-header__navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .has-child > .wp-block-navigation__submenu-container {
	top: calc(100% + 10px);
	left: 0;
	box-sizing: border-box;
	width: 280px;
	min-width: 0;
	padding: 7px 0 0;
	overflow: hidden;
	border: 1px solid var(--wp--custom--design--border);
	border-radius: 10px;
	background: var(--wp--custom--design--surface);
	box-shadow: 0 14px 34px rgba(12, 42, 60, 0.16);
	color: var(--wp--custom--design--ink);
}

/* Same opposing 45deg stitch as .sk-embroidery; core renders this list, so it cannot carry the class. */
.sk-site-header .sk-site-header__navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .has-child > .wp-block-navigation__submenu-container::before {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	height: 7px;
	background:
		linear-gradient(45deg, transparent 40%, var(--wp--custom--design--ochre) 40% 60%, transparent 60%) 0 0 / 7px 7px,
		linear-gradient(-45deg, transparent 40%, var(--wp--custom--design--ochre) 40% 60%, transparent 60%) 0 0 / 7px 7px;
	content: "";
}

.sk-site-header .sk-site-header__navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .has-child > .wp-block-navigation__submenu-container > .wp-block-navigation-item:first-child {
	margin-top: 8px;
}

.sk-site-header .sk-site-header__navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .has-child > .wp-block-navigation__submenu-container > .wp-block-navigation-item {
	margin-inline: 8px;
}

.sk-site-header .sk-site-header__navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .has-child > .wp-block-navigation__submenu-container > .wp-block-navigation-item:last-child {
	margin-bottom: 8px;
}

.sk-site-header .sk-site-header__navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	box-sizing: border-box;
	display: block;
	width: 100%;
	padding: 9px 12px 7px;
	border-radius: 6px;
	color: var(--wp--custom--design--ink);
	font-size: 15px;
	line-height: normal;
	text-decoration: none;
	white-space: normal;
}

.sk-site-header .sk-site-header__navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
	background: var(--wp--custom--design--canvas);
	color: var(--wp--custom--design--ink);
}

/* Search: wide pill ≥1140px */

.sk-site-header .sk-site-header__search {
	flex: none;
	margin: 0;
}

.sk-site-header .sk-site-header__search .wp-block-search__button {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--wp--custom--design--ink);
	cursor: pointer;
}

.sk-site-header .sk-site-header__search .wp-block-search__button svg {
	display: none;
}

.sk-site-header .sk-site-header__search .wp-block-search__button::before {
	content: var(--sk-icon-search);
	font-family: "sk-lucide";
	font-style: normal;
	font-weight: 400;
	line-height: 1;
}

.sk-site-header .sk-site-header__search--wide {
	width: 170px;
}

.sk-site-header .sk-site-header__search--wide .wp-block-search__inside-wrapper {
	box-sizing: border-box;
	flex-direction: row-reverse;
	flex-wrap: nowrap;
	gap: 8px;
	height: 44px;
	align-items: center;
	padding: 0 16px;
	/* Field boundary needs 3:1 against the header (WCAG 1.4.11). */
	border: 1px solid var(--wp--custom--design--inactive);
	border-radius: 999px;
	background: var(--wp--custom--design--surface);
}

/* Core's editor resize handle sets an inline 220px minimum on this 170px search. */
.editor-styles-wrapper .sk-site-header__search--wide .components-resizable-box__container.wp-block-search__inside-wrapper {
	min-width: 0 !important;
}

.sk-site-header .sk-site-header__search--wide .wp-block-search__input {
	min-width: 0;
	height: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--wp--custom--design--ink);
	font-size: 14px;
	line-height: normal;
}

.sk-site-header .sk-site-header__search--wide .wp-block-search__input::placeholder {
	color: var(--wp--custom--design--muted);
	opacity: 1;
}

.sk-site-header .sk-site-header__search--wide .wp-block-search__button {
	flex: none;
	width: 16px;
	height: 16px;
	min-width: 0;
	font-size: 16px;
}

.sk-site-header .sk-site-header__search--wide .wp-block-search__inside-wrapper:focus-within {
	outline: 2px solid var(--wp--custom--design--ink);
	outline-offset: 2px;
}

/* Search: icon-only below 1140px (native expandable button-only search) */

.sk-site-header .sk-site-header__search--compact {
	display: none;
	margin-left: auto;
}

.sk-site-header .sk-site-header__search--compact .wp-block-search__inside-wrapper {
	position: static;
	border: 0;
	background: transparent;
}

/* Keep the focus ring of the collapsed button visible (core clips the hidden field). */
.sk-site-header .wp-block-search.sk-site-header__search--compact.wp-block-search__searchfield-hidden,
.sk-site-header .wp-block-search.sk-site-header__search--compact.wp-block-search__searchfield-hidden .wp-block-search__inside-wrapper {
	overflow: visible;
}

.sk-site-header .sk-site-header__search--compact .wp-block-search__input {
	padding: 0;
	border: 0;
}

.sk-site-header .sk-site-header__search--compact.wp-block-search .wp-block-search__button {
	width: 44px;
	height: 44px;
	border: 1px solid var(--wp--custom--design--search-border);
	border-radius: 50%;
	background: var(--wp--custom--design--surface);
	font-size: 18px;
	box-sizing: border-box;
}

/* Expanded field drops below the header instead of pushing the bar. */
.sk-site-header .sk-site-header__search--compact:not(.wp-block-search__searchfield-hidden) .wp-block-search__input {
	position: absolute;
	top: calc(100% + 8px);
	right: var(--wp--custom--layout--gutter);
	left: var(--wp--custom--layout--gutter);
	box-sizing: border-box;
	width: auto;
	height: 48px;
	padding: 0 16px;
	border: 1px solid var(--wp--custom--design--inactive);
	border-radius: 999px;
	background: var(--wp--custom--design--surface);
	box-shadow: 0 14px 34px rgba(12, 42, 60, 0.16);
	color: var(--wp--custom--design--ink);
	font-size: 16px;
}

/* Mobile navigation trigger and panel */

.sk-site-header .sk-site-header__navigation .wp-block-navigation__responsive-container-open,
.sk-site-header .sk-site-header__navigation .wp-block-navigation__responsive-container-close {
	box-sizing: border-box;
	width: 44px;
	height: 44px;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 1.5px solid var(--wp--custom--design--ink);
	border-radius: 50%;
	background: var(--wp--custom--design--surface);
	color: var(--wp--custom--design--ink);
}

.sk-site-header .sk-site-header__navigation .wp-block-navigation__responsive-container-close {
	display: flex;
	background: var(--wp--custom--design--ink);
	color: var(--wp--custom--design--surface);
}

.sk-site-header .sk-site-header__navigation :is(.wp-block-navigation__responsive-container-open, .wp-block-navigation__responsive-container-close) svg {
	display: none;
}

.sk-site-header .sk-site-header__navigation :is(.wp-block-navigation__responsive-container-open, .wp-block-navigation__responsive-container-close)::before {
	font-family: "sk-lucide";
	font-size: 18px;
	font-style: normal;
	font-weight: 400;
	line-height: 1;
}

.sk-site-header .sk-site-header__navigation .wp-block-navigation__responsive-container-open::before {
	content: var(--sk-icon-menu);
}

.sk-site-header .sk-site-header__navigation .wp-block-navigation__responsive-container-close::before {
	content: var(--sk-icon-x);
}

/* Panel opens under the header like the reference, not as a full-screen overlay. */
.sk-site-header .sk-site-header__navigation.wp-block-navigation .wp-block-navigation__responsive-container.wp-block-navigation__responsive-container.is-menu-open {
	position: absolute;
	top: 100%;
	right: 0;
	bottom: auto;
	left: 0;
	z-index: 30;
	box-sizing: border-box;
	padding: 12px var(--wp--custom--layout--gutter) 24px;
	overflow: visible;
	background: var(--wp--custom--design--footer);
	box-shadow: 0 14px 34px rgba(12, 42, 60, 0.2);
	color: var(--wp--custom--design--surface);
	font-family: var(--wp--preset--font-family--body);
	font-size: 15px;
	font-weight: 400;
}

.sk-site-header .sk-site-header__navigation .is-menu-open .wp-block-navigation__responsive-close {
	max-width: none;
}

.has-modal-open .sk-site-header .sk-site-header__navigation .is-menu-open .wp-block-navigation__responsive-dialog,
.has-modal-open .admin-bar .sk-site-header .sk-site-header__navigation .is-menu-open .wp-block-navigation__responsive-dialog {
	margin-top: 0;
}

/* Close button sits where the burger is: 83px header + 12px panel padding − 16px burger offset. */
.sk-site-header .sk-site-header__navigation .is-menu-open .wp-block-navigation__responsive-container-close {
	top: -79px;
	right: 0;
}

.sk-site-header .sk-site-header__navigation .is-menu-open .wp-block-navigation__responsive-container-content {
	max-height: calc(100dvh - 119px - var(--wp-admin--admin-bar--height, 0px));
	padding-top: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.sk-site-header .sk-site-header__navigation .is-menu-open .wp-block-navigation__container {
	width: 100%;
	gap: 0;
}

.sk-site-header .sk-site-header__navigation .is-menu-open .wp-block-navigation__container > .wp-block-navigation-item {
	position: relative;
	width: 100%;
	border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.sk-site-header .sk-site-header__navigation .is-menu-open .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content {
	box-sizing: border-box;
	display: flex;
	width: 100%;
	height: auto;
	justify-content: space-between;
	align-items: center;
	padding: 14px 0 12px;
	border-radius: 0;
	background: transparent;
	color: var(--wp--custom--design--surface);
	font-family: var(--wp--preset--font-family--editorial);
	font-size: 21px;
	font-weight: 400;
	line-height: normal;
	text-align: left;
	text-decoration: none;
}

.sk-site-header .sk-site-header__navigation .is-menu-open .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-submenu__toggle {
	padding-right: 26px;
}

.sk-site-header .sk-site-header__navigation .is-menu-open .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:hover {
	color: var(--wp--custom--design--blush);
}

.sk-site-header .sk-site-header__navigation .is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-icon {
	top: 27px;
	right: 0;
	display: flex;
	width: 18px;
	height: 18px;
	margin: -9px 0 0;
	color: var(--wp--custom--design--surface);
}

.sk-site-header .sk-site-header__navigation .is-menu-open .wp-block-navigation__submenu-icon::before {
	font-size: 18px;
}

/* Accordion: native toggles keep aria-expanded; collapsed submenus stay hidden. */
.sk-site-header .sk-site-header__navigation .is-menu-open .wp-block-navigation__responsive-container-content .has-child > .wp-block-navigation__submenu-container {
	box-sizing: border-box;
	display: flex;
	width: 100%;
	min-width: 0;
	flex-direction: column;
	gap: 0;
	padding: 0 0 12px 14px;
	border: 0;
	box-shadow: none;
}

/*
 * Accordion: functions.php binds each toggle's aria-expanded to its own submenu state and
 * assets/js/header.js keeps a pointer press from moving focus before core's click handler.
 */
.sk-site-header .sk-site-header__navigation .is-menu-open .wp-block-navigation__responsive-container-content .has-child > .wp-block-navigation-submenu__toggle:not([aria-expanded="true"]) ~ .wp-block-navigation__submenu-container {
	display: none;
}

.sk-site-header .sk-site-header__navigation .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 8px 0;
	border-radius: 0;
	background: transparent;
	color: var(--wp--custom--design--surface);
	font-family: var(--wp--preset--font-family--body);
	font-size: 15px;
	line-height: normal;
	text-decoration: none;
}

.sk-site-header .sk-site-header__navigation .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
	background: transparent;
	color: var(--wp--custom--design--blush);
}

/* Focus visibility (behaviour comes from core navigation/search). */

.sk-site-header :is(a, button, input):focus-visible {
	outline: 2px solid var(--wp--custom--design--ink);
	outline-offset: 2px;
}

.sk-site-header .sk-site-header__search--wide .wp-block-search__input:focus-visible {
	outline: 0;
}

.sk-site-header .is-menu-open :is(a, button):focus-visible {
	outline-color: var(--wp--custom--design--surface);
}

.sk-site-header .is-menu-open .wp-block-navigation__responsive-container-close:focus-visible {
	outline-color: var(--wp--custom--design--ink);
}

/* Decorative chevrons must not add text to the accessible tree. */
@supports (content: "" / "") {
	.sk-site-header .sk-site-header__navigation .wp-block-navigation__submenu-icon::before {
		content: var(--sk-icon-chevron-down) / "";
	}

	.sk-site-header .sk-site-header__navigation .wp-block-navigation-submenu__toggle[aria-expanded="true"] + .wp-block-navigation__submenu-icon::before {
		content: var(--sk-icon-chevron-up) / "";
	}
}

/* Breakpoints from the reference: wide search ≥1140px, desktop navigation ≥940px. */

@media (max-width: 1139.98px) {
	.sk-site-header .sk-site-header__search--wide {
		display: none;
	}

	.sk-site-header .sk-site-header__search--compact {
		display: block;
	}
}

@media (min-width: 940px) and (max-width: 1009.98px) {
	.sk-site-header .sk-site-header__inner {
		gap: 12px;
	}

	.sk-site-header nav.sk-site-header__navigation {
		font-size: 13px;
	}

	.sk-site-header .sk-site-header__navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content {
		padding-inline: 3px;
	}

	.sk-site-header .sk-site-header__navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-submenu__toggle {
		padding-right: 19px;
	}

	.sk-site-header .sk-site-header__navigation .wp-block-navigation__submenu-icon {
		right: 3px;
	}
}

@media (max-width: 939.98px) {
	.sk-site-header nav.sk-site-header__navigation {
		position: static;
		flex: none;
		order: 3;
	}

	.sk-site-header .sk-site-header__navigation .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.sk-site-header .sk-site-header__navigation .wp-block-navigation__responsive-container:not(.is-menu-open) {
		display: none;
	}
}

/* The reference overflows at 320px; shrink logo and gutters just enough to fit. */
@media (max-width: 359.98px) {
	.sk-site-header .sk-site-header__inner {
		gap: 8px;
		padding-inline: 16px;
	}

	.sk-site-header .sk-site-header__logo img {
		height: 40px !important;
	}

	.sk-site-header .sk-site-header__navigation.wp-block-navigation .wp-block-navigation__responsive-container.wp-block-navigation__responsive-container.is-menu-open {
		padding-inline: 16px;
	}

	.sk-site-header .sk-site-header__navigation .is-menu-open .wp-block-navigation__responsive-container-close {
		top: -77px;
	}

	.sk-site-header .sk-site-header__search--compact:not(.wp-block-search__searchfield-hidden) .wp-block-search__input {
		right: 16px;
		left: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sk-site-header .sk-site-header__search .wp-block-search__inside-wrapper,
	.sk-site-header .sk-site-header__search .wp-block-search__input,
	.sk-site-header .wp-block-navigation__responsive-container.is-menu-open {
		transition: none;
		animation: none;
	}
}
