/* ==========================================================================
   Grünes Herz – Einheitliche Zustände
   Ergänzt die Zustände aus gh-colors.css um gedrückt (active), Hover für
   Navigation/Formulare und einen einheitlichen Fehlerzustand.

   Barrierefreiheit (WCAG 2.1 AA / EN 301 549):
     - Zustände nie nur über Farbe: Kante, Linie, Füllung, Symbol oder Text
     - Fokus bleibt überall der 3px-Rahmen aus gh-colors.css
     - Kontraste: Dunkelblau/Weiß 13.6:1, Dunkelblau/Wiesengrün 8.6:1,
       Dunkelblau/Hellgrün #e0f9c7 12:1, Fehlerrot/Weiß 6.6:1
     - Bewegung nur ohne „Bewegung reduzieren“
   ========================================================================== */

:root {
	--gh-hellgruen: #e0f9c7;
	--gh-press-shadow: inset 0 3px 0 rgba(0, 50, 70, .35);
}

/* --------------------------------------------------------------------------
   1. Gedrückt (active): innerer Schatten, 1px tiefer
   !important gegen box-shadow:none der Button-Varianten
   -------------------------------------------------------------------------- */
:root :is(.btn-primary, .btn-secondary, .btn-outline-primary, .btn-outline-secondary, .th-txt p a:not(.btn)):active,
:root main :is(.btn-primary, .btn-secondary, .btn-outline-primary, .btn-outline-secondary, .th-txt p a:not(.btn)):visited:active {
	box-shadow: var(--gh-press-shadow) !important;
	transform: translateY(1px);
}
/* Header-Button: gedrückt und solange das Menü offen ist */
:root .th-header .th-wrapper .th-nav-item:is(:active, [aria-expanded="true"]) {
	box-shadow: inset 0 3px 0 rgba(130, 230, 30, .6) !important;
}
:root .th-header .th-wrapper .th-nav-item:active {
	transform: translateY(1px);
}
@media (prefers-reduced-motion: reduce) {
	:root :is(.btn, .th-txt p a, .th-header .th-nav-item):active {
		transform: none;
	}
}

/* --------------------------------------------------------------------------
   2. Links im Text
   Hover: Linie 3px Wiesengrün (Text bleibt Dunkelblau 13.6:1)
   Gedrückt: hellgrün hinterlegt (12:1); auf Dunkelblau tieferes Blau
   -------------------------------------------------------------------------- */
:root {
	--gh-link-hover-deco: var(--gh-wiesengruen);
	--gh-link-active-bg: var(--gh-hellgruen);
}
:root :is(.th-header, .th-look-primary, .th-content.gh-section-dark, .frame-gh-dark, .gh-band-dark) {
	--gh-link-active-bg: #00445f;
}
main :is(p, li, td, dd) > a:not(.btn, .page-link, .accordion-button, .more, .th-lnk-btn):active,
main :is(p, li, td, dd) > a:not(.btn, .page-link, .accordion-button, .more, .th-lnk-btn):visited:active {
	background-color: var(--gh-link-active-bg) !important;
}
/* Überschriften-Links: gedrückt mit grüner Linie */
main :is(h1, h2, h3, h4, h5, h6, .th-hdl) > a:not(.btn):active,
.th-slider .slick-slide > .th-txt > a:active > :is(h1, h2, h3, h4, h5, h6) {
	text-decoration: underline;
	text-decoration-color: var(--gh-wiesengruen);
	text-decoration-thickness: 3px;
	text-underline-offset: .15em;
}

/* --------------------------------------------------------------------------
   3. Navigation
   -------------------------------------------------------------------------- */
/* Menü „Suche und Menü“: gedrückt = Kante in Schriftfarbe (Weiß bzw. Dunkelblau) */
.th-nav-main :is(.th-lvl2-lnk, .th-lvl3-lnk):active {
	border-left-color: currentColor !important;
}

/* Seitenzahlen: Hover Wiesengrün (8.6:1), gedrückt mit Innenschatten,
   aktuelle Seite gefüllt + fett */
.page-item:not(.active, .disabled) .page-link:hover {
	background-color: var(--gh-wiesengruen);
	border-color: var(--gh-wiesengruen);
	color: var(--gh-dunkelblau);
	text-decoration: none;
}
.page-item:not(.active, .disabled) .page-link:active {
	background-color: var(--gh-wiesengruen);
	box-shadow: var(--gh-press-shadow);
}
.page-item.active .page-link {
	font-weight: 700;
}
.page-item.disabled .page-link {
	color: #5c5c5c;
	border-color: #8a8a8a;
	background-color: transparent;
}

