/**
 * Global site header and navigation.
 */

:root {
	--bv-header-height: 4.5rem;
	--bv-admin-bar-offset: 0px;
}

body.admin-bar {
	--bv-admin-bar-offset: 46px;
}

body.bv-navigation-open {
	overflow: hidden;
}

.site-header {
	position: sticky;
	top: var(--bv-admin-bar-offset);
	z-index: 2000;
	min-height: var(--bv-header-height);
	border-bottom: var(--bv-border-width) solid transparent;
	background: var(--bv-bg);
	transition:
		background-color var(--bv-motion-normal) var(--bv-easing-standard),
		border-color var(--bv-motion-normal) var(--bv-easing-standard);
}

@supports (background: color-mix(in srgb, black 50%, transparent)) {
	.site-header.is-scrolled,
	.site-header.is-open {
		background: color-mix(in srgb, var(--bv-surface) 92%, transparent);
	}
}

@supports (backdrop-filter: blur(1rem)) {
	.site-header.is-scrolled:not(.is-open) {
		backdrop-filter: blur(1rem);
	}
}

.site-header.is-open {
	background: var(--bv-surface);
	backdrop-filter: none;
}

.site-header.is-scrolled,
.site-header.is-open {
	border-bottom-color: var(--bv-border);
}

.site-header__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	min-height: var(--bv-header-height);
	column-gap: var(--bv-space-4);
}

.site-header__wordmark,
.site-header__wordmark:visited {
	position: relative;
	z-index: 2;
	width: fit-content;
	color: var(--bv-text);
	font-size: var(--bv-type-body-sm);
	font-weight: var(--bv-font-weight-bold);
	letter-spacing: 0.12em;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
}

.site-header__wordmark:hover,
.site-header__wordmark:focus-visible {
	color: var(--bv-accent);
	text-decoration: none;
}

.site-header__toggle {
	display: none;
	align-items: center;
	gap: var(--bv-space-3);
	min-height: 2.75rem;
	padding: var(--bv-space-2) var(--bv-space-3);
	border: var(--bv-border-width) solid var(--bv-border);
	border-radius: var(--bv-radius-small);
	background: var(--bv-surface);
	color: var(--bv-text);
	font-size: var(--bv-type-body-sm);
	font-weight: var(--bv-font-weight-medium);
	line-height: 1;
	cursor: pointer;
}

.navigation-ready .site-header__toggle {
	display: inline-flex;
}

.site-header__toggle:hover,
.site-header__toggle:focus-visible,
.site-header__toggle[aria-expanded="true"] {
	border-color: var(--bv-accent);
	color: var(--bv-accent);
}

.site-header__toggle-icon {
	display: grid;
	gap: 0.3rem;
	width: 1.125rem;
}

.site-header__toggle-icon span {
	display: block;
	width: 100%;
	height: 1px;
	background: currentcolor;
	transform-origin: center;
	transition: transform var(--bv-motion-fast) var(--bv-easing-standard);
}

.site-header.is-open .site-header__toggle-icon span:first-child {
	transform: translateY(0.2rem) rotate(45deg);
}

.site-header.is-open .site-header__toggle-icon span:last-child {
	transform: translateY(-0.2rem) rotate(-45deg);
}

.site-header__panel {
	grid-column: 1 / -1;
	padding-block: var(--bv-space-4) var(--bv-space-6);
}

.navigation-ready .site-header__panel {
	position: fixed;
	top: calc(var(--bv-admin-bar-offset) + var(--bv-header-height));
	right: 0;
	bottom: auto;
	left: 0;
	z-index: 1990;
	display: flex;
	flex-direction: column;
	gap: var(--bv-space-8);
	width: 100%;
	max-width: 100%;
	height: calc(100vh - var(--bv-admin-bar-offset) - var(--bv-header-height));
	height: calc(100dvh - var(--bv-admin-bar-offset) - var(--bv-header-height));
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: clamp(var(--bv-space-8), 8vw, var(--bv-space-16)) var(--bv-container-padding);
	padding-bottom: max(var(--bv-space-8), env(safe-area-inset-bottom));
	background-color: var(--bv-surface);
	background-image: none;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-0.5rem);
	-webkit-overflow-scrolling: touch;
	transition:
		opacity var(--bv-motion-normal) var(--bv-easing-standard),
		transform var(--bv-motion-normal) var(--bv-easing-standard),
		visibility var(--bv-motion-normal) step-end;
}

