/* =========================================================================
   Rahmen: Header, Mega-Menü, Mobil-Menü, Seitenkopf, Footer
   ========================================================================= */

/* --- Header (sticky, dreifarbige Unterkante wie Entwurf B) ----------------- */

.kopf {
	position: sticky;
	top: 0;
	z-index: 40;
	background: rgba(255, 255, 255, 0.95);
	-webkit-backdrop-filter: blur(9px);
	backdrop-filter: blur(9px);
	border-bottom: 4px solid transparent;
	border-image: linear-gradient(90deg, var(--blau) 0 33.3%, var(--gruen) 33.3% 66.6%, var(--gelb) 66.6% 100%) 1;
}

.admin-bar .kopf {
	top: var(--wp-admin--admin-bar--height, 32px);
}

.kopf__innen {
	max-width: calc(var(--breite) + 2 * var(--rand));
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 12px var(--rand);
	min-height: calc(var(--kopf-hoehe) - 4px);
}

.kopf__logo {
	display: block;
	flex: none;
	border-radius: 6px;
	transition: opacity 0.15s ease;
}

.kopf__logo:hover {
	opacity: 0.82;
}

.kopf__logo img {
	height: 60px;
	width: auto;
}

/* --- Hauptnavigation: Pills ---------------------------------------------- */

.nav__liste {
	display: flex;
	align-items: center;
	gap: 4px;
	list-style: none;
}

.nav__knopf {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 15px;
	border-radius: 999px;
	border: 2px solid transparent;
	background: transparent;
	color: #223333;
	font-family: var(--schrift-text);
	font-weight: 700;
	font-size: 14.5px;
	line-height: 1.3;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.nav__knopf:hover {
	color: #223333;
	transform: translateY(-1px);
	box-shadow: inset 0 0 0 999px rgba(33, 88, 99, 0.07);
}

.nav__knopf:active {
	transform: translateY(0);
}

.nav__knopf.ist-aktiv {
	background: var(--blau);
	color: var(--weiss);
	border-color: rgba(255, 255, 255, 0.9);
	box-shadow: var(--schatten-knopf);
}

.nav__knopf[aria-expanded='true'] {
	box-shadow: inset 0 0 0 999px rgba(33, 88, 99, 0.09);
}

.nav__knopf.ist-aktiv[aria-expanded='true'] {
	box-shadow: var(--schatten-knopf);
}

.nav__pfeil {
	width: 11px;
	height: 8px;
	opacity: 0.7;
	transition: transform 0.2s ease;
}

.nav__knopf[aria-expanded='true'] .nav__pfeil {
	transform: rotate(180deg);
}

/* --- Mega-Menü -------------------------------------------------------------- */

/* Als Karte auf dem Inhaltsraster, direkt unter der farbigen Kante. */
.mega {
	position: absolute;
	left: max(var(--rand), calc(50% - var(--breite) / 2 - 24px));
	right: max(var(--rand), calc(50% - var(--breite) / 2 - 24px));
	top: calc(100% + 4px);
	background: var(--weiss);
	border: 1px solid var(--rahmen);
	border-top: 0;
	border-radius: 0 0 var(--radius-gross) var(--radius-gross);
	box-shadow: 0 24px 40px rgba(37, 50, 58, 0.14);
	animation: mega-auf 0.18s ease-out;
}

.mega[hidden] {
	display: none;
}

@keyframes mega-auf {
	from { opacity: 0; transform: translateY(-6px); }
	to { opacity: 1; transform: none; }
}

.mega__innen {
	padding: 24px 24px 30px;
	display: grid;
	grid-template-columns: minmax(260px, 340px) 1fr;
	gap: 40px;
	align-items: start;
}

.mega__intro {
	position: relative;
	border-radius: var(--radius);
	padding: 26px 26px 28px;
	border: 1px solid var(--blau-linie);
	background: var(--blau-flaeche);
}

.mega--gruen .mega__intro { background: var(--gruen-flaeche); border-color: var(--gruen-linie); }
.mega--gelb .mega__intro { background: var(--gelb-flaeche); border-color: var(--gelb-linie); }

.mega__symbol {
	font-size: 40px;
	margin-bottom: 14px;
	transform: rotate(-4deg);
}

.mega__titel {
	font-family: var(--schrift-titel);
	font-weight: 700;
	font-size: 25px;
	line-height: 1.15;
	margin-bottom: 8px;
}

.mega__text {
	font-size: 15.5px;
	line-height: 1.55;
	color: var(--grau);
	margin-bottom: 20px;
}

.mega__links {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 32px;
	padding-top: 4px;
}

.mega__links a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 4px;
	border-bottom: 1px solid var(--rahmen);
	font-family: var(--schrift-titel);
	font-weight: 600;
	font-size: 18px;
	color: var(--tinte);
	text-decoration: none;
}

