/* ==========================================================================
   Ovation — site header, search panel and off-canvas drawer
   Built in PHP + CSS, never in Elementor.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Announcement bar (optional, above the header)
   -------------------------------------------------------------------------- */
.o-announce {
	background-color: var(--o-orange);
	color: var(--o-white);
}

.o-announce__inner {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	min-height: 44px;
	padding-block: 0.5rem;
	text-align: center;
}

.o-announce__text {
	margin: 0;
	font-size: var(--o-fs-small);
	font-weight: var(--o-fw-medium);
}

.o-announce__link {
	flex: 0 0 auto;
	font-family: var(--o-font-ui);
	font-size: var(--o-fs-small);
	font-weight: var(--o-fw-semibold);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-underline-offset: 0.25em;
}

.o-announce__close {
	position: absolute;
	right: var(--o-gutter);
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
}

.o-announce__close svg {
	width: 14px;
	height: 14px;
}

/* --------------------------------------------------------------------------
   Header bar
   -------------------------------------------------------------------------- */
.o-header {
	/*
	 * Fluid from the comp's 1920 down to 1200, where the drawer takes over,
	 * so the two sides shrink towards the logo rather than into it.
	 */
	--o-header-gap: clamp(8px, 3.3333vw - 32px, 32px);          /*  8 -> 32 */
	--o-header-menu-size: clamp(14px, 0.4167vw + 9px, 17px);    /* 14 -> 17 */
	--o-header-logo-height: clamp(50px, 2.5vw + 20px, 68px);    /* 50 -> 68 */

	position: relative;
	z-index: var(--o-z-header);
	background-color: var(--o-header-bg);
	box-shadow: var(--o-header-shadow);
	color: var(--o-white);
}

.o-header--sticky {
	position: sticky;
	top: 0;
}

/* Overlays the hero instead of sitting above it. */
.o-header--transparent {
	position: absolute;
	inset: 0 0 auto;
	background-color: transparent;
	box-shadow: none;
	transition: background-color var(--o-transition), box-shadow var(--o-transition);
}

.o-header--transparent.is-scrolled {
	position: fixed;
	background-color: var(--o-header-bg);
	box-shadow: var(--o-header-shadow);
}

/*
 * 1fr auto 1fr keeps the logo exactly centred in the viewport regardless of how
 * different the two menu clusters are in width — matching the comp, where the
 * left cluster is far wider than the right.
 */
.o-header__inner {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: var(--o-space-md);
	min-height: var(--o-header-height);
	transition: min-height var(--o-transition);
}

.o-header__cluster {
	display: flex;
	align-items: center;
	gap: var(--o-header-gap);
	min-width: 0;
}

.o-header__cluster--start {
	justify-content: flex-start;

	/*
	 * The icon buttons sit closer together than the menu does: each is a 44px
	 * touch target around a smaller glyph, so half the gap still reads as a
	 * full one. The menu keeps the full gap from the last icon.
	 */
	gap: calc(var(--o-header-gap) / 2);
}

.o-header__nav--start {
	margin-inline-start: calc(var(--o-header-gap) / 2);
}

.o-header__cluster--end {
	justify-content: flex-end;
}

.o-header__logo {
	justify-self: center;
	color: var(--o-white);
}

.o-header__logo svg {
	height: min(var(--o-logo-height), var(--o-header-logo-height));
	transition: height var(--o-transition);
}

/* Compact state once the page has scrolled past the hero. */
.o-header.is-compact .o-header__inner {
	min-height: var(--o-header-height-compact);
}

.o-header.is-compact .o-header__logo svg {
	height: var(--o-logo-height-compact);
}

/* --------------------------------------------------------------------------
   Header controls
   Icon sizes are taken verbatim from the comp rather than normalised to a
   single size — the hamburger is deliberately much wider than the magnifier.
   -------------------------------------------------------------------------- */
.o-header__burger,
.o-header__search-toggle,
.o-header__webcam {
	width: auto;
	height: auto;
	min-width: 44px;   /* Touch target, independent of the glyph size. */
	min-height: 44px;
	flex: 0 0 auto;
}

.o-header__burger-icon {
	width: 48.61px;
	height: 35px;
	max-height: none;
}

.o-header__webcam-icon {
	width: 34px;
	height: 34px;
	max-height: none;
}

