/**
 * Kubota Europe site header.
 *
 * Built from the approved design (Figma `r3kgqCOuXcGPBzXEFeHlgb`: header
 * `4595:1931` + `4595:1941`, mega-menus `3735:17119` / `5119:2910` / `3735:17123`,
 * country panel `3735:17127`).
 *
 * SCALE. The artboard is 2560 px wide, so its literal values (20px text, 342px
 * logo, 35px gaps) are the sizes at that width and not at a normal desktop one.
 * Following the convention the rest of the plugin already uses, every size is a
 * `clamp()` whose **maximum is the design value** and whose minimum keeps it
 * readable, with the `vw` term reaching the maximum right around the artboard
 * width — so on a 2560 px screen the header matches the mock exactly and scales
 * down gracefully everywhere else.
 *
 * Font family "Inter" comes from the plugin's fonts stylesheet
 * (this handle depends on `kbeu-fonts`); the bundled family ships 300 / 400 / 500 / 700,
 * so the design's Roman (400) matches exactly.
 *
 * Below `--kbeu-header-bp` the bar collapses to logo + search + burger and the
 * navigation moves into the drawer. That small-screen layout is not in the Figma
 * file; it follows the same type scale and colours.
 *
 * VARIANTS. The solid white header (`4481:1376`) is the default; the country
 * home page gets the transparent one (`4595:1931` / `4595:1941`): same elements,
 * no background, everything white over the page. Colours therefore live in the
 * tokens below and the transparent variant only swaps them — see the
 * "Transparent" section.
 */

.kbeu-header {
	--kbeu-header-orange: var( --kbeu-color-orange );
	--kbeu-header-teal: var( --kbeu-color-teal );
	--kbeu-header-ink: #000;
	/* What is drawn on an ink-filled surface (the outlined button on hover). */
	--kbeu-header-paper: #fff;
	--kbeu-header-bg: #fff;
	--kbeu-header-rule: rgba( 0, 0, 0, 0.6 );
	--kbeu-header-hairline: rgba( 0, 0, 0, 0.2 );
	--kbeu-header-bp: 1200px;

	/* Design: 20px @2560. */
	--kbeu-header-fs: clamp( 15px, 0.78vw, 20px );
	/* Design: 18px @2560 (the "EN" code). */
	--kbeu-header-fs-code: clamp( 13px, 0.7vw, 18px );
	/* Design: 35px gap between navigation entries. */
	--kbeu-header-gap: clamp( 14px, 1.37vw, 35px );
	/* Design: content spans 51 → 2509 of the 2560 artboard. */
	--kbeu-header-pad: clamp( 20px, 2vw, 51px );
	/* Design: utility row 36 → 88, main row 88 → 192. */
	--kbeu-header-top-h: clamp( 38px, 2.03vw, 52px );
	--kbeu-header-main-h: clamp( 60px, 4.06vw, 104px );
	--kbeu-header-radius: 15px;

	position: relative;
	z-index: 500;
	color: var( --kbeu-header-ink );
	font-family: var( --kbeu-font-principal );
}

/* The surface is the bar's, not the header's: the panels and the drawer that
   follow it paint their own, and the transparent variant takes this one away. */
.kbeu-header__bar {
	background: var( --kbeu-header-bg );
	color: var( --kbeu-header-ink );
	transition: background-color 0.25s ease, color 0.25s ease;
}

.kbeu-header--sticky {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
}

/* The fixed header is out of the flow, so the document makes room for it. The
   fallback matches the header's natural height before the script measures it. */
body.kbeu-has-fixed-header {
	padding-top: var( --kbeu-header-height, 156px );
}

/* In-page anchors (a button to `#id`, a row ID) land below the pinned header
   instead of under it: the browser's own jump and `scrollIntoView()` honour the
   root's scroll padding. Scripts that scroll with `window.scrollTo()` (the sticky
   menus, the grids' pagers) are unaffected and keep their own offset. */
html:has( > body.kbeu-has-fixed-header ) {
	scroll-padding-top: var( --kbeu-header-height, 156px );
}

/* WordPress' admin bar is itself fixed and pushes the document down. */
body.admin-bar .kbeu-header--sticky,
body.admin-bar .kbeu-header--transparent {
	top: 32px;
}

@media ( max-width: 782px ) {
	body.admin-bar .kbeu-header--sticky,
	body.admin-bar .kbeu-header--transparent {
		top: 46px;
	}
}

