/* ==========================================================================
   Grünes Herz – Header und Hauptnavigation für dtmpackage 11 (nur TYPO3 11)
   dtmpackage 11 hat einen anderen Header als 13: Logo und Suche oben
   (.th-brand), darunter eine waagerechte Hauptnavigation mit Aufklapp-
   Feldern (.th-nav-main, .th-nav-flap), mobil ein Burger-Button.

   Kontraste:
     Weiß auf Dunkelblau 13.6:1, Wiesengrün auf Dunkelblau 8.6:1
     Dunkelblau auf Wiesengrün 8.6:1 (Hover, Suchen-Button, Burger)
     Dunkelblau auf Weiß 13.6:1 / auf Naturweiß 12.0:1 (Aufklapp-Felder)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Kopf: Logo, Service-Links, Suche auf Dunkelblau
   -------------------------------------------------------------------------- */
.th-header .th-brand {
	background-color: var(--gh-dunkelblau);
	color: #fff;
}
.th-header .th-logo {
	padding-top: calc(var(--gh-logo-h) / 2);
	padding-bottom: calc(var(--gh-logo-h) / 2);
}
.th-header .th-logo-link {
	display: inline-block;
	border-bottom: 0;
}

/* Service-Links "thueringen.de" / "Regierung und Ministerien" */
.th-header .th-service .th-nav-item,
.th-header .th-service .th-nav-item:visited {
	color: var(--gh-wiesengruen);
	font-weight: 700;
	background: transparent;
	border-color: transparent;
}
.th-header .th-service .th-nav-item:is(:hover, :focus-visible, [aria-expanded="true"]) {
	color: #fff;
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: .25em;
}
.th-header .th-service .th-nav-item:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

/* Ministerienliste (Bootstrap-Dropdown): hell */
.th-header .th-service .dropdown-menu {
	background-color: #fff;
	border: 0;
	border-top: 4px solid var(--gh-wiesengruen);
	box-shadow: 0 8px 24px rgba(0, 50, 70, .25);
	--gh-focus-ring: var(--gh-dunkelblau);
}
.th-header .th-service .dropdown-menu :is(.dropdown-item, .btn-sub),
.th-header .th-service .dropdown-menu :is(.dropdown-item, .btn-sub):visited {
	color: var(--gh-dunkelblau);
	background-color: transparent;
}
.th-header .th-service .dropdown-menu :is(.dropdown-item, .btn-sub):is(:hover, :focus-visible) {
	background-color: var(--gh-naturweiss);
	color: var(--gh-dunkelblau);
	text-decoration: underline;
}
.th-header .th-service .dropdown-menu :is(.dropdown-item, .btn-sub):focus-visible {
	outline: 3px solid var(--gh-dunkelblau);
	outline-offset: -3px;
}

/* Suche: weißes Feld, Button Wiesengrün mit dunkelblauer Schrift */
.th-header :is(.th-search, .th-search-tiny) {
	background-color: transparent;
}
.th-header .th-search-tiny {
	background-color: var(--gh-dunkelblau);
	color: #fff;
}
.th-header :is(.th-search, .th-search-tiny) input,
.th-header :is(.th-search, .th-search-tiny) input:focus {
	background-color: #fff;
	color: var(--gh-schiefergrau);
	border: 1px solid #fff;
}
.th-header :is(.th-search, .th-search-tiny) input::placeholder {
	color: #5b6770;
}
.th-header :is(.th-search, .th-search-tiny) input:focus-visible {
	outline: 3px solid var(--gh-wiesengruen);
	outline-offset: 2px;
}
/* Suchen-Button ist ein .btn-primary: Farben über die Button-Tokens */
.th-header :is(.th-search, .th-search-tiny) {
	--gh-btn-bg: var(--gh-wiesengruen);
	--gh-btn-fg: var(--gh-dunkelblau);
	--gh-btn-border: var(--gh-wiesengruen);
	--gh-btn-stripe: var(--gh-wiesengruen);
	--gh-btn-wipe-bg: #fff;
	--gh-btn-wipe-fg: var(--gh-dunkelblau);
	--gh-btn-wipe-border: #fff;
	--gh-focus-ring: var(--gh-wiesengruen);
}
.th-header :is(.th-search, .th-search-tiny) .btn {
	font-weight: 700;
}
/* Mobile Suche: Absenden ist ein <input type="submit"> */
.th-header.th-header .th-search-tiny input[type="submit"] {
	background-color: var(--gh-wiesengruen);
	border-color: var(--gh-wiesengruen);
	color: var(--gh-dunkelblau);
	font-weight: 700;
}
.th-header.th-header .th-search-tiny input[type="submit"]:is(:hover, :focus-visible) {
	background-color: #fff;
	border-color: #fff;
}
/* Beschriftung "Stichwort:" in Größe der Service-Links, unabhängig von der
   Fließtextgröße (Vorlage Typografie) */