.o-header__search-icon {
	width: 27px;
	height: 27px;
	max-height: none;
}

.o-header__webcam {
	position: relative;
	gap: 0.375rem;
	text-decoration: none;
}

.o-header__weather {
	display: inline-flex;
	align-items: baseline;
	padding: 0.25rem 0.5rem;
	border-radius: var(--o-radius-sm);
	background-color: var(--o-teal);
	font-family: var(--o-font-body);
	line-height: 1;
	color: var(--o-white);
}

.o-header__weather-temp {
	font-size: var(--o-fs-body-lg);
	letter-spacing: -0.015em;
}

.o-header__weather-unit {
	font-size: var(--o-fs-small);
	letter-spacing: -0.015em;
}

.o-header__cta {
	padding: 0.75rem clamp(1rem, 1.1111vw + 2.667px, 1.5rem); /* 16 -> 24 across 1200 -> 1920 */
	font-size: var(--o-fs-small);
	white-space: nowrap;
}

/*
 * Saved items: the heart and its count. Printed hidden; saved.js shows it once
 * something is saved, so a visitor who has never hearted anything never sees it.
 */
.o-header__saved {
	position: relative;
	flex: 0 0 auto;
}

.o-header__saved[hidden] {
	display: none;
}

.o-header__saved-icon {
	width: 28px;
	height: 26px;
	max-height: none;
}

.o-header__saved-count {
	position: absolute;
	top: 2px;
	right: -4px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: var(--o-radius-pill);
	background-color: var(--o-orange);
	color: var(--o-navy);
	font-family: var(--o-font-ui);
	font-size: var(--o-fs-xs);
	font-weight: var(--o-fw-semibold);
	line-height: 20px;
	text-align: center;
}

.o-header__saved-count[hidden] {
	display: none;
}

/* --------------------------------------------------------------------------
   Header menus
   -------------------------------------------------------------------------- */
.o-menu {
	display: flex;
	align-items: center;
	gap: var(--o-space-lg);
	margin: 0;
	padding: 0;
	list-style: none;
}

.o-menu--header {
	gap: var(--o-header-gap);
}

.o-menu--header .o-menu__item {
	position: relative;
}

.o-menu--header .o-menu__link {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding-block: 0.5rem;
	color: var(--o-white);
	font-family: var(--o-font-ui);
	font-weight: var(--o-label-weight);
	font-size: var(--o-header-menu-size);
	letter-spacing: var(--o-label-tracking);
	line-height: 1.25;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
}

.o-menu--header .o-menu__link:hover,
.o-menu--header .o-menu__link:focus-visible,
.o-menu--header .o-menu__link.is-current {
	color: var(--o-orange);
}

/* Desktop dropdowns */
.o-menu--header .o-menu__toggle {
	display: none; /* Hover/focus opens the panel on pointer devices. */
}

.o-menu--header .o-menu__sub {
	position: absolute;
	top: 100%;
	left: 50%;
	z-index: 1;
	min-width: 15rem;
	margin: 0;
	padding: 0.75rem 0;
	list-style: none;
	background-color: var(--o-navy-deep);
	box-shadow: var(--o-shadow-card);
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, 0.5rem);
	transition: opacity var(--o-transition), transform var(--o-transition), visibility var(--o-transition);
}

.o-menu--header .o-menu__item--has-children:hover > .o-menu__sub,
.o-menu--header .o-menu__item--has-children:focus-within > .o-menu__sub {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
}