/* ------------------------------------------------------------ Transparent */

/* The header laid over the top of the page instead of above it: no surface,
   every element white, and the page — Impreza's `.l-canvas` — starting at the
   very top of the document rather than under a padding. A pinned one stays in
   its fixed slot; an unpinned one is simply anchored to the top and scrolls
   away with the page.

   It is only transparent while the page's own top is behind it. The script adds
   `is-solid` — bringing the default colours back — as soon as the page has
   scrolled past the bar or a panel/the drawer is open, since white text over
   whatever comes next is unreadable and the panels are white themselves. The
   tokens are swapped on the bar alone, so the panels and the drawer keep their
   surfaces. */
.kbeu-header--transparent:not( .kbeu-header--sticky ) {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
}

body.kbeu-has-transparent-header {
	padding-top: 0;
}

.kbeu-header--transparent:not( .is-solid ) .kbeu-header__bar {
	--kbeu-header-ink: #fff;
	--kbeu-header-paper: #000;
	--kbeu-header-bg: transparent;
	--kbeu-header-rule: rgba( 255, 255, 255, 0.6 );
}

/* The white logo, when one is configured; otherwise the regular one is turned
   into a white silhouette. */
.kbeu-header__logo .kbeu-header__logo-img--light {
	display: none;
}

.kbeu-header--transparent:not( .is-solid ) .kbeu-header__logo--has-light .kbeu-header__logo-img--dark {
	display: none;
}

.kbeu-header--transparent:not( .is-solid ) .kbeu-header__logo--has-light .kbeu-header__logo-img--light {
	display: block;
}

.kbeu-header--transparent:not( .is-solid ) .kbeu-header__logo:not( .kbeu-header__logo--has-light ) .kbeu-header__logo-img {
	filter: brightness( 0 ) invert( 1 );
}

.kbeu-header a {
	text-decoration: none;
	color: inherit;
}

/* The links that hover to turquoise further down: Impreza's `.no-touch a:hover`
   out-ranks those rules and paints them with this variable (see `kbeu-buttons.css`). */
.kbeu-header__top-link,
.kbeu-header__nav-link,
.kbeu-header__panel-heading-link,
.kbeu-header__panel-link,
.kbeu-header__country-name,
.kbeu-header__country-lang {
	--color-content-link-hover: var( --kbeu-header-teal );
}

/* Impreza gives every `li` a 0.5rem bottom margin and zeroes it on the last one
   (`li:last-child { margin-bottom: 0 }`); in a centred flex row that lifts every
   entry except the last. None of the header's lists want that margin. */
.kbeu-header li {
	margin: 0;
}

.kbeu-header__container {
	max-width: 2458px;
	margin: 0 auto;
	padding: 0 var( --kbeu-header-pad );
}

.kbeu-header__icon {
	display: block;
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.kbeu-header .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect( 0 0 0 0 );
	white-space: nowrap;
	border: 0;
}

/* ---------------------------------------------------------------- Utility row */

/* The design's divider is inset to the content edges rather than bleeding to the
   viewport, so it is drawn as a rule of the content's own width. */
.kbeu-header__top::after {
	content: "";
	display: block;
	width: min( 2458px, calc( 100% - var( --kbeu-header-pad ) * 2 ) );
	height: 1px;
	margin: 0 auto;
	background: var( --kbeu-header-rule );
}

.kbeu-header__top .kbeu-header__container {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	min-height: var( --kbeu-header-top-h );
}

.kbeu-header__top-list {
	display: flex;
	align-items: center;
	gap: var( --kbeu-header-gap );
	margin: 0;
	padding: 0;
	list-style: none;
}

.kbeu-header__top-item {
	display: flex;
	align-items: center;
	gap: var( --kbeu-header-gap );
}

/* Thin vertical rule between entries, as in the design. */
.kbeu-header__top-item + .kbeu-header__top-item::before,
.kbeu-header__nav-item + .kbeu-header__nav-item::before {
	content: "";
	flex: none;
	width: 1px;
	height: 0.85em;
	background: currentColor;
}

/* A nav entry is taller than its text (10px of room for the active underline
   below it), so the rule would be centred on text + underline room and sit 5px
   low. Lifting it by that room centres it on the text, as in the design. */
.kbeu-header__nav-item + .kbeu-header__nav-item::before {
	margin-bottom: 10px;
}

