/*
 * Header + main navigation (design A).
 * Loaded with core/navigation via wp_enqueue_block_style().
 * Colors and fonts come from theme.json presets / settings.custom only.
 *
 * Breakpoints from the design: utility bar below 600px only with Client Login,
 * "Menu" button below 1100px (core switches at 600px, overridden here).
 */

/* Sticky header: the white bar sticks, the 40px utility bar scrolls away. */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: calc(var(--wp-admin--admin-bar--height, 0px) - 40px);
	z-index: 20;
}

/* Phones: the utility bar shows only Client Login (as design A) and only when the
   link is there (functions.php leaves it out while there is no Client Login page);
   without it the bar is hidden, as before. */
@media (max-width: 599.98px) {
	.wp-site-blocks > header.wp-block-template-part:not(:has(.torqtek-client-login)) {
		top: 0;
	}

	.torqtek-util:not(:has(.torqtek-client-login)) {
		display: none;
	}

	.torqtek-util p:not(.torqtek-client-login) {
		display: none;
	}
}

/* Client Login / My account and Sign out: tap targets of the bar's height. */
.torqtek-util .torqtek-client-login {
	display: flex;
	gap: 1.25rem;
}

.torqtek-util .torqtek-client-login a {
	display: inline-flex;
	align-items: center;
	min-block-size: 40px;
}

/* Utility bar links: white (dark-background rule), underline on hover only. */
.torqtek-util a {
	text-decoration: none;
}

.torqtek-util a:hover,
.torqtek-util a:focus-visible {
	text-decoration: underline;
}

.torqtek-head {
	position: relative;
}

/* Menu items */
.torqtek-nav.wp-block-navigation .wp-block-navigation-item__content {
	display: flex;
	align-items: center;
	min-block-size: 44px;
	padding: 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
}

.torqtek-nav.wp-block-navigation .wp-block-navigation-item__content:hover {
	text-decoration: underline;
}

.torqtek-nav.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.35em;
}

/* Products caret: the design's ▾ after the label instead of the core chevron. */
.torqtek-nav.wp-block-navigation .wp-block-navigation__submenu-icon {
	display: none;
}

.torqtek-nav .torqtek-nav-quote {
	margin-inline-start: 0.25rem;
}

/* "Menu" / "Close" buttons */
.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container-open,
.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container-close {
	align-items: center;
	justify-content: center;
	min-inline-size: 44px;
	min-block-size: 44px;
	padding: 0 0.75rem;
	border: 2px solid var(--wp--preset--color--navy);
	border-radius: var(--wp--preset--border-radius--small);
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--navy);
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.95rem;
	font-weight: 600;
}

.torqtek-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
	display: inline-flex;
}

/* Desktop (1100px+): Products dropdown */
@media (min-width: 1100px) {
	.torqtek-nav.wp-block-navigation .wp-block-navigation-submenu__toggle::after {
		content: "\25BE";
		margin-inline-start: 0.4rem;
		font-size: 0.8em;
	}

	/* Beats core's min-width: 200px on the open submenu. */
	.torqtek-nav.wp-block-navigation:not(.has-background) .has-child .wp-block-navigation__submenu-container.wp-block-navigation__submenu-container {
		min-width: 16rem;
		padding: 0.25rem 1rem;
		border: 1px solid var(--wp--custom--color--rule);
		background-color: var(--wp--preset--color--surface);
	}

	/* 1rem to the inline start of "Products" (left; right in Arabic). */
	.torqtek-nav.wp-block-navigation .has-child > .wp-block-navigation__submenu-container {
		inset-inline-start: -1rem;
	}

	.torqtek-nav.wp-block-navigation .has-child .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
		padding: 0;
		white-space: nowrap;
		border-block-end: 1px solid var(--wp--custom--color--rule);
	}

	.torqtek-nav.wp-block-navigation .has-child .wp-block-navigation__submenu-container .wp-block-navigation-item:last-child .wp-block-navigation-item__content {
		border-block-end: 0;
	}
}

/* 600–1099px: keep the "Menu" button (core shows the full menu from 600px). */
@media (min-width: 600px) and (max-width: 1099.98px) {
	.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: inline-flex;
	}

	.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}