.o-menu--header .o-menu__sub .o-menu__link {
	display: block;
	padding: 0.5rem 1.25rem;
	font-size: var(--o-fs-small);
	letter-spacing: var(--o-label-tracking-tight);
	white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Search panel
   -------------------------------------------------------------------------- */
/* Animated open/close: JS removes [hidden], then adds .is-open on the next frame. */
.o-search-panel {
	position: relative;
	z-index: var(--o-z-search);
	max-height: 0;
	background-color: var(--o-navy-deep);
	color: var(--o-white);
	overflow: hidden;
	transition: max-height var(--o-transition-slow);
}

.o-search-panel.is-open {
	max-height: 20rem;
}

.o-search-panel__inner {
	display: flex;
	align-items: center;
	gap: var(--o-space-md);
	padding-block: var(--o-space-lg);
}

.o-search-panel__close {
	flex: 0 0 auto;
}

.o-search-panel__close svg {
	width: 18px;
	height: 18px;
}

/* --------------------------------------------------------------------------
   Off-canvas drawer
   -------------------------------------------------------------------------- */
.o-drawer {
	position: fixed;
	inset: 0;
	z-index: var(--o-z-drawer);
}

.o-drawer[hidden] {
	display: none;
}

.o-drawer__backdrop {
	position: absolute;
	inset: 0;
	background-color: rgba(15, 31, 64, 0.6);
	opacity: 0;
	transition: opacity var(--o-transition);
}

.o-drawer.is-open .o-drawer__backdrop {
	opacity: 1;
}

.o-drawer__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(440px, 100vw);
	height: 100%;
	margin-right: auto;
	padding: var(--o-space-lg) var(--o-space-lg) var(--o-space-xl);
	background-color: var(--o-navy);
	color: var(--o-white);
	overflow-y: auto;
	overscroll-behavior: contain;
	transform: translateX(-100%);
	transition: transform var(--o-transition-slow);
}

.o-drawer.is-open .o-drawer__panel {
	transform: translateX(0);
}

.o-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--o-space-md);
	margin-bottom: var(--o-space-xl);
}

.o-drawer__logo svg {
	height: 46px;
}

.o-drawer__close svg {
	width: 20px;
	height: 20px;
}

.o-drawer__nav {
	flex: 1 1 auto;
}

.o-drawer-menu,
.o-drawer-menu__sub {
	margin: 0;
	padding: 0;
	list-style: none;
}

.o-drawer-menu__item {
	position: relative;
	border-bottom: 1px solid var(--o-rule-on-dark);
}

.o-drawer-menu__item--depth-0 > .o-drawer-menu__link {
	font-family: var(--o-font-ui);
	font-weight: var(--o-label-weight);
	font-size: var(--o-fs-body-lg);
	letter-spacing: var(--o-label-tracking-tight);
	text-transform: uppercase;
}

.o-drawer-menu__link {
	display: block;
	padding: 0.9rem 3rem 0.9rem 0;
	color: var(--o-white);
	font-family: var(--o-font-body);
	text-decoration: none;
}

.o-drawer-menu__link:hover,
.o-drawer-menu__link:focus-visible,
.o-drawer-menu__link.is-current {
	color: var(--o-orange);
}

/* Disclosure button for submenus */
.o-drawer-menu__toggle {
	position: absolute;
	top: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
}

.o-drawer-menu__chevron {
	display: block;
	width: 9px;
	height: 9px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translate(-2px, -2px);
	transition: transform var(--o-transition);
}

.o-drawer-menu__toggle[aria-expanded="true"] {
	color: var(--o-orange);
}

.o-drawer-menu__toggle[aria-expanded="true"] .o-drawer-menu__chevron {
	transform: rotate(-135deg) translate(-2px, -2px);
}

.o-drawer-menu__sub {
	display: none;
	padding-bottom: 0.5rem;
	padding-left: var(--o-space-md);
}

.o-drawer-menu__item.is-expanded > .o-drawer-menu__sub {
	display: block;
}

.o-drawer-menu__sub .o-drawer-menu__item {
	border-bottom: 0;
}

.o-drawer-menu__sub .o-drawer-menu__link {
	padding-block: 0.5rem;
	font-size: var(--o-fs-small);
}

.o-drawer__foot {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--o-space-md);
	margin-top: var(--o-space-xl);
}

.o-drawer__note {
	margin: 0;
	color: var(--o-mist);
	font-size: var(--o-fs-small);
}

/* --------------------------------------------------------------------------
   Saved-items panel
   The menu drawer's shell, sliding in from the right instead of the left.
   -------------------------------------------------------------------------- */
.o-drawer--saved .o-drawer__panel {
	margin-right: 0;
	margin-left: auto;
	transform: translateX(100%);
}

.o-drawer--saved.is-open .o-drawer__panel {
	transform: translateX(0);
}

.o-drawer--saved .o-drawer__head {
	margin-bottom: var(--o-space-lg);
}

.o-saved__title {
	margin: 0;
	color: var(--o-white);
	font-family: var(--o-font-ui);
	font-size: var(--o-fs-h4);
	font-weight: var(--o-label-weight);
	letter-spacing: var(--o-label-tracking);
	text-transform: uppercase;
}

.o-saved__body {
	flex: 1 1 auto;
}