.th-header .th-brand .form-label {
	font-size: 1rem;
}
/* Desktop: Logo senkrecht mittig neben Service-Links und Suche */
@media (min-width: 880px) {
	.th-header .th-brand > .th-container {
		align-items: center;
	}
	/* Gescrollt: Menü-Button bündig mit der Oberkante des Logos */
	.th-header.navbar-transition .th-nav-sticky {
		align-self: flex-start;
		padding-top: calc(var(--gh-logo-h) / 2);
	}
}

/* --------------------------------------------------------------------------
   2. Hauptnavigation (Desktop): Leiste Dunkelblau, Hover Wiesengrün
   -------------------------------------------------------------------------- */
@media (min-width: 880px) {
	.th-header .th-nav-main {
		background-color: var(--gh-dunkelblau);
		padding-top: 0;
		border-top: 1px solid rgba(255, 255, 255, .18);
	}
	.th-header .th-nav-main .th-lvl1-lst {
		background-color: transparent;
	}
	.th-header .th-nav-main .th-lvl1-lst > li > :is(.th-lvl1-btn, a) {
		position: relative;
		background-color: transparent;
		color: #fff;
		font-weight: 700;
		border: 0;
		text-decoration: none;
	}
	/* Aktive Rubrik / Hover / aufgeklappt: grüne Linie unten, beim Hover
	   wischt Wiesengrün herein (Schrift Dunkelblau 8.6:1) */
	.th-header .th-nav-main .th-lvl1-lst > li > :is(.th-lvl1-btn, a)::after {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
		height: 4px;
		background: var(--gh-wiesengruen);
		transform: scaleX(0);
		transform-origin: left center;
		transition: transform .3s cubic-bezier(.22, .8, .2, 1);
	}
	.th-header .th-nav-main .th-lvl1-lst > li:is(.active, .th-active, .current) > :is(.th-lvl1-btn, a)::after,
	.th-header .th-nav-main .th-lvl1-lst > li > :is(.th-lvl1-btn, a)[aria-current]::after {
		transform: scaleX(1);
	}
	.th-header .th-nav-main .th-lvl1-lst > li > :is(.th-lvl1-btn, a):is(:hover, :focus-visible, [aria-expanded="true"]) {
		background-color: var(--gh-wiesengruen);
		color: var(--gh-dunkelblau);
	}
	.th-header .th-nav-main .th-lvl1-lst > li > :is(.th-lvl1-btn, a):is(:hover, :focus-visible, [aria-expanded="true"]) i {
		color: var(--gh-dunkelblau);
	}
	.th-header .th-nav-main .th-lvl1-lst > li > :is(.th-lvl1-btn, a):focus-visible {
		outline: 3px solid #fff;
		outline-offset: -3px;
		box-shadow: inset 0 0 0 6px var(--gh-dunkelblau);
	}
}

/* --------------------------------------------------------------------------
   3. Aufklapp-Felder (Mega-Menü) und mobiles Menü: hell
   -------------------------------------------------------------------------- */
.th-header .th-nav-flap > .th-container,
.th-header .th-nav-flap .card {
	background-color: #fff;
	color: var(--gh-schiefergrau);
	border-color: var(--gh-naturweiss);
}
.th-header .th-nav-flap {
	color: var(--gh-dunkelblau);
	border-top-color: var(--gh-wiesengruen);
}
@media (min-width: 880px) {
	.th-header .th-nav-flap > .th-container {
		border-top: 4px solid var(--gh-wiesengruen);
		box-shadow: 0 12px 28px rgba(0, 50, 70, .22);
	}
}
/* Einträge ohne Kästen: ruhige Liste mit feiner Trennlinie (Schmuck, kein
   Bedeutungsträger); Hover/Fokus: Naturweiß mit grüner Kante links */
