/**
 * Ebbert — site header.
 *
 * Built on Astra's Header Builder (not Spectra) because Spectra ships no menu block and Astra Pro's
 * mega menu only initialises inside `.ast-builder-menu-N`. Client decision, 2026-08-19.
 *
 * Every value below was measured from the artboard in Chromium — see design-tokens-measured.md.
 * Header renders on #1B1919 with white uppercase nav and a gold utility CTA.
 */

/* ---------- Utility bar ---------- */
.ebbert-topbar {
	display: inline-flex;
	align-items: center;
	gap: 28px;
	font-family: var(--ebbert-font-body);
	font-size: var(--ebbert-nav);
	line-height: var(--ebbert-nav-lh);
	font-weight: var(--ebbert-w-semi);
}

.ebbert-topbar-cta {
	color: var(--ebbert-accent);
	text-transform: uppercase;
	letter-spacing: var(--ebbert-eyebrow-ls);
	text-decoration: none;
}

.ebbert-topbar-cta:hover,
.ebbert-topbar-cta:focus-visible {
	color: #FFFFFF;
}

.ebbert-topbar-phone {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: #FFFFFF;
}

/* [company-phone] emits its own <a>; colour it here rather than wrapping it in another anchor. */
.ebbert-topbar-phone a {
	color: #FFFFFF;
	text-decoration: none;
}

.ebbert-topbar-phone a:hover,
.ebbert-topbar-phone a:focus-visible {
	color: var(--ebbert-accent);
}

/* Phone glyph. Astra sanitises the header HTML component and strips inline <svg>, so the icon
   is a CSS background here instead — measured: the inline SVG never reached the DOM. */
.ebbert-topbar-phone::before {
	content: "";
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	background-color: var(--ebbert-accent);
	-webkit-mask: var(--ebbert-phone-icon) center / contain no-repeat;
	mask: var(--ebbert-phone-icon) center / contain no-repeat;
}

/* ---------- Primary nav ---------- */
/* Astra colours menu links from its own generated stylesheet; these mirror that specificity so the
   override lands without !important. Verify with .claude/scripts/matching-rules.mjs after edits. */
.ast-desktop .ast-builder-menu-1 .main-header-menu > .menu-item > .menu-link,
.ast-desktop .ast-builder-menu-1 .main-header-menu > .menu-item > .ast-menu-toggle {
	color: #FFFFFF;
	font-family: var(--ebbert-font-body);
	font-size: var(--ebbert-nav);
	line-height: var(--ebbert-nav-lh);
	font-weight: var(--ebbert-w-semi);
	text-transform: uppercase;
	letter-spacing: var(--ebbert-nav-ls);
}

.ast-desktop .ast-builder-menu-1 .main-header-menu > .menu-item > .menu-link:hover,
.ast-desktop .ast-builder-menu-1 .main-header-menu > .menu-item.current-menu-item > .menu-link {
	color: var(--ebbert-accent);
}

/* Column headings inside the mega menu need to read as headings, not as another link.
   NOTE: the artboard never shows an open mega menu, so panel styling is UNDESIGNED — this is a
   readable default (heading weight + brand colour), not a match to an approved comp. */
.ast-desktop .astra-megamenu .menu-item-heading > .menu-link {
	font-family: var(--ebbert-font-heading);
	font-weight: var(--ebbert-w-head);
	text-transform: uppercase;
	color: var(--ebbert-ink);
	letter-spacing: 0.04em;
}

/* ---------- Row geometry ----------
   Astra's `hba-header-height` / `hb-header-height` settings did not land (set 40/89, measured
   30/86), so row heights are set here where they can be verified directly.
   Design measures 129px total: 44px utility bar + 85px primary row. */
