/* Info Grove site header: sticky bar, primary menu, Customers mega panel, mobile menu.
   Mobile first; the desktop layout starts at 1024px (keep in sync with assets/js/nav.js).
   Colour-only hovers, no shadows (the buttons lift 2px, base.css). */

.ig-site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--wp--preset--color--white);
	box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06), 0 4px 12px -8px rgba(15, 23, 42, 0.08);
}
.admin-bar .ig-site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .ig-site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .ig-site-header { top: 0; } }

.ig-site-header__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 64px;
}
.ig-site-header__logo {
	display: inline-flex;
	flex-shrink: 0;
	line-height: 0;
}
.ig-site-header__logo img {
	display: block;
	width: auto;
	max-width: none;
	height: 36px;
}

/* ----- Burger (below 1024px) ----- */
.ig-nav__burger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: none;
	cursor: pointer;
}
.ig-nav__burger-bars,
.ig-nav__burger-bars::before,
.ig-nav__burger-bars::after {
	display: block;
	width: 22px;
	height: 2px;
	border-radius: 1px;
	background: var(--wp--preset--color--navy);
}
.ig-nav__burger-bars { position: relative; }
.ig-nav__burger-bars::before,
.ig-nav__burger-bars::after { content: ""; position: absolute; left: 0; }
.ig-nav__burger-bars::before { top: -7px; }
.ig-nav__burger-bars::after { top: 7px; }
.ig-nav__burger[aria-expanded="true"] .ig-nav__burger-bars { background: transparent; }
.ig-nav__burger[aria-expanded="true"] .ig-nav__burger-bars::before { top: 0; transform: rotate(45deg); }
.ig-nav__burger[aria-expanded="true"] .ig-nav__burger-bars::after { top: 0; transform: rotate(-45deg); }

/* ----- Menu panel: full width under the header, accordion submenus ----- */
.ig-nav {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	max-height: calc(100vh - 64px);
	max-height: calc(100dvh - 64px); /* the visible height when mobile browser bars show */
	padding: 8px 16px 20px;
	overflow-y: auto;
	border-top: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--white);
}
.ig-site-header.is-nav-open .ig-nav { display: block; }

.ig-nav__list {
	margin: 0;
	padding: 0;
	list-style: none;
}
.ig-nav__item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
}
.ig-nav__link,
.ig-nav__toggle--label {
	flex: 1;
	padding: 14px 0;
	border: 0;
	background: none;
	color: var(--wp--custom--color--text);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}
.ig-nav__link:hover,
.ig-nav__toggle--label:hover,
.ig-nav__toggle:hover { color: var(--wp--preset--color--blue); }
.is-current > .ig-nav__link,
.is-current > .ig-nav__toggle--label { color: var(--wp--preset--color--blue); }

/* Chevron toggle (the label variant draws the chevron after its text) */
.ig-nav__toggle {
	position: relative;
	border: 0;
	background: none;
	cursor: pointer;
}
.ig-nav__toggle:not(.ig-nav__toggle--label) {
	width: 44px;
	height: 44px;
	padding: 0;
	color: var(--wp--preset--color--muted);
}
.ig-nav__toggle::after {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-left: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
}
.ig-nav__toggle:not(.ig-nav__toggle--label)::after {
	position: absolute;
	top: 50%;
	left: 50%;
	margin: -4px 0 0 -4px;
}
.ig-nav__toggle[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }
.ig-nav__toggle:not(.ig-nav__toggle--label)[aria-expanded="true"]::after { transform: translateY(4px) rotate(-135deg); }
.ig-nav__toggle--label::after { margin-left: 8px; }

