/*
 * IRMI Foundation global header.
 * Everything is scoped to #irmi-hdr. Colours and fonts come from the theme's global
 * variables, so Appearance > Customize > IRMI Foundation > Global colors / Global typography apply here too.
 */

#irmi-hdr {
	--blue: var(--irmi-blue);
	--teal: var(--irmi-cyan);
	--ink: var(--irmi-blue-deep);
	--mist: var(--irmi-mist);
	--white: var(--irmi-white);
	--muted: var(--irmi-muted);
	--line: var(--irmi-line);
	--display: var(--irmi-display);
	--sans: var(--irmi-sans);
	--sm: 16px;
	--md: 24px;
	--r-sm: 4px;
	--r-md: 8px;
	--ease: cubic-bezier(.16, 1, .3, 1);
	--ease2: cubic-bezier(.65, 0, .35, 1);
	--hh: 84px;
	position: relative;
	max-width: none;
	min-height: 0;
	overflow: visible;
	background: none;
	color: var(--ink);
	font-family: var(--sans);
	font-size: 17px;
	line-height: 27px;
	text-align: left;
	-webkit-font-smoothing: antialiased;
}

/* Page content starts below the fixed header (removed by JS on pages that have a hero) */
.ih-hdr-spacer { display: block; height: 90px; }

#irmi-hdr *, #irmi-hdr *::before, #irmi-hdr *::after { box-sizing: border-box; }
#irmi-hdr a { color: var(--blue); text-decoration: none; box-shadow: none; }
#irmi-hdr img { display: block; width: 100%; height: 100%; object-fit: cover; border: 0; border-radius: 0; box-shadow: none; max-width: none; }
#irmi-hdr button, #irmi-hdr input { font: inherit; color: inherit; margin: 0; box-shadow: none; text-transform: none; letter-spacing: normal; min-height: 0; }
#irmi-hdr button { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 0; line-height: inherit; }
#irmi-hdr button:hover, #irmi-hdr button:focus { background: none; color: inherit; }
#irmi-hdr :focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
#irmi-hdr .ih-wrap { width: min(1240px, 100% - 32px); margin-inline: auto; }

/* ---------- Scroll progress bar ---------- */
#irmi-hdr .ih-progress { position: fixed; left: 0; top: 0; height: 3px; width: 100%; background: var(--teal); transform: scaleX(0); transform-origin: left; z-index: 1002; pointer-events: none; }

/* ---------- Bar ---------- */
#irmi-hdr .ih-header {
	position: fixed; left: 0; right: 0; top: 0; z-index: 1000;
	height: var(--hh);
	display: flex; align-items: center; justify-content: center;
	will-change: transform;
	transition: background .6s var(--ease), height .6s var(--ease), box-shadow .6s var(--ease), border-color .6s;
	border-bottom: 1px solid rgba(255, 255, 255, .14);
}
body.admin-bar #irmi-hdr .ih-header, body.admin-bar #irmi-hdr .ih-progress { top: 32px; }
@media (max-width: 782px) {
	body.admin-bar #irmi-hdr .ih-header, body.admin-bar #irmi-hdr .ih-progress { top: 46px; }
}
@media (max-width: 600px) {
	body.admin-bar #irmi-hdr .ih-header, body.admin-bar #irmi-hdr .ih-progress { top: 0; }
}
#irmi-hdr .ih-header.is-solid {
	--hh: 90px;
	background: var(--white);
	border-bottom-color: var(--line);
	box-shadow: 0 8px 28px color-mix(in srgb, var(--ink) 9%, transparent);
}
#irmi-hdr .ih-header.is-hidden { transform: translateY(-110%); }

/* logo | centred nav | search and burger */
#irmi-hdr .ih-header .ih-wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--md); margin: 0; }

/* ---------- Logo ---------- */
#irmi-hdr .ih-logo { position: relative; display: inline-flex; align-items: center; flex: none; justify-self: start; width: auto; height: auto; padding: 4px 0; border-radius: 10px; line-height: 1; }
#irmi-hdr .ih-logo img { position: static; display: block; width: auto; height: 50px; max-width: none; object-fit: contain; }
/* logo plate in menu state removed: white logo is used instead */

/* ---------- Desktop navigation ---------- */
#irmi-hdr .ih-nav { display: flex; align-items: center; gap: 4px; }
#irmi-hdr .ih-nav a {
	position: relative; padding: 10px 14px;
	font-family: var(--display); font-size: 13px; line-height: 20px; font-weight: 700;
	letter-spacing: .06em; text-transform: uppercase;
	color: var(--white); transition: color .4s;
}
#irmi-hdr .ih-nav a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; background: var(--teal); transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease); }
#irmi-hdr .ih-nav a:hover::after, #irmi-hdr .ih-nav a.is-current::after { transform: scaleX(1); transform-origin: left; }
#irmi-hdr .ih-header.is-solid .ih-nav a { color: var(--ink); }
#irmi-hdr .ih-header.is-solid .ih-nav a:hover { color: var(--blue); }

