/*
 * TG Landshut Handball - Header (child override of menu/v1).
 *
 * Fixed header, centered crest, nav split left/right. Two states via custom
 * props on <header>:
 *   - default (solid): white bar, navy text, red crest -> pages without a hero,
 *     and every page once scrolled (.btw_scrolled)
 *   - hero overlay: the page starts with the m25_hero module or a match report
 *     (m47_spielbericht, same hero) or the 404 page (mM_404) (detected in CSS via
 *     :has, no PHP flag / body class) and is not scrolled: transparent, white
 *     text + white crest, geometry from Figma "Navi" (165:597)
 * Fanshop/Tickets icons stay red in both states. --btw_header_height is measured
 * by menu.js (unscrolled state); css/project.css holds the no-JS fallback.
 */

header.btw_header {
	--hdr_fg: var(--btw_navy);
	--hdr_bg: #fff;
	--hdr_crest: var(--btw_red);
	--hdr_divider: rgba(18, 41, 69, .20);
	--hdr_band: 76px;          /* nav band below the topbar */
	--hdr_logo: 56px;          /* crest height */
	--hdr_logo_top: 10px;      /* crest top inside the band */
	--hdr_nav_lift: 0px;       /* moves the nav row up from the band centre */
	--hdr_shadow: 0 2px 14px rgba(9, 24, 41, .08);
	--font_color: var(--hdr_fg);   /* project.css: `* { color: var(--font_color) }` */

	position: fixed;
	top: var(--wp-admin--admin-bar--height, 0px);
	left: 0;
	right: 0;
	width: 100%;
	z-index: 999;
	/* No overflow-x: clip here - Safari also clipped vertically, which cut the
	   dropdowns and the search panel (both hang below the header) */
	color: var(--hdr_fg);
	background: var(--hdr_bg);
	box-shadow: var(--hdr_shadow);
	transition: background .3s ease, box-shadow .3s ease, color .3s ease;
}

/* Hero overlay (Figma): crest 95px with its top 26px below the topbar, nav row
   centred 56px below the topbar -> band 121px, nav lifted 9px from the centre. */
body:has(> main > section:is(.m25_hero, .m47_spielbericht, .mM_404):first-child) > header.btw_header:not(.btw_scrolled) {
	--hdr_fg: #fff;
	--hdr_bg: transparent;
	--hdr_crest: #fff;
	--hdr_divider: rgba(255, 255, 255, .30);
	--hdr_shadow: none;
	--hdr_band: 121px;
	--hdr_logo: 95px;
	--hdr_logo_top: 26px;
	--hdr_nav_lift: 9px;
}

/* menu.js measures the unscrolled height without animating */
header.btw_header.btw_measuring,
header.btw_header.btw_measuring * {
	transition: none !important;   /* measurement must not catch a running transition */
}

/* ---- Pre-header bar (Figma "Förderverein" 165:764) ---- */
header.btw_header .btw_topbar {
	--font_color: #fff;
	background: var(--btw_blue);
}

header.btw_header .btw_topbar_inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	height: 35px;
	padding: 0 50px 0 49px;
}

header.btw_header .btw_topbar_note {
	font-family: var(--font_family);
	font-size: 0.875rem;       /* 14px */
	line-height: 1;
	white-space: nowrap;
}

header.btw_header .btw_topbar_link {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	color: #fff;
	font-family: var(--font_family);
	font-weight: 700;
	font-size: 0.875rem;       /* 14px */
	line-height: 1;
	text-decoration: underline;
	text-underline-position: from-font;
	white-space: nowrap;
}

header.btw_header .btw_topbar_link_text {
	color: inherit;
}

@media (hover: hover) {
	header.btw_header .btw_topbar_link:hover { text-decoration: none; }
}

header.btw_header .btw_topbar_link:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

header.btw_header .btw_topbar_arrow {
	width: 4px;
	height: 7px;
	flex: 0 0 auto;
	fill: #fff;
}

/* ---- Nav band ---- */
header.btw_header .btw_header_inner {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: var(--hdr_band);
	padding: 0 49px var(--hdr_nav_lift) 51px;   /* Figma: nav from x 51 to 1871 */
	/* No container-type here: Safari clipped the dropdowns at the bottom of a
	   container (the desktop sub-menus hang below this bar). The gaps use the
	   bar's content width via vw instead (--hdr_content_w). */
	--hdr_content_w: calc(100vw - 100px);
	transition: min-height .3s ease, padding .3s ease;
}

