/*
 * Site header. One markup for all layouts; the phone menu is the same <nav>
 * shown as a popover below 768px (and always for the "Menu button only" layout).
 */
.sv-site-header,
.sv-site-header *,
.sv-site-header *::before,
.sv-site-header *::after {
	box-sizing: border-box;
}

/* Height: Compact, Normal (default), Tall. The phone menu opens below it. */
.sv-site-header {
	--sv-header-height: 4.5rem;
	--sv-header-pad: 0.75rem;
	/* The logo's height (Logo size), on the header so its room and a floating box can use it. */
	--sv-logo-h: 2.75rem;
	position: relative;
	z-index: 50;
	padding-inline: var(--sv-gutter);
	background: var(--sv-color-background);
	color: var(--sv-color-text);
}

.sv-site-header--height-sm {
	--sv-header-height: 3.5rem;
	--sv-header-pad: 0.4rem;
}

.sv-site-header--height-lg {
	--sv-header-height: 6rem;
	--sv-header-pad: 1.25rem;
}

/*
 * White (stored "background", ADR 0056): white whatever the site's colors. On a dark color scheme the
 * page's text is light, so the header's text is the page's text made dark (same hue).
 */
.sv-site-header--background-background {
	--sv-color-text: oklch(from var(--sv-ink, #1b1f2a) min(l, 0.35) c h);
	--sv-color-muted: oklch(from var(--sv-ink-muted, #5b6170) min(l, 0.5) c h);
	background: #fff;
	color: var(--sv-color-text);
}

/* A dark website's Link color is light (ADR 0072): on the White header it is darkened like the text. */
.sv-site-header--background-background[data-page="dark"] {
	--sv-color-link: oklch(from var(--sv-color-primary) min(l, 0.5) c h);
}

.sv-site-header--background-surface {
	background: var(--sv-color-surface);
}

.sv-site-header--background-inverse {
	--sv-color-text: var(--sv-color-on-inverse);
	--sv-color-muted: color-mix(in srgb, var(--sv-color-on-inverse) 76%, transparent);
	background: var(--sv-color-inverse);
	color: var(--sv-color-on-inverse);
}

/* Accent color: its button in the light color made for it (as in an accent section), not lost in the accent. */
.sv-site-header--background-primary {
	--sv-color-text: var(--sv-color-on-primary);
	--sv-button-main-bg: var(--sv-color-on-primary);
	--sv-button-main-text: var(--sv-color-primary);
	background: var(--sv-color-primary);
	color: var(--sv-color-on-primary);
}

/*
 * A color of your own (Classic and Floating, ADR 0107): the header — or its floating box — in it, with the words of
 * the look it stands in for (Dark for light words, Soft for dark words), a gradient of the site's too. A see-through
 * color may be glass: blurred behind, its light edge, no drop shadow.
 */
.sv-site-header[style*="--sv-custom-header"] {
	background: var(--sv-custom-header);
}

.sv-site-header[style*="--sv-custom-header"][style*="--sv-custom-gradient"] {
	background-image: var(--sv-custom-gradient);
	background-origin: border-box;
}

.sv-site-header[style*="--sv-custom-header"][style*="--sv-custom-glass"] {
	backdrop-filter: var(--sv-custom-glass);
}

/*
 * Color None (ADR 0056): full width, no background (see-through); a floating box, 50% transparent
 * (below). Light text for dark sections or dark text for light ones ("Text and logo"). On a page that
 * isn't a Sitevari page (it doesn't go over a first section) it takes the Dark color with light text,
 * or the Page color with dark text. ([data-overlay] without a box only comes with None now: pages
 * just show or hide the header.)
 */
.sv-site-header:is(:is(.sv-site-header--background-none, .sv-site-header--background-clear), [data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill)) {
	--sv-color-text: var(--sv-color-on-inverse);
	--sv-color-muted: color-mix(in srgb, var(--sv-color-on-inverse) 76%, transparent);
	--sv-header-fill: var(--sv-color-inverse);
	background: transparent;
	color: var(--sv-color-on-inverse);
}

.sv-site-header:is(:is(.sv-site-header--background-none, .sv-site-header--background-clear), [data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill)).sv-site-header--tone-dark {
	--sv-color-text: inherit;
	--sv-color-muted: inherit;
	--sv-header-fill: var(--sv-color-background);
	color: var(--sv-color-text);
}

.sv-site-header:is(.sv-site-header--background-none, .sv-site-header--background-clear):not([data-overlay]) {
	background: var(--sv-header-fill);
}

/*
 * Glass (ADR 0107): white at 63%, a soft blur and a light edge (a bright top line, a faint ring) — the custom colors'
 * "#ffffff/63/blur/edge" — and never a drop shadow; dark glass keeps the blur and the edge.
 */
.sv-site-header {
	--sv-glass-light: color-mix(in srgb, #fff 63%, transparent);
	--sv-glass-blur: blur(10px) saturate(1.4);
	--sv-glass-edge: inset 0 1px 0 rgb(255 255 255 / 60%), inset 0 0 0 1px rgb(255 255 255 / 20%);
}

/* The room inside a floating box's end (a button's gap, below); registered so it can animate. */
@property --sv-header-box-end {
	syntax: "<length>";
	inherits: true;
	initial-value: 0px;
}

/*
 * While a header stays at the top (ADR 0057; every design since ADR 0107). Shrink: over the first 6rem of scrolling
 * the header (a floating box) loses about a quarter of its height and the logo a fifth (browsers without scroll
 * timelines keep it as it is). Hide on scroll down: view.js sets data-hidden while scrolling down, and the header
 * slides up out of view; scrolling up brings it back.
 */
@supports (animation-timeline: scroll()) {
	.sv-site-header.sv-site-header--scroll-shrink[data-sticky] .sv-site-header__inner {
		animation: sv-site-header-shrink linear both;
		animation-range: 0 6rem;
		animation-timeline: scroll(root);
	}

	.sv-site-header.sv-site-header--scroll-shrink[data-sticky] .sv-site-header__logo {
		animation: sv-site-header-shrink-logo linear both;
		animation-range: 0 6rem;
		animation-timeline: scroll(root);
	}
}

@keyframes sv-site-header-shrink-end {
	to {
		--sv-header-box-end: calc((max(var(--sv-header-height) * 0.76, var(--sv-logo-h) * 0.8 + 1.1 * var(--sv-header-pad)) - 2.5rem) / 2);
	}
}

/* How far Shrink has gone (0 at the top, 1 once shrunk; ADR 0107): what is inside the header's row shrinks with it. */
@property --sv-header-shrink {
	syntax: "<number>";
	inherits: true;
	initial-value: 0;
}

@keyframes sv-site-header-shrink {
	to {
		--sv-header-shrink: 1;
		min-block-size: calc(var(--sv-header-height) * 0.76);
		padding-block: calc(var(--sv-header-pad) * 0.55);
	}
}

@keyframes sv-site-header-shrink-logo {
	to {
		block-size: calc(var(--sv-logo-h) * 0.8);
	}
}

.sv-site-header.sv-site-header--scroll-hide[data-sticky] {
	transition: translate 0.3s ease;
}

.sv-site-header.sv-site-header--scroll-hide[data-sticky][data-hidden] {
	translate: 0 calc(-100% - var(--sv-header-gap, 0px) - var(--sv-in-top, 0px) - 1rem);
}

/*
 * Divider (ADR 0056), with Color None only: a light line along the header's lower edge (a floating
 * box's: the content's width), in its own text color at 11% (soft white on dark sections, soft gray on
 * light ones). Drawn, not a border, so the header keeps its height.
 */
:is(.sv-site-header--background-none, .sv-site-header--background-clear).sv-site-header--divider-light:not(.sv-site-header--shape-box, .sv-site-header--shape-pill)::after {
	position: absolute;
	inset-block-end: 0;
	inset-inline: 0;
	block-size: 1px;
	background: color-mix(in srgb, currentcolor 11%, transparent);
	content: "";
	pointer-events: none;
}

.sv-site-header[data-sticky]:not([data-overlay]) {
	position: sticky;
	inset-block-start: var(--wp-admin--admin-bar--height, 0);
}

/*
 * Shadow once the page scrolls (scroll-driven animation). Browsers without
 * scroll timelines show the shadow all the time. A floating box has its own.
 */
.sv-site-header[data-shadow]:not([data-overlay], .sv-site-header--shape-box, .sv-site-header--shape-pill) {
	animation: sv-site-header-shadow linear both;
	animation-range: 0 4rem;
	animation-timeline: scroll();
}

@keyframes sv-site-header-shadow {
	from {
		box-shadow: 0 0 0 transparent;
	}

	to {
		box-shadow: 0 10px 30px -18px rgb(16 24 40 / 45%);
	}
}

/* Content width: the site's layout (Standard, Wide or Full width). */
.sv-site-header__inner {
	display: flex;
	gap: 0.75rem 2rem;
	align-items: center;
	justify-content: space-between;
	max-inline-size: var(--sv-container-content, var(--sv-container-standard));
	min-block-size: var(--sv-header-height);
	margin-inline: auto;
	padding-block: var(--sv-header-pad);
}

/* ---------- Logo and name ---------- */

.sv-site-header__brand {
	display: inline-flex;
	flex: none;
	gap: 0.6rem;
	align-items: center;
	color: inherit;
	text-decoration: none;
}

.sv-site-header__logo {
	display: block;
	inline-size: auto;
	max-inline-size: 14rem;
	block-size: var(--sv-logo-h);
	object-fit: contain;
}

.sv-site-header--logo-size-sm {
	--sv-logo-h: 2rem;
}

.sv-site-header--logo-size-lg {
	--sv-logo-h: 3.75rem;
}

.sv-site-header--logo-size-xl {
	--sv-logo-h: 5rem;
}

.sv-site-header--logo-size-lg .sv-site-header__logo {
	max-inline-size: 16rem;
}

/* On phones a wide logo stays clear of the menu button. */
.sv-site-header--logo-size-xl .sv-site-header__logo {
	max-inline-size: min(20rem, 60vw);
}

/*
 * Logo on dark backgrounds (ADR 0056): shown instead of the logo on a Dark or Accent-color header, or
 * a see-through one with light text; alone (no logo), it is the logo everywhere.
 */
.sv-site-header__logo--on-dark {
	display: none;
}

.sv-site-header:is(.sv-site-header--background-inverse, .sv-site-header--background-primary):not([data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill)) .sv-site-header__logo--on-dark,
.sv-site-header:is(:is(.sv-site-header--background-none, .sv-site-header--background-clear), [data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill)):not(.sv-site-header--tone-dark) .sv-site-header__logo--on-dark,
.sv-site-header__brand:not(:has(> .sv-site-header__logo:not(.sv-site-header__logo--on-dark))) > .sv-site-header__logo--on-dark {
	display: block;
}

.sv-site-header:is(.sv-site-header--background-inverse, .sv-site-header--background-primary):not([data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill)) .sv-site-header__brand:has(> .sv-site-header__logo--on-dark) > .sv-site-header__logo:not(.sv-site-header__logo--on-dark),
.sv-site-header:is(:is(.sv-site-header--background-none, .sv-site-header--background-clear), [data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill)):not(.sv-site-header--tone-dark) .sv-site-header__brand:has(> .sv-site-header__logo--on-dark) > .sv-site-header__logo:not(.sv-site-header__logo--on-dark) {
	display: none;
}

/*
 * A dark website (ADR 0071): a Soft header is a dark shade there, so it shows the logo on dark (White
 * stays white, Dark stays dark).
 */
.sv-site-header[data-page="dark"].sv-site-header--background-surface:not([data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill)) .sv-site-header__logo--on-dark {
	display: block;
}

.sv-site-header[data-page="dark"].sv-site-header--background-surface:not([data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill)) .sv-site-header__brand:has(> .sv-site-header__logo--on-dark) > .sv-site-header__logo:not(.sv-site-header__logo--on-dark) {
	display: none;
}

.sv-site-header__name {
	font-family: var(--sv-font-heading);
	font-weight: var(--sv-font-heading-weight, 700);
	font-synthesis-weight: none;
	letter-spacing: calc(var(--sv-font-heading-tracking, 0em) * var(--sv-tracking, 1));
	font-size: 1.25rem;
	line-height: 1.2;
}

/* ---------- Menu ---------- */

.sv-site-header__nav {
	gap: 1rem 1.75rem;
	align-items: center;
}

/* A closed phone menu is hidden (stated here, because any display rule on the
   <nav> would otherwise override the browser's own popover hiding). */
.sv-site-header__nav:not(:popover-open) {
	display: none;
}

.sv-site-header__menu,
.sv-site-header__submenu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sv-site-header__menu {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.5rem;
	align-items: center;
}

.sv-site-header__item {
	position: relative;
}

.sv-site-header__link {
	display: inline-block;
	padding-block: 0.4rem;
	color: inherit;
	font-family: var(--sv-font-label, var(--sv-font-body));
	font-weight: 500;
	font-synthesis-weight: var(--sv-font-label-synthesis, auto);
	text-decoration: none;
	text-underline-offset: 0.35em;
}

.sv-site-header__link:hover,
.sv-site-header__link:focus-visible,
.sv-site-header__link[aria-current="page"] {
	text-decoration: underline;
	text-decoration-thickness: 2px;
}

/* The page you are on, and the one pointed at or focused: the accent color with its line, never a background (ADR 0055). */
.sv-site-header__link:is([aria-current="page"], :hover, :focus-visible) {
	color: var(--sv-color-link);
}

/* Light text (a Dark or Accent header, or see-through for dark sections): the page you are on keeps it. */
.sv-site-header:is(.sv-site-header--background-inverse, .sv-site-header--background-primary):not([data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill)) .sv-site-header__link[aria-current="page"],
.sv-site-header:is(:is(.sv-site-header--background-none, .sv-site-header--background-clear), [data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill)):not(.sv-site-header--tone-dark) .sv-site-header__link[aria-current="page"] {
	color: inherit;
}

/* Sub-menu: opens on hover or keyboard focus. */
.sv-site-header__item--parent > .sv-site-header__link::after {
	display: inline-block;
	inline-size: 0.4em;
	block-size: 0.4em;
	margin-inline-start: 0.45em;
	border-block-end: 2px solid currentColor;
	border-inline-end: 2px solid currentColor;
	content: "";
	transform: translateY(-0.2em) rotate(45deg);
}

/* Right to left its two lines are the bottom and the left: turned the other way, it still points down. */
[dir="rtl"] .sv-site-header__item--parent > .sv-site-header__link::after {
	transform: translateY(-0.2em) rotate(-45deg);
}

/* Drop-down: a little below the link, small corners, roomy rows with light dividers. */
.sv-site-header__submenu {
	position: absolute;
	inset-block-start: calc(100% + 0.7rem);
	inset-inline-start: -0.85rem;
	z-index: 2;
	display: none;
	min-inline-size: 13.5rem;
	padding: 0.35rem;
	border: 1px solid var(--sv-ink-border, #e2e5ec);
	/* Square at the top, where it meets the header's lower edge (ADR 0055). */
	border-radius: 0 0 var(--sv-radius-sm) var(--sv-radius-sm);
	background: var(--sv-color-background);
	box-shadow: 0 18px 40px -18px rgb(16 24 40 / 35%);
	color: var(--sv-ink, #1b1f2a);
}

/* Under a see-through header there is no edge to meet: the drop-down is rounded all round (ADR 0056). */
.sv-site-header:is(.sv-site-header--background-none, .sv-site-header--background-clear):not(.sv-site-header--shape-box) .sv-site-header__nav:not(:popover-open) .sv-site-header__submenu {
	border-radius: var(--sv-radius-sm);
}

/* An invisible bridge over the gap, so the drop-down stays open on the way down. */
.sv-site-header__submenu::before {
	position: absolute;
	inset-block-end: 100%;
	inset-inline: 0;
	block-size: 0.9rem;
	content: "";
}

.sv-site-header__item--parent:is(:hover, :focus-within) > .sv-site-header__submenu {
	display: block;
}

/*
 * Rows of the drop-down and of the phone menu (ADR 0055): each draws the thin line under its words,
 * which is also the divider; pointed at, focused or the page you are on, the words take the accent and
 * an accent line grows over that divider (no underline, no background). The drop-down's words are the
 * top menu's size.
 */
.sv-site-header__submenu .sv-site-header__link,
.sv-site-header__nav:popover-open .sv-site-header__link {
	display: block;
	border-block-end: 1px solid var(--sv-ink-border, #e2e5ec);
	transition: color 0.2s ease, border-color 0.2s ease;
}

.sv-site-header__submenu .sv-site-header__link {
	padding: 0.7rem 0.8rem;
	font-size: calc(var(--sv-size-body) - 1px);
}

.sv-site-header__nav:not(:popover-open) .sv-site-header__submenu li:last-child > .sv-site-header__link:not(:hover, :focus-visible, [aria-current="page"]) {
	border-block-end-color: transparent;
}

.sv-site-header__nav .sv-site-header__submenu .sv-site-header__link:is(:hover, :focus-visible, [aria-current="page"]),
.sv-site-header__nav:popover-open .sv-site-header__link:is(:hover, :focus-visible, [aria-current="page"]) {
	color: var(--sv-color-link);
	text-decoration: none;
}

/* The drop-down's line: a thin accent line grows over the row's divider, from the reading-direction start. */
.sv-site-header__nav:not(:popover-open) .sv-site-header__submenu .sv-site-header__link {
	position: relative;
}

.sv-site-header__nav:not(:popover-open) .sv-site-header__submenu .sv-site-header__link::before {
	position: absolute;
	inset-inline: 0;
	inset-block-end: -1px;
	block-size: 1px;
	background: var(--sv-color-primary);
	content: "";
	scale: 0 1;
	transform-origin: left;
	transition: scale 0.35s ease;
}

[dir="rtl"] .sv-site-header__nav:not(:popover-open) .sv-site-header__submenu .sv-site-header__link::before {
	transform-origin: right;
}

.sv-site-header__nav:not(:popover-open) .sv-site-header__submenu .sv-site-header__link:is(:hover, :focus-visible, [aria-current="page"])::before {
	scale: 1 1;
}

/*
 * A slightly smaller button in the header, its words the menu's size (ADR 0057): 42px tall, the button system's shape
 * (ADR 0111) — set on its wrapper, never by moving the words.
 */
.sv-button.sv-site-header__button {
	--sv-button-height: 2.625rem;
	--sv-button-font: calc(var(--sv-size-body) - 1px);
	--sv-button-inline: 1.25rem;
	--sv-button-icon: 1rem;
	--sv-button-gap: 0.4rem;
}

/* A text link before the button (ADR 0057): the menu's size and color, the accent when pointed at. */
.sv-site-header__textlink {
	flex: none;
	color: inherit;
	font-size: calc(var(--sv-size-body) - 1px);
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.2s ease, opacity 0.2s ease;
}

a.sv-site-header__textlink:is(:hover, :focus-visible) {
	color: var(--sv-color-link);
}

.sv-site-header:is(.sv-site-header--background-inverse, .sv-site-header--background-primary):not([data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill)) .sv-site-header__nav:not(:popover-open) a.sv-site-header__textlink:is(:hover, :focus-visible),
.sv-site-header:is(:is(.sv-site-header--background-none, .sv-site-header--background-clear), [data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill)):not(.sv-site-header--tone-dark) .sv-site-header__nav:not(:popover-open) a.sv-site-header__textlink:is(:hover, :focus-visible) {
	color: inherit;
	opacity: 0.75;
}

/*
 * In the phone menu: an outline button on its own line above the button (ADR 0104) — the button's shape, room and
 * weight, its edge in the menu's text color.
 */
.sv-site-header__nav:popover-open .sv-site-header__textlink {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-block-size: 3rem;
	padding: 0.4em 1.375rem;
	border: 2px solid currentcolor;
	border-radius: var(--sv-radius-button);
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
}

.sv-site-header__nav:popover-open a.sv-site-header__textlink:is(:hover, :focus-visible) {
	background: color-mix(in srgb, currentcolor 10%, transparent);
	color: inherit;
}

/*
 * Signed in (ADR 0202): the visitor's account link in the text link's place — their initial in a small circle of the
 * words' own color — and its drop-down with the menu's drop-down look, opening on hover or keyboard focus at the
 * link's end. In the phone menu the drop-down's rows follow the link (the sub-pages' rules).
 */
.sv-site-header__account {
	position: relative;
	display: flex;
	flex: none;
	align-items: center;
}

.sv-site-header__account-link {
	display: inline-flex;
	gap: 0.55em;
	align-items: center;
}

.sv-site-header__avatar {
	display: inline-grid;
	flex: none;
	place-items: center;
	inline-size: 2em;
	block-size: 2em;
	border-radius: 50%;
	background: color-mix(in srgb, currentcolor 12%, transparent);
	font-size: 0.85em;
	font-weight: 600;
	line-height: 1;
}

.sv-site-header__account--menu > .sv-site-header__account-link::after {
	display: inline-block;
	inline-size: 0.4em;
	block-size: 0.4em;
	border-block-end: 2px solid currentcolor;
	border-inline-end: 2px solid currentcolor;
	content: "";
	transform: translateY(-0.2em) rotate(45deg);
}

[dir="rtl"] .sv-site-header__account--menu > .sv-site-header__account-link::after {
	transform: translateY(-0.2em) rotate(-45deg);
}

.sv-site-header__account-menu {
	inset-inline: auto -0.85rem;
	border-radius: var(--sv-radius-sm);
}

.sv-site-header__account--menu:is(:hover, :focus-within) > .sv-site-header__account-menu {
	display: block;
}

.sv-site-header__nav:popover-open .sv-site-header__account {
	flex-direction: column;
	align-items: stretch;
}

.sv-site-header__nav:popover-open .sv-site-header__account--menu > .sv-site-header__account-link::after {
	display: none;
}

/* ---------- Layouts ---------- */

.sv-site-header--layout-centered .sv-site-header__inner {
	flex-direction: column;
	justify-content: center;
}

/*
 * Logo in the middle (ADR 0056): three columns, the logo in the exact middle; the first half of the
 * menu starts at the start edge, the second half and the button end at the end edge. A half too long
 * for its column widens it (the logo then moves aside rather than being covered). On phones the logo
 * stays in the middle, the menu button at the end.
 */
.sv-site-header--layout-split .sv-site-header__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	column-gap: 2rem;
}

.sv-site-header--layout-split .sv-site-header__brand {
	grid-row: 1;
	grid-column: 2;
	justify-self: center;
}

.sv-site-header--layout-split .sv-site-header__toggle {
	grid-row: 1;
	grid-column: 3;
	justify-self: end;
}

.sv-site-header--layout-inline .sv-site-header__nav {
	flex: 1;
	justify-content: space-between;
}

.sv-site-header--layout-inline .sv-site-header__menu {
	flex: 1;
	justify-content: center;
}

/* ---------- Phone menu (popover) ---------- */

.sv-site-header__toggle {
	display: none;
	place-items: center;
	inline-size: 2.75rem;
	block-size: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: var(--sv-radius-sm);
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.sv-site-header__bars,
.sv-site-header__bars::before,
.sv-site-header__bars::after {
	display: block;
	inline-size: 1.4rem;
	block-size: 2px;
	border-radius: 2px;
	background: currentColor;
}

.sv-site-header__bars {
	position: relative;
}

.sv-site-header__bars::before,
.sv-site-header__bars::after {
	position: absolute;
	content: "";
}

.sv-site-header__bars::before {
	inset-block-start: -7px;
}

.sv-site-header__bars::after {
	inset-block-start: 7px;
}

/* The three bars turn into an X (the close button, and the menu button while open). */
.sv-site-header__bars,
.sv-site-header__bars::before,
.sv-site-header__bars::after {
	transition: background-color 0.2s ease, rotate 0.25s ease, inset 0.25s ease;
}

.sv-site-header__close .sv-site-header__bars,
.sv-site-header:has(.sv-site-header__nav:popover-open) .sv-site-header__toggle .sv-site-header__bars {
	background-color: transparent;
}

.sv-site-header__close .sv-site-header__bars::before,
.sv-site-header:has(.sv-site-header__nav:popover-open) .sv-site-header__toggle .sv-site-header__bars::before {
	inset-block-start: 0;
	rotate: 45deg;
}

.sv-site-header__close .sv-site-header__bars::after,
.sv-site-header:has(.sv-site-header__nav:popover-open) .sv-site-header__toggle .sv-site-header__bars::after {
	inset-block-start: 0;
	rotate: -45deg;
}

/* Close button: only inside the open menu (phones and tablets). */
.sv-site-header__close {
	display: none;
	flex: none;
	place-items: center;
	align-self: flex-end;
	inline-size: 2.75rem;
	block-size: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: var(--sv-radius-sm);
	background: transparent;
	color: inherit;
	cursor: pointer;
}

/* Large screens (wider than a tablet, ADR 0091): the popover <nav> is an ordinary inline menu. */
@media (min-width: 1025px) {
	.sv-site-header:not(.sv-site-header--layout-minimal) .sv-site-header__nav[popover] {
		position: static;
		display: flex;
		inset: auto;
		inline-size: auto;
		block-size: auto;
		margin: 0;
		padding: 0;
		overflow: visible;
		border: 0;
		background: none;
		color: inherit;
	}
}

/*
 * Wide screens (ADR 0055): the menu's words a little smaller and further apart. In the Classic and
 * Inline layouts the menu reaches down to the header's lower edge, where a line marks the page you
 * are on (and the one pointed at); the Centered layout keeps the line under the words.
 */
@media (min-width: 1025px) {
	.sv-site-header:not(.sv-site-header--layout-minimal) .sv-site-header__menu {
		column-gap: 2.25rem;
	}

	.sv-site-header:not(.sv-site-header--layout-minimal) .sv-site-header__menu > .sv-site-header__item > .sv-site-header__link {
		font-size: calc(var(--sv-size-body) - 1px);
	}

	/* Logo in the middle: the menu's two halves and the button take the outer columns (ADR 0056). */
	.sv-site-header--layout-split .sv-site-header__inner {
		grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
	}

	.sv-site-header.sv-site-header--layout-split .sv-site-header__nav[popover] {
		display: contents;
	}

	.sv-site-header--layout-split .sv-site-header__nav > .sv-site-header__menu {
		grid-row: 1;
		grid-column: 1;
		justify-self: start;
	}

	.sv-site-header--layout-split :is(.sv-site-header__end, .sv-site-header__nav > .sv-site-header__button) {
		grid-row: 1;
		grid-column: 3;
		justify-self: end;
	}

	.sv-site-header__end {
		display: flex;
		gap: 1.75rem;
		align-items: center;
	}

	.sv-site-header--layout-split .sv-site-header__end {
		align-self: stretch;
	}

	.sv-site-header--layout-split :is(.sv-site-header__end, .sv-site-header__nav) > .sv-site-header__button {
		align-self: center;
	}

	:is(.sv-site-header--layout-classic, .sv-site-header--layout-inline, .sv-site-header--layout-split) .sv-site-header__inner {
		align-items: stretch;
	}

	:is(.sv-site-header--layout-classic, .sv-site-header--layout-inline, .sv-site-header--layout-split) .sv-site-header__brand {
		align-self: center;
	}

	:is(.sv-site-header--layout-classic, .sv-site-header--layout-inline, .sv-site-header--layout-split) .sv-site-header__menu {
		align-self: stretch;
		align-items: stretch;
	}

	:is(.sv-site-header--layout-classic, .sv-site-header--layout-inline, .sv-site-header--layout-split) .sv-site-header__menu > .sv-site-header__item {
		display: flex;
		align-items: center;
	}

	:is(.sv-site-header--layout-classic, .sv-site-header--layout-inline, .sv-site-header--layout-split) .sv-site-header__menu > .sv-site-header__item > .sv-site-header__link {
		text-decoration: none;
	}

	/* The drop-down opens right on the header's lower edge, under the line (the bridge spans the gap). */
	:is(.sv-site-header--layout-classic, .sv-site-header--layout-inline, .sv-site-header--layout-split) .sv-site-header__menu > .sv-site-header__item > .sv-site-header__submenu {
		inset-block-start: calc(100% + var(--sv-header-pad));
	}

	:is(.sv-site-header--layout-classic, .sv-site-header--layout-inline, .sv-site-header--layout-split) .sv-site-header__menu > .sv-site-header__item > .sv-site-header__submenu::before {
		block-size: calc(var(--sv-header-pad) + 0.25rem);
	}

	:is(.sv-site-header--layout-classic, .sv-site-header--layout-inline, .sv-site-header--layout-split) .sv-site-header__menu > .sv-site-header__item > .sv-site-header__link::before {
		position: absolute;
		inset-inline: 0;
		inset-block-end: calc(var(--sv-header-pad) * -1);
		block-size: 2px;
		background: currentcolor;
		content: "";
		scale: 0 1;
		transition: scale 0.25s ease;
	}

	:is(.sv-site-header--layout-classic, .sv-site-header--layout-inline, .sv-site-header--layout-split) .sv-site-header__menu > .sv-site-header__item > .sv-site-header__link:is(:hover, :focus-visible, [aria-current="page"])::before {
		scale: 1 1;
	}

	/*
	 * See-through (ADR 0056): no lower edge to sit on, so the line is 1px and 40% closer to the words.
	 * Measured from the item (100%, the words centered in it, 1em tall): the words end
	 * (100% - 1em) / 2 above its foot; the line moves up by 40% of its distance from them.
	 */
	.sv-site-header:is(.sv-site-header--background-none, .sv-site-header--background-clear):not(.sv-site-header--shape-box):is(.sv-site-header--layout-classic, .sv-site-header--layout-inline, .sv-site-header--layout-split) .sv-site-header__menu > .sv-site-header__item > .sv-site-header__link::before {
		inset-block-end: calc(0.2 * (100% - 1em) - 0.6 * var(--sv-header-pad));
		block-size: 1px;
	}

	/* With the line at the bottom, the menu's line sits right on it, on the header's lower edge. */
	.sv-site-header:is(.sv-site-header--background-none, .sv-site-header--background-clear).sv-site-header--divider-light:not(.sv-site-header--shape-box, .sv-site-header--shape-pill):is(.sv-site-header--layout-classic, .sv-site-header--layout-inline, .sv-site-header--layout-split) .sv-site-header__menu > .sv-site-header__item > .sv-site-header__link::before {
		inset-block-end: calc(var(--sv-header-pad) * -1);
	}

	/* On a dark or colored header the top menu keeps its light text, with the line. */
	.sv-site-header:is(.sv-site-header--background-inverse, .sv-site-header--background-primary):not([data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill)) .sv-site-header__menu > .sv-site-header__item > .sv-site-header__link:is(:hover, :focus-visible),
	.sv-site-header:is(:is(.sv-site-header--background-none, .sv-site-header--background-clear), [data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill)):not(.sv-site-header--tone-dark) .sv-site-header__menu > .sv-site-header__item > .sv-site-header__link:is(:hover, :focus-visible) {
		color: inherit;
	}
}

@media (max-width: 1024px) {
	.sv-site-header__toggle {
		display: grid;
	}
}

.sv-site-header--layout-minimal .sv-site-header__toggle {
	display: grid;
}

/*
 * The open phone menu: a full-height drawer that slides in from the end side
 * (right, or left on right-to-left sites) and covers 70% of the screen.
 */
.sv-site-header__nav:popover-open {
	position: fixed;
	inset-block: 0;
	inset-inline: auto 0;
	display: flex;
	inline-size: 70vw;
	max-inline-size: 26rem;
	block-size: 100dvh;
	max-block-size: none;
	flex-direction: column;
	gap: 1.25rem;
	align-items: stretch;
	margin: 0;
	padding: calc(var(--wp-admin--admin-bar--height, 0px) + 0.75rem) 1.5rem 2rem;
	overflow: auto;
	border: 0;
	border-radius: 0;
	background: var(--sv-color-background);
	box-shadow: 0 0 60px rgb(16 24 40 / 30%);
	color: var(--sv-ink, #1b1f2a);
}

/* Slide in and out (browsers without these features simply show and hide it). */
.sv-site-header__nav[popover] {
	transition: translate 0.3s ease, display 0.3s allow-discrete, overlay 0.3s allow-discrete;
}

.sv-site-header__nav:popover-open {
	translate: 0 0;
}

@starting-style {
	.sv-site-header__nav:popover-open {
		translate: 100% 0;
	}
}

@starting-style {
	[dir="rtl"] .sv-site-header__nav:popover-open {
		translate: -100% 0;
	}
}

/* Closing: slide back out (only where the menu is a drawer). */
@media (max-width: 1024px) {
	.sv-site-header__nav[popover]:not(:popover-open) {
		translate: 100% 0;
	}

	[dir="rtl"] .sv-site-header__nav[popover]:not(:popover-open) {
		translate: -100% 0;
	}
}

.sv-site-header--layout-minimal .sv-site-header__nav[popover]:not(:popover-open) {
	translate: 100% 0;
}

[dir="rtl"] .sv-site-header--layout-minimal .sv-site-header__nav[popover]:not(:popover-open) {
	translate: -100% 0;
}

.sv-site-header__nav:popover-open .sv-site-header__close {
	display: grid;
}

/* The list from the top, whatever the wide-screen layout spreads (Menu in the middle stretches it there). */
.sv-site-header__nav:popover-open {
	justify-content: flex-start;
}

.sv-site-header__nav:popover-open .sv-site-header__menu {
	flex: none;
	flex-direction: column;
	align-items: stretch;
	justify-content: flex-start;
	gap: 0;
}

/* Logo in the middle: the two halves read as one list in the phone menu (ADR 0056). */
.sv-site-header__nav:popover-open .sv-site-header__end {
	display: contents;
}

.sv-site-header__nav:popover-open .sv-site-header__end > .sv-site-header__menu {
	margin-block-start: -1.25rem;
}

/* Roomy rows with light dividers. */
.sv-site-header__nav:popover-open .sv-site-header__link {
	display: block;
	padding-block: 0.95rem;
	font-size: 1.05rem;
}

/*
 * Phone menu rows (ADR 0055): no dividers; the page you are on, and the one pointed at or tapped, get a
 * thin line in the accent that grows across the row in the reading direction.
 */
.sv-site-header__nav:popover-open .sv-site-header__link {
	position: relative;
	border-block-end: 0;
}

.sv-site-header__nav:popover-open .sv-site-header__link::before {
	position: absolute;
	inset-inline: 0;
	inset-block-end: 0;
	block-size: 1px;
	background: var(--sv-color-primary);
	content: "";
	scale: 0 1;
	transform-origin: left;
	transition: scale 0.35s ease;
}

[dir="rtl"] .sv-site-header__nav:popover-open .sv-site-header__link::before {
	transform-origin: right;
}

/* Sub-pages: a small dot before each, in their color (the accent with the row's line). */
.sv-site-header__nav:popover-open .sv-site-header__submenu .sv-site-header__link {
	display: flex;
	gap: 0.7em;
	align-items: center;
}

.sv-site-header__nav:popover-open .sv-site-header__submenu .sv-site-header__link::after {
	display: block;
	flex: none;
	order: -1;
	inline-size: 5px;
	block-size: 5px;
	border-radius: 50%;
	background: currentcolor;
	content: "";
	opacity: 0.55;
	transition: opacity 0.2s ease;
}

.sv-site-header__nav:popover-open .sv-site-header__submenu .sv-site-header__link:is(:hover, :focus-visible, [aria-current="page"])::after {
	opacity: 1;
}

.sv-site-header__nav:popover-open .sv-site-header__link:is(:hover, :focus-visible, [aria-current="page"])::before {
	scale: 1 1;
}

/* The main pages larger and bolder; their sub-pages under them, at the same start (ADR 0055). */
.sv-site-header__nav:popover-open .sv-site-header__menu > .sv-site-header__item > .sv-site-header__link {
	font-size: calc(1.05rem + 2px);
	font-weight: 650;
}

.sv-site-header__nav:popover-open .sv-site-header__submenu {
	position: static;
	display: block;
	min-inline-size: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
}

.sv-site-header__nav:popover-open .sv-site-header__submenu::before {
	display: none;
}

.sv-site-header__nav:popover-open .sv-site-header__submenu .sv-site-header__link {
	padding: 0.7rem 0;
	font-size: 1rem;
}

.sv-site-header__nav:popover-open .sv-site-header__item--parent > .sv-site-header__link::after {
	display: none;
}

.sv-site-header__nav:popover-open .sv-site-header__button .sv-button__control {
	display: flex;
	inline-size: 100%;
}

.sv-site-header__nav::backdrop {
	background: rgb(16 24 40 / 40%);
}

@media (prefers-reduced-motion: reduce) {

	.sv-site-header__link::before,
	.sv-site-header.sv-site-header--scroll-hide[data-sticky] {
		transition: none;
	}

	.sv-site-header__nav[popover],
	.sv-site-header__bars,
	.sv-site-header__bars::before,
	.sv-site-header__bars::after {
		transition: none;
	}
}

/* ---------- Search (ADR 0056, 0057) ---------- */

/* An icon at the end of the menu; it opens the full-screen search (a popover, no JavaScript). */
.sv-site-header__search-toggle {
	display: grid;
	flex: none;
	place-items: center;
	inline-size: 2.25rem;
	block-size: 2.25rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: color 0.2s ease, opacity 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.sv-site-header__search-toggle:is(:hover, :focus-visible) {
	color: var(--sv-color-primary);
}

.sv-site-header:is(.sv-site-header--background-inverse, .sv-site-header--background-primary):not([data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill)) .sv-site-header__nav:not(:popover-open) .sv-site-header__search-toggle,
.sv-site-header:is(:is(.sv-site-header--background-none, .sv-site-header--background-clear), [data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill)):not(.sv-site-header--tone-dark) .sv-site-header__nav:not(:popover-open) .sv-site-header__search-toggle {
	color: inherit;
}

.sv-site-header__search-toggle svg {
	inline-size: 1.2rem;
	block-size: 1.2rem;
	fill: none;
	stroke: currentcolor;
	stroke-linecap: round;
	stroke-width: 2;
}

.sv-site-header__search-text {
	display: none;
}

/* The phone menu: a row that looks like a field, at the top. */
.sv-site-header__nav:popover-open .sv-site-header__close {
	order: -2;
}

.sv-site-header__nav:popover-open .sv-site-header__search-toggle {
	display: flex;
	order: -1;
	gap: 0.6rem;
	justify-content: flex-start;
	inline-size: 100%;
	block-size: auto;
	padding: 0.75rem 0.9rem;
	border: 1px solid var(--sv-ink-border, #e2e5ec);
	border-radius: var(--sv-radius-sm);
	background: color-mix(in srgb, currentcolor 4%, transparent);
	color: inherit;
	font: inherit;
	text-align: start;
}

.sv-site-header__nav:popover-open .sv-site-header__search-toggle svg {
	opacity: 0.6;
}

.sv-site-header__nav:popover-open .sv-site-header__search-text {
	display: inline;
	opacity: 0.6;
}

/*
 * The full-screen search (ADR 0057, the owner's earlier sites): over the whole page in its color, a
 * small accent label, a large field (focused on opening) on a line, a hint (Enter, Esc) and a round
 * close button. It fades in.
 */
.sv-site-search {
	position: fixed;
	inset: 0;
	inline-size: 100%;
	max-inline-size: none;
	block-size: 100%;
	max-block-size: none;
	margin: 0;
	padding: clamp(1.25rem, 5vw, 4rem);
	border: 0;
	background: color-mix(in srgb, var(--sv-color-background) 97%, transparent);
	backdrop-filter: blur(8px);
	color: var(--sv-ink, #1b1f2a);
	opacity: 0;
	transition: opacity 0.25s ease, display 0.25s allow-discrete, overlay 0.25s allow-discrete;
}

.sv-site-search:popover-open {
	display: grid;
	place-items: center;
	opacity: 1;
}

@starting-style {
	.sv-site-search:popover-open {
		opacity: 0;
	}
}

.sv-site-search::backdrop {
	background: transparent;
}

/* The close button: the phone menu's X (its bars) in a thin circle, in the top corner. */
.sv-site-search__close {
	position: absolute;
	inset-block-start: calc(var(--wp-admin--admin-bar--height, 0px) + clamp(1rem, 3vw, 2rem));
	inset-inline-end: clamp(1rem, 3vw, 2rem);
	display: grid;
	inline-size: 3rem;
	block-size: 3rem;
	border: 1px solid var(--sv-ink-border, #e2e5ec);
	border-radius: 50%;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.sv-site-search__close:is(:hover, :focus-visible) {
	border-color: var(--sv-color-primary);
	color: var(--sv-color-primary);
}

.sv-site-search__form {
	inline-size: min(44rem, 100%);
	margin: 0;
}

.sv-site-search__label {
	display: block;
	margin-block-end: 1.25rem;
	color: var(--sv-color-link);
	font-family: var(--sv-font-label, var(--sv-font-body));
	font-size: var(--sv-size-small);
	font-weight: 700;
	font-synthesis-weight: var(--sv-font-label-synthesis, auto);
	letter-spacing: calc(0.04em * var(--sv-tracking, 1));
	text-align: center;
	text-transform: var(--sv-uppercase, uppercase);
}

.sv-site-search__row {
	display: flex;
	gap: 1rem;
	align-items: center;
	padding-block-end: 0.75rem;
	border-block-end: 2px solid color-mix(in srgb, currentcolor 25%, transparent);
	transition: border-color 0.2s ease;
}

.sv-site-search__row:focus-within {
	border-block-end-color: var(--sv-color-primary);
}

.sv-site-search__row svg {
	flex: none;
	inline-size: 1.75rem;
	block-size: 1.75rem;
	fill: none;
	opacity: 0.5;
	stroke: currentcolor;
	stroke-linecap: round;
	stroke-width: 1.8;
}

.sv-site-search__field {
	flex: 1;
	min-inline-size: 0;
	padding: 0.25rem 0;
	border: 0;
	outline: 0;
	background: transparent;
	color: inherit;
	font-family: var(--sv-font-heading);
	font-size: clamp(1.6rem, 4vw, 2.5rem);
	font-weight: var(--sv-font-heading-weight, 700);
	font-synthesis-weight: none;
}

.sv-site-search__field::placeholder {
	color: currentcolor;
	opacity: 0.3;
}

/*
 * The field's clear button (Chrome, Edge, Safari show one in a search field): the theme's thin X — the
 * menu's lines, 2px with round ends — instead of the browser's own.
 */
.sv-site-search__field::-webkit-search-cancel-button {
	inline-size: 1.4rem;
	block-size: 1.4rem;
	margin-inline-start: 0.75rem;
	background-color: currentcolor;
	cursor: pointer;
	opacity: 0.45;
	transition: opacity 0.2s ease;
	appearance: none;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center / contain no-repeat;
}

.sv-site-search__field::-webkit-search-cancel-button:hover {
	opacity: 1;
}

.sv-site-search__hint {
	margin: 1.25rem 0 0;
	color: var(--sv-ink-muted, #5b6170);
	font-size: var(--sv-size-small);
	text-align: center;
}

/* Pages found as you type (view.js): a short list of links under the field. */
.sv-site-search__results:empty {
	display: none;
}

.sv-site-search__results {
	margin-block-start: 1.5rem;
}

.sv-site-search__list {
	display: grid;
	gap: 0.15rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sv-site-search__result {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 1rem;
	border-radius: 12px;
	color: inherit;
	font-size: var(--sv-size-body);
	font-weight: 500;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.sv-site-search__result::after {
	flex: none;
	inline-size: 0.45em;
	block-size: 0.45em;
	border-block-start: 2px solid currentcolor;
	border-inline-end: 2px solid currentcolor;
	content: "";
	opacity: 0.4;
	rotate: 45deg;
}

[dir="rtl"] .sv-site-search__result::after {
	rotate: -135deg;
}

.sv-site-search__result:is(:hover, :focus-visible) {
	background: color-mix(in srgb, var(--sv-color-primary) 8%, transparent);
	color: var(--sv-color-link);
}

.sv-site-search__empty {
	margin: 0;
	color: var(--sv-ink-muted, #5b6170);
	text-align: center;
}

@media (prefers-reduced-motion: reduce) {
	.sv-site-search {
		transition: none;
	}
}

/*
 * Phone menu: Dark (ADR 0056). The drawer in the Dark color with light text; the page you are on and
 * the one tapped in a lighter accent, readable on it.
 */
.sv-site-header--drawer-dark .sv-site-header__nav:popover-open {
	--sv-ink: var(--sv-color-on-inverse);
	--sv-ink-border: color-mix(in srgb, var(--sv-color-on-inverse) 18%, transparent);
	--sv-drawer-accent: color-mix(in oklab, var(--sv-color-primary), #fff 45%);
	background: var(--sv-color-inverse);
	color: var(--sv-color-on-inverse);
}

.sv-site-header--drawer-dark .sv-site-header__nav:popover-open .sv-site-header__link:is([aria-current="page"], :hover, :focus-visible) {
	color: var(--sv-drawer-accent);
}

.sv-site-header--drawer-dark .sv-site-header__nav:popover-open .sv-site-header__link::before {
	background: var(--sv-drawer-accent);
}

@keyframes sv-site-header-fade-in {
	from {
		opacity: 0;
	}
}

/* ---------- Over the first section (ADR 0056) ---------- */

/*
 * Out of the flow, at the top of the page — inside the first section's box when it has a Space around
 * (ADR 0078): the site writes that box's top and sides on each screen size (--sv-over-*, overFrame).
 */
.sv-site-header[data-overlay] {
	--sv-in-top: var(--sv-over-top, 0px);
	--sv-in-start: var(--sv-over-start, 0px);
	--sv-in-end: var(--sv-over-end, 0px);
	position: absolute;
	inset-block-start: calc(var(--wp-admin--admin-bar--height, 0px) + var(--sv-in-top));
	inset-inline: var(--sv-in-start) var(--sv-in-end);
}

@media (max-width: 1024px) {
	.sv-site-header[data-overlay] {
		--sv-in-top: var(--sv-over-top-t, 0px);
		--sv-in-start: var(--sv-over-start-t, 0px);
		--sv-in-end: var(--sv-over-end-t, 0px);
	}
}

@media (max-width: 767px) {
	.sv-site-header[data-overlay] {
		--sv-in-top: var(--sv-over-top-m, 0px);
		--sv-in-start: var(--sv-over-start-m, 0px);
		--sv-in-end: var(--sv-over-end-m, 0px);
	}
}

/*
 * A see-through header that stays at the top fills with its background as the page scrolls (Dark for
 * light text, Page for dark text). Browsers without scroll timelines keep it at the top of the page.
 */
@supports (animation-timeline: scroll()) {
	.sv-site-header:is(.sv-site-header--background-none, .sv-site-header--background-clear):not(.sv-site-header--shape-box, .sv-site-header--shape-pill)[data-overlay][data-sticky] {
		position: fixed;
		animation: sv-site-header-fill linear both;
		animation-range: 0 5rem;
		animation-timeline: scroll();
	}
}

/* Filled, it leaves a boxed first section's frame (ADR 0107): edge to edge at the top, no margins around. */
@keyframes sv-site-header-fill {
	to {
		inset-block-start: var(--wp-admin--admin-bar--height, 0px);
		inset-inline: 0;
		background-color: var(--sv-header-fill);
	}
}

/*
 * The top bar (ADR 0103, Classic): a thin band above the header's row, as wide as the page, with the footer's phone,
 * email and social links and words of its own — Dark, Accent color or Soft. Phone numbers and addresses read left
 * to right in every language. On phones the phone and email are icons (a tap calls or writes) and the words go.
 */
.sv-site-header__top {
	--sv-top-bg: var(--sv-color-inverse);
	--sv-top-ink: var(--sv-color-on-inverse);
	margin-inline: calc(-1 * var(--sv-gutter));
	padding-inline: var(--sv-gutter);
	background: var(--sv-top-bg);
	color: var(--sv-top-ink);
	font-size: var(--sv-size-small);
	line-height: 1.3;
}

.sv-site-header__top--accent {
	--sv-top-bg: var(--sv-color-primary);
	--sv-top-ink: var(--sv-color-on-primary);
}

.sv-site-header__top--soft {
	--sv-top-bg: var(--sv-color-surface);
	--sv-top-ink: var(--sv-color-text);
	/* A hairline under it: on a Soft header it would blend in. */
	border-block-end: 1px solid color-mix(in srgb, currentcolor 10%, transparent);
}

.sv-site-header__top-inner {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.5rem;
	align-items: center;
	justify-content: space-between;
	max-inline-size: var(--sv-container-content, var(--sv-container-standard));
	min-block-size: 2.25rem;
	margin-inline: auto;
	padding-block: 0.25rem;
}

.sv-site-header__top-contacts {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
	align-items: center;
}

.sv-site-header__top-link {
	display: inline-flex;
	gap: 0.45em;
	align-items: center;
	color: inherit;
	text-decoration: none;
	opacity: 0.9;
}

.sv-site-header__top-link:hover,
.sv-site-header__top-link:focus-visible {
	text-decoration: underline;
	opacity: 1;
}

.sv-site-header__top-label {
	direction: ltr;
	unicode-bidi: isolate;
}

.sv-site-header__top-text {
	opacity: 0.85;
}

.sv-site-header__top-icon {
	flex: none;
	inline-size: 1.05em;
	block-size: 1.05em;
	fill: none;
	stroke: currentcolor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2;
}

.sv-site-header__top-socials {
	display: flex;
	gap: 0.15rem;
	align-items: center;
	margin-inline-start: auto;
}

.sv-site-header__top-social {
	display: inline-grid;
	place-items: center;
	inline-size: 1.75rem;
	block-size: 1.75rem;
	border-radius: 50%;
	color: inherit;
	opacity: 0.85;
	transition: opacity 0.2s ease, background-color 0.2s ease;
}

.sv-site-header__top-social:hover,
.sv-site-header__top-social:focus-visible {
	background: color-mix(in srgb, currentcolor 14%, transparent);
	opacity: 1;
}

@media (max-width: 767px) {
	.sv-site-header__top-text {
		display: none;
	}

	/* The number and address stay readable to screen readers; the icons are what shows. */
	.sv-site-header__top-label {
		position: absolute;
		inline-size: 1px;
		block-size: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.sv-site-header__top-link {
		display: inline-grid;
		place-items: center;
		inline-size: 1.75rem;
		block-size: 1.75rem;
	}

	.sv-site-header__top-icon {
		inline-size: 1.1em;
		block-size: 1.1em;
	}
}

/* Over the first section, the top bar's height joins the room the header takes. */
:root:has(.sv-site-header[data-overlay] > .sv-site-header__top) {
	--sv-hr-top: 2.25rem;
}

/*
 * The room the header takes over the first section: the page's first section (or the page name, when
 * it is shown) starts with a spacer this tall, so its content keeps its place, and a half- or
 * full-screen section centers it in the space below the header. Worked out from the header's sizes
 * above (keep them in step): its height and room inside, the logo or the name, the button, the menu
 * button on phones, the Centered layout's second row, and a floating box's gap above and below.
 */
:root:has(.sv-site-header[data-overlay]) {
	--sv-hr-height: 4.5rem;
	--sv-hr-pad: 0.75rem;
	--sv-hr-brand: 1.5rem;
	--sv-hr-button: 0px;
	--sv-hr-gap: 0px;
	--sv-header-room: calc(max(var(--sv-hr-height), max(var(--sv-hr-brand), var(--sv-hr-button)) + 2 * var(--sv-hr-pad)) + 2 * var(--sv-hr-gap) + var(--sv-hr-top, 0px));
}

:root:has(.sv-site-header--height-sm[data-overlay]) {
	--sv-hr-height: 3.5rem;
	--sv-hr-pad: 0.4rem;
}

:root:has(.sv-site-header--height-lg[data-overlay]) {
	--sv-hr-height: 6rem;
	--sv-hr-pad: 1.25rem;
}

:root:has(.sv-site-header[data-overlay] .sv-site-header__logo) {
	--sv-hr-brand: 2.75rem;
}

:root:has(.sv-site-header--logo-size-sm[data-overlay] .sv-site-header__logo) {
	--sv-hr-brand: 2rem;
}

:root:has(.sv-site-header--logo-size-lg[data-overlay] .sv-site-header__logo) {
	--sv-hr-brand: 3.75rem;
}

:root:has(.sv-site-header--logo-size-xl[data-overlay] .sv-site-header__logo) {
	--sv-hr-brand: 5rem;
}

:root:has(.sv-site-header[data-overlay] .sv-site-header__button) {
	--sv-hr-button: 2.5rem;
}

/* The Centered layout: the menu on a second row. */
@media (min-width: 1025px) {
	:root:has(.sv-site-header--layout-centered[data-overlay]) {
		--sv-header-room: calc(max(var(--sv-hr-height), var(--sv-hr-brand) + 0.75rem + max(1.925rem, var(--sv-hr-button)) + 2 * var(--sv-hr-pad)) + 2 * var(--sv-hr-gap) + var(--sv-hr-top, 0px));
	}
}

/* Phones and tablets (ADR 0091), and Menu button only: the menu button beside the logo. */
@media (max-width: 1024px) {
	:root:has(.sv-site-header[data-overlay]) {
		--sv-header-room: calc(max(var(--sv-hr-height), max(var(--sv-hr-brand), 2.75rem) + 2 * var(--sv-hr-pad)) + 2 * var(--sv-hr-gap) + var(--sv-hr-top, 0px));
	}

	/* Centered: the menu button under the logo. */
	:root:has(.sv-site-header--layout-centered[data-overlay]) {
		--sv-header-room: calc(max(var(--sv-hr-height), var(--sv-hr-brand) + 0.75rem + 2.75rem + 2 * var(--sv-hr-pad)) + 2 * var(--sv-hr-gap) + var(--sv-hr-top, 0px));
	}
}

:root:has(.sv-site-header--layout-minimal[data-overlay]) {
	--sv-header-room: calc(max(var(--sv-hr-height), max(var(--sv-hr-brand), 2.75rem) + 2 * var(--sv-hr-pad)) + 2 * var(--sv-hr-gap) + var(--sv-hr-top, 0px));
}

@keyframes sv-site-header-shrink-glow {
	to {
		block-size: calc((var(--sv-hr-gap) + var(--sv-hr-height) * 0.76) * 1.95);
	}
}

:root:has(.sv-site-header[data-overlay]):not(:has(.entry-wrap--builder:not([hidden]))) .sv-page > :first-child::before,
:root:has(.sv-site-header[data-overlay]) .entry-wrap--builder:not([hidden])::before {
	display: block;
	block-size: var(--sv-header-room);
	content: "";
}

/*
 * Over a dark page title band (ADR 0065): the site's page title look is Dark, Accent color or a
 * picture with light text, and the page starts with it — a see-through header with dark text ("for light sections")
 * takes light text there, so the menu stays readable on every inner page.
 */
:root:has(.sv-page > :first-child .sv-titleband:is(.sv-titleband--bg-dark, .sv-titleband--bg-accent, .sv-titleband--bg-image.sv-titleband--tone-light)):not(:has(.entry-wrap--builder:not([hidden]))) .sv-site-header.sv-site-header--tone-dark[data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill) {
	--sv-color-text: var(--sv-color-on-inverse);
	--sv-color-muted: color-mix(in srgb, var(--sv-color-on-inverse) 76%, transparent);
	--sv-header-fill: var(--sv-color-inverse);
	color: var(--sv-color-on-inverse);
}

:root:has(.sv-page > :first-child .sv-titleband:is(.sv-titleband--bg-dark, .sv-titleband--bg-accent, .sv-titleband--bg-image.sv-titleband--tone-light)):not(:has(.entry-wrap--builder:not([hidden]))) .sv-site-header.sv-site-header--tone-dark[data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill) .sv-site-header__logo--on-dark {
	display: block;
}

:root:has(.sv-page > :first-child .sv-titleband:is(.sv-titleband--bg-dark, .sv-titleband--bg-accent, .sv-titleband--bg-image.sv-titleband--tone-light)):not(:has(.entry-wrap--builder:not([hidden]))) .sv-site-header.sv-site-header--tone-dark[data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill) .sv-site-header__brand:has(> .sv-site-header__logo--on-dark) > .sv-site-header__logo:not(.sv-site-header__logo--on-dark) {
	display: none;
}

:root:has(.sv-page > :first-child .sv-titleband:is(.sv-titleband--bg-dark, .sv-titleband--bg-accent, .sv-titleband--bg-image.sv-titleband--tone-light)):not(:has(.entry-wrap--builder:not([hidden]))) .sv-site-header.sv-site-header--tone-dark[data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill) .sv-site-header__link[aria-current="page"],
:root:has(.sv-page > :first-child .sv-titleband:is(.sv-titleband--bg-dark, .sv-titleband--bg-accent, .sv-titleband--bg-image.sv-titleband--tone-light)):not(:has(.entry-wrap--builder:not([hidden]))) .sv-site-header.sv-site-header--tone-dark[data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill) .sv-site-header__nav:not(:popover-open) .sv-site-header__search-toggle {
	color: inherit;
}

:root:has(.sv-page > :first-child .sv-titleband:is(.sv-titleband--bg-dark, .sv-titleband--bg-accent, .sv-titleband--bg-image.sv-titleband--tone-light)):not(:has(.entry-wrap--builder:not([hidden]))) .sv-site-header.sv-site-header--tone-dark[data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill) .sv-site-header__nav:not(:popover-open) a.sv-site-header__textlink:is(:hover, :focus-visible) {
	color: inherit;
	opacity: 0.75;
}

@media (min-width: 1025px) {
	:root:has(.sv-page > :first-child .sv-titleband:is(.sv-titleband--bg-dark, .sv-titleband--bg-accent, .sv-titleband--bg-image.sv-titleband--tone-light)):not(:has(.entry-wrap--builder:not([hidden]))) .sv-site-header.sv-site-header--tone-dark[data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill) .sv-site-header__menu > .sv-site-header__item > .sv-site-header__link:is(:hover, :focus-visible) {
		color: inherit;
	}
}

/* Over an Accent-color band its button takes the light color made for it, as on an Accent-color header. */
:root:has(.sv-page > :first-child .sv-titleband--bg-accent):not(:has(.entry-wrap--builder:not([hidden]))) .sv-site-header:is(.sv-site-header--background-none, .sv-site-header--background-clear)[data-overlay]:not(.sv-site-header--shape-box, .sv-site-header--shape-pill) {
	--sv-button-main-bg: var(--sv-color-on-primary);
	--sv-button-main-text: var(--sv-color-primary);
}

@keyframes sv-site-header-glass {
	to {
		inset-block-start: var(--wp-admin--admin-bar--height, 0px);
		inset-inline: 0;
		background-color: var(--sv-pill-glass);
		backdrop-filter: var(--sv-glass-blur);
	}
}
