/* ==========================================================================
   Push Button — hamburger menu
   Bricks: Templates > Global Navbar (ID 11) > Offcanvas #brxe-bzvrdk (.hb-menu)
   Links: Appearance > Menus > "Audio Services", "Company",
   "Some Industries We Serve" (rendered by the [menu_*] shortcodes).
   Script: assets/js/hamburger-menu.js. ACSS sets html { font-size: 62.5% } →
   sizes here are px-based.

   - Phones & tablets (< 1100px): full-screen panel. Logo row, then the
     navigation, then the brand block (artwork, CTA, phone) at the end.
   - Desktop (≥ 1100px): a right-anchored drawer (~72% wide, as tall as its
     content, never taller than the screen). The page stays visible behind a
     soft backdrop; clicking it closes the menu.
   - ONE open/close control: the header hamburger (#brxe-vgkdfy). It is lifted
     above the panel and morphs into an X, so it never moves or swaps. The
     panel's logo row is aligned to it with --hb-toggle-y / --hb-toggle-h,
     measured by the script, so it lines up in the normal and sticky headers.

   ROOT CAUSE of the original OuterBox issues (kept fixed):
   - The old panel had height:100vh + overflow:auto, its columns were stretched
     to exactly that height and the links were centred vertically. Taller
     content overflowed both ways: above the viewport (unreachable, "pushed
     upward") and below the 100vh blue box ("background doesn't cover").
   FIX: the panel is pinned to the viewport edges (no vh), is itself the
   scroll container and carries the background; content flows from the top,
   so nothing can overflow upward and the background covers every link.
   ========================================================================== */