/* Figma gaps at 1920: 51px left / 50px right = 2.802 / 2.747 % of the bar's
   content width (1920 - 100px padding = 1820). Below 1920 they shrink with the
   bar, so the items never run into the centred crest (desktop nav from 1400px
   up); from 1920 on they stay at the Figma value. */
header.btw_header .btw_nav .btw_menu {
	display: flex;
	align-items: center;
	gap: min(51px, calc(var(--hdr_content_w) * .02802));
	margin: 0;
	padding: 0;
	list-style: none;
}

header.btw_header .btw_nav_right .btw_menu {
	gap: min(50px, calc(var(--hdr_content_w) * .02747));
}

header.btw_header .btw_nav_right {
	display: flex;
	align-items: center;
}

header.btw_header .btw_menu > li {
	position: relative;
}

/* The label span would otherwise take `* { color }` instead of the link colour
   (hover / dropdown colours are set on the <a>). */
header.btw_header .btw_mi_text {
	color: inherit;
}

header.btw_header .btw_menu a {
	display: inline-flex;
	align-items: center;
	color: var(--hdr_fg);
	font-family: var(--h_font_family, var(--font_family));
	font-weight: 900;             /* left group: Black */
	font-size: 1.25rem;           /* 20px */
	font-variation-settings: "slnt" -7;
	line-height: 1.2;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	transition: opacity .25s ease;
}

/* Right group is Bold (Figma) */
header.btw_header .btw_nav_right .btw_menu a {
	font-weight: 700;
}

@media (hover: hover) {
	header.btw_header .btw_menu a:hover { opacity: .7; }
}

header.btw_header .btw_menu a:focus-visible {
	outline: 2px solid var(--hdr_fg);
	outline-offset: 4px;
	opacity: 1;
}

/* Active item underline */
header.btw_header .btw_menu .current-menu-item > a .btw_mi_text,
header.btw_header .btw_menu .current-menu-ancestor > a .btw_mi_text {
	box-shadow: 0 2px 0 0 currentColor;
}

/* ---- Icons inside items (child sprite, coloured via fill) ---- */
header.btw_header .btw_mi_arrow {
	width: 9.4px;                 /* Figma chevron 9.4 x 5.4, 8px after the text */
	height: 5.4px;
	margin-left: 8px;
	flex: 0 0 auto;
	fill: var(--hdr_fg);
	transition: transform .3s ease;
}

header.btw_header .btw_mi_shop {
	width: 16px;
	height: 15px;
	margin-left: 7px;             /* Figma */
	flex: 0 0 auto;
	fill: var(--btw_red);
}

header.btw_header .btw_mi_tick {
	width: 15px;
	height: 12px;
	margin-left: 9px;             /* Figma */
	flex: 0 0 auto;
	fill: var(--btw_red);
}

/* ---- Centered crest ---- */
header.btw_header .btw_header_logo {
	position: absolute;
	left: 50%;
	top: var(--hdr_logo_top);
	transform: translateX(-50%);
	display: block;
	line-height: 0;
	transition: top .3s ease;
}

header.btw_header .btw_crest {
	display: block;
	width: auto;
	height: var(--hdr_logo);
	fill: var(--hdr_crest);
	transition: height .3s ease, fill .3s ease;
}

/* ---- Right utilities: divider + search (Figma: 25px / 22px, icon 14px) ---- */
header.btw_header .btw_header_right {
	display: flex;
	align-items: center;
}

header.btw_header .btw_header_divider {
	display: block;
	width: 1px;
	height: 30px;
	margin-left: 25px;
	background: var(--hdr_divider);
	transition: background .3s ease;
}

/* 26px hit area around the 14px icon; the negative margin keeps the layout box
   at 14px so the icon sits exactly where Figma puts it. */
header.btw_header .btw_search_toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	margin: -6px -6px -6px 16px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

header.btw_header .btw_i_search {
	width: 14px;
	height: 14px;
	fill: var(--hdr_fg);
}

header.btw_header .btw_search_toggle:focus-visible {
	outline: 2px solid var(--hdr_fg);
	outline-offset: 2px;
}

