/* =========================================================================
   VOBADMZ Navbar
   Variablen werden zusätzlich über Elementor-Controls gesetzt.
   ========================================================================= */

.vbn-root {
	--vbn-bar-h: 88px;
	--vbn-bar-bg: #2B3149;
	--vbn-bar-bg-opacity: 1;
	--vbn-col-gap: 80px;
	--vbn-l1-width: 50%;
	--vbn-shrink-scale: 0.85;
	--vbn-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--vbn-dur: 660ms;

	position: absolute;
	inset-block-start: 0;
	inset-inline-start: 0;
	inline-size: 100%;
	box-sizing: border-box;
}

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

.vbn-root.vbn-sticky {
	position: fixed;
}

/* Screenreader-Only Helper (falls Theme keinen mitbringt). */
.vbn-root .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;
}

/* -------------------------------------------------------------------------
   LEISTE (geschlossener Zustand)
   ------------------------------------------------------------------------- */
.vbn-bar {
	position: relative;
	z-index: 2;
	inline-size: 100%;
	min-block-size: var(--vbn-bar-h);
	display: flex;
	align-items: stretch;
	/* Skalierungs-Ursprung liegt genau am Logo-Anfang (Content-Kante + Einzug),
	   damit das Logo beim Schrumpfen optisch an seiner Position bleibt. */
	transform-origin: calc( max( 0px, ( 100% - var(--vbn-content-max, 1140px) ) / 2 ) + var(--vbn-bar-pad, 20px) ) 0;
	transition: transform var(--vbn-dur) var(--vbn-ease);
}

/* Hintergrund als eigene Ebene -> Farbe, Transparenz und Boxed-Breite getrennt.
   Linksbündig; Breite über --vbn-bar-bg-width (Standard 100 %). */
.vbn-bar::before {
	content: "";
	position: absolute;
	inset-block: 0;
	/* Hintergrund läuft weit nach links über den Bildrand hinaus. So bleibt
	   beim Schrumpfen um den Logo-Ursprung links keine Lücke. */
	inset-inline-start: -100vw;
	inline-size: calc( var(--vbn-bar-bg-width, 100%) + 100vw );
	background-color: var(--vbn-bar-bg);
	opacity: var(--vbn-bar-bg-opacity);
	transition: opacity var(--vbn-dur) var(--vbn-ease);
	z-index: -1;
}

.vbn-bar__inner {
	inline-size: 100%;
	max-inline-size: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	/* Links: auf die Inhaltskante + fester Einzug; rechts: zum Rand der dunklen
	   Box + fester Einzug. So bleibt der Inhalt auch auf breiten Screens
	   mindestens um den Einzug nach innen versetzt. */
	padding-inline-start: calc( max( 0px, ( 100% - var(--vbn-content-max, 1140px) ) / 2 ) + var(--vbn-bar-pad, 20px) );
	padding-inline-end: calc( ( 100% - var(--vbn-bar-bg-width, 100%) ) + var(--vbn-bar-pad, 20px) );
	min-block-size: var(--vbn-bar-h);
	transition: padding var(--vbn-dur) var(--vbn-ease);
}

/* Logo */
.vbn-logo {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	line-height: 0;
}

.vbn-logo img {
	display: block;
	height: 48px;
	width: auto;
	transition: height var(--vbn-dur) var(--vbn-ease);
}

.vbn-logo__text {
	color: #fff;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.1;
}

/* Toggle „Menü / Schließen" */
.vbn-root .vbn-toggle {
	appearance: none;
	-webkit-appearance: none;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	text-shadow: none;
	margin: 0;
	padding: 8px 4px;
	cursor: pointer;
	color: #fff;
	font: inherit;
	font-weight: 700;
	letter-spacing: 0.08em;
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	line-height: 1.1;
}

.vbn-root .vbn-toggle:hover,
.vbn-root .vbn-toggle:focus,
.vbn-root .vbn-toggle:active {
	background: transparent !important;
	background-color: transparent !important;
	box-shadow: none !important;
}

.vbn-toggle__text {
	position: relative;
}

.vbn-toggle__text::after {
	content: "";
	display: block;
	height: 1px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: right center;
	transition: transform 240ms var(--vbn-ease);
}

.vbn-toggle:hover .vbn-toggle__text::after,
.vbn-toggle:focus-visible .vbn-toggle__text::after {
	transform: scaleX(1);
	transform-origin: left center;
}