.o-saved__body[aria-busy="true"] {
	min-height: 6rem;
	opacity: 0.6;
}

.o-saved__group + .o-saved__group {
	margin-top: var(--o-space-lg);
}

.o-saved__heading {
	margin: 0 0 var(--o-space-xs);
	color: var(--o-orange);
	font-family: var(--o-font-ui);
	font-size: var(--o-fs-small);
	font-weight: var(--o-fw-semibold);
	letter-spacing: var(--o-label-tracking-tight);
	text-transform: uppercase;
}

.o-saved__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.o-saved__item {
	display: flex;
	align-items: center;
	gap: var(--o-space-sm);
	padding-block: var(--o-space-sm);
	border-bottom: 1px solid var(--o-rule-on-dark);
}

.o-saved__link {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: var(--o-space-sm);
	min-width: 0;
	color: var(--o-white);
	text-decoration: none;
}

.o-saved__media {
	flex: 0 0 64px;
	width: 64px;
	height: 64px;
	overflow: hidden;
	background-color: var(--o-navy-deep);
}

.o-saved__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.o-saved__text {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	min-width: 0;
}

.o-saved__eyebrow {
	color: var(--o-mist);
	font-size: var(--o-fs-xs);
	letter-spacing: var(--o-label-tracking-tight);
	text-transform: uppercase;
}

.o-saved__name {
	font-family: var(--o-font-ui);
	font-weight: var(--o-fw-medium);
	line-height: 1.25;
}

.o-saved__link:hover .o-saved__name,
.o-saved__link:focus-visible .o-saved__name {
	color: var(--o-orange);
}

.o-saved__remove {
	display: flex;
	flex: 0 0 44px;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--o-orange);
	cursor: pointer;
	transition: transform var(--o-transition);
}

.o-saved__remove:hover,
.o-saved__remove:focus-visible {
	transform: scale(1.1);
}

.o-saved__remove-glyph {
	display: block;
	width: 22px;
	height: 20px;
}

.o-saved__empty,
.o-saved__error {
	margin: 0;
	color: var(--o-mist);
}

.o-saved__empty[hidden] {
	display: none;
}

.o-saved__note {
	margin: var(--o-space-lg) 0 0;
	color: var(--o-mist);
	font-size: var(--o-fs-xs);
}

@media (prefers-reduced-motion: reduce) {
	.o-saved__remove {
		transition: none;
	}
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

/*
 * Tighten the label voice before anything has to be dropped. Sizes and gaps
 * scale on their own (see .o-header); tracking steps, since em and vw do not
 * interpolate cleanly.
 */
@media (max-width: 1400px) {
	.o-header {
		--o-label-size: 0.9375rem;      /* 15px */
		--o-label-tracking: 0.08em;
	}
}

@media (max-width: 1300px) {
	.o-header {
		--o-label-tracking: 0.05em;
	}
}

/*
 * Menus that still do not fit. header.js adds .is-collapsed when either side
 * would run into the logo - a long menu, a translated label, a zoomed-in
 * browser - and the drawer (the burger, always present) takes over, exactly
 * as it does below 1200. The CTA stays while there is room for it.
 */
.o-header.is-collapsed .o-header__nav {
	display: none;
}

.o-header.is-collapsed-cta .o-header__cta {
	display: none;
}

/*
 * Below 1200 the two inline menus no longer fit alongside a 235px logo, so the
 * drawer becomes the only navigation.
 */
@media (max-width: 1199px) {
	.o-header__nav,
	.o-header__cta {
		display: none;
	}

	.o-header__inner {
		min-height: var(--o-header-height-compact);
	}

	.o-header__logo svg {
		height: 48px;
	}
}

@media (max-width: 782px) {
	.o-header__webcam {
		display: none; /* Keep the burger, logo and search only. */
	}

	.o-header__burger-icon {
		width: 32px;
		height: 23px;
	}

	.o-header__logo svg {
		height: 38px;
	}

	.o-search-panel__inner {
		flex-wrap: wrap;
		padding-block: var(--o-space-md);
	}

	.o-search-form {
		flex-wrap: wrap;
	}

	.o-search-form__submit {
		width: 100%;
	}
}

/* WordPress admin bar must not cover a sticky header. */
.admin-bar .o-header--sticky {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar .o-header--sticky {
		top: 46px;
	}
}