/* ---- Desktop dropdown (desktop navs only, the mobile panel has its own) ---- */
header.btw_header .btw_nav .sub-menu {
	--font_color: var(--btw_navy);
	position: absolute;
	top: calc(100% + 14px);
	left: 0;
	min-width: 220px;
	margin: 0;
	padding: 10px 0;
	list-style: none;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 18px 40px rgba(9, 24, 41, .18);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	/* short close delay (hover intent), hide after the fade-out (4.8) */
	transition: opacity .2s ease .1s, transform .2s ease .1s, visibility 0s .3s;
	z-index: 10;
}

/* Hover bridge over the 14px gap between the item and the dropdown, so the
   menu does not close while the pointer moves down into it */
header.btw_header .btw_nav .sub-menu::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 100%;
	height: 14px;
}

/* Right menu dropdowns align to the right edge */
header.btw_header .btw_nav_right .sub-menu {
	left: auto;
	right: 0;
}

header.btw_header .btw_nav .menu-item-has-children:hover > .sub-menu,
header.btw_header .btw_nav .menu-item-has-children:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
	/* visible at once, so a Tab from the parent link lands inside */
	transition: opacity .25s ease, transform .25s ease, visibility 0s;
}

header.btw_header .btw_nav .menu-item-has-children:hover > a .btw_mi_arrow,
header.btw_header .btw_nav .menu-item-has-children:focus-within > a .btw_mi_arrow {
	transform: rotate(180deg);
}

header.btw_header .btw_nav .sub-menu a {
	display: block;
	padding: 8px 22px;
	color: var(--btw_navy);
	font-size: 1rem;
	white-space: nowrap;
}

@media (hover: hover) {
	header.btw_header .btw_nav .sub-menu a:hover { color: var(--btw_red); opacity: 1; }
}

/* ---- Search panel (drops below the bar, full width, brand navy) ---- */
header.btw_header .btw_search_panel {
	--font_color: #fff;
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	background: var(--btw_navy);
	border-top: 3px solid var(--btw_red);
	box-shadow: 0 18px 40px rgba(9, 24, 41, .30);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
	transition: opacity .25s ease, transform .25s ease, visibility .25s;
	z-index: 8;
}

header.btw_header .btw_search_panel.open {
	opacity: 1;
	visibility: visible;
	transform: none;
}

/* Page below the open search: dimmed and blurred like the mobile menu overlay.
   It belongs to the panel (fades and hides with it); a click on it closes the
   search (menu.js). No scrolling: descendants of the fixed header add none. */
header.btw_header .btw_search_panel::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	height: 100vh;
	background: rgba(9, 24, 41, .55);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	cursor: pointer;
}

header.btw_header .btw_search_panel_inner {
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 24px 50px;
}

header.btw_header .btw_search_panel .btw-ls-wrap {
	position: relative;
	flex: 1 1 auto;    /* full available width */
	max-width: none;   /* override the plugin's 480px cap */
	width: 100%;
}