/* Akkordeon: Naturweiß, Hover grüne Kante, geöffnet Dunkelblau/Weiß (13.6:1).
   Zustand zusätzlich über das Pfeil-Symbol und aria-expanded. */
.accordion-button {
	background-color: var(--gh-naturweiss);
	color: var(--gh-dunkelblau);
	border-left: 4px solid transparent;
	box-shadow: none;
}
.accordion-button:hover {
	border-left-color: var(--gh-wiesengruen);
}
.accordion-button:active {
	background-color: #ebe3da;
}
.accordion-button:not(.collapsed) {
	background-color: var(--gh-dunkelblau);
	color: #fff;
	border-left-color: var(--gh-wiesengruen);
	box-shadow: none;
}
.accordion-button:not(.collapsed)::after {
	filter: brightness(0) invert(1);
}
.accordion-button:focus {
	box-shadow: none;
}

/* Social-Media, Teilen, Drucken/nach oben: Hover Dunkelblau mit weißem
   Symbol (13.6:1), gedrückt Wiesengrün (8.6:1) */
:is(.th-social, .th-sharing, .th-misc) ul li a:hover,
.shariff .shariff-button a:hover {
	background-color: var(--gh-dunkelblau) !important;
	border-color: var(--gh-dunkelblau) !important;
	color: #fff !important;
	text-decoration: none;
}
:is(.th-social, .th-sharing, .th-misc) ul li a:hover :is(i, svg, span),
.shariff .shariff-button a:hover :is(i, svg, span) {
	color: #fff !important;
	fill: #fff;
}
:is(.th-social, .th-sharing, .th-misc) ul li a:active,
.shariff .shariff-button a:active {
	background-color: var(--gh-wiesengruen) !important;
	border-color: var(--gh-wiesengruen) !important;
	color: var(--gh-dunkelblau) !important;
}
:is(.th-social, .th-sharing, .th-misc) ul li a:active :is(i, svg, span),
.shariff .shariff-button a:active :is(i, svg, span) {
	color: var(--gh-dunkelblau) !important;
	fill: var(--gh-dunkelblau);
}

/* --------------------------------------------------------------------------
   4. Formulare
   -------------------------------------------------------------------------- */
/* Hover: Rahmen optisch 2px (Innenschatten, kein Springen des Layouts) */
:is(.form-control, .form-select, input[type=text], input[type=email], input[type=tel], input[type=search], input[type=number], input[type=date], input[type=url], textarea, select):not(:disabled, [readonly]):hover {
	box-shadow: inset 0 0 0 1px var(--gh-dunkelblau);
}
/* Checkbox/Radio: Hover mit hellgrünem Hof */
:is(.form-check-input, input[type=checkbox], input[type=radio]):not(:disabled):hover {
	box-shadow: 0 0 0 3px var(--gh-hellgruen);
}
/* Deaktiviert */
:is(.form-control, .form-select, input, textarea, select):disabled {
	background-color: var(--gh-naturweiss);
	border-color: #8a8a8a;
	color: #5c5c5c;
}

/* Fehler: 2px Fehlerrot (6.6:1) + Symbol + Text am Feld (nicht nur Farbe) */
.is-invalid,
.powermail_field_error,
.tx-powermail .powermail_fieldset :is(input, textarea, select).powermail_field_error {
	border: 2px solid var(--gh-fehlerrot) !important;
}
:is(.form-check-input, input[type=checkbox], input[type=radio]).powermail_field_error {
	outline: 2px solid var(--gh-fehlerrot);
	outline-offset: 2px;
}
.invalid-feedback,
.powermail-errors-list,
.powermail-errors-list li {
	color: var(--gh-fehlerrot);
	font-weight: 600;
	list-style: none;
}
.powermail-errors-list {
	margin: .35rem 0 0;
	padding: 0;
}
.invalid-feedback::before,
.powermail-errors-list li::before {
	content: "!" / "";
	display: inline-grid;
	place-items: center;
	width: 1.15em;
	height: 1.15em;
	margin-right: .35em;
	border-radius: 50%;
	background-color: var(--gh-fehlerrot);
	color: #fff;
	font-size: .8em;
	font-weight: 700;
	vertical-align: .1em;
}

/* --------------------------------------------------------------------------
   5. Windows-Kontrastmodus
   -------------------------------------------------------------------------- */
@media (forced-colors: active) {
	:root :is(.btn, .th-txt p a, .th-header .th-nav-item):active {
		box-shadow: none !important;
		outline: 2px solid ButtonText;
	}
	.accordion-button:not(.collapsed)::after {
		filter: none;
	}
	.invalid-feedback::before,
	.powermail-errors-list li::before {
		forced-color-adjust: none;
		background-color: CanvasText;
		color: Canvas;
	}
}