.mega__links a::after {
	content: '→';
	font-family: var(--schrift-text);
	font-weight: 700;
	color: var(--grau);
	opacity: 0;
	transform: translateX(-6px);
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.mega__links a:hover,
.mega__links a:focus-visible,
.mega__links a.ist-aktiv {
	color: var(--blau-text);
}

.mega__links a:hover::after,
.mega__links a:focus-visible::after,
.mega__links a.ist-aktiv::after {
	opacity: 1;
	transform: none;
}

/* --- Menü-Knopf und Mobil-Menü ------------------------------------------------ */

.kopf__menue {
	display: none;
	align-items: center;
	gap: 10px;
	padding: 10px 18px 10px 14px;
	border-radius: 999px;
	border: 2px solid var(--tinte);
	background: var(--weiss);
	color: var(--tinte);
	font-weight: 800;
	font-size: 15px;
	cursor: pointer;
}

.kopf__menue-striche {
	display: grid;
	gap: 4px;
	width: 18px;
}

.kopf__menue-striche span {
	display: block;
	height: 2.5px;
	border-radius: 2px;
	background: currentColor;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.kopf__menue[aria-expanded='true'] .kopf__menue-striche span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.kopf__menue[aria-expanded='true'] .kopf__menue-striche span:nth-child(2) { opacity: 0; }
.kopf__menue[aria-expanded='true'] .kopf__menue-striche span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobilnav {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 4px);
	max-height: calc(100vh - var(--kopf-hoehe));
	max-height: calc(100dvh - var(--kopf-hoehe));
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--weiss);
	box-shadow: 0 24px 40px rgba(37, 50, 58, 0.18);
	padding: 8px var(--rand) 28px;
}

.mobilnav[hidden] {
	display: none;
}

.mobilnav__liste {
	list-style: none;
}

.mobilnav__punkt {
	border-bottom: 1px solid var(--rahmen);
}

.mobilnav__titel {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 2px;
	font-family: var(--schrift-titel);
	font-weight: 600;
	font-size: 21px;
	color: var(--tinte);
	text-decoration: none;
	cursor: pointer;
	list-style: none;
}

.mobilnav__titel::-webkit-details-marker {
	display: none;
}

.mobilnav__titel .symbol {
	font-size: 20px;
}

summary.mobilnav__titel::after {
	content: '';
	margin-left: auto;
	width: 10px;
	height: 10px;
	border-right: 2.5px solid currentColor;
	border-bottom: 2.5px solid currentColor;
	transform: rotate(45deg) translate(-3px, -3px);
	transition: transform 0.2s ease;
}

details[open] > summary.mobilnav__titel::after {
	transform: rotate(-135deg) translate(-3px, -3px);
}

.mobilnav details ul {
	list-style: none;
	padding: 0 0 14px 34px;
}

.mobilnav details a {
	display: block;
	padding: 8px 0;
	font-size: 17px;
	font-weight: 700;
	color: var(--tinte);
	text-decoration: none;
}

.mobilnav details a[aria-current='page'] {
	color: var(--blau-text);
}

@media (max-width: 1080px) {
	.nav {
		display: none;
	}
	.kopf__menue {
		display: inline-flex;
	}
}

@media (max-width: 820px) {
	.kopf__innen {
		padding-block: 10px;
	}
	.kopf__logo img {
		height: 48px;
	}
}

/* --- Seitenkopf (Unterseiten) ----------------------------------------------- */

.seitenkopf {
	padding: 52px 0 0;
}

.seitenkopf__raster {
	display: flex;
	gap: 52px;
	align-items: center;
	flex-wrap: wrap;
	padding-bottom: 40px;
}

.seitenkopf__text {
	flex: 1 1 0%;
	min-width: 290px;
}