/* Dropdown (ordinary) and mega panel children, as mobile accordions */
.ig-nav__sub,
div.ig-mega {
	flex-basis: 100%;
	margin: 0;
	padding: 0 0 8px 12px;
	list-style: none;
}
.ig-nav__sub[hidden],
div.ig-mega[hidden] { display: none; }
.ig-nav__subitem { margin: 0; }
.ig-nav__sublink,
.ig-mega__link {
	display: block;
	padding: 10px 12px;
	border-radius: 8px;
	color: var(--wp--custom--color--text);
	font-size: 14px;
	text-decoration: none;
}
.ig-nav__sublink:hover,
.ig-mega__link:hover { background: var(--wp--preset--color--grey); }
.ig-mega__title {
	display: block;
	color: var(--wp--preset--color--navy);
	font-size: 14px;
	font-weight: 700;
}
.ig-mega__desc {
	display: block;
	margin-top: 2px;
	color: var(--wp--preset--color--muted);
	font-size: 12.5px;
	line-height: 1.5;
}

.ig-nav__cta {
	display: flex;
	width: 100%;
	margin-top: 16px;
	box-sizing: border-box;
}
.ig-nav__cta + .ig-nav__cta { margin-top: 10px; }

/* Search form (searchform.php): header search, burger menu, and the blog, search and 404 headings. Each place
   sets only its width. */
.ig-searchform {
	display: flex;
	gap: 6px;
	padding: 6px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 8px;
	background: var(--wp--preset--color--white);
}
.ig-searchform label { flex: 1; min-width: 0; }
.ig-searchform input[type="search"] {
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	min-height: 42px;
	padding: 10px 12px;
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--navy);
	font: inherit;
	font-size: 16px; /* 16px or more: iOS zooms the page into a field with smaller text. */
}
.ig-searchform input[type="search"]::placeholder { color: var(--wp--preset--color--muted); }
/* Focus: the site's 2px blue ring goes round the whole rounded box, not the square field inside it. */
.ig-searchform input[type="search"]:focus { outline: none; }
.ig-searchform:has(input[type="search"]:focus) {
	border-color: var(--wp--preset--color--blue);
	outline: 2px solid var(--wp--preset--color--blue);
	outline-offset: 2px;
}
.ig-searchform button {
	flex: none;
	padding: 10px 18px;
	border: 0;
	border-radius: 4px;
	background: var(--wp--preset--color--red);
	color: var(--wp--preset--color--white);
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}
.ig-searchform button:hover { background: var(--wp--custom--color--red-dark); transform: translateY(-2px); }
/* As the site's other buttons (base.css): a 2px lift; the focus ring fades in. */
.ig-searchform { transition: border-color 0.2s ease, outline-color 0.2s ease; }
.ig-searchform button { transition: transform 0.2s ease, background-color 0.2s ease; }
@media (prefers-reduced-motion: reduce) {
	.ig-searchform,
	.ig-searchform button { transition: none; }
}


/* ----- Header search ----- */
/* Below 1024px the form sits at the top of the burger menu; from 1024px the magnifier opens it under the bar. */
.ig-nav__search { padding: 8px 0 12px; }
.ig-site-search__toggle { display: none; }
.ig-site-search { display: none; }