/* Below 1100px: the open menu is a panel under the white bar, not a full-screen overlay. */
@media (max-width: 1099.98px) {
	.torqtek-nav.wp-block-navigation {
		position: static;
	}

	.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open {
		position: absolute;
		inset: 100% 0 auto 0;
		padding: 0 var(--wp--style--root--padding-right, 1rem) 1rem var(--wp--style--root--padding-left, 1rem);
		overflow: visible;
		border-block-end: 1px solid var(--wp--custom--color--rule);
		animation: none;
	}

	.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-dialog {
		position: relative;
		margin-block-start: 0;
	}

	/* "Close" sits exactly over "Menu": bar 68px, button 44px, 12px from the top. */
	.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
		top: -56px;
		inset-inline-end: 0;
		min-inline-size: 4.25rem; /* always covers "Menu", which is a few px wider than "Close" */
	}

	.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
		align-items: stretch;
		gap: 0;
		/* Screen minus header (108px) and the quick-contact bar (4.5rem, footer.css). */
		max-block-size: calc(100dvh - 108px - 4.5rem - var(--wp-admin--admin-bar--height, 0px));
		padding-block-start: 0;
		overflow-y: auto;
	}

	.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container,
	.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item,
	.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .has-child .wp-block-navigation__submenu-container {
		align-items: stretch;
		gap: 0;
	}

	.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
		inline-size: 100%;
		min-block-size: 48px;
		padding: 0;
		box-sizing: border-box;
		font-size: 1.05rem;
		border-block-end: 1px solid var(--wp--custom--color--rule);
	}

	.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .has-child .wp-block-navigation__submenu-container {
		padding: 0;
		padding-inline-start: 1rem;
	}

	.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .torqtek-nav-quote {
		margin: 1rem 0 0;
	}

	.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .torqtek-nav-quote .wp-block-button,
	.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .torqtek-nav-quote .wp-block-button__link {
		inline-size: 100%;
	}
}

/*
 * EXPERIMENT (theme 0.39.0-rc4, decision of the client 2026-11-21; rc5 smoke,
 * back in rc7 after rc6): a dark
 * navy "glass" header on every page — the white logo with the blue Q
 * (functions.php), white menu, the bright blue "Request a Quote".
 *
 * Density: at the top of the page 95% navy. rc5 (Artem 2026-11-22): once
 * the bar sticks over the page, home-header.js puts "torqtek-stuck" on
 * <body> and the bar turns into blue-gray smoke. rc8 (variant A, Artem
 * 2026-11-22): instead of the smoke a see-through blue bar (below), and over
 * the dark top band of inner pages (product.css) the bar is as see-through
 * as over the home banner. Without JavaScript: 95%.
 * The blur sits on a pseudo-element, not on the bar itself: a
 * backdrop-filter on the bar would trap the phone menu inside it. Browsers
 * without backdrop-filter get a solid navy bar.
 *
 * Contrast (AA), measured on screenshots: white menu on the bar 11–14:1;
 * hover text Sky + 30% white 5.4:1 or more; current-item underline pure Sky
 * (a line, 3:1 needed) 4.1:1 or more; white on the bright blue button 4.6:1.
 * Home page over the dark banner: the darker, more see-through bar below
 * (unchanged since try8).
 */
/* Two classes: stronger than WordPress' ".has-surface-background-color"
   (also !important), which would paint the bar solid white again. */
.wp-block-template-part .torqtek-head {
	background-color: transparent !important;
	border-block-end-color: var(--wp--custom--color--navy-line) !important;
}

.torqtek-head::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-color: var(--wp--preset--color--navy);
	transition: background-color 0.3s ease, -webkit-backdrop-filter 0.3s ease, backdrop-filter 0.3s ease;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.torqtek-head::before {
		background-color: color-mix(in srgb, var(--wp--preset--color--navy) 95%, transparent);
		-webkit-backdrop-filter: blur(14px);
		backdrop-filter: blur(14px);
	}

	/* rc8, variant A: once the bar sticks over the page — see-through blue.
	   Tint: navy with 20% Accent bright (#09315B) at 74%; the glass darkens
	   what is under it to half (brightness .5) and keeps its colors
	   (saturate 1.2), so white pages turn blue, not gray. Measured over a
	   white page: bar #274463, white menu 10:1, the cylinder-blue Q 2.5:1,
	   hover 4.9:1. One state over light and dark sections alike. */
	body.torqtek-stuck .torqtek-head::before {
		background-color: color-mix(in srgb, color-mix(in srgb, var(--wp--preset--color--navy) 80%, var(--wp--preset--color--accent-bright)) 74%, transparent);
		-webkit-backdrop-filter: blur(16px) brightness(0.5) saturate(1.2);
		backdrop-filter: blur(16px) brightness(0.5) saturate(1.2);
	}

	/* Home page over the dark banner (unchanged since try8) and, since rc8,
	   inner pages over their dark top band: no darkening of the band. */
	:is(.home:has(.torqtek-hero.is-style-torqtek-hero-dark), body:has(.torqtek-page-hero)):not(.torqtek-scrolled) .torqtek-head::before {
		background-color: color-mix(in srgb, var(--wp--preset--color--navy-deep) 55%, transparent);
		-webkit-backdrop-filter: blur(14px);
		backdrop-filter: blur(14px);
	}
}

