/*--------------------------------------------------------------
	iqa-header: solid, sticky header + primary navigation
	Every class here starts with iqa-, and the menu markup comes
	from IQA_Nav_Walker (functions-additions.php), so none of the
	old .sub-menu / .menu-item / #top-menu rules can touch it.

	Desktop nav starts at 1280px. If you change it, change it in
	iqa-nav.js as well (DESKTOP_MQ).
--------------------------------------------------------------*/

.iqa-header {
	--iqa-nav-h: 72px;
	--iqa-nav-bg: #000;
	--iqa-nav-accent: #6E00B7;
	--iqa-nav-accent-light: #d9a8f0;
	--iqa-nav-tint: #f3e9fb;
	--iqa-nav-grad: linear-gradient(to right, #AD55C0 0%, #6F4BC4 100%);
	--iqa-nav-grad-hover: linear-gradient(to right, #8A3CC6 0%, #7B1FA2 100%);
	/* Fluid sizing so 7 top-level items plus logo and CTA fit at 1280px and open up on wider screens */
	--iqa-nav-fs: clamp(14px, calc(0.68vw + 5.2px), 15px);   /* label size: 14px @1280, 15px @1440+ */
	--iqa-nav-pad: clamp(8px, calc(4vw - 42px), 14px);        /* space either side of each label */
	--iqa-nav-gap: clamp(12px, calc(2.4vw - 14px), 24px);     /* logo | menu | CTA */
	--iqa-nav-inset: clamp(16px, 2.5vw, 48px);                /* left/right edge of the bar */

	position: sticky;
	top: 0;
	z-index: 999;
	background-color: var(--iqa-nav-bg);
}

@media (min-width: 1280px) {
	.iqa-header { --iqa-nav-h: 80px; }
}

/* Logged-in admin bar */
.admin-bar .iqa-header { top: 32px; }
@media (max-width: 782px) {
	.admin-bar .iqa-header { top: 46px; }
}

/*--------------------------------------------------------------
	Bar layout
--------------------------------------------------------------*/

.iqa-header__inner {
	display: flex;
	align-items: stretch;
	gap: var(--iqa-nav-gap);
	width: 100%;
	max-width: 1600px;
	min-height: var(--iqa-nav-h);
	margin: 0 auto;
	padding: 0 var(--iqa-nav-inset);
}

/* Logo: white plate behind the right part of the mark, carried over from the old header */
.iqa-header__logo {
	display: flex;
	align-items: center;
	flex: 0 1 auto; /* may shrink on very narrow phones so the bar never overflows */
	min-width: 0;
	margin-right: auto;
	padding: 10px 0;
}
.iqa-header__logo .custom-logo-link {
	position: relative;
	display: block;
	line-height: 0;
}
.iqa-header__logo .custom-logo-link::before {
	content: "";
	position: absolute;
	top: 4px;
	bottom: 4px;
	right: 0;
	width: 42%;
	background-color: #fff;
	border-radius: 8px;
}
.iqa-header__logo .custom-logo {
	position: relative;
	z-index: 1;
	display: block;
	max-width: 100%;
	height: auto;
}

.iqa-header__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
}

/*--------------------------------------------------------------
	CTA: pill with attached arrow (brand gradient)
	Keeps the .contactMnCTA class from the old markup in case
	GTM / analytics triggers rely on it.
--------------------------------------------------------------*/

.iqa-header .iqa-header__cta {
	position: relative;
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0 56px 0 26px;
	border-radius: 999px;
	background: var(--iqa-nav-grad);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	text-decoration: none;
}
.iqa-header .iqa-header__cta::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%231a0630' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='12' x2='20' y2='12'/%3E%3Cpolyline points='13 5 20 12 13 19'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 20px 20px;
}
.iqa-header .iqa-header__cta:hover,
.iqa-header .iqa-header__cta:focus-visible {
	background: var(--iqa-nav-grad-hover);
	color: #fff;
	text-decoration: none;
}