/* ----- Desktop ----- */
@media (min-width: 1024px) {
	.ig-site-header__bar { gap: 28px; min-height: 68px; }
	.ig-site-header__logo img { height: 44px; }
	.ig-nav__burger { display: none; }

	.ig-nav {
		position: static;
		display: flex;
		flex: 1;
		align-items: center;
		align-self: stretch;
		max-height: none;
		padding: 0;
		overflow: visible;
		border-top: 0;
		background: none;
	}
	.ig-nav__list {
		display: flex;
		align-self: stretch;
		gap: 24px;
		margin-left: auto;
	}
	.ig-nav__item {
		position: relative;
		flex-wrap: nowrap;
		border-bottom: 0;
	}
	/* The mega panel positions against the header, so its item must not be the containing block */
	.ig-nav__item--mega { position: static; }

	.ig-nav__link,
	.ig-nav__toggle--label {
		flex: none;
		padding: 8px 0;
		font-size: 14px;
	}
	.ig-nav__toggle:not(.ig-nav__toggle--label) { width: 24px; height: 24px; }
	.ig-nav__toggle:not(.ig-nav__toggle--label)::after { margin: -4px 0 0 -4px; }

	.ig-nav__sub {
		position: absolute;
		top: 100%;
		left: 0;
		width: 320px;
		padding: 8px;
		border: 1px solid var(--wp--preset--color--border);
		border-top: 0;
		border-radius: 0 0 8px 8px;
		background: var(--wp--preset--color--white);
	}
	div.ig-mega {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		display: flex;
		gap: 24px;
		padding: 24px max(16px, calc((100% - 1222px) / 2 + 16px));
		border-top: 1px solid var(--wp--preset--color--border);
		background: var(--wp--preset--color--white);
		box-shadow: 0 18px 30px -18px rgba(15, 23, 42, 0.25);
	}
	div.ig-mega[hidden] { display: none; }
	/* Any number of audience links share the row. */
	div.ig-mega > .ig-mega__link { flex: 1 1 0; min-width: 0; }
	.ig-mega__link { padding: 12px; }

	.ig-nav__search { display: none; }
	.ig-site-search__toggle {
		display: inline-flex;
		flex: none;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		margin-left: 16px;
		border-radius: 4px;
		color: var(--wp--preset--color--navy);
	}
	.ig-site-search__toggle {
		position: relative;
		transition: color 0.2s ease;
	}
	.ig-site-search__toggle:hover,
	.ig-site-search__toggle[aria-expanded="true"] { color: var(--wp--preset--color--blue); }
	/* The magnifier turns into a close cross while the panel is open. */
	.ig-site-search__icon {
		position: absolute;
		top: 50%;
		left: 50%;
		margin: -10px 0 0 -10px;
		transition: opacity 0.2s ease, transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
	}
	.ig-site-search__icon--close { opacity: 0; transform: rotate(-90deg) scale(0.6); }
	.ig-site-search__toggle[aria-expanded="true"] .ig-site-search__icon--open { opacity: 0; transform: rotate(90deg) scale(0.6); }
	.ig-site-search__toggle[aria-expanded="true"] .ig-site-search__icon--close { opacity: 1; transform: none; }
	.ig-site-search {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		display: block;
		padding: 20px 0;
		border-top: 1px solid var(--wp--preset--color--border);
		background: var(--wp--preset--color--white);
		box-shadow: 0 18px 30px -18px rgba(15, 23, 42, 0.25);
	}
	/* Slides down and fades in with the drawers' easing (drawers.css), and back up on close. `hidden` still marks
	   it closed: visibility keeps it out of reach of the mouse, the Tab key and screen readers once the fade ends. */
	.ig-site-search {
		transition: opacity 0.2s ease, transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0s linear 0s;
	}
	.ig-site-search[hidden] {
		display: block;
		visibility: hidden;
		opacity: 0;
		transform: translateY(-12px);
		pointer-events: none;
		transition: opacity 0.2s ease, transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0s linear 0.28s;
	}
	.ig-site-search .ig-searchform { max-width: 720px; margin-inline: auto; }

	.ig-nav__cta {
		display: inline-flex;
		width: auto;
		margin: 0 0 0 28px;
		padding: 10px 18px;
		flex-shrink: 0;
	}
	.ig-nav__cta + .ig-nav__cta { margin: 0 0 0 10px; }
}

/* 1024–1199px: the menu and both buttons share one row, so the spacing tightens. */
@media (min-width: 1024px) and (max-width: 1199px) {
	.ig-nav__list { gap: 16px; }
	.ig-nav__cta { margin-left: 20px; padding-inline: 14px; }
	.ig-site-search__toggle { margin-left: 8px; }
}

@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
	.ig-site-search,
	.ig-site-search[hidden],
	.ig-site-search__icon { transition: none; }
}