.site-header.is-open .site-header__panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition-timing-function: var(--bv-easing-emphasized), var(--bv-easing-emphasized), step-start;
}

.site-header__panel[hidden] {
	display: none;
}

.site-header .main-navigation {
	display: block;
	width: auto;
}

.site-header .main-navigation ul,
.site-header__menu {
	display: flex;
	flex-direction: column;
	gap: var(--bv-space-2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-header .main-navigation li {
	position: relative;
}

.site-header .main-navigation a,
.site-header .main-navigation a:visited {
	display: flex;
	align-items: center;
	width: 100%;
	min-height: 2.75rem;
	padding-block: var(--bv-space-3);
	color: var(--bv-text-secondary);
	font-size: clamp(1.5rem, 7vw, 2.5rem);
	font-weight: var(--bv-font-weight-medium);
	line-height: 1.2;
	text-decoration: underline;
	text-decoration-color: transparent;
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.24em;
}

.site-header .main-navigation a:hover,
.site-header .main-navigation a:focus-visible,
.site-header .main-navigation .current-menu-item > a,
.site-header .main-navigation .current-menu-ancestor > a {
	color: var(--bv-text);
	text-decoration-color: var(--bv-accent);
}

.site-header .main-navigation ul ul {
	position: static;
	display: flex;
	width: auto;
	padding-inline-start: var(--bv-space-4);
	box-shadow: none;
}

.site-header .main-navigation ul ul a {
	width: auto;
	font-size: var(--bv-type-body-lg);
}

.site-header__cta {
	align-self: stretch;
	margin-top: auto;
}

@media (min-width: 48.9375rem) {
	body.admin-bar {
		--bv-admin-bar-offset: 32px;
	}
}

@media (min-width: 60rem) {
	:root {
		--bv-header-height: 4.75rem;
	}

	body.bv-navigation-open {
		overflow: visible;
	}

	.site-header__inner {
		grid-template-columns: minmax(8rem, 1fr) auto;
		column-gap: clamp(var(--bv-space-6), 3vw, var(--bv-space-12));
	}

	.navigation-ready .site-header__toggle,
	.site-header__toggle {
		display: none;
	}

	.navigation-ready .site-header__panel,
	.site-header__panel {
		position: static;
		grid-column: 2;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: flex-end;
		flex-wrap: wrap;
		gap: clamp(var(--bv-space-4), 2vw, var(--bv-space-8));
		z-index: auto;
		width: auto;
		max-width: none;
		height: auto;
		min-height: 0;
		overflow: visible;
		padding: 0;
		background: transparent;
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: none;
	}

	.site-header__panel[hidden] {
		display: flex;
	}

	.site-header .main-navigation ul,
	.site-header__menu {
		flex-direction: row;
		align-items: center;
		justify-content: flex-end;
		flex-wrap: wrap;
		gap: clamp(var(--bv-space-3), 1.4vw, var(--bv-space-6));
	}

	.site-header .main-navigation a,
	.site-header .main-navigation a:visited {
		padding-block: var(--bv-space-3);
		font-size: var(--bv-type-body-sm);
	}

	.site-header .main-navigation ul ul {
		position: absolute;
		top: 100%;
		left: 0;
		display: none;
		min-width: 13rem;
		padding: var(--bv-space-3);
		border: var(--bv-border-width) solid var(--bv-border);
		border-radius: var(--bv-radius-default);
		background: var(--bv-surface-elevated);
	}

	.site-header .main-navigation li:hover > ul,
	.site-header .main-navigation li:focus-within > ul,
	.site-header .main-navigation li.focus > ul {
		display: flex;
		left: 0;
	}

	.site-header .main-navigation ul ul a {
		width: 100%;
		font-size: var(--bv-type-body-sm);
	}

	.site-header__cta {
		align-self: center;
		width: auto;
		margin-top: 0;
		min-height: 2.5rem;
		padding-inline: var(--bv-space-4);
		white-space: nowrap;
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-header,
	.site-header__panel,
	.site-header__toggle-icon span {
		transition: none;
	}
}
