/**
 * Header (W1, 2026-10-25). Desktop (≥ 1100 px): Header 10 "Signature" (Design 03), a white bar with
 * the logo and wordmark, the approved multi-page navigation divided by hairlines (Services is a
 * disclosure), the phone set large at the right with "Free estimate" under it.
 * Below 1100 px: the approved compact header (Figma R / Header 740:750): a 72 px bar, a square logo
 * (size/logo 52 / 48 / 40), the wordmark, and on phones a 44 px call button and a 44 px menu button,
 * on tablets the phone number and a labelled "Menu" button. The menu opens the panel of
 * Figma R / Menu Panel 740:923: full screen on phones, a 420 px drawer on tablets.
 * Markup: parts/header.html + inc/navigation.php (publication-aware links). Mechanics: assets/js/site.js.
 */

.site-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 80;
}


.hv {
	--hv-fg: var(--ink);
	--hv-h: 6em;
	--hv-logo: 4em;
	position: relative;
	width: 100%;
	background: #fff;
	color: var(--hv-fg);
	box-shadow: 0 1px 0 var(--line-cool);
	font-family: var(--sans);
}

.hv a {
	color: inherit;
	text-decoration: none;
}

.hv a:focus-visible,
.hv button:focus-visible,
.hm a:focus-visible,
.hm button:focus-visible {
	outline: var(--hydro-focus);
	outline-offset: 3px;
}

.hv__wrap {
	width: min(80rem, 100% - 2 * var(--gutter));
	margin-inline: auto;
}

.hv__row {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 2rem;
	min-height: var(--hv-h);
}

/* ------------------------------------------------------------------ brand */
.hv-brand {
	position: relative;
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 0.75rem;
	min-height: 2.75rem;
}

.hv-brand .wp-block-site-logo {
	flex: none;
	line-height: 0;
}

/* The approved badge is square (384 × 384): a square box, never stretched or cropped. */
.hv-brand .custom-logo,
.hm__brand .custom-logo {
	width: var(--hv-logo);
	height: var(--hv-logo);
	object-fit: contain;
}

/* The logo link covers the wordmark too, so the whole brand goes home. */
.hv-brand .custom-logo-link::after,
.hm__brand .custom-logo-link::after {
	content: "";
	position: absolute;
	inset: 0;
}

.hv-brand__name,
.hm__name {
	font-size: 1.4rem;
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.03em;
	white-space: nowrap;
	color: var(--ink);
}

.hv-brand__name::after,
.hm__name::after {
	content: ".";
	content: "." / "";
	color: var(--teal);
}

/* ------------------------------------------------------------------ navigation (desktop) */
.hv-nav {
	justify-self: center;
	margin: 0;
	font-size: 0.9rem;
}

.hv-nav__list,
.hv-sub {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hv-nav__list {
	display: flex;
	align-items: center;
}

.hv-nav__item {
	position: relative;
	display: flex;
	align-items: center;
}

.hv-nav__item + .hv-nav__item::before {
	content: "";
	width: 1px;
	height: 1rem;
	background: var(--line-cool);
}

.hv-nav__link,
.hv-nav__toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	min-height: 2.75rem;
	padding: 0 1.15rem;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
}

.hv-nav__link:hover,
.hv-nav__toggle:hover,
.hv-nav__toggle[aria-expanded="true"] {
	color: var(--ocean);
}

/* Current page / section: colour + a cyan underline (never colour alone: aria-current on the link). */
.hv-nav__link[aria-current="page"],
.is-current-section > .hv-nav__toggle {
	color: var(--ocean);
	text-decoration: underline;
	text-decoration-color: var(--teal);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.55em;
}

.hv-chev {
	flex: none;
	width: 1rem;
	height: 1rem;
	transition: transform 0.2s ease;
}

[aria-expanded="true"] > .hv-chev {
	transform: rotate(180deg);
}

.hv-sub {
	position: absolute;
	top: calc(100% + 0.35rem);
	left: 0.4rem;
	z-index: 10;
	display: none;
	min-width: 17.5rem;
	padding: 0.4rem;
	border: 1px solid var(--line-cool);
	border-top: 2px solid var(--teal);
	border-radius: var(--radius);
	background: #fff;
}

