/*
 * Site header — Figma "Global Header" (CRH file CPO8VrN83OFQrdnEQ6hRGX,
 * 8103:36711: desktop 8103:36712, mobile 8107:1167) and "Global / Message
 * Bar" (28408:5436).
 *
 * Served directly, like block CSS; bin/add-fallbacks.mjs generates the var()
 * fallbacks. Type metrics come from the composite classes in the markup
 * (.text-label-sm, .text-label-lg); this file is color and layout only.
 */

.site-header {
	background: var(--background, #ffffff);
}

/* Announcement bar ---------------------------------------------------------- */

.site-announcement {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 48px;
	padding: var(--spacing-2, 8px) var(--section-hr-padding, 64px);
	background: var(--primary, #345171);
	color: var(--primary-foreground, #ffffff);
}

.site-announcement[hidden] {
	display: none;
}

.site-announcement__text {
	flex: 1 1 0;
	min-width: 0;
	margin: 0;
	text-align: center;
}

/* Desktop: pinned 16px from the right edge at 20px, so the copy stays centred
   on the full bar. Mobile moves it into the flow at 16px (below). */
.site-announcement__close {
	--icon-size: 20px;
	position: absolute;
	top: 50%;
	right: var(--spacing-4, 16px);
	display: inline-flex;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transform: translateY(-50%);
}

.site-announcement__close:focus-visible {
	outline: 2px solid var(--primary-foreground, #ffffff);
	outline-offset: 2px;
	border-radius: var(--radius-sm, 2px);
}

/* Main row ------------------------------------------------------------------ */

.site-header__inner {
	display: flex;
	align-items: center;
	gap: var(--spacing-8, 32px);
	max-width: var(--container-max-width, 1440px);
	margin-inline: auto;
	padding: var(--spacing-6, 24px) var(--section-hr-padding, 64px);
}

/* The global a:not(.btn) hover underline doesn't belong on the logo. */
.site-header__logo,
.site-header__logo:hover {
	display: flex;
	flex: none;
	align-items: center;
	border-bottom-color: transparent;
}

.site-header__logo img {
	display: block;
	width: auto;
	max-width: 200px;
	height: 60px;
	object-fit: contain;
}

.site-header__site-name {
	color: var(--foreground, #666666);
}

.site-header__nav {
	flex: 1 1 0;
	min-width: 0;
}

.site-header__menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	/* 24px between links, per Figma. A menu longer than the comp's three links
	   can wrap at tablet widths; the 8px row gap keeps it compact when it does. */
	gap: var(--spacing-2, 8px) var(--spacing-6, 24px);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Menu links are Figma Button Type=Link in foreground: the hover underline
   comes from the global link rule, in the link's own color. */
.site-header__link {
	color: var(--foreground, #666666);
}

.site-header__actions {
	display: flex;
	flex: none;
	align-items: center;
	gap: var(--spacing-2, 8px);
	margin-left: auto;
}

/* The header's pills are full-round in Figma whatever the brand's
   --radius-button is (the Button component uses border-radius/full here). */
.site-header__pill {
	border-radius: var(--radius-full, 9999px);
}

.site-header__toggle {
	display: none;
}

/* Mobile -------------------------------------------------------------------- */

@media (max-width: 767px) {
	.site-announcement__close {
		--icon-size: 16px;
		position: static;
		flex: none;
		transform: none;
	}

	.site-header__inner {
		flex-wrap: wrap;
		justify-content: space-between;
		gap: 0 var(--spacing-2, 8px);
		padding-block: var(--spacing-4, 16px);
	}

	.site-header__logo img {
		height: 40px;
	}

	/* The menu becomes a panel under the row, opened by the toggle. Without JS
	   (no .has-js) it stays visible and the toggle stays hidden, so the menu is
	   always reachable. The open panel isn't in the Figma comp — this is the
	   simplest treatment on existing tokens; replace it when design adds one. */
	.site-header__nav {
		flex-basis: 100%;
		order: 3;
	}

	.site-header.has-js .site-header__nav {
		display: none;
	}

	.site-header.has-js.is-open .site-header__nav {
		display: block;
	}

	.site-header.has-js .site-header__toggle {
		display: inline-flex;
	}

	.site-header__menu {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		margin-top: var(--spacing-4, 16px);
		border-top: var(--border-width-1, 1px) solid var(--border, #d6d3d1);
	}

	.site-header__menu > li {
		border-bottom: var(--border-width-1, 1px) solid var(--border, #d6d3d1);
	}

	.site-header__link {
		display: block;
		padding-block: var(--spacing-3, 12px);
	}
}

/* CCR ---------------------------------------------------------------------
   Clearwater: live Divi lays the white menu over the hero photo. Rebuilt as a
   solid white sticky bar (the rule from the Game On rebuilds: no transparent
   header over photos, for contrast), with the round full-colour logo (live
   170px, 90px here so the bar stays slim) and Poppins 400 16px slate links. */

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
}

.admin-bar .site-header { top: 32px; }

@media (max-width: 782px) {
	.admin-bar .site-header { top: 46px; }
}

.site-header__inner {
	width: 80%;
	max-width: 1200px;
	min-height: 100px;
	padding: 0;
	gap: 24px;
}

.site-header__logo img {
	width: 90px;
	max-width: 100%;
	height: auto;
}

.site-header__menu {
	justify-content: flex-end;
	gap: 0 28px;
}

.site-header__menu > li {
	position: relative;
}

.site-header__link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding-block: 42px;
	font-family: var(--font-label, "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif);
	font-weight: 400;
	font-size: 16px;
	line-height: 1;
	color: var(--primary, #345171);
	border-bottom: 0;
}

.site-header__link:hover,
.site-header__menu .current-menu-item > .site-header__link,
.site-header__menu .current-menu-ancestor > .site-header__link {
	color: var(--primary, #345171);
	opacity: 0.7;
	border-bottom: 0;
}

.site-header__menu .menu-item--strong > .site-header__link {
	font-weight: 700;
}

.site-header__menu > .menu-item-has-children > .site-header__link::after {
	content: "";
	width: 6px;
	height: 6px;
	margin: -3px 2px 0 4px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
}

.site-header__menu .sub-menu {
	position: absolute;
	top: 100%;
	left: -20px;
	z-index: 10;
	width: 300px;
	margin: 0;
	padding: 20px 0;
	list-style: none;
	background: var(--background, #ffffff);
	border-top: 3px solid var(--ccr-accent, #8ddaec);
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.site-header__menu > li:hover > .sub-menu,
.site-header__menu > li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.2s ease;
}

.site-header__menu .sub-menu .site-header__link {
	display: block;
	padding: 6px 20px 6px 40px;
	line-height: 28px;
	color: var(--ccr-text, #666666);
}

.site-header__menu .sub-menu .site-header__link:hover {
	opacity: 1;
	background: rgba(0, 0, 0, 0.03);
}

@media (max-width: 980px) and (min-width: 768px) {
	.site-header__inner { width: 92%; }
	.site-header__logo img { width: 80px; }
	.site-header__menu { gap: 0 14px; }
	.site-header__link { font-size: 14px; }
}

@media (max-width: 767px) {
	.site-header__inner {
		width: 90%;
		min-height: 72px;
		padding-block: 10px;
	}

	.site-header__logo img { width: 64px; }

	.site-header__nav { max-height: calc(100vh - 80px); overflow-y: auto; }

	.site-header__link { padding-block: 12px; }

	.site-header__menu > .menu-item-has-children > .site-header__link::after { display: none; }

	/* In the mobile panel the dropdowns are always open, indented. */
	.site-header__menu .sub-menu {
		position: static;
		width: auto;
		padding: 0 0 8px 16px;
		border-top: 0;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
	}

	.site-header__menu .sub-menu .site-header__link { padding: 8px 0; }

	.site-header__toggle { color: var(--primary, #345171); }
}

@media (prefers-reduced-motion: reduce) {
	.site-header__menu .sub-menu { transition: none; }
}
