/* ==========================================================================
   Header – Christine Blome (Nachbau des Elementor-Pro-Headers #2980)
   ========================================================================== */

:root {
	--cb-primary:   #164194;   /* Elementor Global: Primär  */
	--cb-secondary: #008BD2;   /* Elementor Global: Sekundär */
	--cb-bg:        #EEEDED;   /* Header-Hintergrund          */
	--cb-font:      "Lato", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--cb-content-width: 1140px;
	--cb-menu-font-size: 1rem;
	--cb-header-h: 0px;        /* wird per JS gesetzt (für Anker-Links) */
}

/* Anker-Links nicht unter dem Sticky-Header verstecken */
html {
	scroll-padding-top: var(--cb-header-h);
}

/* --------------------------------------------------------------------------
   Container / Sticky
   -------------------------------------------------------------------------- */
.cb-header {
	position: sticky;
	top: 0;
	z-index: 999;
	background-color: var(--cb-bg);
	box-shadow: 0 0 10px 0 rgba(0, 0, 0, .5);
	padding: 15px;
	font-family: var(--cb-font);
}

/* WordPress-Adminleiste berücksichtigen (nur für eingeloggte Nutzer) */
.admin-bar .cb-header { top: 32px; }
@media (max-width: 782px) {
	.admin-bar .cb-header { top: 46px; }
}
@media (max-width: 600px) {
	.admin-bar .cb-header { top: 0; } /* Adminleiste scrollt hier mit */
}

.cb-header__inner {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: flex-end;
	gap: 15px;
	max-width: var(--cb-content-width);
	margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Logo
   -------------------------------------------------------------------------- */
.cb-header__logo {
	flex: 1 0 auto;
	padding-left: 9px;
	line-height: 0;
}

.cb-header__logo a { display: inline-block; }

.cb-header__logo img {
	display: block;
	width: 340px;
	max-width: 100%;
	height: auto;
}

.cb-header__sitename {
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--cb-primary);
}

/* --------------------------------------------------------------------------
   Menü – Desktop
   -------------------------------------------------------------------------- */
.cb-menu,
.cb-menu ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.cb-menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

.cb-menu > li { position: relative; }

.cb-menu a {
	position: relative;
	display: flex;
	align-items: center;
	padding: 0 9px;
	font-family: var(--cb-font);
	font-size: var(--cb-menu-font-size);
	font-weight: 500;
	line-height: 20px;
	color: var(--cb-primary);
	text-decoration: none;
	transition: color .3s;
}

/* Unterstrich mit „Slide“-Animation (wie Elementor: pointer underline / slide) */
.cb-menu > li > a::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 3px;
	background-color: var(--cb-primary);
	opacity: 0;
	transition: all .3s cubic-bezier(.58, .3, .005, 1);
}

.cb-menu > li > a:not(:hover):not(:focus-visible)::after {
	left: 100%;
	width: 10px;
}

.cb-menu > li > a:hover,
.cb-menu > li > a:focus-visible {
	color: var(--cb-secondary);
}

.cb-menu > li > a:hover::after,
.cb-menu > li > a:focus-visible::after {
	opacity: 1;
}

/* Aktive Seite */
.cb-menu > .current-menu-item > a,
.cb-menu > .current-menu-ancestor > a {
	color: var(--cb-primary);
}

.cb-menu > .current-menu-item > a::after,
.cb-menu > .current-menu-ancestor > a::after {
	left: 0 !important;
	width: 100% !important;
	opacity: 1;
	background-color: var(--cb-secondary);
}

/* Sprachumschalter (TranslatePress-Menüeintrag) – nur Flagge, kein Unterstrich */
.cb-menu .trp-menu-ls-item > a::after { display: none; }

.cb-menu .trp-menu-ls-label {
	display: inline-flex;
	align-items: center;
}

.cb-menu .trp-flag-image {
	display: block;
	width: 18px;
	height: auto;
	transition: transform .2s;
}

.cb-menu .trp-menu-ls-item > a:hover .trp-flag-image,
.cb-menu .trp-menu-ls-item > a:focus-visible .trp-flag-image {
	transform: scale(1.15);
}

/* Optionale Untermenüs (falls später ergänzt) */
.cb-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 200px;
	padding: 10px 0;
	background: var(--cb-bg);
	box-shadow: 0 6px 12px rgba(0, 0, 0, .15);
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s, visibility .2s;
}

.cb-menu li:hover > .sub-menu,
.cb-menu li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
}

.cb-menu .sub-menu a { padding: 8px 16px; }

/* --------------------------------------------------------------------------
   Burger-Button
   -------------------------------------------------------------------------- */
.cb-header__toggle {
	display: none;
	align-items: center;
	justify-content: center;
	padding: .25em;
	margin: 0;
	border: 0;
	border-radius: 3px;
	background-color: var(--cb-bg);
	color: var(--cb-primary);
	font-size: 30px; /* = Icongröße Tablet */
	line-height: 1;
	cursor: pointer;
}

.cb-header__toggle:hover,
.cb-header__toggle:focus {
	background-color: var(--cb-bg);
	color: var(--cb-primary);
}

.cb-header__toggle:focus-visible {
	outline: 2px solid var(--cb-secondary);
	outline-offset: 2px;
}

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

.cb-icon--close { display: none; }
.cb-header.is-open .cb-icon--open  { display: none; }
.cb-header.is-open .cb-icon--close { display: block; }

/* --------------------------------------------------------------------------
   Tablet & Mobil (≤ 1024px): Burger + aufklappendes Menü über volle Breite
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {

	.cb-header__logo { padding-left: 0; }

	.cb-header__toggle { display: inline-flex; }

	.cb-header__nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background-color: var(--cb-bg);
		box-shadow: 0 8px 10px -6px rgba(0, 0, 0, .35);
		max-height: 0;
		overflow: hidden;
		visibility: hidden;
		transition: max-height .3s ease, visibility 0s linear .3s;
	}

	.cb-header.is-open .cb-header__nav {
		max-height: calc(100vh - var(--cb-header-h));
		overflow-y: auto;
		visibility: visible;
		transition: max-height .3s ease, visibility 0s;
	}

	.cb-menu {
		display: block;
	}

	.cb-menu a {
		display: block;
		padding: 10px 16px;
		font-size: 18px;
		font-weight: 400;
		letter-spacing: 1px;
		line-height: 20px;
		color: var(--cb-primary);
	}

	.cb-menu > li > a::after { display: none; }

	.cb-menu a:hover,
	.cb-menu a:focus-visible {
		color: var(--cb-primary);
		background-color: #008BD247;
	}

	.cb-menu .current-menu-item > a {
		background-color: #008BD230;
	}

	.cb-menu .trp-menu-ls-label { display: inline-flex; }

	.cb-menu .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		box-shadow: none;
		padding: 0 0 0 16px;
		background: transparent;
	}
}

/* Mobil (≤ 767px) */
@media (max-width: 767px) {
	.cb-header__logo { margin-left: -10px; }
	.cb-header__logo img { width: 274px; }
	.cb-header__toggle { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
	.cb-header *,
	.cb-header *::after { transition: none !important; }
}