/* Closing rule between the last entry and the outlined button that follows the
   navigation (Aftersales), as in the design. The centre's own gap spaces it from
   the button; the margin spaces it from the last entry. */
.kbeu-header__nav:has( + .kbeu-header__action ) {
	align-items: center;
}

.kbeu-header__nav:has( + .kbeu-header__action )::after {
	content: "";
	flex: none;
	width: 1px;
	height: 0.85em;
	margin: 0 0 10px var( --kbeu-header-gap );
	background: currentColor;
}

.kbeu-header__top-link {
	font-size: var( --kbeu-header-fs );
	font-weight: 700;
	line-height: 1.3;
	transition: color 0.2s ease;
}

.kbeu-header__top-link:hover,
.kbeu-header__top-link:focus-visible {
	color: var( --kbeu-header-teal );
}

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

/* Logo · navigation · actions. The two outer tracks share what is left over, so
   the middle one lands on the bar's true centre — where the design puts the
   navigation together with its outlined button (their combined span is centred
   on the 2560 artboard). */
.kbeu-header__main .kbeu-header__container {
	display: grid;
	grid-template-columns: minmax( 0, 1fr ) auto minmax( 0, 1fr );
	align-items: center;
	gap: var( --kbeu-header-gap );
	min-height: var( --kbeu-header-main-h );
}

.kbeu-header__center {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var( --kbeu-header-gap );
}

.kbeu-header__logo {
	flex: none;
	display: block;
	/* Design: 342px wide @2560. */
	width: clamp( 150px, 13.4vw, 342px );
}

.kbeu-header__logo img {
	display: block;
	width: 100%;
	height: auto;
}

.kbeu-header__logo-text {
	font-size: calc( var( --kbeu-header-fs ) * 1.4 );
	font-weight: 700;
}

.kbeu-header__nav {
	flex: 0 1 auto;
	display: flex;
	justify-content: center;
}

.kbeu-header__nav-list {
	display: flex;
	align-items: center;
	gap: var( --kbeu-header-gap );
	margin: 0;
	padding: 0;
	list-style: none;
}

.kbeu-header__nav-item {
	display: flex;
	align-items: center;
	gap: var( --kbeu-header-gap );
}

.kbeu-header__nav-link {
	position: relative;
	display: block;
	padding: 0 0 10px;
	border: 0;
	background: none;
	font-family: inherit;
	font-size: var( --kbeu-header-fs );
	font-weight: 400;
	line-height: 1.3;
	color: inherit;
	white-space: nowrap;
	cursor: pointer;
	transition: color 0.2s ease;
}

/* Turquoise rule under the entry of the page being viewed (design: 3px). */
.kbeu-header__nav-link::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: var( --kbeu-header-teal );
	opacity: 0;
	transition: opacity 0.2s ease;
}

.kbeu-header__nav-link.is-current,
.kbeu-header__nav-link.is-ancestor {
	font-weight: 700;
}

.kbeu-header__nav-link.is-current::after,
.kbeu-header__nav-link[aria-expanded="true"]::after {
	opacity: 1;
}

.kbeu-header__nav-link:hover,
.kbeu-header__nav-link:focus-visible {
	color: var( --kbeu-header-teal );
}

/* --------------------------------------------------------------------- Actions */

.kbeu-header__actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: clamp( 10px, 0.9vw, 23px );
}

/* Design (`4481:1391` "Find a dealer", `4595:1942` "Aftersales"): 54px tall,
   i.e. 20px above and below the label's cap height — Figma trims the text box to
   it — with the 35px pin overhanging that padding. A CSS line box is taller than
   the cap height and the pin taller than both, so vertical padding sized the
   button off the pin (77px @2560): the height is set instead and the content
   centred in it. */
.kbeu-header__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	box-sizing: border-box;
	min-height: clamp( 40px, 2.11vw, 54px );
	padding: 0 clamp( 14px, 1.02vw, 26px );
	border: 1px solid transparent;
	border-radius: var( --kbeu-header-radius );
	font-size: var( --kbeu-header-fs );
	font-weight: 400;
	line-height: 1.2;
	white-space: nowrap;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* The filled buttons keep a white label whatever the bar's ink is (solid bar,
   open panel, drawer). Scoped to `.kbeu-header` so they outrank the
   `.kbeu-header a { color: inherit }` reset above — unscoped, the label took
   the ink and turned black everywhere but the transparent bar. */