/*--------------------------------------------------------------
	Navigation: shared
--------------------------------------------------------------*/

.iqa-nav .iqa-nav__list,
.iqa-nav .iqa-nav__sub {
	margin: 0;
	padding: 0;
	list-style: none;
}
.iqa-nav .iqa-nav__item {
	position: relative;
	float: none;
	margin: 0;
	padding: 0;
	list-style: none;
}

.iqa-nav .iqa-nav__link,
.iqa-nav .iqa-nav__link:visited,
.iqa-nav .iqa-nav__link:hover,
.iqa-nav .iqa-nav__link:focus {
	color: inherit;
	text-decoration: none;
}

/* Caret buttons are printed by IQA_Nav_Walker */
.iqa-nav .iqa-nav__caret {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: inherit;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.iqa-nav .iqa-nav__caret svg {
	width: 14px;
	height: 14px;
	transition: transform 0.2s ease;
}
.iqa-nav .iqa-nav__item.is-open > .iqa-nav__caret svg { transform: rotate(180deg); }

/* Focus ring (white on the black bar, purple inside white panels) */
.iqa-header a:focus-visible,
.iqa-header button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}
.iqa-nav .iqa-nav__sub a:focus-visible,
.iqa-nav .iqa-nav__sub button:focus-visible {
	outline-color: var(--iqa-nav-accent);
	outline-offset: -2px;
}

/* If the theme's old dropdown script still injects its own toggles, hide them */
.iqa-nav .dropdown-toggle { display: none !important; }

/* Mobile toggle button (hamburger to X) */
.iqa-nav__toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0 -8px 0 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.iqa-nav__bars,
.iqa-nav__bars::before,
.iqa-nav__bars::after {
	display: block;
	width: 24px;
	height: 2px;
	border-radius: 2px;
	background-color: currentColor;
	transition: transform 0.2s ease, background-color 0.2s ease;
}
.iqa-nav__bars { position: relative; }
.iqa-nav__bars::before,
.iqa-nav__bars::after {
	content: "";
	position: absolute;
	left: 0;
}
.iqa-nav__bars::before { top: -7px; }
.iqa-nav__bars::after { top: 7px; }
.iqa-nav__toggle[aria-expanded="true"] .iqa-nav__bars { background-color: transparent; }
.iqa-nav__toggle[aria-expanded="true"] .iqa-nav__bars::before { transform: translateY(7px) rotate(45deg); }
.iqa-nav__toggle[aria-expanded="true"] .iqa-nav__bars::after { transform: translateY(-7px) rotate(-45deg); }

/*--------------------------------------------------------------
	Desktop (1280px and up)
--------------------------------------------------------------*/