/* Transparent input on the navy panel - white text, no white box */
header.btw_header .btw_search_panel .btw-ls-input {
	width: 100%;
	height: 56px;
	margin: 0;
	padding: 0 20px 0 52px;
	color: #fff;
	font-family: var(--font_family);
	font-size: 1.0625rem;      /* 17px */
	line-height: 1.4;
	background-color: rgba(255, 255, 255, .06);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='%23ffffff'%3E%3Cpath d='M12.83 14l-4.25-4.25a5.3 5.3 0 0 1-1.73.79 6 6 0 0 1-1.73.25A5.22 5.22 0 0 1 1.57 9.26 5.22 5.22 0 0 1 0 5.42 5.22 5.22 0 0 1 1.57 1.57 5.22 5.22 0 0 1 5.42 0a5.22 5.22 0 0 1 3.84 1.57 5.22 5.22 0 0 1 1.57 3.85 6 6 0 0 1-.25 1.73 5.3 5.3 0 0 1-.79 1.73L14 12.83zM5.42 9.17a3.6 3.6 0 0 0 2.65-1.1 3.6 3.6 0 0 0 1.1-2.65 3.6 3.6 0 0 0-1.1-2.66 3.6 3.6 0 0 0-2.65-1.09 3.6 3.6 0 0 0-2.66 1.09 3.6 3.6 0 0 0-1.09 2.66 3.6 3.6 0 0 0 1.09 2.65 3.6 3.6 0 0 0 2.66 1.1z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: 20px center;
	background-size: 18px 18px;
	border: 1px solid rgba(255, 255, 255, .28);
	border-radius: 10px;
	outline: none;
	transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

header.btw_header .btw_search_panel .btw-ls-input::placeholder {
	color: rgba(255, 255, 255, .6);
}

header.btw_header .btw_search_panel .btw-ls-input:focus {
	border-color: var(--btw_red);
	background-color: rgba(255, 255, 255, .10);
	box-shadow: 0 0 0 3px rgba(223, 23, 33, .25);
}

/* Results dropdown stays a readable light card under the input */
header.btw_header .btw_search_panel .btw-ls-results {
	--font_color: var(--btw_navy);
	margin-top: 8px;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 18px 40px rgba(9, 24, 41, .30);
	overflow: hidden;
}

header.btw_header .btw_search_panel .btw-ls-item--active,
header.btw_header .btw_search_panel .btw-ls-item:hover {
	background: #f3f5f8;
}

header.btw_header .btw_search_panel .btw-ls-title {
	color: var(--btw_navy);
}

header.btw_header .btw_search_close {
	position: relative;
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

header.btw_header .btw_search_close_bar {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 22px;
	height: 2px;
	background: #fff;
}

header.btw_header .btw_search_close_bar:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg); }
header.btw_header .btw_search_close_bar:nth-child(2) { transform: translate(-50%, -50%) rotate(-45deg); }

