/* Site header */

.ibc-header {
	height: 88px;
	background: var(--ibc-accent);
	color: var(--ibc-white);
}

.ibc-header__container {
	display: flex;
	align-items: center;
	width: 100%;
	max-width: var(--ibc-container-max);
	height: 100%;
	margin: 0 auto;
	padding: 0 var(--ibc-container-padding);
}

.ibc-header__inner {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: var(--ibc-space-24);
	width: 100%;
	height: 100%;
}

.ibc-header__logo {
	display: inline-flex;
	flex-shrink: 0;
	overflow: hidden;
	line-height: 0;
}

.ibc-header__logo img {
	display: block;
	height: 34px;
	width: auto;
}

.ibc-header__logo-img--theme {
	/* Raster-in-SVG + invert can leave a 1px fringe; clip it. */
	filter: brightness(0) invert(1);
	clip-path: inset(1px 0);
	transform: translateZ(0);
}

.ibc-header__backdrop {
	display: none;
}

.ibc-header__toggle {
	display: none;
	position: relative;
	flex-shrink: 0;
	width: var(--ibc-space-48);
	height: var(--ibc-space-48);
	padding: 0;
	background: transparent;
	border: 0;
	cursor: pointer;
}

.ibc-header__toggle-bar {
	position: absolute;
	left: 50%;
	top: 50%;
	display: block;
	width: 22px;
	height: 2px;
	margin: 0;
	background: var(--ibc-white);
	border-radius: 1px;
	transform: translate(-50%, -50%);
	transition: transform 0.25s ease, opacity 0.2s ease;
}

.ibc-header__toggle-bar:nth-child(1) {
	transform: translate(-50%, calc(-50% - 7px));
}

.ibc-header__toggle-bar:nth-child(3) {
	transform: translate(-50%, calc(-50% + 7px));
}

.ibc-header__nav {
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	min-width: 0;
}

.ibc-header__menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: var(--ibc-space-8) var(--ibc-space-24);
	margin: 0;
	padding: 0;
	list-style: none;
}

.ibc-header__menu-item {
	position: relative;
}

.ibc-header__menu-link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: var(--ibc-space-8) 0;
	font: inherit;
	font-size: 18px;
	font-weight: 500;
	line-height: 1.2;
	color: #fff;
	text-decoration: none;
	white-space: nowrap;
	background: transparent;
	background-color: transparent;
	background-image: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
}

.ibc-header__menu-link:hover,
.ibc-header__menu-link:focus,
.ibc-header__menu-link:focus-visible,
.ibc-header__menu-link:active,
.ibc-header__menu-link:visited,
.ibc-header__menu-toggle:hover,
.ibc-header__menu-toggle:focus,
.ibc-header__menu-toggle:focus-visible,
.ibc-header__menu-toggle:active,
button.ibc-header__menu-link:hover,
button.ibc-header__menu-link:focus,
button.ibc-header__menu-link:focus-visible,
button.ibc-header__menu-link:active,
button.ibc-header__menu-toggle:hover,
button.ibc-header__menu-toggle:focus,
button.ibc-header__menu-toggle:focus-visible,
button.ibc-header__menu-toggle:active {
	color: #fff !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
}

.ibc-header__menu-link::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 2px;
	background: var(--ibc-white);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.25s ease;
}

.ibc-header__menu-item:hover > .ibc-header__menu-link::after,
.ibc-header__menu-item:focus-within > .ibc-header__menu-link::after,
.ibc-header__menu-item.is-open > .ibc-header__menu-link::after,
.ibc-header__menu .current-menu-item > .ibc-header__menu-link::after,
.ibc-header__menu .current_page_item > .ibc-header__menu-link::after {
	transform: scaleX(1);
}

.ibc-header__menu-chevron {
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-top: -2px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s ease;
}

.ibc-header__menu-item.is-open > .ibc-header__menu-toggle .ibc-header__menu-chevron,
.ibc-header__menu-item:hover > .ibc-header__menu-toggle .ibc-header__menu-chevron,
.ibc-header__menu-item:focus-within > .ibc-header__menu-toggle .ibc-header__menu-chevron {
	margin-top: 2px;
	transform: rotate(225deg);
}