.kbeu-header .kbeu-header__btn--primary {
	background: var( --kbeu-header-orange );
	border-color: var( --kbeu-header-orange );
	color: #fff;
}

.kbeu-header .kbeu-header__btn--primary:hover,
.kbeu-header .kbeu-header__btn--primary:focus-visible {
	background: var( --kbeu-color-orange-dark );
	border-color: var( --kbeu-color-orange-dark );
	color: #fff;
}

/* `--color-content-link-hover`: Impreza's `.no-touch a:hover` out-ranks the hover
   label below and paints it with this variable (see `kbeu-buttons.css`). */
.kbeu-header__btn--outline {
	--color-content-link-hover: var( --kbeu-header-paper );
	border-color: var( --kbeu-header-ink );
	color: var( --kbeu-header-ink );
}

.kbeu-header__btn--outline:hover,
.kbeu-header__btn--outline:focus-visible {
	background: var( --kbeu-header-ink );
	color: var( --kbeu-header-paper );
}

.kbeu-header .kbeu-header__btn--pill {
	background: var( --kbeu-header-teal );
	border-color: var( --kbeu-header-teal );
	color: #fff;
}

.kbeu-header .kbeu-header__btn--pill:hover,
.kbeu-header .kbeu-header__btn--pill:focus-visible {
	background: var( --kbeu-color-teal-dark );
	border-color: var( --kbeu-color-teal-dark );
	color: #fff;
}

/* The pin that rides inside the primary call to action (design: 35px @2560). */
.kbeu-header__btn--primary .kbeu-header__icon {
	flex: none;
	width: clamp( 20px, 1.37vw, 35px );
	height: clamp( 20px, 1.37vw, 35px );
}

.kbeu-header__icon-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px;
	border: 0;
	background: none;
	color: inherit;
	cursor: pointer;
	transition: color 0.2s ease;
}

.kbeu-header__icon-btn:hover,
.kbeu-header__icon-btn:focus-visible {
	color: var( --kbeu-header-teal );
}

.kbeu-header__search-toggle .kbeu-header__icon {
	width: clamp( 18px, 1.18vw, 30px );
	height: auto;
}

.kbeu-header__globe > .kbeu-header__icon {
	width: clamp( 20px, 1.08vw, 28px );
	height: clamp( 20px, 1.08vw, 28px );
}

.kbeu-header__globe-code {
	font-size: var( --kbeu-header-fs-code );
	font-weight: 400;
	line-height: 1;
}

.kbeu-header__globe-chevron {
	display: block;
	width: clamp( 10px, 0.55vw, 14px );
	/* Drawn pointing right; the switcher's points down. */
	transform: rotate( 90deg );
	transition: transform 0.2s ease;
}

.kbeu-header__globe[aria-expanded="true"] .kbeu-header__globe-chevron {
	transform: rotate( -90deg );
}

/* Burger: three bars drawn in CSS (no small-screen design to follow). */
.kbeu-header__burger {
	display: none;
	width: 34px;
	height: 34px;
	justify-content: center;
}

