/* M-DREI Header – Grundstil (gilt für alle Breiten).
   Desktop- und Mobil-Regeln liegen in header-desktop.css / header-mobile.css
   und werden passend zum eingestellten Breakpoint inline ausgegeben. */

.m3h {
	--m3h-bg: #fff;
	--m3h-bg-scrolled: var(--m3h-bg);
	--m3h-color: #1e1e1e;
	--m3h-accent: var(--e-global-color-secondary, #8f2436);
	--m3h-hover: var(--m3h-accent);
	--m3h-active: var(--m3h-accent);
	--m3h-align: center;
	--m3h-gap: 36px;
	--m3h-pad-y: 12px;
	--m3h-pad-x: clamp(16px, 3vw, 40px);
	--m3h-max: 1400px;
	--m3h-logo-h: 52px;
	--m3h-drop-bg: #fff;
	--m3h-drop-color: var(--m3h-color);
	--m3h-drop-hover-bg: rgba(0, 0, 0, .05);
	--m3h-drop-radius: 12px;
	--m3h-drop-min: 220px;
	--m3h-cta-bg: var(--m3h-accent);
	--m3h-cta-color: #fff;
	--m3h-cta-bg-hover: #1e1e1e;
	--m3h-cta-color-hover: #fff;
	--m3h-cta-radius: 999px;
	--m3h-panel-bg: #fff;
	--m3h-panel-color: var(--m3h-color);
	--m3h-panel-w: 380px;
	--m3h-panel-font: 18px;
	--m3h-speed: .22s;

	position: relative;
	background: var(--m3h-bg);
	color: var(--m3h-color);
	transition: background-color var(--m3h-speed) ease, box-shadow var(--m3h-speed) ease;
}

.m3h *,
.m3h *::before,
.m3h *::after {
	box-sizing: border-box;
}

.m3h.is-scrolled {
	background: var(--m3h-bg-scrolled);
	/* Feine Linie plus ganz leichter Schatten – ruhiger als ein kräftiger Schlagschatten */
	box-shadow: 0 1px 0 rgba(0, 0, 0, .08), 0 10px 24px -14px rgba(0, 0, 0, .18);
}

.m3h__bar {
	display: flex;
	align-items: center;
	gap: 24px;
	max-width: var(--m3h-max);
	margin-inline: auto;
	padding: var(--m3h-pad-y) var(--m3h-pad-x);
	transition: padding var(--m3h-speed) ease;
}

.m3h--full .m3h__bar {
	max-width: none;
}

.m3h--shrink.is-scrolled .m3h__bar {
	padding-block: calc(var(--m3h-pad-y) * .55);
}

/* ---- Logo ---- */
.m3h a.m3h__logo {
	display: inline-flex;
	align-items: center;
	flex: none;
	color: inherit;
	text-decoration: none;
}

.m3h .m3h__logo-img {
	display: block;
	width: auto;
	max-width: none;
	height: var(--m3h-logo-h);
	transition: height var(--m3h-speed) ease;
}

.m3h--shrink.is-scrolled .m3h__logo-img {
	height: calc(var(--m3h-logo-h) * .8);
}

.m3h .m3h__logo-img--mobile {
	display: none;
}

.m3h__logo-text {
	font-size: 22px;
	font-weight: 800;
	letter-spacing: .02em;
}

/* ---- Navigation ---- */
.m3h__nav {
	display: flex;
	flex: 1;
	justify-content: var(--m3h-align);
	min-width: 0;
}

.m3h ul.m3h__menu,
.m3h ul.m3h__sub {
	margin: 0;
	padding: 0;
	list-style: none;
}

.m3h ul.m3h__menu {
	display: flex;
	align-items: center;
	gap: var(--m3h-gap);
}

.m3h li.m3h__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Reset gegen Theme-/Kit-Stile für Links und Buttons */
.m3h a.m3h__link,
.m3h button.m3h__link,
.m3h button.m3h__sub-toggle,
.m3h button.m3h__toggle,
.m3h button.m3h__close {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.m3h a.m3h__link,
.m3h button.m3h__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.25;
	white-space: nowrap;
	text-align: left;
	transition: color var(--m3h-speed) ease, background-color var(--m3h-speed) ease;
}

.m3h a.m3h__link:hover,
.m3h button.m3h__link:hover,
.m3h button.m3h__link:focus,
.m3h button.m3h__sub-toggle:hover,
.m3h button.m3h__sub-toggle:focus {
	background: none;
	color: var(--m3h-hover);
}

.m3h .is-current > a.m3h__link,
.m3h .is-current > .m3h__row > a.m3h__link,
.m3h .m3h__item--l0.is-ancestor > .m3h__row > .m3h__link {
	color: var(--m3h-active);
}

.m3h button.m3h__sub-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 24px;
	height: 24px;
}

.m3h__chev {
	display: inline-flex;
	transition: transform var(--m3h-speed) ease;
}