@media (min-width: 1280px) {

	.iqa-header .iqa-header__cta {
		padding: 0 52px 0 22px;
		font-size: var(--iqa-nav-fs);
	}

	.iqa-nav {
		display: flex;
		flex: 1 1 auto;
		min-width: 0;
	}

	.iqa-nav .iqa-nav__list {
		display: flex;
		flex: 1 1 auto;
		flex-wrap: nowrap;
		align-items: stretch;
		justify-content: center;
	}

	/* Top level: each item is as tall as the bar, so the dropdown attaches to the bar with no gap */
	.iqa-nav .iqa-nav__list > .iqa-nav__item {
		display: flex;
		align-items: stretch;
		color: #fff;
	}
	.iqa-nav .iqa-nav__list > .iqa-nav__item > .iqa-nav__link {
		display: flex;
		align-items: center;
		padding: 0 var(--iqa-nav-pad);
		font-size: var(--iqa-nav-fs);
		font-weight: 500;
		letter-spacing: 0.2px;
		line-height: 1.2;
		white-space: nowrap;
	}
	.iqa-nav .iqa-nav__list > .iqa-nav__item.has-sub > .iqa-nav__link { padding-right: 4px; }
	.iqa-nav .iqa-nav__list > .iqa-nav__item > .iqa-nav__caret { padding: 0 var(--iqa-nav-pad) 0 0; }

	/* Indicator: hover, open, and the section you are currently in */
	.iqa-nav .iqa-nav__list > .iqa-nav__item::after {
		content: "";
		position: absolute;
		left: var(--iqa-nav-pad);
		right: var(--iqa-nav-pad);
		bottom: 0;
		height: 3px;
		border-radius: 3px 3px 0 0;
		background: var(--iqa-nav-grad);
		transform: scaleX(0);
		transform-origin: left center;
		transition: transform 0.25s ease;
	}
	.iqa-nav .iqa-nav__list > .iqa-nav__item.is-open::after,
	.iqa-nav .iqa-nav__list > .iqa-nav__item.is-current::after,
	.iqa-nav .iqa-nav__list > .iqa-nav__item.is-current-ancestor::after {
		transform: scaleX(1);
	}

	/* Dropdown panel: white sheet hanging from the bar */
	.iqa-nav .iqa-nav__sub {
		position: absolute;
		z-index: 2;
		padding: 8px;
		background-color: #fff;
		box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
		opacity: 0;
		visibility: hidden;
		transform: translateY(6px);
		transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
	}
	.iqa-nav .iqa-nav__item.is-open > .iqa-nav__sub {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition-delay: 0s;
	}

	/* Level 1: attached to the bar */
	.iqa-nav .iqa-nav__sub--1 {
		top: 100%;
		left: calc(var(--iqa-nav-pad) - 22px); /* lines item text up with the parent label */
		min-width: 260px;
		max-width: 340px;
		border-radius: 0 0 14px 14px;
	}

	/* Level 2: opens beside the panel, top-aligned with it (two-pane feel) */
	.iqa-nav .iqa-nav__sub--1 > .iqa-nav__item { position: static; }
	.iqa-nav .iqa-nav__sub--2 {
		top: 0;
		left: 100%;
		min-width: 280px;
		max-width: 360px;
		max-height: calc(100vh - var(--iqa-nav-h) - 24px);
		overflow-y: auto;
		border-radius: 0 0 14px 14px;
	}
	/* ...and flips to the left for the last two items so it never runs off-screen */
	.iqa-nav .iqa-nav__list > .iqa-nav__item:nth-last-child(-n+2) .iqa-nav__sub--2 {
		left: auto;
		right: 100%;
	}

	.iqa-nav .iqa-nav__sub .iqa-nav__item {
		display: flex;
		align-items: center;
	}
	.iqa-nav .iqa-nav__sub .iqa-nav__link {
		display: block;
		flex: 1 1 auto;
		padding: 10px 14px;
		border-radius: 8px;
		color: #1a1a1a;
		font-size: 15px;
		font-weight: 500;
		line-height: 1.35;
		transition: background-color 0.15s ease, color 0.15s ease;
	}
	.iqa-nav .iqa-nav__sub .iqa-nav__link:hover,
	.iqa-nav .iqa-nav__sub .iqa-nav__link:focus-visible,
	.iqa-nav .iqa-nav__sub .iqa-nav__item.is-open > .iqa-nav__link {
		background-color: var(--iqa-nav-tint);
		color: var(--iqa-nav-accent);
	}
	.iqa-nav .iqa-nav__sub .iqa-nav__item.is-current > .iqa-nav__link {
		color: var(--iqa-nav-accent);
		font-weight: 600;
	}

	/* Caret in a panel points at the flyout */
	.iqa-nav .iqa-nav__sub .iqa-nav__caret {
		padding: 0 10px;
		color: var(--iqa-nav-accent);
	}
	.iqa-nav .iqa-nav__sub .iqa-nav__caret svg,
	.iqa-nav .iqa-nav__sub .iqa-nav__item.is-open > .iqa-nav__caret svg { transform: rotate(-90deg); }
	.iqa-nav .iqa-nav__list > .iqa-nav__item:nth-last-child(-n+2) .iqa-nav__sub--1 .iqa-nav__caret svg,
	.iqa-nav .iqa-nav__list > .iqa-nav__item:nth-last-child(-n+2) .iqa-nav__sub--1 .iqa-nav__item.is-open > .iqa-nav__caret svg { transform: rotate(90deg); }
}