/* Logo: the white one comes from functions.php; in the editor the site logo
   (dark) is shown as a white silhouette so it stays visible on navy. */
.editor-styles-wrapper .torqtek-head .wp-block-site-logo img {
	filter: brightness(0) invert(1);
}

/* Menu items on the bar: white; hover and the current item — Sky. */
.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--surface);
}

.torqtek-nav.wp-block-navigation .wp-block-navigation-item__content:hover,
.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:hover {
	/* Sky lightened with 30% white (#4DC0FF): 5.4:1 or more on the bar as
	   measured in the browser (pure Sky was 4.1–4.5:1 there, below AA for
	   text). The current-item underline is a line, not text: pure Sky. */
	color: color-mix(in srgb, var(--wp--preset--color--sky) 70%, var(--wp--preset--color--surface));
	text-decoration-color: currentcolor;
}

/* rc7 (from rc6): hover over the home banner (rc8: and over the dark top
   band of inner pages) — Sky + 50% white (#80D2FF).
   #4DC0FF was 4.3:1 over the lightest part of the banner under the bar
   (#3D4C59); this one 5.3:1. */
:is(.home:has(.torqtek-hero.is-style-torqtek-hero-dark), body:has(.torqtek-page-hero)):not(.torqtek-scrolled) .torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:hover {
	color: color-mix(in srgb, var(--wp--preset--color--sky) 50%, var(--wp--preset--color--surface));
}

.torqtek-nav.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
	text-decoration-color: var(--wp--preset--color--sky);
}

/* "Request a Quote" in the bar: bright blue (as "View Parts"), white text 4.6:1. */
.torqtek-nav.wp-block-navigation .torqtek-nav-quote .wp-block-button__link {
	border-color: var(--wp--preset--color--accent-bright);
	background-color: var(--wp--preset--color--accent-bright);
	color: var(--wp--preset--color--surface);
}

.torqtek-nav.wp-block-navigation .torqtek-nav-quote .wp-block-button__link:hover {
	border-color: color-mix(in srgb, var(--wp--preset--color--accent-bright) 78%, var(--wp--preset--color--navy));
	background-color: color-mix(in srgb, var(--wp--preset--color--accent-bright) 78%, var(--wp--preset--color--navy));
	color: var(--wp--preset--color--surface);
}

/* "Menu" and "Close" on phones and tablets: white outline. */
.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container-open,
.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container-close {
	border-color: var(--wp--preset--color--surface);
	background-color: transparent;
	color: var(--wp--preset--color--surface);
}

/* Products dropdown (computers) and the open phone menu: solid panels in the
   tint of the bar (rc8: navy + 20% Accent bright, #09315B), white text. */
@media (min-width: 1100px) {
	.torqtek-nav.wp-block-navigation:not(.has-background) .has-child .wp-block-navigation__submenu-container.wp-block-navigation__submenu-container {
		border-color: var(--wp--custom--color--navy-line);
		background-color: color-mix(in srgb, var(--wp--preset--color--navy) 80%, var(--wp--preset--color--accent-bright)) !important; /* beats the overlay color class on the submenu */
	}

	.torqtek-nav.wp-block-navigation .has-child .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
		color: var(--wp--preset--color--surface);
		border-block-end-color: var(--wp--custom--color--navy-line);
	}
}

.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open {
	background-color: color-mix(in srgb, var(--wp--preset--color--navy) 80%, var(--wp--preset--color--accent-bright)) !important; /* beats the overlay color class */
	color: var(--wp--preset--color--surface) !important;
}

.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	color: var(--wp--preset--color--surface);
}

@media (max-width: 1099.98px) {
	.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open {
		border-block-end-color: var(--wp--custom--color--navy-line);
	}

	.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
		border-block-end-color: var(--wp--custom--color--navy-line);
	}
}

/* "Close" covers "Menu" exactly: solid, or "Menu" shows through. */
.torqtek-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
	background-color: color-mix(in srgb, var(--wp--preset--color--navy) 80%, var(--wp--preset--color--accent-bright));
}

/* Top line (email, Client Login): the same tone as the bar under it (95%
   navy over the page), so both read as one block. Home page: the bar over
   the dark banner is darker, so the line keeps the plain navy there; so do
   the inner pages with the dark top band (rc8). */
body:not(.home):not(:has(.torqtek-page-hero)) .torqtek-util.has-background {
	background-color: color-mix(in srgb, var(--wp--preset--color--navy) 95%, var(--wp--preset--color--background)) !important;
}

.torqtek-head :focus-visible {
	outline-color: var(--wp--preset--color--surface);
}

@media (prefers-reduced-motion: reduce) {
	.torqtek-head::before {
		transition: none;
	}
}