.seitenkopf__titel {
	font-weight: 700;
	font-size: clamp(32px, 3.8vw, 46px);
	line-height: 1.14;
	letter-spacing: -0.02em;
	color: var(--petrol);
	max-width: 22ch;
}

.seitenkopf__lead {
	margin-top: 16px;
	font-size: 18.5px;
	line-height: 1.62;
	color: var(--grau);
	max-width: 52ch;
}

.seitenkopf__bild {
	position: relative;
	flex: 0 0 auto;
	width: 40%;
	min-width: 300px;
	height: 280px;
}

.seitenkopf__bild .bildrahmen {
	position: absolute;
	inset: 0;
}

/* Hochformate zeigen Gebäude und Köpfe meist im oberen Drittel. */
.seitenkopf__bild img {
	object-position: 50% 30%;
}

.seitenkopf__symbol {
	position: absolute;
	top: -22px;
	right: -18px;
	font-size: 58px;
	transform: rotate(8deg);
}

.seitenkopf__symbol.symbol--dreieck {
	top: auto;
	bottom: -22px;
	right: auto;
	left: 44px;
	transform: rotate(-6deg);
}

/* Unternavigation: Pills zu den Seiten der Rubrik */
.unternav {
	padding-bottom: 26px;
}

.unternav__liste {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

/* --- Inhalt der Unterseiten ------------------------------------------------- */

.inhalt {
	background: var(--weiss);
	padding: 60px 0 96px;
}

.inhalt > .sektion,
.inhalt > .sektion + .sektion {
	margin-top: 0;
}

.inhalt > .sektion + .sektion {
	margin-top: 64px;
}

/* Bänder innerhalb des weissen Inhalts brauchen keine eigene Fläche. */
.inhalt > .band--weiss {
	padding-block: 0;
}

/* --- Footer (Entwurf B) ------------------------------------------------------ */

.fuss {
	background: var(--tinte);
	color: var(--weiss);
}

.home .fuss {
	margin-top: 40px;
}

.fuss__raster {
	max-width: calc(var(--breite) + 2 * var(--rand));
	margin: 0 auto;
	display: flex;
	gap: 40px;
	flex-wrap: wrap;
	padding: 56px var(--rand) 34px;
}

.fuss__raster > div {
	min-width: 200px;
}

.fuss__marke {
	flex: 1 1 0%;
	min-width: 220px;
}

.fuss__logo {
	display: inline-block;
	margin-bottom: 16px;
}

.fuss__logo img {
	height: 64px;
	width: auto;
}

.fuss p,
.fuss li {
	font-size: 15px;
	line-height: 1.7;
	color: rgba(255, 255, 255, 0.8);
}

.fuss a {
	color: rgba(255, 255, 255, 0.92);
	text-decoration-color: rgba(255, 255, 255, 0.35);
}

.fuss a:hover {
	color: var(--weiss);
	text-decoration-color: var(--gelb);
}

.fuss__titel {
	font-family: var(--schrift-text);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.6);
	margin-bottom: 13px;
}

.fuss__unten {
	max-width: calc(var(--breite) + 2 * var(--rand));
	margin: 0 auto;
	padding: 20px var(--rand) 30px;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 24px;
}

.fuss__unten p,
.fuss__unten li {
	font-size: 13px;
	color: rgba(255, 255, 255, 0.6);
}

.fuss__liste {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 20px;
}

@media (max-width: 820px) {
	.seitenkopf {
		padding-top: 36px;
	}
	.seitenkopf__raster {
		gap: 40px;
	}
	.seitenkopf__text {
		min-width: 0;
		flex-basis: 100%;
	}
	.seitenkopf__bild {
		width: calc(100% - 20px);
		min-width: 0;
		height: 220px;
		margin-left: 10px;
	}
	.unternav {
		padding-inline: 0;
	}
	.unternav__liste {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding: 2px var(--rand) 6px;
		scrollbar-width: none;
	}
	.unternav__liste::-webkit-scrollbar {
		display: none;
	}
	.unternav__liste li {
		flex: none;
	}
	.inhalt {
		padding: 40px 0 64px;
	}
	.inhalt > .sektion + .sektion {
		margin-top: 48px;
	}
	.fuss__raster {
		padding: 44px var(--rand) 28px;
	}
}
