/**
 * header.css — site header chrome (non-block markup: token-rendered utility row, primary nav, mega panels, menu toggle).
 * Values measured from the current site (Protomiq Sept, Oct 27). Colors are theme.json presets only.
 * The header collapses to the "Menu" disclosure at ≤1050px (the current design's header breakpoint; page sections use 900/650).
 */

:root {
	--protomiq-tint: color-mix(in srgb, var(--wp--preset--color--secondary) 10%, var(--wp--preset--color--white));
	--protomiq-tint-strong: color-mix(in srgb, var(--wp--preset--color--secondary) 16%, var(--wp--preset--color--white));
	--protomiq-hairline: color-mix(in srgb, var(--wp--preset--color--primary) 8%, transparent);
	--protomiq-shadow-panel: 0 30px 50px color-mix(in srgb, var(--wp--preset--color--primary) 13%, transparent);
}

/* Sticky on the template-part landmark itself (the inner group's wrapper is the same height, so sticky there has no travel). */
header.wp-block-template-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 1000;
	background: color-mix(in srgb, var(--wp--preset--color--white) 97%, transparent);
	border-bottom: 1px solid var(--protomiq-hairline);
	backdrop-filter: blur(18px);
	transition: transform 0.3s ease, box-shadow 0.2s ease;
}
header.wp-block-template-part.protomiq-header-hidden {
	transform: translateY(-100%);
}
/* Soft shadow once the page has scrolled (header.js toggles .is-scrolled). */
header.wp-block-template-part.is-scrolled {
	box-shadow: 0 6px 18px color-mix(in srgb, var(--wp--preset--color--primary) 8%, transparent);
}

/* WordPress defines the root padding variable on body, not :root — resolve it here, inside the header. */
.protomiq-header {
	--protomiq-header-pad: var(--wp--style--root--padding-left, clamp(20px, 4vw, 64px));
	position: relative;
	padding: 8px var(--protomiq-header-pad);
}
.protomiq-header__bar {
	min-height: 85px;
}
.protomiq-header__logo {
	flex-shrink: 0;
}
.protomiq-header__logo img {
	display: block;
	height: auto;
}

/* ---------- Utility (Sign In + search) ----------
 * Desktop: in the bar, after Request a Demo (Alex, Nov 18). The bar's 60px gap is pulled back to 24px.
 * Collapsed header (≤1050px): pinned top right above the Menu button, as before. */
.protomiq-utility {
	flex-shrink: 0;
	white-space: nowrap;
	display: flex;
	align-items: center;
	gap: 18px;
	color: var(--wp--preset--color--primary);
}
/* Two classes: beats core's `body .is-layout-flex > * { margin: 0 }`. */
.protomiq-header__bar > .protomiq-utility {
	margin-inline-start: -36px;
}
.protomiq-utility__link {
	color: inherit;
	font: 500 16px/20px var(--wp--preset--font-family--primary);
	text-decoration: none;
}
.protomiq-utility__link:hover,
.protomiq-utility__link:focus-visible {
	text-decoration: underline;
}
.protomiq-search {
	position: relative;
}
.protomiq-search__toggle {
	display: grid;
	place-items: center;
	min-width: 24px;
	min-height: 24px;
	list-style: none;
	cursor: pointer;
	color: var(--wp--preset--color--secondary);
}
.protomiq-search__toggle::-webkit-details-marker {
	display: none;
}
.protomiq-search__icon,
.protomiq-search__toggle svg {
	width: 16px;
	height: 16px;
}
.protomiq-search__form {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	z-index: 3;
	display: flex;
	gap: 8px;
	width: min(420px, calc(100vw - 2 * var(--protomiq-header-pad)));
	padding: 12px;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--protomiq-hairline);
	border-radius: 14px;
	box-shadow: var(--protomiq-shadow-panel);
}
.protomiq-search__input {
	flex: 1;
	min-width: 0;
	padding: 10px 14px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 999px;
	font: 400 15px var(--wp--preset--font-family--primary);
	color: var(--wp--preset--color--primary);
}
.protomiq-search__submit {
	padding: 10px 18px;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	font: 500 15px var(--wp--preset--font-family--primary);
	cursor: pointer;
}
.protomiq-search__submit:hover,
.protomiq-search__submit:focus-visible {
	background: var(--wp--preset--color--primary-hover);
}