#irmi-hdr .ih-navitem { position: relative; display: flex; align-items: center; }
#irmi-hdr .ih-navitem.has-sub > a { padding-right: 26px; }
#irmi-hdr .ih-navitem.has-sub > a::before { content: ""; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-70%) rotate(45deg); transition: transform .4s var(--ease); }
#irmi-hdr .ih-navitem.has-sub:hover > a::before { transform: translateY(-30%) rotate(225deg); }

#irmi-hdr .ih-sub {
	position: absolute; left: 0; top: 100%; min-width: 230px; padding: 8px 0;
	background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--teal);
	border-radius: 0 0 var(--r-md) var(--r-md);
	opacity: 0; visibility: hidden; transform: translateY(10px);
	transition: opacity .35s var(--ease), transform .45s var(--ease), visibility 0s .35s;
}
#irmi-hdr .ih-navitem:hover > .ih-sub, #irmi-hdr .ih-navitem:focus-within > .ih-sub { opacity: 1; visibility: visible; transform: none; transition: opacity .35s var(--ease), transform .45s var(--ease), visibility 0s; }
#irmi-hdr .ih-nav .ih-sub a { display: block; padding: 10px 20px; color: var(--ink); font-size: 13px; letter-spacing: .04em; text-transform: none; font-weight: 600; }
#irmi-hdr .ih-nav .ih-sub a::after { display: none; }
#irmi-hdr .ih-nav .ih-sub a:hover, #irmi-hdr .ih-nav .ih-sub a.is-current { color: var(--blue); background: var(--mist); }

/* menu items with no link (a "#" custom link in Appearance > Menus) */
#irmi-hdr a.is-nolink { cursor: default; }
#irmi-hdr .ih-nav a.is-nolink:hover::after { transform: scaleX(0); }
#irmi-hdr .ih-header.is-solid .ih-nav a.is-nolink:hover { color: var(--ink); }

/* ---------- Search and burger ---------- */
#irmi-hdr .ih-hdr-cta { display: flex; align-items: center; justify-self: end; gap: 4px; }

#irmi-hdr .ih-search, #irmi-hdr .ih-searchgo {
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; padding: 0; margin: 0;
	background: none; border: 0; border-radius: 4px; box-shadow: none;
	cursor: pointer; color: var(--white); transition: color .4s;
}
#irmi-hdr .ih-search svg, #irmi-hdr .ih-searchgo svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#irmi-hdr .ih-search:hover, #irmi-hdr .ih-searchgo:hover { color: var(--teal); background: none; }
#irmi-hdr .ih-header.is-solid .ih-search { color: var(--ink); }
#irmi-hdr .ih-header.is-solid .ih-search:hover { color: var(--blue); }
#irmi-hdr .ih-header.is-menu .ih-search { color: var(--white); }
#irmi-hdr .ih-search.is-off { pointer-events: none; cursor: default; }

/* Search popup: a compact pill under the icon, not a full-width bar */
#irmi-hdr .ih-searchbar {
	position: fixed; z-index: 1003; top: calc(var(--hh, 84px) + 12px); left: auto; right: max(16px, calc((100% - 1240px) / 2));
	display: flex; align-items: center; gap: 6px;
	width: min(400px, calc(100% - 32px)); height: auto; padding: 7px 7px 7px 22px; margin: 0;
	background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
	border: 1px solid var(--line); border-radius: 100px;
	box-shadow: 0 18px 44px color-mix(in srgb, var(--ink) 14%, transparent);
	opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.98); transform-origin: top right;
	transition: opacity .3s var(--ease), transform .4s var(--ease), box-shadow .3s, border-color .3s, visibility 0s .3s;
}
#irmi-hdr .ih-header.is-search .ih-searchbar, #irmi-hdr .ih-searchbar.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .3s var(--ease), transform .4s var(--ease), box-shadow .3s, border-color .3s, visibility 0s; }
#irmi-hdr .ih-searchbar:focus-within { border-color: color-mix(in srgb, var(--teal) 55%, var(--line)); box-shadow: 0 18px 44px color-mix(in srgb, var(--ink) 14%, transparent), 0 0 0 4px color-mix(in srgb, var(--teal) 16%, transparent); }
#irmi-hdr .ih-searchbar input {
	flex: 1; min-width: 0; height: 44px; padding: 0; margin: 0;
	background: transparent; border: 0; border-radius: 0;
	box-shadow: none; outline: 0; color: var(--ink); font: 600 16px/1 var(--sans);
}
#irmi-hdr .ih-searchbar input::placeholder { color: var(--muted); opacity: 1; }
#irmi-hdr .ih-searchbar .ih-searchgo { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--white); transition: background .3s, transform .4s var(--ease); }
#irmi-hdr .ih-searchbar .ih-searchgo:hover { background: var(--blue); color: var(--white); transform: scale(1.06); }
#irmi-hdr .ih-searchbar .ih-searchgo svg { width: 20px; height: 20px; }