.kbeu-header__burger-bars,
.kbeu-header__burger-bars::before,
.kbeu-header__burger-bars::after {
	display: block;
	width: 24px;
	height: 2px;
	background: currentColor;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.kbeu-header__burger-bars {
	position: relative;
}

.kbeu-header__burger-bars::before,
.kbeu-header__burger-bars::after {
	content: "";
	position: absolute;
	left: 0;
}

.kbeu-header__burger-bars::before {
	top: -7px;
}

.kbeu-header__burger-bars::after {
	top: 7px;
}

.kbeu-header__burger[aria-expanded="true"] .kbeu-header__burger-bars {
	background: transparent;
}

.kbeu-header__burger[aria-expanded="true"] .kbeu-header__burger-bars::before {
	transform: translateY( 7px ) rotate( 45deg );
}

.kbeu-header__burger[aria-expanded="true"] .kbeu-header__burger-bars::after {
	transform: translateY( -7px ) rotate( -45deg );
}

/* ---------------------------------------------------------------------- Panels */

/* Stacking inside the header (which is its own stacking context): the overlay
   sits under the panels and the drawer, or it would swallow their clicks — it
   is a later sibling in the DOM and `position: fixed`, so without an explicit
   order it paints on top of them. */
/* The panels share one grid cell: while one rolls up and the next rolls down
   they overlap instead of stacking, and the one opening paints on top. */
.kbeu-header__panels {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 2;
	display: grid;
}

/* Opening, a panel unrolls from the bar downwards — its clip moves from the top
   edge to the bottom one — and its content drops in just behind that edge;
   closing, it rolls back up, quicker. The transition on each state is the one
   used to reach it. The script hides the panel once the closing transition
   has run (it reads the duration from here). */
.kbeu-header__panel {
	--kbeu-header-unroll: 0.65s cubic-bezier( 0.4, 0, 0.2, 1 );
	--kbeu-header-rollup: 0.35s cubic-bezier( 0.32, 0, 0.67, 0 );

	grid-area: 1 / 1;
	background: #fff;
	clip-path: inset( 0 0 100% 0 );
	transition: clip-path var( --kbeu-header-rollup );
}

.kbeu-header__panel[hidden] {
	display: none;
}

.kbeu-header__panel.is-open {
	z-index: 1;
	clip-path: inset( 0 );
	transition: clip-path var( --kbeu-header-unroll );
}

.kbeu-header__panel-inner > * {
	opacity: 0;
	transform: translateY( -16px );
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.kbeu-header__panel.is-open .kbeu-header__panel-inner > * {
	opacity: 1;
	transform: none;
	transition: opacity 0.4s ease 0.15s, transform 0.6s cubic-bezier( 0.4, 0, 0.2, 1 ) 0.1s;
}

.kbeu-header__panel-inner {
	position: relative;
	/* Design: headings sit 57px under the bar, panel ends 571px lower. */
	padding-top: clamp( 24px, 2.2vw, 57px );
	padding-bottom: clamp( 28px, 2.7vw, 70px );
}

.kbeu-header__panel-close {
	position: absolute;
	top: clamp( 24px, 2.2vw, 57px );
	right: var( --kbeu-header-pad );
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 0;
	border: 0;
	background: none;
	font-family: inherit;
	font-size: var( --kbeu-header-fs );
	font-weight: 700;
	line-height: 1.5;
	color: inherit;
	cursor: pointer;
	transition: color 0.2s ease;
}

.kbeu-header__panel-close:hover,
.kbeu-header__panel-close:focus-visible {
	color: var( --kbeu-header-teal );
}

.kbeu-header__panel-close .kbeu-header__icon {
	width: clamp( 18px, 0.94vw, 24px );
	height: clamp( 18px, 0.94vw, 24px );
}

/* ------------------------------------------------------------------ Mega menu */

.kbeu-header__panel-columns {
	display: flex;
	flex-wrap: wrap;
	/* Design: columns start at x=820 of 2560, i.e. one third in. */
	padding-left: clamp( 0px, 30vw, 769px );
	gap: clamp( 24px, 2.7vw, 70px );
}

.kbeu-header__panel-column {
	flex: 0 1 clamp( 200px, 11.2vw, 286px );
	min-width: 0;
}

.kbeu-header__panel-heading {
	margin: 0 0 clamp( 12px, 0.86vw, 22px );
	font-family: inherit;
	font-size: var( --kbeu-header-fs );
	font-weight: 700;
	line-height: 1.5;
	color: var( --kbeu-header-ink );
}

.kbeu-header__panel-heading-link:hover,
.kbeu-header__panel-heading-link:focus-visible {
	color: var( --kbeu-header-teal );
}

.kbeu-header__panel-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.kbeu-header__panel-item + .kbeu-header__panel-item {
	/* Design: 37px baseline pitch against a 1.5 line-height. */
	margin-top: clamp( 4px, 0.27vw, 7px );
}

.kbeu-header__panel-link {
	display: block;
	font-size: var( --kbeu-header-fs );
	line-height: 1.5;
	transition: color 0.2s ease;
}

.kbeu-header__panel-link:hover,
.kbeu-header__panel-link:focus-visible {
	color: var( --kbeu-header-teal );
}

/* Third level (Figma `5309:1618`, the after-sales panel): "Service ⌄" opens a
   bulleted list. The disclosure is a button drawn like the plain links. */
.kbeu-header__panel-sub-toggle {
	display: inline-flex;
	align-items: center;
	gap: clamp( 10px, 0.8vw, 20px );
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	font-family: inherit;
	color: inherit;
	text-align: left;
	cursor: pointer;
}

.kbeu-header__panel-sub-chevron {
	display: inline-flex;
	width: 0.6em;
	transition: transform 0.2s ease;
}

.kbeu-header__panel-sub-chevron svg {
	display: block;
	width: 100%;
	height: auto;
}

/* Drawn pointing right (closed); the open state of the design points down. */
.kbeu-header__panel-sub-toggle[aria-expanded="true"] .kbeu-header__panel-sub-chevron {
	transform: rotate( 90deg );
}

.kbeu-header__panel-sublist {
	margin: clamp( 6px, 0.5vw, 13px ) 0 0;
	padding: 0;
	list-style: none;
}

.kbeu-header__panel-sublist[hidden] {
	display: none;
}

.kbeu-header__panel-subitem {
	display: flex;
	align-items: baseline;
	gap: 0.6em;
}

.kbeu-header__panel-subitem + .kbeu-header__panel-subitem {
	margin-top: clamp( 4px, 0.27vw, 7px );
}

.kbeu-header__panel-subitem::before {
	content: "";
	flex: none;
	width: 0.3em;
	height: 0.3em;
	border-radius: 50%;
	background: currentColor;
	transform: translateY( -0.12em );
}

/* An action entry that opens a panel is a <button>, not an <a>: drop the look the
   theme gives every button (a grey fill, a shadow), so the outlined variant stays
   see-through on the transparent home bar like the link it replaces. */
.kbeu-header button.kbeu-header__action {
	font-family: inherit;
	cursor: pointer;
	box-shadow: none;
	text-shadow: none;
	text-transform: none;
	letter-spacing: normal;
}

.kbeu-header button.kbeu-header__btn--outline {
	background: transparent;
}

.kbeu-header button.kbeu-header__btn--outline:hover,
.kbeu-header button.kbeu-header__btn--outline:focus-visible {
	background: var( --kbeu-header-ink );
	color: var( --kbeu-header-paper );
}

.kbeu-header__panel-ctas {
	margin-top: clamp( 14px, 1.05vw, 27px );
	padding-top: clamp( 14px, 1.05vw, 27px );
	border-top: 1px solid var( --kbeu-header-hairline );
}

.kbeu-header__panel-cta {
	width: 100%;
}

/* ------------------------------------------------------------- Country panel */

/* Design: "International" on its own, then four columns as wide as their
   longest entry, filled top to bottom — 661 / 880 / 1201 / 1383 / 1638 of
   2560, i.e. ~90px between columns — and the whole block centred on the page.
   Every entry is two 20px lines at 1.56 on an 88px pitch, both in #202024. */
.kbeu-header__countries {
	--kbeu-country-ink: #202024;
	--kbeu-country-gap: clamp( 28px, 3.5vw, 90px );
	--kbeu-country-row-gap: clamp( 12px, 1vw, 26px );

	display: flex;
	flex-wrap: wrap;
	justify-content: safe center;
	align-items: flex-start;
	gap: var( --kbeu-country-row-gap ) var( --kbeu-country-gap );
	color: var( --kbeu-country-ink );
}

.kbeu-header__countries-list {
	flex: 0 1 auto;
	display: grid;
	grid-auto-flow: column;
	grid-template-rows: repeat( var( --kbeu-country-rows, 9 ), auto );
	grid-auto-columns: max-content;
	gap: var( --kbeu-country-row-gap ) var( --kbeu-country-gap );
	margin: 0;
	padding: 0;
	list-style: none;
}

.kbeu-header__country {
	break-inside: avoid;
	margin: 0;
}

.kbeu-header__country--international {
	flex: 0 1 auto;
	/* A long language list wraps instead of pushing the columns away. */
	max-width: clamp( 170px, 12vw, 300px );
}

.kbeu-header__country-name {
	display: block;
	font-size: var( --kbeu-header-fs );
	font-weight: 700;
	line-height: 1.56;
	transition: color 0.2s ease;
}

.kbeu-header__country.is-current > .kbeu-header__country-name,
.kbeu-header__country-name:hover,
.kbeu-header__country-name:focus-visible {
	color: var( --kbeu-header-teal );
}

.kbeu-header__country-langs {
	display: block;
	font-size: var( --kbeu-header-fs );
	line-height: 1.56;
}

.kbeu-header__country-lang {
	transition: color 0.2s ease;
}

.kbeu-header__country-lang.is-current {
	color: var( --kbeu-header-teal );
}

/* Design: the panel's white ends 92px under the last row. */
.kbeu-header__panel--countries .kbeu-header__panel-inner {
	padding-bottom: clamp( 28px, 3.6vw, 92px );
}

.kbeu-header__country-lang:hover,
.kbeu-header__country-lang:focus-visible {
	color: var( --kbeu-header-teal );
}

.kbeu-header__countries-empty {
	margin: 0;
	font-size: var( --kbeu-header-fs );
}

/* -------------------------------------------------------------------- Search */

.kbeu-header__search-form {
	display: flex;
	align-items: center;
	gap: clamp( 10px, 0.9vw, 23px );
	max-width: 1100px;
	/* Room for the "Close" control on the right. */
	padding-right: clamp( 90px, 8vw, 205px );
}

.kbeu-header__search-icon {
	flex: none;
	display: block;
	width: clamp( 18px, 1.18vw, 30px );
	color: var( --kbeu-header-ink );
}

.kbeu-header__search-field {
	flex: 1 1 auto;
	min-width: 0;
	padding: 10px 0;
	border: 0;
	border-bottom: 1px solid var( --kbeu-header-rule );
	border-radius: 0;
	background: none;
	font-family: inherit;
	font-size: var( --kbeu-header-fs );
	line-height: 1.5;
	color: var( --kbeu-header-ink );
}

.kbeu-header__search-field:focus {
	outline: none;
	border-bottom-color: var( --kbeu-header-teal );
}

.kbeu-header__search-submit {
	flex: none;
	padding: clamp( 10px, 0.78vw, 20px ) clamp( 14px, 1.02vw, 26px );
	border: 0;
	border-radius: var( --kbeu-header-radius );
	background: var( --kbeu-header-teal );
	font-family: inherit;
	font-size: var( --kbeu-header-fs );
	line-height: 1.2;
	color: #fff;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.kbeu-header__search-submit:hover,
.kbeu-header__search-submit:focus-visible {
	background: var( --kbeu-color-teal-dark );
}

/* ------------------------------------------------------------------- Overlay */

.kbeu-header__overlay {
	position: fixed;
	z-index: 1;
	top: var( --kbeu-header-height, 156px );
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba( 0, 0, 0, 0.4 );
	opacity: 0;
	transition: opacity 0.3s ease;
}

.kbeu-header__overlay[hidden] {
	display: none;
}

.kbeu-header__overlay.is-open {
	opacity: 1;
}

/* -------------------------------------------------------------------- Drawer */

/* The page behind the open drawer must not scroll with it. */
body.kbeu-header-lock {
	overflow: hidden;
}


.kbeu-header__drawer {
	position: fixed;
	z-index: 3;
	top: var( --kbeu-header-height, 156px );
	right: 0;
	bottom: 0;
	width: min( 420px, 100% );
	background: #fff;
	overflow-y: auto;
	overscroll-behavior: contain;
	/* Unrolls from the bar like the desktop panels (the same curves). */
	clip-path: inset( 0 0 100% 0 );
	transition: clip-path 0.35s cubic-bezier( 0.32, 0, 0.67, 0 );
}

.kbeu-header__drawer[hidden] {
	display: none;
}

.kbeu-header__drawer.is-open {
	clip-path: inset( 0 );
	transition: clip-path 0.65s cubic-bezier( 0.4, 0, 0.2, 1 );
}

.kbeu-header__drawer-inner {
	position: relative;
	padding: 24px 20px 40px;
}

.kbeu-header__drawer-close {
	position: static;
	margin: 0 0 16px auto;
}

.kbeu-header__drawer-list,
.kbeu-header__drawer-group-list,
.kbeu-header__drawer-utility {
	margin: 0;
	padding: 0;
	list-style: none;
}

.kbeu-header__drawer-item {
	border-bottom: 1px solid var( --kbeu-header-hairline );
}

.kbeu-header__drawer-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	padding: 14px 0;
	border: 0;
	background: none;
	font-family: inherit;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	text-align: left;
	color: inherit;
	cursor: pointer;
}

.kbeu-header__drawer-chevron {
	display: block;
	flex: none;
	width: 12px;
	transform: rotate( 90deg );
	transition: transform 0.2s ease;
}

.kbeu-header__drawer-link[aria-expanded="true"] .kbeu-header__drawer-chevron {
	transform: rotate( -90deg );
}

.kbeu-header__drawer-sub[hidden] {
	display: none;
}

.kbeu-header__drawer-group {
	padding: 0 0 14px 12px;
}

.kbeu-header__drawer-group-title {
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 700;
	color: rgba( 0, 0, 0, 0.55 );
}

.kbeu-header__drawer-sublink {
	display: block;
	padding: 6px 0;
	font-size: 16px;
	line-height: 1.4;
}

.kbeu-header__drawer-actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 24px 0;
}

.kbeu-header__drawer-action {
	justify-content: center;
	width: 100%;
	font-size: 16px;
}

.kbeu-header__drawer-utility {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	padding-top: 16px;
	border-top: 1px solid var( --kbeu-header-hairline );
}

.kbeu-header__drawer-utility-link {
	font-size: 15px;
	font-weight: 700;
}

.kbeu-header__drawer-globe {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	margin-top: 20px;
	padding: 12px 0 0;
	border: 0;
	border-top: 1px solid var( --kbeu-header-hairline );
	background: none;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	color: inherit;
	cursor: pointer;
}

.kbeu-header__drawer-globe .kbeu-header__icon {
	flex: none;
	width: 22px;
	height: 22px;
}

.kbeu-header__drawer-globe-code {
	margin-left: 6px;
	font-weight: 400;
	color: rgba( 0, 0, 0, 0.6 );
}

/* --------------------------------------------------------- Small screens */

@media ( max-width: 1200px ) {

	.kbeu-header__center,
	.kbeu-header__actions .kbeu-header__action {
		display: none;
	}

	.kbeu-header__main .kbeu-header__container {
		display: flex;
	}

	.kbeu-header__burger {
		display: inline-flex;
	}

	.kbeu-header__main .kbeu-header__container {
		justify-content: space-between;
	}

	.kbeu-header__panel-columns {
		padding-left: 0;
	}

	/* No design below the desktop bar: International on top, then the markets
	   in equal newspaper columns, still top to bottom. */
	.kbeu-header__countries {
		justify-content: flex-start;
	}

	.kbeu-header__countries-list {
		flex-basis: 100%;
		display: block;
		column-count: 2;
		column-gap: var( --kbeu-country-gap );
	}

	.kbeu-header__countries-list > .kbeu-header__country {
		margin-bottom: var( --kbeu-country-row-gap );
	}

	.kbeu-header__country--international {
		flex-basis: 100%;
		max-width: none;
		/* Room for "Close", which sits on the same line. */
		padding-right: clamp( 90px, 8vw, 205px );
	}

	.kbeu-header__search-form {
		padding-right: 0;
		flex-wrap: wrap;
	}

	.kbeu-header__panel--search .kbeu-header__panel-close {
		position: static;
		margin-top: 16px;
	}
}

@media ( max-width: 720px ) {

	.kbeu-header__top {
		display: none;
	}

	.kbeu-header__countries-list {
		column-count: 1;
	}

	.kbeu-header__panel-inner {
		max-height: calc( 100vh - var( --kbeu-header-height, 96px ) );
		overflow-y: auto;
		overscroll-behavior: contain;
	}
}

/* ------------------------------------------------------- Reduced motion */

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

	.kbeu-header__bar,
	.kbeu-header__overlay,
	.kbeu-header__nav-link,
	.kbeu-header__nav-link::after,
	.kbeu-header__btn,
	.kbeu-header__icon-btn,
	.kbeu-header__globe-chevron,
	.kbeu-header__drawer-chevron,
	.kbeu-header__burger-bars,
	.kbeu-header__burger-bars::before,
	.kbeu-header__burger-bars::after {
		transition: none;
	}

	/* No unrolling and no drop: the panels and the drawer only fade. */
	.kbeu-header__panel,
	.kbeu-header__panel.is-open,
	.kbeu-header__drawer,
	.kbeu-header__drawer.is-open {
		clip-path: none;
		opacity: 0;
		transition: opacity 0.2s ease;
	}

	.kbeu-header__panel.is-open,
	.kbeu-header__drawer.is-open {
		opacity: 1;
	}

	.kbeu-header__panel-inner > *,
	.kbeu-header__panel.is-open .kbeu-header__panel-inner > * {
		opacity: 1;
		transform: none;
		transition: none;
	}
}