/* ---------- Primary nav ---------- */
.protomiq-nav__list {
	display: flex;
	align-items: center;
	gap: clamp(14px, 2.2vw, 32px);
	margin: 0; /* UA reset — defeats browser <ul> margins */
	padding: 0;
	list-style: none;
}
.protomiq-nav__link,
.protomiq-nav__trigger {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 32px 0;
	border: 0;
	background: none;
	color: var(--wp--preset--color--primary);
	font: 600 14px/20px var(--wp--preset--font-family--primary);
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}
.protomiq-nav__trigger::after {
	content: "⌄";
	color: var(--wp--preset--color--accent);
	transition: transform 0.2s;
}
.protomiq-nav__item.is-open > .protomiq-nav__trigger::after {
	transform: rotate(180deg);
}
.protomiq-nav__link[aria-current="page"] {
	text-decoration: underline;
	text-underline-offset: 6px;
}
.protomiq-nav__link:focus-visible,
.protomiq-nav__trigger:focus-visible,
.protomiq-mega a:focus-visible,
.protomiq-mega__tab:focus-visible,
.protomiq-menu-toggle:focus-visible,
.protomiq-search__toggle:focus-visible,
.protomiq-utility__link:focus-visible {
	outline: 3px solid var(--wp--preset--color--secondary);
	outline-offset: 4px;
	border-radius: 6px;
}

/* ---------- Mega panels ---------- */
.protomiq-mega {
	position: absolute;
	top: 100%;
	left: var(--protomiq-header-pad);
	right: var(--protomiq-header-pad);
	z-index: 2;
	max-height: calc(100dvh - 140px);
	overflow: auto;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--protomiq-hairline);
	border-top: 0;
	border-radius: 0 0 24px 24px;
	box-shadow: var(--protomiq-shadow-panel);
	animation: protomiq-menu-in 0.24s ease both;
}
/* Closed state only once JS is running (html.js from atomic_js_class); without JS panels open on hover/focus. */
html.js .protomiq-nav__item.has-mega:not(.is-open) > .protomiq-mega,
html:not(.js) .protomiq-nav__item.has-mega:not(:hover):not(:focus-within) > .protomiq-mega {
	display: none;
}
.protomiq-mega ul {
	margin: 0; /* UA reset — defeats browser <ul> margins */
	padding: 0;
	list-style: none;
}
@keyframes protomiq-menu-in {
	from { opacity: 0; transform: translateY(-8px); }
	to { opacity: 1; transform: none; }
}