.th-header .th-nav-main :is(.th-lvl1-lnk, .th-lvl1-trg, .th-lvl2-lnk, .th-lvl2-trg, .th-lvl3-lnk),
.th-header .th-nav-main .th-nav-inner :is(.card, .th-wrapper, li) {
	border: 0;
	box-shadow: none;
}
.th-header .th-nav-main .th-nav-flap {
	border: 0;
}
.th-header.th-header .th-nav-main .th-nav-inner .th-lvl2-lst > li {
	border-bottom: 1px solid #e6e0d6;
}
.th-header.th-header .th-nav-main .th-nav-inner .th-lvl2-lst > li:last-child {
	border-bottom: 0;
}
/* Rubrik oben im Feld als Überschrift */
.th-header .th-nav-flap .th-lvl1-lnk {
	font-size: 1.25em;
	padding-left: 0;
	background: transparent;
}
.th-header .th-nav-flap :is(.th-lvl2-lnk, .th-lvl3-lnk):is(:hover, :focus-visible) {
	box-shadow: inset 4px 0 0 var(--gh-wiesengruen);
}
/* "schließen" im Aufklapp-Feld (Button ohne Klasse, erkennbar am ×) */
.th-header .th-nav-flap button:has(> .fa-times),
.th-header .th-nav-flap button:has(> .fa-times):focus {
	background-color: var(--gh-naturweiss);
	color: var(--gh-dunkelblau);
	border: 0;
}
.th-header .th-nav-flap button:has(> .fa-times):is(:hover, :focus-visible) {
	background-color: var(--gh-dunkelblau);
	color: #fff;
}
.th-header .th-nav-flap :is(.th-lvl1-lnk, .th-lvl2-lnk, .th-lvl3-lnk),
.th-header .th-nav-flap :is(.th-lvl1-lnk, .th-lvl2-lnk, .th-lvl3-lnk):visited {
	color: var(--gh-dunkelblau);
	background-color: transparent;
}
.th-header .th-nav-flap .th-lvl1-lnk {
	font-weight: 700;
}
.th-header .th-nav-flap :is(.th-lvl1-lnk, .th-lvl2-lnk, .th-lvl3-lnk):is(:hover, :focus-visible) {
	background-color: var(--gh-naturweiss);
	color: var(--gh-dunkelblau);
	text-decoration: underline;
	text-decoration-color: var(--gh-wiesengruen);
	text-decoration-thickness: 3px;
	text-underline-offset: .2em;
}
.th-header .th-nav-flap :is(.th-lvl1-trg, .th-lvl2-trg) {
	color: var(--gh-dunkelblau);
	background-color: transparent;
}
.th-header .th-nav-flap :is(.th-lvl1-trg, .th-lvl2-trg):is(:hover, :focus-visible, [aria-expanded="true"]) {
	background-color: var(--gh-wiesengruen);
	color: var(--gh-dunkelblau);
}
.th-header .th-nav-flap :is(a, button):focus-visible {
	outline: 3px solid var(--gh-dunkelblau);
	outline-offset: -3px;
}

/* --------------------------------------------------------------------------
   4. Burger-Button (mobil und im gescrollten Header): Wiesengrün
   -------------------------------------------------------------------------- */
.th-header .navbar-toggler {
	background-color: var(--gh-wiesengruen);
	color: var(--gh-dunkelblau);
	border: 0;
	border-radius: var(--gh-radius-sm, 0);
	min-height: 44px;
	padding: .5rem .85rem;
	gap: .5rem;
	font-weight: 600;
}
.th-header .navbar-toggler .icon-bar {
	background-color: var(--gh-dunkelblau);
}
.th-header .navbar-toggler:is(:hover, :focus-visible, [aria-expanded="true"]) {
	background-color: #fff;
	color: var(--gh-dunkelblau);
}
.th-header .navbar-toggler:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   5. Mobil: Menü hell
   -------------------------------------------------------------------------- */