.ast-above-header-bar {
	min-height: 44px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.ast-primary-header-bar {
	min-height: 85px;
}

/* The utility bar and primary row both sit on #1B1919; Astra applies that from its generated
   stylesheet via hba-/hb-header-bg-obj-responsive (measured rgb(27,25,25) — confirmed applied). */

/* ---------- Mobile ----------
   Astra's default toggle is its own blue; on the #1B1919 header it must be brand-neutral.
   NOTE: the artboard has NO mobile comp, so mobile treatment below is a reasoned default,
   not a match to an approved design. */
.ast-mobile-menu-trigger-minimal,
.ast-mobile-menu-trigger-fill,
.ast-mobile-menu-trigger-outline {
	color: #FFFFFF;
	background: transparent;
	border-color: rgba(255, 255, 255, 0.35);
}

.ast-mobile-menu-trigger-minimal .ast-mobile-svg,
.ast-mobile-menu-trigger-fill .ast-mobile-svg,
.ast-mobile-menu-trigger-outline .ast-mobile-svg {
	fill: #FFFFFF;
}

.ast-mobile-menu-trigger-minimal:hover .ast-mobile-svg {
	fill: var(--ebbert-accent);
}

/* Off-canvas panel inherits the header's dark ground so the transition is not jarring. */
.ast-mobile-popup-drawer .ast-mobile-popup-inner {
	background-color: var(--ebbert-ink);
}

.ast-mobile-popup-drawer .ast-mobile-popup-inner .menu-item > .menu-link {
	color: #FFFFFF;
	font-family: var(--ebbert-font-body);
	font-weight: var(--ebbert-w-semi);
	text-transform: uppercase;
	letter-spacing: var(--ebbert-nav-ls);
}

/* Astra colours the mobile trigger from global-color-0 at 0-4-0 via
   [data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg
   (measured). Even with the brand palette applied that slot is oxblood, which is unreadable on the
   #1B1919 header, so this mirrors Astra's selector and adds a type for 0-4-1. */
html [data-section="section-header-mobile-trigger"] .ast-button-wrap .mobile-menu-toggle-icon .ast-mobile-svg {
	fill: #FFFFFF;
}

/* ---------- Mobile click-to-call ----------
   Client decision 2026-08-19: keep the phone reachable in one tap on mobile, since the artboard is
   desktop-only and hiding the number behind the hamburger costs calls.
   Lives in Astra's mobile header row only (header-mobile-items), so no desktop hiding is needed.
   The number comes from [company-phone], which supplies its own <a href="tel:"> — never wrap it. */
.ebbert-mobile-call {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-inline-end: 12px;
}

.ebbert-mobile-call::before {
	content: "";
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	background-color: var(--ebbert-accent);
	-webkit-mask: var(--ebbert-phone-icon) center / contain no-repeat;
	mask: var(--ebbert-phone-icon) center / contain no-repeat;
}

.ebbert-mobile-call a {
	color: #FFFFFF;
	font-family: var(--ebbert-font-body);
	font-size: 15px;
	font-weight: var(--ebbert-w-semi);
	text-decoration: none;
	white-space: nowrap;
}

/* Below 480px the logo, number and hamburger stop fitting side by side — the digits go and the
   icon stays. Threshold from measurement: with the digits shown the header needs 448px and
   overflows at 360 and 390 (scrollWidth 448); it fits from 480 up.

   The LINK itself becomes the tap target (client QA, Markup mobile #76 "call button not linked").
   The first version shrank the link to a 1px clipped box and put the enlarged tap area on the
   wrapper span — measured: a tap on the icon at 360, 390 and 479px hit SPAN.ebbert-mobile-call,
   not the <a>, so the button did nothing. Now the <a> is a 44×44 box centred on the 18px icon
   (WCAG 2.5.5 target size); its digits stay in the DOM as the link's accessible name but are
   not painted. */
@media (max-width: 479px) {
	.ebbert-mobile-call {
		position: relative;
	}
	.ebbert-mobile-call a {
		position: absolute;
		inset: -13px;
		z-index: 1;
		font-size: 0;
		line-height: 0;
		color: transparent;
		overflow: hidden;
	}
}

/* Astra wraps header HTML component content in <p>; strip its inherited margin. */
.ast-header-html-2 p,
.ast-header-html-1 p {
	margin: 0;
}