/* How We Help: intro + tabs | panel + CTA card */
.protomiq-mega--help {
	display: grid;
	grid-template-columns: 28% 1fr;
}
.protomiq-mega__intro {
	padding: 30px;
	background:
		radial-gradient(ellipse at 0% 100%, color-mix(in srgb, var(--wp--preset--color--secondary) 19%, transparent), transparent 80%),
		var(--wp--preset--color--ice);
}
.protomiq-mega__kicker {
	margin: 0 0 18px; /* UA reset — <p> inside non-block markup */
	color: var(--wp--preset--color--accent);
	font: 600 11px/1.6 var(--wp--preset--font-family--primary);
	letter-spacing: 0.12em;
	text-transform: uppercase;
}
.protomiq-mega__tabs {
	display: grid;
	gap: 10px;
}
.protomiq-mega__tab {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	padding: 20px 16px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: var(--wp--preset--color--primary);
	font: 700 18px/1.25 var(--wp--preset--font-family--display);
	text-align: left;
	cursor: pointer;
}
.protomiq-mega__tab[aria-selected="true"] {
	background: var(--wp--preset--color--white);
	box-shadow: 0 8px 20px color-mix(in srgb, var(--wp--preset--color--primary) 4%, transparent);
}
.protomiq-mega__tagline {
	margin: 44px 0 4px; /* UA reset — <p> inside non-block markup */
	color: var(--wp--preset--color--muted);
	font: 600 24px/1.25 var(--wp--preset--font-family--display);
}
.protomiq-mega__content {
	padding: 32px;
}
.protomiq-mega__panel[hidden] {
	display: none;
}
.protomiq-mega__heading {
	margin: 0 0 22px; /* UA reset — <p> inside non-block markup */
	color: var(--wp--preset--color--primary);
	font: 700 23px/1.2 var(--wp--preset--font-family--display);
}
.protomiq-mega__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px 20px;
}
.protomiq-mega__link {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 14px 10px;
	border-radius: 12px;
	color: var(--wp--preset--color--primary);
	text-decoration: none;
	transition: background-color 0.2s;
}
.protomiq-mega__link:hover {
	background: var(--protomiq-tint);
}
.protomiq-mega__icon {
	display: grid;
	place-items: center;
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--secondary) 9%, transparent);
	border-radius: 10px;
	background: var(--protomiq-tint);
	color: var(--wp--preset--color--secondary);
	transition: background-color 0.2s, transform 0.2s;
}
.protomiq-mega__icon svg {
	width: 20px;
	height: 20px;
}
.protomiq-mega__link:hover .protomiq-mega__icon {
	background: var(--protomiq-tint-strong);
	transform: translateY(-2px);
}
.protomiq-mega__label {
	padding-top: 2px;
	font: 600 15px/1.4 var(--wp--preset--font-family--primary);
}
.protomiq-mega__label small,
.protomiq-mega__card small,
.protomiq-mega__cta-copy small {
	display: block;
	max-width: 35ch;
	margin-top: 7px;
	color: var(--wp--preset--color--muted);
	font: 400 12px/1.6 var(--wp--preset--font-family--primary);
}
.protomiq-mega__cta {
	display: grid;
	grid-template-columns: 58px minmax(0, 1fr) auto;
	align-items: center;
	gap: 18px;
	margin-top: 26px;
	padding: 22px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--primary) 5%, transparent);
	border-radius: 16px;
	background: linear-gradient(120deg, color-mix(in srgb, var(--wp--preset--color--ice) 70%, var(--protomiq-tint)), var(--protomiq-tint));
	color: var(--wp--preset--color--primary);
	text-decoration: none;
	transition: box-shadow 0.2s;
}
.protomiq-mega__cta:hover {
	box-shadow: 0 8px 22px color-mix(in srgb, var(--wp--preset--color--primary) 6%, transparent);
}
.protomiq-mega__mark svg {
	display: block;
	width: 58px;
	height: 58px;
	color: var(--wp--preset--color--primary);
}
.protomiq-mega__cta-copy strong {
	display: block;
	font: 700 18px/1.25 var(--wp--preset--font-family--display);
}
.protomiq-mega__cta-copy small {
	max-width: 46ch;
}
.protomiq-mega__cta-action {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 8px 0;
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--primary) 40%, transparent);
	font: 600 12px var(--wp--preset--font-family--primary);
	white-space: nowrap;
}
.protomiq-mega__cta-action svg {
	width: 16px;
	height: 14px;
	transition: transform 0.25s;
}
.protomiq-mega__cta:hover .protomiq-mega__cta-action svg {
	transform: translateX(3px);
}

/* News & Events / Company: three cards. Two classes so the padding beats the `.protomiq-mega ul` reset above. */
.protomiq-mega .protomiq-mega__cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	padding: 32px;
}
.protomiq-mega__card {
	display: block;
	min-height: 130px;
	padding: 28px;
	border-radius: 16px;
	background: linear-gradient(135deg, var(--wp--preset--color--ice), var(--protomiq-tint));
	color: var(--wp--preset--color--primary);
	text-decoration: none;
	transition: background-color 0.2s;
}
.protomiq-mega__card:hover {
	background: var(--protomiq-tint-strong);
}
.protomiq-mega__card > span {
	display: block;
	font: 700 28px/1.2 var(--wp--preset--font-family--display);
}

/* ---------- Header CTAs ---------- */
.protomiq-header__ctas .wp-block-button__link {
	min-height: 44px;
	white-space: nowrap;
}
.protomiq-header__ctas .wp-block-button__link::after {
	margin-inline-start: 12px;
}

/* ---------- Menu toggle (collapsed header) ---------- */
.protomiq-menu-toggle {
	display: none;
	align-items: center;
	gap: 18px;
	padding: 12px 18px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--primary) 16%, transparent);
	border-radius: 30px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--primary);
	font: 600 14px var(--wp--preset--font-family--primary);
	cursor: pointer;
}
.protomiq-menu-toggle__icon::before {
	content: "+";
	display: inline-block;
	font-size: 18px;
	line-height: 1;
	transition: transform 0.2s;
}
.protomiq-menu-toggle[aria-expanded="true"] .protomiq-menu-toggle__icon::before {
	transform: rotate(45deg);
}