#irmi-hdr .ih-burger { display: none; width: 44px; height: 44px; position: relative; border-radius: var(--r-sm); }
#irmi-hdr .ih-burger span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--white); transition: transform .5s var(--ease), opacity .3s, background .4s; }
#irmi-hdr .ih-burger span:nth-child(1) { top: 15px; }
#irmi-hdr .ih-burger span:nth-child(2) { top: 21px; }
#irmi-hdr .ih-burger span:nth-child(3) { top: 27px; }
#irmi-hdr .ih-header.is-solid .ih-burger span { background: var(--ink); }
#irmi-hdr .ih-burger[aria-expanded="true"] span { background: var(--white); }
#irmi-hdr .ih-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
#irmi-hdr .ih-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
#irmi-hdr .ih-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
#irmi-hdr .ih-header.is-menu, #irmi-hdr .ih-header.is-menu.is-solid { background: transparent; border-bottom-color: transparent; box-shadow: none; }
#irmi-hdr .ih-header.is-menu .ih-burger span { background: var(--white); }

/* ---------- Mobile drawer ---------- */
#irmi-hdr .ih-drawer {
	position: fixed; inset: 0; z-index: 999;
	background: var(--ink); padding: 110px 24px 40px;
	display: flex; flex-direction: column; gap: var(--md);
	overflow-y: auto;
	clip-path: circle(0% at calc(100% - 38px) 42px);
	transition: clip-path .8s var(--ease2);
	visibility: hidden;
}
#irmi-hdr .ih-drawer.is-open { clip-path: circle(150% at calc(100% - 38px) 42px); visibility: visible; }
#irmi-hdr .ih-dnav { display: flex; flex-direction: column; gap: var(--md); }
#irmi-hdr .ih-drawer a { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 40px; color: var(--white); opacity: 0; transform: translateY(20px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
#irmi-hdr .ih-drawer.is-open a { opacity: 1; transform: none; }
#irmi-hdr .ih-drawer .ih-dsub { display: flex; flex-direction: column; gap: 12px; padding-left: var(--md); border-left: 2px solid var(--teal); margin-top: -8px; }
#irmi-hdr .ih-drawer .ih-dsub a { font-size: 20px; line-height: 28px; font-weight: 700; color: rgba(255, 255, 255, .85); }
#irmi-hdr .ih-drawer a.is-current { color: var(--teal); }

/* ---------- Entrance animation (only when JS is running) ---------- */
#irmi-hdr.ih-js .ih-header { opacity: 0; transform: translate3d(0, -100%, 0); }
#irmi-hdr.ih-js.ih-loaded .ih-header { opacity: 1; transform: none; animation: ihHdrIn 1.1s cubic-bezier(.22, 1, .36, 1) backwards; }
#irmi-hdr.ih-js.ih-loaded .ih-header :is(.ih-logo, .ih-nav > *, .ih-search, .ih-burger) { animation: ihHdrItem .9s cubic-bezier(.22, 1, .36, 1) backwards; animation-delay: calc(.35s + var(--i, 0) * 70ms); }
@keyframes ihHdrIn { from { opacity: 0; transform: translate3d(0, -100%, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }
@keyframes ihHdrItem { from { opacity: 0; transform: translate3d(0, -14px, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }
@media (prefers-reduced-motion: reduce) {
	#irmi-hdr *, #irmi-hdr *::before, #irmi-hdr *::after { transition-duration: .01s !important; animation: none !important; }
	#irmi-hdr.ih-js .ih-header { opacity: 1 !important; transform: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	#irmi-hdr .ih-nav { display: none; }
	#irmi-hdr .ih-burger { display: block; }
	#irmi-hdr .ih-header .ih-wrap { display: flex; justify-content: space-between; }
}
@media (max-width: 700px) {
	#irmi-hdr .ih-wrap { width: calc(100% - 32px); }
	#irmi-hdr .ih-logo img { height: 42px; }
}

/* Dropdown: no top border, sits a little lower */
#irmi-hdr .ih-sub { top: calc(100% + 12px); border-top: 1px solid var(--line); border-radius: var(--r-md); box-shadow: 0 14px 34px rgb(19 42 117 / 10%); }
#irmi-hdr .ih-sub::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }

/* Mobile menu open: swap to the white logo at the exact size and position of the header logo, no plate. */
#irmi-hdr .ih-logo { --ih-logo-h: 50px; }
#irmi-hdr .ih-logo img:not(.ih-logo-white) { transition: opacity .25s ease; }
#irmi-hdr .ih-logo img.ih-logo-white { position: absolute; top: 50%; left: calc(var(--ih-logo-h) * 0.0164); width: calc(var(--ih-logo-h) * 2.59); height: auto; transform: translateY(-50%); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
#irmi-hdr .ih-header.is-menu .ih-logo img:not(.ih-logo-white) { opacity: 0; }
#irmi-hdr .ih-header.is-menu .ih-logo img.ih-logo-white { opacity: 1; }
@media (max-width: 700px) { #irmi-hdr .ih-logo { --ih-logo-h: 42px; } }