.hv-nav__toggle[aria-expanded="true"] + .hv-sub {
	display: block;
}

/* Without JavaScript the submenu opens on hover and keyboard focus. */
html:not(.js) .hv-nav__item--services:hover > .hv-sub,
html:not(.js) .hv-nav__item--services:focus-within > .hv-sub {
	display: block;
}

.hv-sub__link {
	display: flex;
	align-items: center;
	min-height: 2.75rem;
	padding: 0.45rem 0.85rem;
	border-left: 3px solid transparent;
	color: var(--ocean);
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.3;
}

.hv .hv-sub__link:hover {
	background: var(--paper);
	color: var(--ink);
}

.hv-sub__link--all {
	margin-top: 0.25rem;
	border-top: 1px solid var(--line-cool);
	font-weight: 600;
}

.hv .hv-sub__link[aria-current="page"] {
	border-left-color: var(--ink);
	color: var(--ink);
	font-weight: 600;
}

/* ------------------------------------------------------------------ actions */
.hv-actions {
	display: flex;
	flex: none;
	flex-direction: column;
	align-items: flex-end;
	gap: 0;
}

.hv-phone a {
	display: inline-flex;
	align-items: center;
	min-height: 1.75rem;
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}

.hv-cta a {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 1.75rem;
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--ocean);
	text-decoration: underline;
	text-underline-offset: 0.3em;
	white-space: nowrap;
}

.hv-cta a::after {
	content: "";
	width: 1em;
	height: 1em;
	background: currentColor;
	-webkit-mask: var(--i-arrow) center / contain no-repeat;
	mask: var(--i-arrow) center / contain no-repeat;
}

.hv-mcall,
.hv-toggle {
	display: none;
}

/* The menu panel is a native <dialog>: not rendered until site.js opens it with showModal()
   (only below 1100 px). Open, it lives in the browser's top layer, above every fixed element of
   the page, so no z-index is involved. */
.hm:not([open]) {
	display: none;
}

/* Laptops (1100–1279 px): tighter navigation. */
@media (max-width: 1279px) {
	.hv__row {
		gap: 1.25rem;
	}

	.hv-nav {
		font-size: 0.875rem;
	}

	.hv-nav__link,
	.hv-nav__toggle {
		padding: 0 0.7rem;
	}
}