.ibc-header__submenu {
	position: absolute;
	top: calc(100% + 4px);
	left: 50%;
	z-index: 30;
	display: flex;
	flex-direction: column;
	gap: 0;
	min-width: 220px;
	margin: 0;
	padding: var(--ibc-space-8) 0;
	list-style: none;
	background: var(--ibc-white);
	border-radius: 10px;
	box-shadow: 0 12px 32px rgba(var(--ibc-accent-rgb), 0.18);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translate(-50%, 6px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.ibc-header__menu-item:hover > .ibc-header__submenu,
.ibc-header__menu-item:focus-within > .ibc-header__submenu,
.ibc-header__menu-item.is-open > .ibc-header__submenu {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translate(-50%, 0);
}

.ibc-header__submenu-link {
	display: block;
	padding: 10px var(--ibc-space-16);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--ibc-accent);
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.15s ease, color 0.15s ease;
}

.ibc-header__submenu-link:hover,
.ibc-header__submenu-link:focus-visible {
	background: rgba(var(--ibc-accent-rgb), 0.06);
	color: var(--ibc-accent);
}

.ibc-header__actions {
	display: flex;
	flex-shrink: 0;
	flex-direction: row;
	align-items: center;
	gap: var(--ibc-space-24);
	margin-left: auto;
}

.ibc-header__lang {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	gap: var(--ibc-space-8);
	font-size: 16px;
	font-weight: 500;
	line-height: 1;
}

.ibc-header__lang--drawer {
	display: none;
}

.ibc-header__lang-link {
	font-size: 16px;
	color: rgba(255, 255, 255, 0.72);
	text-decoration: none;
	transition: color 0.2s ease;
}

.ibc-header__lang-link:hover,
.ibc-header__lang-link.is-active {
	color: var(--ibc-white);
	font-weight: 700;
}

.ibc-header__lang-sep {
	color: rgba(255, 255, 255, 0.45);
}

.ibc-header.is-open .ibc-header__toggle-bar:nth-child(1) {
	transform: translate(-50%, -50%) rotate(45deg);
}

.ibc-header.is-open .ibc-header__toggle-bar:nth-child(2) {
	opacity: 0;
}

.ibc-header.is-open .ibc-header__toggle-bar:nth-child(3) {
	transform: translate(-50%, -50%) rotate(-45deg);
}

@media (max-width: 1368px) {
	.ibc-header .ibc-btn {
		padding-left: var(--ibc-space-16);
		padding-right: var(--ibc-space-16);
	}

	/* Theme logo: show mark only (crop wordmark). */
	.ibc-header__logo:not(.ibc-header__logo--custom) {
		width: 34px;
		overflow: hidden;
	}

	.ibc-header__logo:not(.ibc-header__logo--custom) .ibc-header__logo-img {
		width: 250px;
		max-width: none;
		height: 34px;
	}
}

@media (max-width: 1280px) {
	.ibc-header__menu {
		gap: var(--ibc-space-8) var(--ibc-space-16);
	}

	.ibc-header__menu-link {
		font-size: 16px;
	}
}

@media (max-width: 1180px) {
	.ibc-header__menu {
		gap: var(--ibc-space-8) var(--ibc-space-12);
	}
}

@media (max-width: 1024px) {
	:root {
		--ibc-header-height: 64px;
		--ibc-header-offset: 0px;
		--ibc-drawer-top: 64px;
	}

	body.admin-bar {
		--ibc-header-offset: 46px;
		--ibc-drawer-top: 110px;
	}

	body.ibc-nav-open {
		overflow: hidden;
	}

	.ibc-header {
		position: sticky;
		top: var(--ibc-header-offset);
		z-index: 200;
		height: var(--ibc-header-height);
		min-height: var(--ibc-header-height);
		background: var(--ibc-accent);
	}

	.ibc-header.is-open {
		/* Kept in place via inline fixed top from header.js */
		z-index: 220;
	}

	.ibc-header__spacer {
		display: block;
		width: 100%;
		flex-shrink: 0;
		pointer-events: none;
	}

	.ibc-header__container {
		position: relative;
		z-index: 3;
		height: 100%;
		min-height: 0;
		padding: 0 var(--ibc-container-padding-sm);
		background: var(--ibc-accent);
	}

	.ibc-header__inner {
		position: relative;
		z-index: 3;
		gap: var(--ibc-space-16);
		height: 100%;
		min-height: 0;
	}

	/* Full wordmark on mobile — shrink when space is tight. */
	.ibc-header__logo {
		flex: 1 1 auto;
		min-width: 88px;
	}

	.ibc-header__logo:not(.ibc-header__logo--custom) {
		width: auto;
		max-width: 206px;
		overflow: hidden;
	}

	.ibc-header__logo:not(.ibc-header__logo--custom) .ibc-header__logo-img {
		display: block;
		width: 100%;
		max-width: 206px;
		height: auto;
		max-height: 28px;
		object-fit: contain;
		object-position: left center;
	}

	.ibc-header__actions,
	.ibc-header__toggle {
		flex-shrink: 0;
	}

	.ibc-header__toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		z-index: 4;
		width: 34px;
		height: 34px;
		overflow: visible;
	}

	.ibc-header__backdrop {
		display: block;
		position: fixed;
		top: var(--ibc-drawer-top);
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 1;
		padding: 0;
		border: 0;
		background: rgba(7, 19, 87, 0.45);
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		cursor: pointer;
		transition: opacity 0.3s ease, visibility 0.3s ease;
	}

	.ibc-header.is-open .ibc-header__backdrop {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
	}

	.ibc-header__nav {
		position: fixed;
		top: var(--ibc-drawer-top);
		right: 0;
		bottom: 0;
		z-index: 2;
		display: flex;
		flex: none;
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-start;
		width: min(360px, 86vw);
		height: auto;
		margin: 0;
		padding: var(--ibc-space-16) var(--ibc-container-padding-sm) var(--ibc-space-32);
		overflow-x: hidden;
		overflow-y: auto;
		background: var(--ibc-accent);
		box-shadow: -16px 0 40px rgba(7, 19, 87, 0.28);
		transform: translateX(100%);
		visibility: hidden;
		pointer-events: none;
		transition: transform 0.35s ease, visibility 0.35s ease;
	}

	.ibc-header.is-open .ibc-header__nav {
		transform: translateX(0);
		visibility: visible;
		pointer-events: auto;
	}

	.ibc-header__menu {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--ibc-space-4);
		width: 100%;
	}

	.ibc-header__menu-item {
		width: 100%;
	}

	.ibc-header__menu-link {
		padding: var(--ibc-space-12) 0;
		background: transparent;
		-webkit-tap-highlight-color: transparent;
	}

	.ibc-header__menu-link:hover,
	.ibc-header__menu-link:focus,
	.ibc-header__menu-link:focus-visible,
	.ibc-header__menu-link:active,
	.ibc-header__menu-toggle:hover,
	.ibc-header__menu-toggle:focus,
	.ibc-header__menu-toggle:focus-visible,
	.ibc-header__menu-toggle:active {
		background: transparent;
	}

	.ibc-header__menu-item--has-children > .ibc-header__menu-toggle {
		width: 100%;
		justify-content: space-between;
	}

	.ibc-header__submenu {
		position: static;
		left: auto;
		top: auto;
		display: none;
		min-width: 0;
		width: 100%;
		margin: 0 0 var(--ibc-space-8);
		padding: 0 0 0 var(--ibc-space-12);
		background: transparent;
		border-radius: 0;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: none;
		transition: none;
	}

	.ibc-header__menu-item:hover > .ibc-header__submenu,
	.ibc-header__menu-item:focus-within > .ibc-header__submenu {
		display: none;
		transform: none;
	}

	.ibc-header__menu-item.is-open:hover > .ibc-header__submenu,
	.ibc-header__menu-item.is-open:focus-within > .ibc-header__submenu,
	.ibc-header__menu-item.is-open > .ibc-header__submenu {
		display: flex;
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: none;
	}

	.ibc-header__submenu-link {
		padding: var(--ibc-space-8) 0;
		font-size: 16px;
		color: rgba(255, 255, 255, 0.82);
	}

	.ibc-header__submenu-link:hover,
	.ibc-header__submenu-link:focus-visible {
		background: transparent;
		color: var(--ibc-white);
	}

	.ibc-header__actions {
		gap: var(--ibc-space-16);
		margin-left: auto;
	}

	.ibc-header__lang--bar {
		display: none;
	}

	.ibc-header__lang--drawer {
		display: inline-flex;
		margin-top: var(--ibc-space-24);
		padding-top: var(--ibc-space-16);
		border-top: 1px solid rgba(255, 255, 255, 0.16);
		font-size: 18px;
	}

	.ibc-header__lang--drawer .ibc-header__lang-link {
		font-size: 18px;
		padding: var(--ibc-space-12) 0;
	}

	.ibc-header .ibc-btn {
		box-sizing: border-box;
		width: auto;
		height: 34px;
		padding: 0 var(--ibc-space-12);
		font-size: 13px;
	}
}

@media (min-width: 783px) and (max-width: 1024px) {
	body.admin-bar {
		--ibc-header-offset: 32px;
		--ibc-drawer-top: 96px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ibc-header__toggle-bar,
	.ibc-header__backdrop,
	.ibc-header__nav {
		transition: none;
	}
}

@media (max-width: 640px) {
	.ibc-header__inner {
		gap: var(--ibc-space-12);
	}

	.ibc-header__actions {
		gap: var(--ibc-space-8);
	}

	.ibc-header__logo:not(.ibc-header__logo--custom) {
		max-width: 160px;
	}

	.ibc-header .ibc-btn {
		height: 34px;
		padding: 0 var(--ibc-space-12);
		font-size: 13px;
	}
}

@media (max-width: 400px) {
	.ibc-header__logo:not(.ibc-header__logo--custom) {
		max-width: 120px;
	}

	.ibc-header__logo:not(.ibc-header__logo--custom) .ibc-header__logo-img {
		max-height: 24px;
	}
}