.hb-menu {
	--hb-bg: var(--primary-dark, #034a7c);
	--hb-ink: var(--base, #103543);
	--hb-cream: var(--accent, #fef6dd);
	--hb-yellow: #f7d746;
	--hb-line: color-mix(in srgb, var(--hb-cream) 18%, transparent);
	--hb-ease: cubic-bezier(.2, .7, .2, 1);

	/* set by the script from the header button; fallbacks for no-JS */
	--hb-toggle-y: 56px;
	--hb-toggle-h: 48px;
	--hb-toggle-r: 64px; /* button centre → right edge of the screen */
	--hb-logo-h: 44px;

	--hb-gutter: 24px;
	--hb-col-gap: 40px;

	/* one heading style, one link style */
	--hb-head-font: "new-spirit", Georgia, serif;
	--hb-head-size: 21px;
	--hb-link-font: "Inter", system-ui, sans-serif;
	--hb-link-size: 17px;
}

/* --------------------------------------------------------------------------
   The one open/close control: the header hamburger, above the panel.
   Same element, same box in both states — only its bars animate (squeeze).
   -------------------------------------------------------------------------- */
:root { --hb-dot: 64px; /* the button's circle; the desktop panel unfolds from exactly this circle */ }
.brxe-toggle[aria-controls="brxe-bzvrdk"] { position: relative; z-index: 100002 !important; /* Bricks sets 99999 on the element ID */ }
.brxe-toggle[aria-controls="brxe-bzvrdk"]:focus-visible { outline: none !important; /* the circle carries the focus ring */ }

/* The circle: centred on the button's own box (the script measures the same
   box for the panel's clip origin, so the two can't drift apart). Painted
   behind the bars inside the button's stacking context. */
.brxe-toggle[aria-controls="brxe-bzvrdk"]::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	z-index: -1;
	width: var(--hb-dot);
	height: var(--hb-dot);
	margin: calc(var(--hb-dot) / -2) 0 0 calc(var(--hb-dot) / -2);
	border-radius: 50%;
	background: var(--primary-dark, #034a7c); /* = the panel's --hb-bg */
	opacity: 0;
	transform: scale(.6);
	transition: opacity .18s ease, transform .3s cubic-bezier(.25, .8, .25, 1), box-shadow .2s ease;
	pointer-events: none;
}
@media (hover: hover) {
	.brxe-toggle[aria-controls="brxe-bzvrdk"]:hover::before { opacity: 1; transform: none; }
}
/* keyboard focus: the same circle plus a yellow focus ring around it */
.brxe-toggle[aria-controls="brxe-bzvrdk"]:focus-visible::before { opacity: 1; transform: none; box-shadow: 0 0 0 2px var(--hb-yellow, #f7d746); }
/* touch / click press: a slightly smaller circle, released as it settles */
.brxe-toggle[aria-controls="brxe-bzvrdk"]:active::before { opacity: 1; transform: scale(.92); transition-duration: .08s; }
/* open or closing: the circle stays on until the panel has folded back into it */
html.hb-menu-active .brxe-toggle[aria-controls="brxe-bzvrdk"]::before { opacity: 1; transform: none; }
html.hb-menu-open .brxe-toggle[aria-controls="brxe-bzvrdk"]:focus-visible::before { box-shadow: 0 0 0 2px var(--hb-yellow, #f7d746); }
/* the X: cream on the dark blue (the header's toggle styles turn the active bars dark) */
.brxe-toggle[aria-controls="brxe-bzvrdk"].is-active .brxa-inner,
.brxe-toggle[aria-controls="brxe-bzvrdk"].is-active .brxa-inner::before,
.brxe-toggle[aria-controls="brxe-bzvrdk"].is-active .brxa-inner::after { background-color: var(--accent, #fef6dd) !important; }
.brxe-toggle[aria-controls="brxe-bzvrdk"].is-active:hover .brxa-inner,
.brxe-toggle[aria-controls="brxe-bzvrdk"].is-active:hover .brxa-inner::before,
.brxe-toggle[aria-controls="brxe-bzvrdk"].is-active:hover .brxa-inner::after { background-color: #f7d746 !important; }

/* html.hb-menu-active (open or closing) and html.hb-menu-open are set by the
   script — cheaper than :has(), which re-styled the whole page on every open */
/* Keep the header's stacking context above page content while open */
html.hb-menu-active .navbar { z-index: 100000; }
/* Real scroll lock: the theme makes <html> the scroller; no scrollbar jump */
html.hb-menu-open { overflow: hidden; scrollbar-gutter: stable; }

/* --------------------------------------------------------------------------
   Panel (phones & tablets: the whole screen)
   -------------------------------------------------------------------------- */
.brxe-offcanvas.hb-menu[data-direction] .brx-offcanvas-inner {
	--hb-side: max(var(--hb-gutter), calc((100% - 720px) / 2));
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	width: 100%;
	min-width: 100%;
	max-width: 100%;
	height: auto;
	padding: 0;
	gap: 0; /* Bricks/ACSS give blocks a default gap */
	z-index: 100000;
	display: grid;
	grid-template-columns: [full-start] var(--hb-side) [content-start] minmax(0, 1fr) [content-end] var(--hb-side) [full-end];
	grid-template-rows: auto auto 1fr;
	align-content: start;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--hb-bg);
	color: var(--hb-cream);
	/* open/close motion: see "Motion" at the end of this file */
}
.brxe-offcanvas.hb-menu .brx-offcanvas-backdrop {
	background: rgba(4, 22, 38, .55);
	transition: opacity .3s ease;
}

/* Logo row: the logo's centre sits on the button's centre line; sticky, so
   the logo row (and the button above it) stay put while the panel scrolls */
.hb-menu .hb-menu__top {
	grid-column: full;
	grid-row: 1;
	display: grid;
	grid-template-columns: subgrid;
	align-items: start;
	position: sticky;
	top: 0;
	z-index: 2;
	height: calc(var(--hb-toggle-y) + max(var(--hb-toggle-h), var(--hb-logo-h)) / 2 + 14px);
	background: var(--hb-bg);
}
.hb-menu .hb-menu__logo {
	grid-column: content;
	justify-self: start;
	margin-top: calc(var(--hb-toggle-y) - var(--hb-logo-h) / 2);
	display: block;
	line-height: 0;
}
.hb-menu .hb-menu__logo img { display: block; width: auto; height: var(--hb-logo-h); }

/* --------------------------------------------------------------------------
   Navigation (phones: one column)
   -------------------------------------------------------------------------- */
.hb-menu .hb-menu__main {
	grid-column: content;
	grid-row: 2;
	padding: 28px 0 8px;
}
.hb-menu .hb-menu__nav {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	column-gap: var(--hb-col-gap);
	row-gap: 36px;
	align-items: start;
}

.hb-menu .hb-menu__heading {
	margin: 0 0 6px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--hb-line);
	font-family: var(--hb-head-font);
	font-weight: 500;
	font-size: var(--hb-head-size);
	line-height: 1.15;
	letter-spacing: 0;
	color: var(--hb-yellow);
	text-wrap: balance;
}
.hb-menu .hb-menu__heading a { color: inherit; text-decoration: none; transition: color .2s ease; }
.hb-menu .hb-menu__heading a:hover { color: var(--hb-cream); }

.hb-menu .hamburger-menu { list-style: none; margin: 0; padding: 0; }
.hb-menu .hamburger-menu li { margin: 0; padding: 0; }
.hb-menu .hamburger-menu a {
	display: flex;
	align-items: center;
	width: fit-content;
	min-height: 44px; /* tap target */
	font-family: var(--hb-link-font);
	font-weight: 400;
	font-size: var(--hb-link-size);
	line-height: 1.35;
	color: var(--hb-cream);
	text-decoration: none;
	transition: color .2s ease, transform .25s var(--hb-ease);
}
/* Hover: yellow and a small nudge right (transform only — nothing moves around it) */
.hb-menu .hamburger-menu a:hover,
.hb-menu .hamburger-menu a:focus-visible { color: var(--hb-yellow); transform: translateX(3px); }
.hb-menu .hamburger-menu a[aria-current="page"] { color: var(--hb-yellow); }

.hb-menu a:focus-visible {
	outline: 2px solid var(--hb-yellow);
	outline-offset: 3px;
	border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Brand block (phones & tablets: after the navigation)
   -------------------------------------------------------------------------- */
.hb-menu .hb-menu__aside {
	grid-column: content;
	grid-row: 3;
	align-self: start;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	grid-template-areas: "badge cta" "badge phone";
	align-items: center;
	column-gap: 20px;
	row-gap: 6px;
	margin-top: 36px;
	padding: 32px 0 calc(48px + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid var(--hb-line);
}
.hb-menu .hb-menu__badge-wrap { grid-area: badge; margin: 0; width: 120px; }
.hb-menu .hb-menu__badge { display: block; width: 100%; height: auto; aspect-ratio: 597.5 / 482.88; }

.hb-menu .hb-menu__cta.bricks-button {
	grid-area: cta;
	align-self: end;
	width: 100%;
	justify-content: center;
	padding: 14px 20px;
	border: 0;
	background: var(--hb-yellow);
	color: var(--hb-ink);
	font-family: var(--hb-link-font);
	font-weight: 600;
	font-size: 16px;
	letter-spacing: .01em;
	transition: background-color .2s ease, transform .2s var(--hb-ease);
}
.hb-menu .hb-menu__cta.bricks-button:hover { background: var(--hb-cream); color: var(--hb-ink); transform: translateY(-1px); }

.hb-menu .hb-menu__phone {
	grid-area: phone;
	align-self: start;
	justify-self: center;
	display: inline-flex;
	align-items: center;
	gap: .45em;
	min-height: 44px;
	padding: 0 4px;
	font-family: var(--hb-link-font);
	font-weight: 600;
	font-size: 17px;
	letter-spacing: .02em;
	color: var(--hb-cream);
	text-decoration: none;
	transition: color .2s ease;
}
.hb-menu .hb-menu__phone::before {
	content: "Or call";
	font-weight: 400;
	font-size: 14px;
	letter-spacing: 0;
	color: color-mix(in srgb, var(--hb-cream) 70%, transparent);
}
.hb-menu .hb-menu__phone:hover { color: var(--hb-yellow); }

/* Smallest phones: drop the artwork, keep the CTA and phone */
@media (max-width: 359px) {
	.hb-menu .hb-menu__badge-wrap { display: none; }
	.hb-menu .hb-menu__aside { grid-template-columns: minmax(0, 1fr); grid-template-areas: "cta" "phone"; }
}

/* ==========================================================================
   Tablets & large phones (600–1099): two-column navigation
   Audio Services on its own row (two columns), Company | Industries beneath
   ========================================================================== */
@media (min-width: 600px) {
	.hb-menu { --hb-gutter: 40px; --hb-logo-h: 52px; --hb-head-size: 22px; --hb-col-gap: 48px; }
	.hb-menu .hb-menu__main { padding-top: 40px; }
	/* One shared two-column grid for the whole nav. The right column is never
	   narrower than "Some Industries We Serve" (no heading wrap); the Audio
	   Services links sit on the same two columns through subgrid. */
	.hb-menu .hb-menu__nav { grid-template-columns: minmax(0, 1fr) minmax(max-content, 1fr); row-gap: 40px; }
	.hb-menu .hb-menu__group--services,
	.hb-menu .hb-menu__group--services > .brxe-shortcode {
		grid-column: 1 / -1;
		display: grid;
		grid-template-columns: subgrid;
		column-gap: normal; /* = the nav's gap (Bricks gives divs their own) */
	}
	.hb-menu .hb-menu__group--services > .hb-menu__heading { grid-column: 1 / -1; }
	.hb-menu .hb-menu__group--services .hamburger-menu {
		grid-column: 1 / -1;
		display: grid;
		grid-template-columns: subgrid;
		column-gap: normal;
		grid-template-rows: repeat(var(--hb-rows, 5), auto);
		grid-auto-flow: column;
	}
	.hb-menu .hb-menu__group--services .hamburger-menu:has(> li:nth-child(11)) { --hb-rows: 6; }
	.hb-menu .hb-menu__group--services .hamburger-menu:has(> li:nth-child(13)) { --hb-rows: 7; }
	.hb-menu .hb-menu__heading { white-space: nowrap; }

	.hb-menu .hb-menu__aside {
		grid-template-columns: auto minmax(0, 300px);
		justify-content: start;
		column-gap: 40px;
		margin-top: 48px;
		padding-top: 40px;
	}
	.hb-menu .hb-menu__badge-wrap { width: 170px; }
	.hb-menu .hb-menu__cta.bricks-button { font-size: 17px; padding: 15px 24px; }
}

/* ==========================================================================
   Desktop (≥ 1100): right-anchored drawer
   ========================================================================== */
@media (min-width: 1100px) {
	.hb-menu {
		--hb-logo-h: 48px;
		--hb-pad: clamp(48px, 4.4vw, 72px);
		--hb-aside: clamp(200px, 16vw, 240px);
		--hb-zone-gap: clamp(48px, 4.4vw, 72px);
		--hb-col-gap: clamp(40px, 3.6vw, 56px);
	}
	.brxe-offcanvas.hb-menu[data-direction] .brx-offcanvas-inner {
		left: auto;
		bottom: auto;
		width: 100%;
		min-width: 0;
		max-width: clamp(920px, 72vw, 1160px); /* width via max-width: the Bricks ID rule sets width */
		max-height: 100%; /* of the screen: taller content scrolls inside the drawer */
		grid-template-columns:
			[full-start] var(--hb-pad)
			[aside-start content-start] var(--hb-aside) [aside-end]
			var(--hb-zone-gap)
			[main-start] minmax(0, 1fr) [main-end content-end]
			var(--hb-pad) [full-end];
		grid-template-rows: auto auto;
		border-bottom-left-radius: 20px;
		box-shadow: -24px 0 64px rgba(4, 22, 38, .28);
	}
	.hb-menu .hb-menu__logo { grid-column: aside; }

	/* Brand column: artwork, CTA and phone as one compact unit */
	.hb-menu .hb-menu__aside {
		grid-column: aside;
		grid-row: 2;
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
		margin: 0;
		padding: 40px 0 56px;
		border: 0;
	}
	.hb-menu .hb-menu__badge-wrap { width: 100%; margin-bottom: 6px; }
	.hb-menu .hb-menu__cta.bricks-button { align-self: stretch; padding: 15px 20px; }
	.hb-menu .hb-menu__phone { align-self: center; }

	/* Navigation: Audio Services row (two columns), Company | Industries
	   beneath, all on one shared two-column grid */
	.hb-menu .hb-menu__main {
		grid-column: main;
		grid-row: 2;
		padding: 40px 0 56px;
	}
	.hb-menu .hb-menu__nav { row-gap: 36px; }
	.hb-menu .hb-menu__heading { margin-bottom: 10px; padding-bottom: 14px; }
	.hb-menu .hamburger-menu a { min-height: 0; padding: 7px 0; }
}

/* Short desktop windows: tighten vertical rhythm (the drawer still scrolls) */
@media (min-width: 1100px) and (max-height: 760px) {
	.hb-menu .hb-menu__aside,
	.hb-menu .hb-menu__main { padding-top: 20px; padding-bottom: 36px; }
	.hb-menu .hb-menu__nav { row-gap: 26px; }
	.hb-menu .hamburger-menu a { padding-block: 5px; }
	.hb-menu .hb-menu__badge-wrap { width: 80%; align-self: center; }
}

/* Landscape phones: less space around the brand block */
@media (max-height: 500px) and (max-width: 1099px) {
	.hb-menu .hb-menu__main { padding-top: 20px; }
	.hb-menu .hb-menu__badge-wrap { width: 120px; }
}

/* ==========================================================================
   Motion
   Bricks toggles .brx-open / .brx-closing on the offcanvas and removes
   .brx-closing after the panel's FIRST transition-duration, so every closed-
   state rule lists the full closing time first.
   ========================================================================== */

/* The panel stays visible until its closing motion has finished (Bricks adds
   .brx-closing a moment after its own click handling) */
.brxe-offcanvas.hb-menu { --hb-close-time: .15s; transition: visibility 0s linear var(--hb-close-time); }
.brxe-offcanvas.hb-menu.brx-open { visibility: visible; transition: visibility 0s; }
/* Bricks makes .brx-closing visible; removing that class then restarted the
   delayed hide, leaving the folded panel on screen for a second close-time */
.brxe-offcanvas.hb-menu.brx-closing:not(.brx-open) { visibility: hidden; }

/* Reduced motion (default): a short cross-fade, nothing moves */
.brxe-offcanvas.hb-menu[data-direction] .brx-offcanvas-inner {
	transform: none;
	opacity: 0;
	transition: opacity .15s ease;
}
.brxe-offcanvas.hb-menu.brx-open[data-direction] .brx-offcanvas-inner { opacity: 1; }

/* Phones & tablets: a quick drop-in fade (~220ms) — no waiting on touch */
@media (max-width: 1099px) and (prefers-reduced-motion: no-preference) {
	.brxe-offcanvas.hb-menu { --hb-close-time: .18s; }
	.brxe-offcanvas.hb-menu[data-direction] .brx-offcanvas-inner {
		transform: translateY(-12px);
		transition: opacity .18s ease, transform .18s ease-in;
	}
	.brxe-offcanvas.hb-menu.brx-open[data-direction] .brx-offcanvas-inner {
		transition: opacity .2s ease, transform .26s var(--hb-ease);
	}
}

/* Desktop: the button's circle becomes the menu.
   Hover: the dark-blue circle appears behind the hamburger (--hb-dot).
   Open:  the panel is clipped to exactly that circle — same centre, same
          size, same colour — and the circle grows until it just covers the
          panel (--hb-reach, from the script). Only clip-path animates: no
          layout, no scrollbars, no jitter.
          Each content group fades in as the circle actually uncovers it
          (--hb-d, from the script, using the same curve and duration).
   Close: content fades out first, then the circle shrinks back into the
          button, landing softly on the button's own circle, which stays on
          until the fold is done and then eases back to hover / rest.
   Interrupting either way reverses from wherever it is. */
@media (min-width: 1100px) and (prefers-reduced-motion: no-preference) {
	.brxe-offcanvas.hb-menu { --hb-close-time: .46s; }
	.brxe-offcanvas.hb-menu[data-direction] .brx-offcanvas-inner {
		--hb-origin: calc(100% - var(--hb-toggle-r)) var(--hb-toggle-y);
		transform: none;
		opacity: 1;
		clip-path: circle(calc(var(--hb-dot) / 2) at var(--hb-origin));
		transition:
			outline-color .46s linear,                               /* = total close time, read by Bricks */
			clip-path .38s cubic-bezier(.45, 0, .2, 1) .08s,         /* after the content has faded */
			opacity 0s linear .46s;
	}
	.brxe-offcanvas.hb-menu.brx-open[data-direction] .brx-offcanvas-inner {
		clip-path: circle(var(--hb-reach, 150%) at var(--hb-origin));
		transition: clip-path .52s cubic-bezier(.32, .2, .12, 1), opacity 0s; /* = OPEN_MS / EASE in the script */
	}

	/* Content groups: logo, Audio Services, Company, Industries, brand block */
	.hb-menu .hb-reveal {
		opacity: 0;
		transform: translate(6px, -6px); /* a touch toward the button: they drift out with the circle */
		transition: opacity .1s ease, transform 0s linear .1s;
	}
	.hb-menu.brx-open .hb-reveal {
		opacity: 1;
		transform: none;
		transition:
			opacity .24s ease var(--hb-d, 120ms),
			transform .38s cubic-bezier(.2, .8, .2, 1) var(--hb-d, 120ms);
	}
	/* keyboard users tabbing in early see the focused group at once */
	.hb-menu.brx-open .hb-reveal:focus-within { opacity: 1; transform: none; transition: none; }

	/* Artwork: a restrained settle, no overshoot */
	.hb-menu .hb-menu__badge-wrap { transform: scale(.97); transition: transform 0s linear .1s; }
	.hb-menu.brx-open .hb-menu__badge-wrap {
		transform: none;
		transition: transform .45s cubic-bezier(.2, .8, .2, 1) var(--hb-d, 200ms);
	}

	/* the backdrop follows the circle rather than leading it */
	.brxe-offcanvas.hb-menu .brx-offcanvas-backdrop { transition: opacity .34s ease .08s; }
	.brxe-offcanvas.hb-menu.brx-open .brx-offcanvas-backdrop { transition: opacity .4s ease; }
}

@media (prefers-reduced-motion: reduce) {
	.brxe-toggle[aria-controls="brxe-bzvrdk"]::before { transition: opacity .12s ease; transform: none !important; }
	.brxe-offcanvas.hb-menu .brx-offcanvas-backdrop,
	.hb-menu .hb-menu__cta.bricks-button,
	.hb-menu .hamburger-menu a { transition: none; }
	.hb-menu .hb-menu__cta.bricks-button:hover,
	.hb-menu .hamburger-menu a:hover,
	.hb-menu .hamburger-menu a:focus-visible { transform: none; }
}