/* ------------------------------------------------------------------ compact header (< 1100 px) */
@media (max-width: 1099px) {
	.hv {
		--hv-h: var(--hydro-header-h);
		--hv-logo: var(--hydro-logo);
		box-shadow: inset 0 -1px 0 var(--line-cool); /* the 1 px rule sits inside the 72 px, as in Figma */
	}

	.hv__wrap {
		width: auto;
		margin-inline: 0;
		padding-inline: var(--hydro-gutter);
	}

	.hv__row {
		display: flex;
		gap: var(--hydro-header-gap);
		height: var(--hv-h);
		min-height: 0;
	}

	.hv-brand {
		flex: 0 1 auto;
		gap: 0.625rem;
		min-width: 0;
		margin-right: auto;
	}

	.hv-brand__name {
		min-width: 0;
		font-size: var(--hydro-wordmark);
		line-height: 1.2;
		letter-spacing: -0.02em;
		white-space: normal; /* wraps instead of pushing the menu button off screen (WCAG text spacing) */
		overflow-wrap: anywhere;
	}

	/* Enlarged text must not widen the bar past the screen: the logo never takes more than a fifth
	   of the width, and the icon buttons stay 44 px targets. */
	.hv-brand .custom-logo {
		width: min(var(--hv-logo), 20vw);
		height: min(var(--hv-logo), 20vw);
	}

	.js .hv-nav,
	.hv-cta {
		display: none;
	}

	.hv-actions {
		flex-direction: row;
		align-items: center;
		gap: var(--hydro-header-gap);
		margin-left: auto;
	}

	.hv-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 0.5rem;
		min-width: var(--hydro-target);
		height: var(--hydro-target);
		padding: 0;
		border: 0;
		border-radius: var(--radius);
		background: none;
		color: var(--ink);
		font: 600 0.9375rem/1.4 var(--sans);
		cursor: pointer;
	}

	.hv-toggle__icon {
		flex: none;
		width: 1.5rem;
		height: 1.5rem;
		background:
			linear-gradient(currentColor, currentColor) center 6px / 18px 2px no-repeat,
			linear-gradient(currentColor, currentColor) center 11px / 18px 2px no-repeat,
			linear-gradient(currentColor, currentColor) center 16px / 18px 2px no-repeat;
	}

	/* Without JavaScript there is no menu panel: the links stay visible under the bar. */
	html:not(.js) .hv-toggle {
		display: none;
	}

	html:not(.js) .hv__row {
		flex-wrap: wrap;
		height: auto;
		min-height: var(--hv-h);
	}

	html:not(.js) .hv-nav {
		flex-basis: 100%;
		order: 3;
		padding-bottom: 0.5rem;
	}

	html:not(.js) .hv-nav__list {
		flex-wrap: wrap;
	}

	/* ---------------- menu panel (Figma R / Menu Panel 740:923) */
	.hm[open] {
		position: fixed;
		inset: 0;
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		width: 100%;
		max-width: none;
		height: 100%;
		max-height: none;
		margin: 0;
		padding: 0 0 calc(1.5rem + env(safe-area-inset-bottom));
		border: 0;
		overflow-y: auto;
		overscroll-behavior: contain;
		background: #fff;
		color: var(--ink);
		font-family: var(--sans);
	}

	/* Phones: the panel covers the whole screen; the backdrop adds nothing. */
	.hm::backdrop {
		background: transparent;
	}

	.hm__head {
		position: sticky;
		top: 0;
		z-index: 1;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 0.75rem;
		min-height: var(--hydro-header-h);
		padding: 0 var(--hydro-gutter);
		background: #fff;
		box-shadow: inset 0 -1px 0 var(--line-cool);
	}

	.hm__brand {
		position: relative;
		display: inline-flex;
		align-items: center;
		gap: 0.625rem;
		min-width: 0;
	}

	.hm__brand .custom-logo-link {
		flex: none;
		line-height: 0;
	}

	.hm__brand .custom-logo {
		width: min(var(--hydro-logo), 20vw);
		height: min(var(--hydro-logo), 20vw);
	}

	.hm__name {
		min-width: 0;
		font-size: var(--hydro-wordmark);
		line-height: 1.2;
		letter-spacing: -0.02em;
		white-space: normal;
	}

	.hm__close {
		display: inline-grid;
		flex: none;
		place-items: center;
		width: var(--hydro-target);
		height: var(--hydro-target);
		padding: 0;
		border: 1px solid var(--line-cool);
		border-radius: var(--radius);
		background: #fff;
		color: var(--ink);
		cursor: pointer;
	}

	.hm__close-icon {
		width: 1.5rem;
		height: 1.5rem;
		background: currentColor;
		-webkit-mask: var(--i-close) center / 1.5rem no-repeat; /* a 12 px cross, as in Figma */
		mask: var(--i-close) center / 1.5rem no-repeat;
	}

	.hm__nav {
		padding: 0.5rem var(--hydro-gutter) 0;
	}

	.hm__list,
	.hm__sub {
		margin: 0;
		padding: 0;
		list-style: none;
	}

	.hm__link,
	.hm__toggle {
		display: flex;
		align-items: center;
		gap: 0.75rem;
		width: 100%;
		min-height: 3.5rem;
		padding: 0.5rem 0;
		border: 0;
		border-bottom: 1px solid var(--line-cool);
		background: none;
		color: var(--ink);
		font: 600 var(--hydro-menu-link) / 1.4 var(--sans);
		text-align: left;
		text-decoration: none;
		cursor: pointer;
	}

	.hm__toggle-label {
		flex: 1;
	}

	.hm__toggle[aria-expanded="true"] {
		color: var(--ocean);
	}

	.hm__toggle .hv-chev {
		width: 1.25rem;
		height: 1.25rem;
		color: var(--ink);
	}

	/* Current page or section: a cyan marker bar + aria-current (link) / the section's own state. */
	.hm__link[aria-current="page"]::before,
	.is-current-section > .hm__toggle::before {
		content: "";
		flex: none;
		width: 3px;
		height: 1.5rem;
		background: var(--teal);
	}

	.hm__sub {
		padding: 0.375rem 0.5rem 0.375rem 0.75rem;
		background: var(--paper);
	}

	.hm__sublink {
		display: flex;
		align-items: center;
		gap: 0.625rem;
		min-height: 2.75rem;
		padding: 0.25rem 0;
		color: var(--ocean);
		font: 500 var(--hydro-menu-sublink) / 1.4 var(--sans);
		text-decoration: none;
	}

	.hm__sublink--all {
		font-weight: 600;
	}

	.hm__sublink[aria-current="page"] {
		color: var(--ink);
		font-weight: 600;
	}

	.hm__sublink[aria-current="page"]::before {
		content: "";
		flex: none;
		width: 3px;
		height: 1.25rem;
		background: var(--ink);
	}

	.hm__link:hover,
	.hm__sublink:hover {
		text-decoration: underline;
		text-underline-offset: 0.25em;
	}

	.hm__actions {
		display: grid;
		gap: 0.625rem;
		padding: 1.5rem var(--hydro-gutter) 0;
	}

	.hm__cta,
	.hm__call {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 0.625rem;
		min-height: 3.25rem;
		padding: 0.75rem 1rem;
		border-radius: var(--radius);
		font: 700 var(--hydro-button) / 1.35 var(--sans);
		text-align: center;
		text-decoration: none;
	}

	.hm__cta {
		background: var(--teal);
		color: var(--navy-2);
	}

	.hm__cta:hover {
		background: var(--teal-deep);
	}

	.hm__cta::after,
	.hm__call::before {
		content: "";
		flex: none;
		width: 1.25rem;
		height: 1.25rem;
		background: currentColor;
		-webkit-mask: var(--i-arrow) center / contain no-repeat;
		mask: var(--i-arrow) center / contain no-repeat;
	}

	.hm__call {
		border: 1.5px solid var(--ink);
		color: var(--ink);
	}

	.hm__call::before {
		width: 1.375rem;
		height: 1.375rem;
		-webkit-mask-image: var(--i-phone);
		mask-image: var(--i-phone);
	}

	html.nav-open .hydro-mobilebar {
		display: none !important;
	}
}