.m3h__chev svg {
	display: block;
}

.m3h__plus-v {
	transform-origin: center;
	transition: transform var(--m3h-speed) ease;
}

.m3h [aria-expanded="true"] > .m3h__chev {
	transform: rotate(180deg);
}

.m3h [aria-expanded="true"] .m3h__plus-v {
	transform: scaleY(0);
}

.m3h__badge {
	display: inline-block;
	padding: 3px 7px;
	border-radius: 999px;
	background: var(--m3h-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: .02em;
}

/* ---- Aktionen rechts ---- */
.m3h__actions {
	display: flex;
	align-items: center;
	flex: none;
	gap: 12px;
}

.m3h a.m3h__cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	border-radius: var(--m3h-cta-radius);
	background: var(--m3h-cta-bg);
	color: var(--m3h-cta-color);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color var(--m3h-speed) ease, color var(--m3h-speed) ease;
}

.m3h a.m3h__cta:hover,
.m3h a.m3h__cta:focus-visible {
	background: var(--m3h-cta-bg-hover);
	color: var(--m3h-cta-color-hover);
}

.m3h__cta-icon {
	display: inline-flex;
}

.m3h__cta-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.m3h__cta-icon--preset svg {
	width: 1.3em;
	height: 1.3em;
	fill: none;
}

/* ---- Untermenü-Einträge: Bild, Titel, Kurzbeschreibung, Pfeil ---- */
.m3h__text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.m3h__title-line {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.m3h__desc {
	max-width: 30ch;
	font-size: 12.5px;
	font-weight: 400;
	line-height: 1.35;
	white-space: normal;
	opacity: .62;
}

.m3h__thumb {
	flex: none;
	width: 46px;
	height: 46px;
	overflow: hidden;
	border-radius: 10px;
	background: rgba(0, 0, 0, .06);
}

.m3h .m3h__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .35s ease;
}

.m3h a.m3h__link:hover .m3h__thumb img {
	transform: scale(1.1);
}

.m3h__arrow {
	display: inline-flex;
	flex: none;
}

/* ---- Nur im Mobilmodus sichtbar ---- */
.m3h button.m3h__toggle,
.m3h__panel-head,
.m3h__panel-foot,
.m3h__overlay {
	display: none;
}

.m3h__burger {
	position: relative;
	display: block;
	width: 22px;
	height: 16px;
}

.m3h__burger span {
	position: absolute;
	left: 0;
	width: 100%;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
	transition: transform var(--m3h-speed) ease, opacity var(--m3h-speed) ease;
}

.m3h__burger span:nth-child(1) { top: 0; }
.m3h__burger span:nth-child(2) { top: 7px; }
.m3h__burger span:nth-child(3) { top: 14px; }
.m3h__burger span:nth-child(4) { display: none; }

/* Kräftige Variante: vier dicke Balken */
.m3h--burger-bold .m3h__burger {
	width: 28px;
	height: 25px;
}

.m3h--burger-bold .m3h__burger span {
	height: 4px;
	border-radius: 1.5px;
}

.m3h--burger-bold .m3h__burger span:nth-child(1) { top: 0; }
.m3h--burger-bold .m3h__burger span:nth-child(2) { top: 7px; }
.m3h--burger-bold .m3h__burger span:nth-child(3) { top: 14px; }
.m3h--burger-bold .m3h__burger span:nth-child(4) { display: block; top: 21px; }

.m3h__notice {
	margin: 0;
	padding: 8px 12px;
	border: 1px dashed currentColor;
	border-radius: 8px;
	font-size: 13px;
}

/* ---- Fokus ---- */
.m3h a:focus-visible,
.m3h button:focus-visible {
	outline: 2px solid var(--m3h-accent);
	outline-offset: 3px;
	border-radius: 4px;
}

/* ---- Sticky: Klasse landet per JS auf dem äußeren Header-Element ---- */
/* Bewusst "fixed" statt "sticky": sticky versagt, sobald html/body overflow-x: hidden
   haben (bei vielen Themes der Fall). Den Platz hält ein per JS eingefügter Platzhalter frei. */
/* !important ist hier nötig: Themes setzen die Position ihres Headers gern per ID
   (z. B. Astra: #masthead { position: relative }), das schlägt sonst jede Klasse. */
.m3h-host {
	position: fixed !important;
	top: var(--m3h-top, 0px) !important;
	right: 0 !important;
	left: 0 !important;
	z-index: 990 !important;
	width: 100% !important;
	margin: 0 !important;
	transition: transform .3s ease;
}

.m3h-host.m3h-host--hidden {
	transform: translateY(calc(-100% - var(--m3h-top, 0px)));
}

.m3h-spacer {
	display: block;
}

html.m3h-lock {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.m3h,
	.m3h *,
	.m3h *::before,
	.m3h-host {
		transition-duration: .01ms !important;
	}
}
