/* Primary nav dropdown panels (Industries submenu). The chevron on top-level
 * items comes from the .cmp-has-sub rule in theme.json; the nav block disables
 * core's submenu icon (showSubmenuIcon:false) so the panel opens on
 * hover/focus-within via core's CSS. Scoped to the desktop nav — the
 * :not(.is-menu-open) guard keeps the mobile overlay's inline submenu list
 * unstyled. Specificity intentionally beats core's
 * .wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container
 * default (white panel). */
.cmp-site-header .cmp-primary-nav.wp-block-navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container {
	background: var(--wp--preset--color--theme-02);
	color: var(--wp--preset--color--theme-01);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 8px;
	padding: 8px 0;
	min-width: 224px;
	/* Size to the longest label: Services / Facilities children (e.g. "Laser
	 * Cutting & Fabrication", "Gray Manufacturing Technologies") exceed the
	 * 224px Figma panel and would wrap onto two lines otherwise. */
	width: max-content;
	max-width: min(360px, calc(100vw - 32px));
	white-space: nowrap;
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

/* Core right-aligns the panel under a right-justified nav (items-justified-right
 * sets right:0), which hangs the 224px panel far left of the parent label.
 * Left-align it instead, pulled back 16px so the submenu link text (16px inner
 * padding) sits flush with the parent item's text. */
.cmp-site-header .cmp-primary-nav.wp-block-navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .has-child > .wp-block-navigation__submenu-container {
	left: -16px;
	right: auto;
}

.cmp-site-header .cmp-primary-nav.wp-block-navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	color: var(--wp--preset--color--theme-01);
	padding: 10px 16px;
}

.cmp-site-header .cmp-primary-nav.wp-block-navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--theme-06);
}

/* QA 2026-09-02 DEC-4: the logo <img> is inline inside the figure's <a>, so the figure
 * grows by the line box's descender gap (11px at 1440, 8px at 430) and the header runs
 * 149 / 131 tall instead of Figma's 138 / 123 (33392:8079 / 33490:8007 = 24 + logo + 24). */
.cmp-header-logo a,
.cmp-header-logo img,
.cmp-footer-logo img {
	display: block;
}

/* Mobile review 2026-09-11 (M9): the ldt-cookie-consent banner
 * (z-index 2147483000) covered the bottom of the open mobile menu. Core's
 * open overlay is z-index 100000; sit the banner just under it so the menu
 * is fully readable and the banner returns when the menu closes. */
html:has(.wp-block-navigation__responsive-container.is-menu-open) .ldtcc {
	display: none;
}

/* Mobile audit 2026-09-15, M8: inside the overlay core paints every submenu
 * expanded, so Services (6) + Facilities (11) pushed the last four top-level
 * links below the fold. cmp-interactive.js adds a .cmp-sub-toggle button after
 * each parent link; submenus stay collapsed until it is pressed. Desktop
 * (responsive container not in .is-menu-open) is untouched. */
.cmp-sub-toggle {
	display: none;
}

.wp-block-navigation__responsive-container.is-menu-open .cmp-primary-nav .cmp-has-sub {
	display: flex;
	flex-direction: row !important; /* core's overlay rule stacks items in a column */
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
}

.wp-block-navigation__responsive-container.is-menu-open .cmp-primary-nav .cmp-has-sub > .wp-block-navigation-item__content {
	width: auto;
	flex: 0 0 auto;
}

.wp-block-navigation__responsive-container.is-menu-open .cmp-primary-nav .cmp-has-sub > .wp-block-navigation-item__content::after {
	display: none;
}

.wp-block-navigation__responsive-container.is-menu-open .cmp-sub-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: -10px 0 -10px 4px;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.wp-block-navigation__responsive-container.is-menu-open .cmp-sub-toggle svg {
	width: 14px;
	height: 14px;
	transition: transform 160ms ease;
}

.wp-block-navigation__responsive-container.is-menu-open .cmp-sub-toggle[aria-expanded="true"] svg {
	transform: rotate(180deg);
}

.wp-block-navigation__responsive-container.is-menu-open .cmp-primary-nav .cmp-has-sub > .wp-block-navigation__submenu-container {
	flex-basis: 100%;
	width: 100%;
	align-items: flex-start;
}

.wp-block-navigation__responsive-container.is-menu-open .cmp-primary-nav .cmp-has-sub:not(.is-sub-open) > .wp-block-navigation__submenu-container {
	display: none;
}