/* Phones (< 768 px): the call icon button and the icon-only menu button. */
@media (max-width: 767px) {
	.hv-phone {
		display: none;
	}

	.hv-mcall {
		display: block;
	}

	.hv-mcall a {
		display: inline-grid;
		place-items: center;
		width: var(--hydro-target);
		height: var(--hydro-target);
		border: 1px solid var(--line-cool);
		border-radius: var(--radius);
		color: var(--ink);
		font-size: 0; /* the link text stays for screen readers */
	}

	.hv-mcall a::before {
		content: "";
		width: 1.375rem;
		height: 1.375rem;
		background: currentColor;
		-webkit-mask: var(--i-phone) center / contain no-repeat;
		mask: var(--i-phone) center / contain no-repeat;
	}

	.hv-toggle {
		width: var(--hydro-target);
	}

	.hv-toggle__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}

/* Tablets (768–1099 px): phone number with its icon, labelled "Menu" button, 420 px drawer. */
@media (min-width: 768px) and (max-width: 1099px) {
	.hv-phone a {
		gap: 0.5rem;
		min-height: var(--hydro-target);
		font-size: 1.0625rem;
		font-weight: 600;
		letter-spacing: 0;
	}

	.hv-phone a::before {
		content: "";
		width: 1.375rem;
		height: 1.375rem;
		background: var(--ocean);
		-webkit-mask: var(--i-phone) center / contain no-repeat;
		mask: var(--i-phone) center / contain no-repeat;
	}

	.hv-toggle {
		padding: 0 0.75rem 0 0.875rem;
		border: 1px solid var(--line);
	}

	.hm[open] {
		inset: 0 0 0 auto;
		width: min(26.25rem, 100%);
	}

	/* The approved navy 40 % scrim behind the drawer. */
	.hm::backdrop {
		background: rgb(9 38 92 / 0.4);
	}
}

@media (prefers-reduced-motion: no-preference) and (max-width: 1099px) {
	.hm[open] {
		animation: hm-in 0.2s ease;
	}

	@keyframes hm-in {
		from {
			opacity: 0;
			transform: translateY(-6px);
		}
	}
}