header.btw_header .btw_search_close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* ---- Burger (mobile only) ---- */
header.btw_header .btw_burger {
	display: none;
	flex-direction: column;
	justify-content: center;
	align-items: flex-end;
	gap: 6px;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

header.btw_header .btw_burger_bar {
	display: block;
	width: 28px;
	height: 3px;
	border-radius: 3px;
	background: var(--hdr_fg);
	transition: transform .3s ease, opacity .2s ease, width .3s ease, background .3s ease;
}

header.btw_header .btw_burger_bar:nth-child(3) { width: 20px; }

header.btw_header .btw_burger:focus-visible {
	outline: 2px solid var(--hdr_fg);
	outline-offset: 3px;
}

/* ---- Mobile overlay + slide-in panel ----
   Both start below the header (--btw_menu_top = its bottom edge, menu.js):
   topbar, crest and close button stay visible while the menu is open. */
header.btw_header .btw_mobile_overlay {
	position: fixed;
	inset: var(--btw_menu_top, 0px) 0 0 0;
	background: rgba(9, 24, 41, .55);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	opacity: 0;
	visibility: hidden;
	transition: opacity .35s ease, visibility .35s;
	z-index: 998;
}

header.btw_header .btw_mobile_panel {
	--font_color: #fff;
	position: fixed;
	top: var(--btw_menu_top, var(--wp-admin--admin-bar--height, 0px));
	right: 0;
	bottom: 0;
	width: 420px;
	max-width: 100%;
	display: flex;
	flex-direction: column;
	padding: 40px 40px 40px;
	background: var(--btw_navy);
	color: #fff;
	overflow-y: auto;
	overflow-x: hidden;
	visibility: hidden;
	transform: translateX(100%);
	transition: transform .4s cubic-bezier(.2, .7, .2, 1), visibility 0s .4s;
	z-index: 999;
}

header.btw_header.btw_menu_open .btw_mobile_overlay {
	opacity: 1;
	visibility: visible;
}

header.btw_header.btw_menu_open .btw_mobile_panel {
	visibility: visible;
	transform: none;
	transition: transform .4s cubic-bezier(.2, .7, .2, 1), visibility 0s;
}

/* Close button: in the burger's place on the right, only while the menu is open
   (the burger hides meanwhile) */
header.btw_header .btw_mobile_close {
	position: absolute;
	top: 50%;
	right: 24px;
	display: none;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	background: transparent;
	transform: translateY(-50%);
	cursor: pointer;
}

/* Flush right like the burger bars, so the X centres on the same spot */
header.btw_header .btw_mobile_close_bar {
	position: absolute;
	right: 0;
	width: 28px;
	height: 3px;
	border-radius: 3px;
	background: var(--hdr_fg);
	transform: rotate(45deg);
}

header.btw_header .btw_mobile_close_bar + .btw_mobile_close_bar {
	transform: rotate(-45deg);
}

header.btw_header .btw_mobile_close:focus-visible {
	outline: 2px solid var(--hdr_fg);
	outline-offset: 3px;
}

/* Faint background crest, large at the bottom of the panel */
header.btw_header .btw_mobile_crest {
	position: absolute;
	right: -20px;
	top: 50px;
	width: 300px;
	height: auto;
	fill: rgba(255, 255, 255, .06);
	pointer-events: none;
}

header.btw_header .btw_mobile_panel_inner {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	flex: 1 1 auto;
	gap: 40px;
	z-index: 1;
}

header.btw_header .btw_mobile_nav .btw_menu {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Row = link (navigates) + toggle button over the rest of the row (menu.js) */
header.btw_header .btw_mobile_nav .btw_menu > li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

header.btw_header .btw_mobile_nav .btw_menu a {
	display: flex;
	align-items: center;
	padding: 12px 0;
	color: #fff;
	font-family: var(--h_font_family, var(--font_family));
	font-weight: 800;
	font-size: 1.375rem;      /* 22px */
	font-variation-settings: "slnt" -7;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	text-decoration: none;
}

/* The in-link chevron is replaced by the toggle button on mobile */
header.btw_header .btw_mobile_nav a .btw_mi_arrow {
	display: none;
}

header.btw_header .btw_mobile_nav .btw_mi_shop,
header.btw_header .btw_mobile_nav .btw_mi_tick {
	margin-left: 10px;
}

header.btw_header .btw_mnav_toggle {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex: 1 1 auto;
	align-self: stretch;
	min-width: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

header.btw_header .btw_mnav_toggle svg {
	width: 12px;
	height: 7px;
	fill: #fff;
	transition: transform .3s ease;
}

header.btw_header .btw_mnav_toggle[aria-expanded="true"] svg {
	transform: rotate(180deg);
}

header.btw_header .btw_mnav_toggle:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -2px;
}

/* Closed: no height, out of tab order + screen reader via visibility.
   menu.js animates the height; no display switch (4.8). */
header.btw_header .btw_mobile_nav .sub-menu {
	flex: 0 0 100%;
	height: 0;
	overflow: hidden;
	visibility: hidden;
	margin: 0;
	padding: 0 0 0 16px;
	list-style: none;
	transition: height .3s ease, visibility 0s .3s;
}

header.btw_header .btw_mobile_nav .menu-item-has-children.open > .sub-menu {
	visibility: visible;
	transition: height .3s ease, visibility 0s;
}

header.btw_header .btw_mobile_nav .sub-menu a {
	font-size: 1.0625rem;      /* 17px */
	font-weight: 600;
	color: rgba(255, 255, 255, .85);
	padding: 8px 0;
}

/* Mobile foot: search, social, legal */
header.btw_header .btw_mobile_foot {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

header.btw_header .btw_mobile_search .btw-ls-input {
	width: 100%;
	height: 52px;
	margin: 0;
	padding: 0 18px;
	color: var(--btw_navy);
	font-family: var(--font_family);
	font-size: 1rem;
	background: #fff;
	border: 0;
	border-radius: 8px;
	outline: none;
}

header.btw_header .btw_mobile_search .btw-ls-input:focus {
	box-shadow: 0 0 0 3px rgba(223, 23, 33, .4);
}

header.btw_header .btw_mobile_search .btw-ls-results {
	--font_color: var(--btw_navy);
}

header.btw_header .btw_mobile_social {
	display: flex;
	gap: 16px;
}

header.btw_header .btw_mobile_social_item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border: 1px solid rgba(255, 255, 255, .25);
	border-radius: 8px;
}

header.btw_header .btw_mobile_social_item svg {
	width: 20px;
	height: 20px;
	fill: #fff;
}

@media (hover: hover) {
	header.btw_header .btw_mobile_social_item:hover {
		background: var(--btw_red);
		border-color: var(--btw_red);
	}
}

header.btw_header .btw_mobile_legal {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
}

header.btw_header .btw_mobile_legal a {
	color: rgba(255, 255, 255, .7);
	font-size: 0.875rem;
	text-decoration: none;
}

/* ---- Breakpoints: switch to burger (desktop nav + crest need >= 1400px) ---- */
@media all and (max-width: 1399px) {
	header.btw_header .btw_nav,
	header.btw_header .btw_header_right {
		display: none;
	}
	/* Burger on the right (like the close button), crest stays centred */
	header.btw_header .btw_burger {
		display: flex;
		margin-left: auto;
	}
	/* Burger band: crest centred, no nav lift */
	header.btw_header {
		--hdr_nav_lift: 0px;
	}
	body:has(> main > section:is(.m25_hero, .m47_spielbericht, .mM_404):first-child) > header.btw_header:not(.btw_scrolled) {
		--hdr_band: 125px;
		--hdr_logo: 95px;
		--hdr_logo_top: 15px;
		--hdr_nav_lift: 0px;
	}
	header.btw_header .btw_header_inner,
	header.btw_header .btw_topbar_inner {
		padding-left: 24px;
		padding-right: 24px;
	}
	/* Open menu: solid header (also over the hero), close button instead of the burger */
	header.btw_header.btw_menu_open,
	body:has(> main > section:is(.m25_hero, .m47_spielbericht, .mM_404):first-child) > header.btw_header.btw_menu_open:not(.btw_scrolled) {
		--hdr_fg: var(--btw_navy);
		--hdr_bg: #fff;
		--hdr_crest: var(--btw_red);
		--hdr_divider: rgba(18, 41, 69, .20);
		--hdr_shadow: 0 2px 14px rgba(9, 24, 41, .08);
	}
	header.btw_header.btw_menu_open .btw_burger {
		visibility: hidden;
	}
	header.btw_header.btw_menu_open .btw_mobile_close {
		display: flex;
	}
}

@media all and (max-width: 767px) {
	/* The long note no longer fits next to the club link */
	header.btw_header .btw_topbar_note {
		display: none;
	}
	header.btw_header .btw_topbar_inner {
		justify-content: flex-end;
	}
}

@media all and (max-width: 575px) {
	header.btw_header {
		--hdr_band: 68px;
		--hdr_logo: 48px;
	}
	body:has(> main > section:is(.m25_hero, .m47_spielbericht, .mM_404):first-child) > header.btw_header:not(.btw_scrolled) {
		--hdr_band: 102px;
		--hdr_logo: 72px;
		--hdr_logo_top: 15px;
	}
	header.btw_header .btw_mobile_panel {
		width: 100%;
		padding: 32px 24px 32px;
	}
	header.btw_header .btw_mobile_nav .btw_menu a {
		font-size: 1.25rem;
	}
}

/* Fallback font (html.btw_ersatzschrift, see functions.php): the system font is
   wider than Salford Sans, so the desktop menu gets a smaller size and tighter
   gaps – otherwise „KONTAKT“ runs into the crest. 15px up to 1599px also fits
   plain Arial (devices without Arial Narrow). */
html.btw_ersatzschrift header.btw_header .btw_nav .btw_menu > li > a {
	font-size: 1.0625rem;         /* 17px */
	letter-spacing: 0;
}

html.btw_ersatzschrift header.btw_header .btw_nav .btw_menu,
html.btw_ersatzschrift header.btw_header .btw_nav_right .btw_menu {
	gap: min(40px, calc(var(--hdr_content_w) * .022));
}

@media all and (max-width: 1599px) {
	html.btw_ersatzschrift header.btw_header .btw_nav .btw_menu > li > a {
		font-size: .9375rem;      /* 15px */
	}
	html.btw_ersatzschrift header.btw_header .btw_nav .btw_menu,
	html.btw_ersatzschrift header.btw_header .btw_nav_right .btw_menu {
		gap: calc(var(--hdr_content_w) * .02);
	}
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
	header.btw_header,
	header.btw_header .btw_header_inner,
	header.btw_header .btw_header_logo,
	header.btw_header .btw_crest,
	header.btw_header .btw_mobile_panel,
	header.btw_header .btw_mobile_overlay,
	header.btw_header .btw_mobile_nav .sub-menu {
		transition: none;
	}
}