/* -------------------------------------------------------------------------
   OVERLAY (geöffneter Zustand)
   ------------------------------------------------------------------------- */
.vbn-overlay {
	position: fixed;
	inset: 0;
	z-index: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background-color: #2B3149; /* von Elementor überschrieben */
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	/* Schließen: Hintergrund verzögert ausblenden, damit zuerst der Text geht. */
	transition: opacity var(--vbn-dur) var(--vbn-ease) calc(var(--vbn-dur) * 0.35),
		visibility 0s linear calc(var(--vbn-dur) * 1.35);
}

.vbn-overlay[hidden] {
	display: none;
}

.vbn-overlay__media {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

.vbn-overlay__tint {
	position: absolute;
	inset: 0;
	background-color: rgba(28, 33, 50, 0.82); /* von Elementor überschrieben */
}

.vbn-overlay__inner {
	position: relative;
	z-index: 1;
	min-block-size: 100%;
	display: flex;
	align-items: center;
	padding-block: calc(var(--vbn-bar-h) + 48px) 64px;
	padding-inline: 40px;
}

/* -------------------------------------------------------------------------
   SCHRUMPFEN BEIM SCROLLEN – ganze Leiste (inkl. Höhe & Hintergrund)
   proportional skalieren; linke Kante bleibt fix.
   ------------------------------------------------------------------------- */
.vbn-root.is-scrolled .vbn-bar {
	transform: scale(var(--vbn-shrink-scale, 0.85));
}

/* -------------------------------------------------------------------------
   OFFENER ZUSTAND – Leiste verschmilzt mit Overlay (immer volle Größe)
   ------------------------------------------------------------------------- */
.vbn-root.is-open .vbn-bar {
	transform: none !important;
}

.vbn-root.is-open .vbn-bar__inner {
	/* Leiste ist offen 100 % breit -> Toggle bündig zum Bildschirmrand. */
	padding-inline-end: var(--vbn-bar-pad, 20px);
}

.vbn-root.is-open .vbn-bar::before {
	opacity: 0;
}

/* Hintergrund-Ebene des Overlays: beim ÖFFNEN sofort, beim SCHLIESSEN verzögert
   ausblenden (erst verschwindet der Text, dann der Hintergrund). */
.vbn-root.is-open .vbn-overlay {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition: opacity var(--vbn-dur) var(--vbn-ease);
}

/* Text-/Menü-Ebene: beim ÖFFNEN verzögert nach dem Hintergrund einblenden,
   beim SCHLIESSEN sofort ausblenden. */
.vbn-overlay__inner {
	opacity: 0;
	transition: opacity calc(var(--vbn-dur) * 0.55) var(--vbn-ease);
}

.vbn-root.is-open .vbn-overlay__inner {
	opacity: 1;
	transition: opacity var(--vbn-dur) var(--vbn-ease) calc(var(--vbn-dur) * 0.25);
}

/* -------------------------------------------------------------------------
   MENÜ – zwei Spalten
   ------------------------------------------------------------------------- */
.vbn-menu {
	position: static;
	inline-size: 100%;
	max-inline-size: var(--vbn-content-max, 1140px);
	margin-inline: auto;
	padding-inline-start: var(--vbn-indent, 0px);
}

/* Relativer Container für die zwei Spalten – trägt KEIN Padding,
   damit erste (im Fluss) und zweite Spalte (absolut) exakt fluchten. */
.vbn-menu__cols {
	position: relative;
	inline-size: 100%;
}

.vbn-empty {
	color: rgba(255, 255, 255, 0.7);
}

/* Erste Spalte */
.vbn-l1 {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 28px; /* von Elementor überschrieben */
	inline-size: var(--vbn-l1-width, 50%);
}

.vbn-l1__item {
	position: static;
}

.vbn-l1__link {
	display: inline-block;
	text-decoration: none;
	color: rgba(255, 255, 255, 0.45); /* von Elementor überschrieben */
	font-size: clamp(1.4rem, 2.4vw, 2.2rem);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	line-height: 1.1;
	overflow-wrap: break-word;
	hyphens: auto;
	transition: color 200ms var(--vbn-ease), transform 200ms var(--vbn-ease);
}

.vbn-l1__link:hover,
.vbn-l1__link:focus-visible {
	color: #fff;
}

.vbn-l1__item.is-active .vbn-l1__link {
	color: #C2A05B; /* gold – von Elementor überschrieben */
}

/* Zweite Spalte: alle Panels in der rechten Spalte gestapelt, nur aktives sichtbar. */
.vbn-l2 {
	list-style: none;
	margin: 0;
	padding: 0;
	display: none;
	flex-direction: column;
	gap: 24px; /* von Elementor überschrieben */

	position: absolute;
	inset-block-start: 0;
	inset-inline-start: calc(var(--vbn-l1-width, 50%) + var(--vbn-col-gap, 80px));
	inline-size: calc(100% - var(--vbn-l1-width, 50%) - var(--vbn-col-gap, 80px));
}

.vbn-l2.is-active {
	display: flex;
}

/* Gestaffeltes Einblenden der Unterpunkte (leicht verzögert nach den
   Hauptpunkten), läuft bei jedem Panelwechsel neu. */
.vbn-l2.is-active .vbn-l2__link {
	animation: vbn-rise var(--vbn-dur) var(--vbn-ease) both;
}

.vbn-l2.is-active .vbn-l2__item:nth-child(1) .vbn-l2__link { animation-delay: 80ms; }
.vbn-l2.is-active .vbn-l2__item:nth-child(2) .vbn-l2__link { animation-delay: 140ms; }
.vbn-l2.is-active .vbn-l2__item:nth-child(3) .vbn-l2__link { animation-delay: 200ms; }
.vbn-l2.is-active .vbn-l2__item:nth-child(4) .vbn-l2__link { animation-delay: 260ms; }
.vbn-l2.is-active .vbn-l2__item:nth-child(5) .vbn-l2__link { animation-delay: 320ms; }
.vbn-l2.is-active .vbn-l2__item:nth-child(n+6) .vbn-l2__link { animation-delay: 380ms; }

.vbn-l2__link {
	text-decoration: none;
	color: #fff; /* von Elementor überschrieben */
	font-size: clamp(1.1rem, 1.6vw, 1.6rem);
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	line-height: 1.1;
	transition: color 200ms var(--vbn-ease);
}

.vbn-l2__link:hover,
.vbn-l2__link:focus-visible {
	color: #C2A05B; /* von Elementor überschrieben */
}

/* Disclosure-Button: nur auf Touch/Mobile sichtbar.
   Gegen Theme-Button-Styles (z. B. orange Hintergründe) abgesichert. */
.vbn-disclosure {
	display: none;
}

.vbn-root .vbn-disclosure {
	appearance: none;
	-webkit-appearance: none;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	text-shadow: none;
}

/* -------------------------------------------------------------------------
   STAGGERED REVEAL beim Öffnen
   Wichtig: Animation auf dem LINK, nicht auf dem Listenelement – sonst würde
   der Transform das <li> zum Bezugsrahmen der absolut positionierten zweiten
   Spalte machen und diese verspringen lassen.
   ------------------------------------------------------------------------- */
.vbn-root.is-open .vbn-l1__link {
	animation: vbn-rise var(--vbn-dur) var(--vbn-ease) both;
}

.vbn-root.is-open .vbn-l1__item:nth-child(1) .vbn-l1__link { animation-delay: 60ms; }
.vbn-root.is-open .vbn-l1__item:nth-child(2) .vbn-l1__link { animation-delay: 105ms; }
.vbn-root.is-open .vbn-l1__item:nth-child(3) .vbn-l1__link { animation-delay: 150ms; }
.vbn-root.is-open .vbn-l1__item:nth-child(4) .vbn-l1__link { animation-delay: 195ms; }
.vbn-root.is-open .vbn-l1__item:nth-child(5) .vbn-l1__link { animation-delay: 240ms; }
.vbn-root.is-open .vbn-l1__item:nth-child(6) .vbn-l1__link { animation-delay: 285ms; }
.vbn-root.is-open .vbn-l1__item:nth-child(7) .vbn-l1__link { animation-delay: 330ms; }
.vbn-root.is-open .vbn-l1__item:nth-child(8) .vbn-l1__link { animation-delay: 375ms; }
.vbn-root.is-open .vbn-l1__item:nth-child(n+9) .vbn-l1__link { animation-delay: 420ms; }

@keyframes vbn-rise {
	from { opacity: 0; transform: translateY(14px); }
	to   { opacity: 1; transform: translateY(0); }
}

@keyframes vbn-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* -------------------------------------------------------------------------
   FOKUS-SICHTBARKEIT (Tastatur)
   ------------------------------------------------------------------------- */
.vbn-root :focus-visible {
	outline: 2px solid #C2A05B;
	outline-offset: 4px;
	border-radius: 2px;
}

/* -------------------------------------------------------------------------
   RESPONSIVE – unter 1024px wird gestapelt (Akkordeon)
   ------------------------------------------------------------------------- */
@media (max-width: 1024px) {
	/* Leiste auf Mobile/Tablet immer vollbreit und ohne Skalierung. */
	.vbn-root .vbn-bar { --vbn-bar-bg-width: 100% !important; }
	.vbn-root.is-scrolled .vbn-bar { transform: none; }

	.vbn-overlay__inner {
		align-items: flex-start;
	}

	.vbn-menu {
		max-inline-size: 640px;
	}

	.vbn-l1 {
		inline-size: 100%;
		max-inline-size: 100%;
		gap: 8px;
	}

	.vbn-l1__item {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 12px;
		padding-block: 6px;
	}

	.vbn-l1__link {
		flex: 1;
		font-size: clamp(1.3rem, 6vw, 1.8rem);
	}

	/* Untermenüs im Fluss, per Disclosure aufklappbar. */
	.vbn-l2 {
		position: static;
		inline-size: 100%;
		inset-inline-start: auto;
		flex-basis: 100%;
		padding-block: 4px 16px;
		padding-inline-start: 4px;
		gap: 14px;
	}

	.vbn-l2.is-active {
		animation: none;
	}

	/* Auf Touch/Mobile entscheidet der Disclosure-Button, nicht .is-active. */
	.vbn-l2,
	.vbn-l2.is-active {
		display: none;
	}

	.vbn-l2.is-expanded {
		display: flex;
	}

	.vbn-l2__link {
		font-size: clamp(1rem, 4.5vw, 1.3rem);
	}

	.vbn-disclosure {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		inline-size: 44px;
		block-size: 44px;
		flex: 0 0 auto;
		cursor: pointer;
		color: rgba(255, 255, 255, 0.6);
		padding: 0;
	}

	.vbn-disclosure__icon {
		position: relative;
		inline-size: 14px;
		block-size: 14px;
	}

	.vbn-disclosure__icon::before,
	.vbn-disclosure__icon::after {
		content: "";
		position: absolute;
		inset-block-start: 50%;
		inset-inline-start: 50%;
		background: currentColor;
		transform: translate(-50%, -50%);
		transition: transform 200ms var(--vbn-ease), opacity 200ms var(--vbn-ease);
	}

	.vbn-disclosure__icon::before {
		inline-size: 14px;
		block-size: 2px;
	}

	.vbn-disclosure__icon::after {
		inline-size: 2px;
		block-size: 14px;
	}

	.vbn-disclosure[aria-expanded="true"] .vbn-disclosure__icon::after {
		transform: translate(-50%, -50%) scaleY(0);
		opacity: 0;
	}
}

@media (max-width: 600px) {
	.vbn-bar__inner,
	.vbn-overlay__inner {
		padding-inline: 20px;
	}
}

/* -------------------------------------------------------------------------
   BEWEGUNG REDUZIEREN
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.vbn-root *,
	.vbn-root *::before,
	.vbn-root *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}

/* Body-Sperre, wenn Menü offen (Klasse wird per JS gesetzt). */
body.vbn-menu-open {
	overflow: hidden;
}

/* -------------------------------------------------------------------------
   WORDPRESS-ADMINLEISTE berücksichtigen (eingeloggte Nutzer).
   Der Versatz wird per JS live aus der tatsächlichen Position der Adminleiste
   abgeleitet (--vbn-admin-offset). So funktioniert es sowohl bei fixierter
   Adminleiste (Desktop/Tablet) als auch bei mitscrollender (Mobile ≤ 600).
   ------------------------------------------------------------------------- */
body.admin-bar {
	--vbn-admin-offset: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar {
		--vbn-admin-offset: 46px;
	}
}

body.admin-bar .vbn-root.vbn-sticky,
body.admin-bar .vbn-overlay {
	inset-block-start: var(--vbn-admin-offset, 0px);
}