@media (max-width: 879px) {
	/* Logo darf schrumpfen, damit der Burger-Button Platz hat */
	.th-header .th-brand > .th-container {
		flex-direction: row;
		flex-wrap: nowrap;
		padding-left: calc(var(--gh-logo-h) / 2);   /* Schutzraum zum Bildschirmrand */
		padding-right: 16px;
	}
	.th-header .th-nav-sticky {
		order: 2;
		flex: 0 0 auto;
		width: auto;
		max-width: none;   /* Basis: 25 %, zu schmal für den Button */
	}
	.th-header .th-brand .th-logo {
		order: 1;
		flex: 1 1 0% !important;   /* gegen feste Breite aus dtmpackage 11 */
		width: auto !important;
		max-width: none !important;
		min-width: 0;
		padding-left: 0;
		padding-right: calc(var(--gh-logo-h) / 2);
	}
	.th-header .th-brand .th-logo img {
		max-width: 100%;
		height: var(--gh-logo-h);
		width: auto;
		object-fit: contain;
		object-position: left center;
	}
	.th-header .th-nav-sticky {
		padding-top: 0;
		display: flex;
		align-items: center;
	}
	.th-header .th-brand > .th-container {
		align-items: center;
	}
	.th-header .th-nav-main {
		background-color: #fff;
		color: var(--gh-dunkelblau);
		border-top: 4px solid var(--gh-wiesengruen);
	}
	/* Rubriken mobil: feine Trennlinie */
	.th-header .th-nav-main .th-lvl1-lst > li {
		border-bottom: 1px solid #e6e0d6;
	}
	.th-header .th-nav-main :is(.th-lvl1-btn, .th-lvl1-lst > li > a),
	.th-header .th-nav-main :is(.th-lvl1-btn, .th-lvl1-lst > li > a):visited {
		background-color: transparent;
		color: var(--gh-dunkelblau);
		border-color: var(--gh-naturweiss);
		font-weight: 700;
	}
	.th-header .th-nav-main :is(.th-lvl1-btn, .th-lvl1-lst > li > a):is(:hover, :focus-visible, [aria-expanded="true"]) {
		background-color: var(--gh-naturweiss);
		box-shadow: inset 4px 0 0 var(--gh-wiesengruen);
	}
}

/* Sehr schmale Bildschirme: nur das Burger-Symbol, damit breite Logos die
   Mindestgröße (7 mm ≈ 26px Höhe) halten. Für Screenreader bleibt der Text
   „Navigation ein-/ausblenden“ (.sr-only) erhalten. */
@media (max-width: 399px) {
	.th-header .navbar-toggler :is(.nav-open, .nav-close) {
		display: none;
	}
	.th-header .navbar-toggler {
		min-width: 48px;
		justify-content: center;
	}
}

/* --------------------------------------------------------------------------
   6. Inhalt und Footer
   -------------------------------------------------------------------------- */
/* Seitengrund Naturweiß statt Grau; die Inhaltsfläche bleibt weiß */
main {
	background-color: var(--gh-naturweiss);
}
/* Kopf der Linklisten (z. B. „Aktuelles“): Dunkelblau statt Hellblau */
:root .th-media .th-lst-head {
	background-color: var(--gh-dunkelblau);
	color: #fff;
}
/* Footer-Sitemap: Dunkelblau, Kästen mit hellem Rahmen, Links Weiß
   (13.6:1), Hover Wiesengrün (8.6:1) */
.th-nav-sitemap {
	background-color: var(--gh-dunkelblau);
	color: #fff;
	--gh-focus-ring: var(--gh-wiesengruen);
	--th-color-focus: var(--gh-wiesengruen);
}
:root .th-nav-sitemap div,
:root .th-nav-sitemap .th-level1 > [class*="col"] > div {
	border-color: rgba(255, 255, 255, .25) !important;   /* Basis setzt Hellblau #5bb3da mit !important */
}
.th-nav-sitemap a,
.th-nav-sitemap a:visited {
	color: #fff;
}
.th-nav-sitemap a:is(:hover, :focus-visible) {
	color: var(--gh-wiesengruen);
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: .2em;
}
.th-nav-sitemap a:focus-visible {
	outline: 3px solid var(--gh-wiesengruen);
	outline-offset: 2px;
}