@media (min-width: 1051px) and (max-width: 1250px) {
	.protomiq-header .protomiq-header__bar { gap: 28px; } /* beats the 60px layout gap so the bar fits with the utility inline */
	.protomiq-header__bar > .protomiq-utility { margin-inline-start: -4px; }
	.protomiq-nav__list { gap: 14px; }
	.protomiq-header__logo img { width: 130px; }
	.protomiq-mega__cta { grid-template-columns: 48px 1fr; }
	.protomiq-mega__mark svg { width: 48px; height: 48px; }
	.protomiq-mega__cta-action { grid-column: 2; justify-self: start; }
}

@media (max-width: 1050px) {
	.protomiq-header { padding-top: 18px; padding-bottom: 0; }
	.protomiq-header__bar { min-height: 58px; }
	.protomiq-utility { position: absolute; top: 4px; right: var(--protomiq-header-pad); gap: 14px; }
	.protomiq-header__bar > .protomiq-utility { margin-inline-start: 0; }
	.protomiq-utility__link { font-size: 11px; }
	.protomiq-menu-toggle { display: inline-flex; }
	.protomiq-header__panel {
		display: none !important; /* beats the flex layout class until opened */
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		max-height: calc(100dvh - 76px);
		overflow-y: auto;
		padding: 20px var(--protomiq-header-pad) 35px;
		background: var(--wp--preset--color--white);
		border-bottom: 1px solid var(--protomiq-hairline);
		box-shadow: 0 25px 30px color-mix(in srgb, var(--wp--preset--color--primary) 8%, transparent);
	}
	.protomiq-header__panel.is-open {
		display: block !important;
	}
	.protomiq-nav__list { display: block; }
	.protomiq-nav__link,
	.protomiq-nav__trigger {
		display: flex;
		justify-content: space-between;
		width: 100%;
		padding: 20px 0;
		border-bottom: 1px solid var(--protomiq-hairline);
		font-size: 18px;
	}
	.protomiq-mega {
		position: static;
		max-height: none;
		overflow: visible;
		margin: 12px 0;
		border: 0;
		border-radius: 16px;
		box-shadow: none;
		animation: none;
	}
	.protomiq-mega--help { grid-template-columns: 1fr; }
	.protomiq-mega__intro { padding: 20px; border-radius: 16px; }
	.protomiq-mega__tagline { display: none; }
	.protomiq-mega__tabs { grid-template-columns: 1fr 1fr; }
	.protomiq-mega__tab { padding: 14px; font-size: 15px; }
	.protomiq-mega__content { padding: 24px 0; }
	.protomiq-mega .protomiq-mega__cards { padding: 0; gap: 12px; }
	.protomiq-mega__card { min-height: 0; padding: 20px; }
	.protomiq-mega__card > span { font-size: 21px; }
	.protomiq-header__ctas { margin-top: 14px; flex-wrap: wrap; }
}

@media (max-width: 650px) {
	.protomiq-header__bar { min-height: 46px; }
	.protomiq-header__logo img { width: 120px; }
	.protomiq-utility { top: 2px; }
	.protomiq-utility__link { font-size: 10px; }
	.protomiq-search__toggle { min-width: 20px; min-height: 20px; }
	.protomiq-menu-toggle { padding: 9px 16px; }
	.protomiq-header__panel { max-height: calc(100dvh - 64px); }
	.protomiq-mega__grid,
	.protomiq-mega .protomiq-mega__cards { grid-template-columns: 1fr; }
	.protomiq-mega__grid { gap: 4px; }
	.protomiq-mega__heading { font-size: 21px; }
	.protomiq-mega__cta { grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 20px; }
	.protomiq-mega__mark svg { width: 44px; height: 44px; }
	.protomiq-mega__cta-copy strong { font-size: 17px; }
	.protomiq-mega__cta-action { grid-column: 2; justify-self: start; }
	.protomiq-mega__label small { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
	header.wp-block-template-part,
	.protomiq-mega,
	.protomiq-mega__icon,
	.protomiq-mega__cta,
	.protomiq-mega__cta-action svg,
	.protomiq-nav__trigger::after,
	.protomiq-menu-toggle__icon::before {
		transition: none;
		animation: none;
	}
}