/* Mouse users: open on hover as well (touch relies on the caret button) */
@media (min-width: 1280px) and (hover: hover) and (pointer: fine) {
	.iqa-nav .iqa-nav__item:hover > .iqa-nav__sub {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition-delay: 0s;
	}
	.iqa-nav .iqa-nav__list > .iqa-nav__item:hover::after { transform: scaleX(1); }
	.iqa-nav .iqa-nav__list > .iqa-nav__item:hover > .iqa-nav__caret svg { transform: rotate(180deg); }
}

/*--------------------------------------------------------------
	Mobile / tablet (below 1280px)
--------------------------------------------------------------*/

@media (max-width: 1279.98px) {

	.iqa-nav__toggle { display: inline-flex; }

	.iqa-nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		display: none;
		max-height: calc(100vh - var(--iqa-nav-h));
		max-height: calc(100dvh - var(--iqa-nav-h));
		overflow-y: auto;
		overscroll-behavior: contain;
		background-color: var(--iqa-nav-bg);
		border-top: 1px solid rgba(255, 255, 255, 0.14);
	}
	.iqa-nav.is-open { display: block; }

	.iqa-nav .iqa-nav__list {
		display: block;
		padding: 4px var(--iqa-nav-inset) 28px;
	}

	.iqa-nav .iqa-nav__item {
		display: flex;
		flex-wrap: wrap;
		align-items: stretch;
		color: #fff;
	}
	.iqa-nav .iqa-nav__item > .iqa-nav__link {
		flex: 1 1 0;
		min-width: 0;
		padding: 15px 0;
		font-size: 17px;
		font-weight: 500;
		line-height: 1.3;
	}
	.iqa-nav .iqa-nav__list > .iqa-nav__item { border-bottom: 1px solid rgba(255, 255, 255, 0.14); }

	.iqa-nav .iqa-nav__caret {
		flex: 0 0 48px;
		margin-right: -12px;
	}
	.iqa-nav .iqa-nav__caret svg { width: 18px; height: 18px; }

	/* Accordion sub-menus */
	.iqa-nav .iqa-nav__sub {
		display: none;
		flex: 0 0 100%;
		padding: 0 0 12px 16px;
		background: transparent;
	}
	.iqa-nav .iqa-nav__item.is-open > .iqa-nav__sub { display: block; }
	.iqa-nav .iqa-nav__sub .iqa-nav__item { border: 0; }
	.iqa-nav .iqa-nav__sub .iqa-nav__item > .iqa-nav__link {
		padding: 11px 0;
		color: #d6d6d6;
		font-size: 15px;
		font-weight: 400;
	}
	.iqa-nav .iqa-nav__sub .iqa-nav__sub { padding-bottom: 4px; }

	.iqa-nav .iqa-nav__item.is-current > .iqa-nav__link,
	.iqa-nav .iqa-nav__item.is-current-ancestor > .iqa-nav__link {
		color: var(--iqa-nav-accent-light);
	}

	.iqa-header .iqa-nav a:focus-visible,
	.iqa-header .iqa-nav button:focus-visible {
		outline-color: #fff;
		outline-offset: 2px;
	}

	/* Stop the page scrolling behind the open menu */
	html.iqa-nav-open { overflow: hidden; }
}

@media (max-width: 575.98px) {
	.iqa-header__inner { gap: 10px; }
	.iqa-header__actions { gap: 8px; }
	.iqa-header .iqa-header__cta {
		min-height: 34px;
		padding: 0 40px 0 14px;
		font-size: 13px;
	}
	.iqa-header .iqa-header__cta::after {
		width: 34px;
		height: 34px;
		background-size: 15px 15px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.iqa-header *,
	.iqa-header *::before,
	.iqa-header *::after {
		transition-duration: 0.01ms !important;
		transition-delay: 0s !important;
	}
}