/*
Theme Name: KGV Verein Website
Author: KGV Verein
Description: Block-Theme für Kleingartenvereine, passend zum Plugin „KGV Verein“. Texte und Logos des eigenen Vereins unter Design → Website des Vereins (oder per Vereinspaket). Gut lesbar, mobilfreundlich, mit lokal eingebundenen Schriften (keine Verbindung zu Google Fonts) und fertigen Vorlagen für Hinweise, Termine, Vereinshaus, freie Parzellen und Vorstand.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 2.17.5
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kgv-am-walde
Tags: block-theme, full-site-editing, blog, two-columns, right-sidebar, accessibility-ready
*/

/* ---------- Grundlagen ---------- */

html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Abstände zwischen Kopf, Inhalt und Fuß selbst steuern */
.wp-site-blocks > * {
	margin-block-start: 0;
}

.kgv-main > * {
	margin-block-start: 0;
}

/* Deutliche Fokusmarkierung für Tastaturbedienung: 3px Erde (Designsystem). Eingabefelder: Rand wald + Schein moos (unten). */
:where(a, button, summary, [tabindex], input[type="checkbox"], input[type="radio"], input[type="submit"], input[type="button"], input[type="file"]):focus-visible {
	outline: 3px solid var(--kgv-earth, var(--wp--preset--color--erde));
	outline-offset: 3px;
	border-radius: 4px;
}

a {
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}

a:hover {
	text-decoration-thickness: 2px;
}

::selection {
	background: var(--kgv-sun, var(--wp--preset--color--sonne, #F6E7C1));
	color: var(--kgv-text, var(--wp--preset--color--dunkel, #1D2A20));
}

/* ---------- Kopfbereich ---------- */

.kgv-kopf .kgv-logo {
	margin: 0;
	flex-shrink: 0;
}

.kgv-kopf .kgv-logo img {
	display: block;
}

.kgv-fuss .kgv-logo-fuss {
	margin: 0 0 0.5rem;
}

.kgv-fuss .kgv-logo-fuss img {
	max-width: 100%;
	height: auto;
}

@media (max-width: 600px) {
	.kgv-kopf .kgv-logo img {
		width: 60px !important;
		height: 60px !important;
	}
}

.kgv-kopf .wp-block-site-title a {
	text-decoration: none;
}

.kgv-kopf-hinweis {
	opacity: 0.92;
}

.kgv-kopf-hinweis a {
	font-weight: 700;
}

.kgv-menueleiste {
	border-bottom: 1px solid var(--kgv-line, var(--wp--preset--color--linie));
	box-shadow: 0 2px 10px rgba(22, 54, 31, 0.06);
}

.kgv-menueleiste .wp-block-navigation-item__content {
	display: inline-block;
	padding-block: 0.85rem;
	text-decoration: none;
	border-bottom: 3px solid transparent;
}

.kgv-menueleiste .wp-block-navigation-item__content:hover,
.kgv-menueleiste .current-menu-item > .wp-block-navigation-item__content,
.kgv-menueleiste .wp-block-navigation-item__content[aria-current="page"] {
	border-bottom-color: var(--kgv-earth, var(--wp--preset--color--erde));
}

.kgv-menueleiste .wp-block-navigation .wp-block-navigation__submenu-container {
	border: 1px solid var(--kgv-line, var(--wp--preset--color--linie)) !important;
	border-radius: 8px;
	box-shadow: 0 10px 30px rgba(22, 54, 31, 0.14);
	padding: 0.4rem 0;
	min-width: 15rem;
}

.kgv-menueleiste .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 0.5rem 1.1rem;
	border-bottom: 0;
	font-weight: 400;
}

.kgv-menueleiste .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
	background: rgba(255, 255, 255, 0.14);
	text-decoration: underline;
}

.kgv-menueleiste .wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	border: 0 !important;
	box-shadow: none !important;
	padding-left: 1rem !important;
}

/* Mobiles Menü */
.wp-block-navigation__responsive-container-open {
	padding: 0.6rem 0;
	gap: 0.4rem;
	font-weight: 700;
}

.wp-block-navigation__responsive-container-open::after {
	content: "Menü";
}

.wp-block-navigation__responsive-container.is-menu-open {
	padding: 1.5rem;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: 1.25rem;
	padding-block: 0.35rem;
	border-bottom: 0;
}

/* ---------- Startseite: Begrüßung ---------- */

.kgv-hero {
	position: relative;
	overflow: hidden;
}

.kgv-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: radial-gradient(circle at 85% 20%, rgba(246, 231, 193, 0.18), transparent 45%);
	pointer-events: none;
}

.kgv-hero > * {
	position: relative;
}

.kgv-hero h1 {
	max-width: 16ch;
	text-wrap: balance;
}

.kgv-hero .kgv-vorzeile {
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-weight: 700;
}

.kgv-hero-bild img {
	width: 100%;
	height: auto;
	filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.25));
}

.kgv-hero .wp-block-button.is-style-outline > .wp-block-button__link {
	border-width: 2px;
}

.kgv-hero .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: rgba(255, 255, 255, 0.12);
}

.has-erde-background-color.wp-block-button__link:hover {
	background-color: var(--kgv-earth-deep, #8A4717) !important;
}

/* ---------- Karten ---------- */

.is-style-karte,
.kgv-karte {
	background: var(--kgv-white, var(--wp--preset--color--weiss));
	border: 1px solid var(--kgv-line, var(--wp--preset--color--linie));
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(22, 54, 31, 0.05);
}

.is-style-karte {
	padding: clamp(1.25rem, 2.5vw, 1.75rem);
}

.kgv-beitragskarte {
	overflow: hidden;
	height: 100%;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.kgv-beitragskarte:hover {
	box-shadow: 0 10px 28px rgba(22, 54, 31, 0.12);
	transform: translateY(-2px);
}

.kgv-beitragskarte .wp-block-post-featured-image {
	margin: 0;
}

.kgv-beitragskarte .wp-block-post-featured-image img {
	border-radius: 0;
}

/*
 * 2.17.5: Beitragsbilder in den Karten nicht mehr beschneiden. Rahmen 16:9 (das übliche Format für Grafiken), das ganze
 * Bild bleibt sichtbar; hat es ein anderes Format, füllt die Kartenfarbe den Rest. Mit !important, damit es auch für im
 * Website-Editor angepasste Vorlagen (alte Einstellung 16:10, „Zuschneiden“) gilt.
 */
.kgv-beitragskarte .wp-block-post-featured-image {
	aspect-ratio: 16 / 9 !important;
	background: var(--kgv-moss-light, var(--wp--preset--color--moos));
	overflow: hidden;
}
.kgv-beitragskarte .wp-block-post-featured-image a {
	display: block;
	height: 100%;
}
.kgv-beitragskarte .wp-block-post-featured-image img {
	width: 100% !important;
	height: 100% !important;
	aspect-ratio: 16 / 9 !important;
	object-fit: contain !important;
}

.kgv-karte-inhalt {
	padding: 1.25rem 1.4rem 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	flex: 1;
}

.kgv-karte-inhalt > * {
	margin: 0 !important;
}

.kgv-beitragskarte .wp-block-post-title {
	line-height: 1.25;
}

.kgv-beitragskarte .wp-block-post-title a:hover {
	text-decoration: underline;
}

.kgv-meta {
	gap: 0.25rem 0.9rem;
}

.kgv-meta .wp-block-post-author-name::before {
	content: "von ";
}

.wp-block-post-excerpt__more-text {
	margin-top: 0.6rem;
}

.wp-block-post-excerpt__more-link {
	font-weight: 700;
	text-decoration: none;
	color: var(--kgv-earth-text, var(--wp--preset--color--erde));
}

.wp-block-post-excerpt__more-link::after {
	content: " →";
}

/* Schnellzugriff */
.kgv-schnell {
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.kgv-schnell:hover {
	box-shadow: 0 10px 28px rgba(22, 54, 31, 0.12);
	transform: translateY(-2px);
}

/* Lange Wörter („Gemeinschaftsstunden“) in schmalen Karten trennen statt mitten im Wort umbrechen. */
.kgv-schnell h3 {
	hyphens: auto;
	overflow-wrap: break-word;
}

.kgv-schnell h3 a {
	text-decoration: none;
	color: inherit;
}

.kgv-schnell h3 a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.kgv-schnell {
	position: relative;
}

.kgv-schnell .wp-block-image {
	margin-bottom: 0.25rem;
}

/* ---------- Seitenleiste ---------- */

/* Beim Scrollen angepinnt (Abstand oben setzt assets/js/seitenleiste.js) – nur, wenn die Spalten nebeneinander stehen. */
@media (min-width: 782px) {
	.wp-block-column > .kgv-seitenleiste-halter {
		position: sticky;
		top: var(--kgv-sl-top, 1.5rem);
	}
}

.kgv-seitenkarte__liste {
	margin: 0 0 1rem;
	padding-left: 1.1rem;
}

.kgv-seitenkarte__liste li + li {
	margin-top: 0.35rem;
}

.kgv-seitenleiste > * + * {
	margin-block-start: 1.5rem;
}

.kgv-seitenleiste h2 {
	font-size: 1.35rem;
}

.kgv-termine {
	border-top: 6px solid var(--kgv-earth, var(--wp--preset--color--erde));
}

.kgv-termine ul {
	padding-left: 0;
	list-style: none;
}

.kgv-termine li {
	padding: 0.6rem 0;
	border-bottom: 1px dashed var(--kgv-line, var(--wp--preset--color--linie));
}

/* Termin-Plugins in der Seitenleiste etwas aufräumen */
.kgv-termine img {
	border-radius: 8px;
	max-width: 100%;
	height: auto;
}

/* ---------- Hinweis-Boxen mit Icon (Info, Wasser, Achtung) ---------- */

.is-style-hinweis,
.is-style-hinweis-wasser,
.is-style-achtung {
	position: relative;
	padding-left: 4.9rem !important;
	min-height: 4.6rem;
}

.is-style-hinweis::before,
.is-style-hinweis-wasser::before,
.is-style-achtung::before {
	content: "";
	position: absolute;
	top: 0.95rem;
	left: 1.1rem;
	width: 2.8rem;
	height: 2.8rem;
	background: url("assets/images/icon-info-box.svg") center / contain no-repeat;
}

.is-style-hinweis-wasser::before {
	background-image: url("assets/images/icon-tropfen-box.svg");
}

.is-style-achtung::before {
	background-image: url("assets/images/icon-achtung-box.svg");
}

@media (max-width: 600px) {
	.is-style-hinweis,
	.is-style-hinweis-wasser,
	.is-style-achtung {
		padding-left: 1.2rem !important;
		padding-top: 4.3rem !important;
	}
}

/* Achtung-Box: für Sperrungen, Wasserabstellung, Fristen */
.is-style-achtung {
	background: var(--kgv-red-light, #FBE3D8);
	border-left: 6px solid var(--kgv-red-fill, #A3261B);
	border-radius: 8px;
	padding: 1.1rem 1.35rem;
	color: var(--kgv-text, var(--wp--preset--color--dunkel));
}

.is-style-achtung > :first-child { margin-top: 0; }
.is-style-achtung > :last-child { margin-bottom: 0; }

/* ---------- Hinweis-Box ---------- */

.is-style-hinweis {
	background: var(--kgv-sun, var(--wp--preset--color--sonne));
	border-left: 6px solid var(--kgv-earth, var(--wp--preset--color--erde));
	border-radius: 8px;
	padding: 1.1rem 1.35rem;
	color: var(--kgv-text, var(--wp--preset--color--dunkel));
}

.is-style-hinweis > :first-child { margin-top: 0; }
.is-style-hinweis > :last-child { margin-bottom: 0; }

/* Variante für Wasser-Themen (Komplementärfarben zu Sonne und Erde) */
.is-style-hinweis-wasser {
	background: var(--kgv-info-light, #C1D0F6);
	border-left: 6px solid var(--kgv-info-strong, #1E6CA4);
	border-radius: 8px;
	padding: 1.1rem 1.35rem;
	color: var(--kgv-text, var(--wp--preset--color--dunkel));
}

.is-style-hinweis-wasser > :first-child { margin-top: 0; }
.is-style-hinweis-wasser > :last-child { margin-bottom: 0; }

/* ---------- Beitrag & Seite ---------- */

.kgv-beitrag-meta {
	gap: 0.3rem 1rem;
	color: var(--kgv-gray, var(--wp--preset--color--grau));
}

.wp-block-post-featured-image img {
	border-radius: 12px;
}

.kgv-inhalt .wp-block-post-content img {
	border-radius: 8px;
}

.kgv-inhalt .wp-block-post-content :where(table) {
	border-collapse: collapse;
}

.kgv-inhalt .wp-block-post-content :where(td, th) {
	border: 1px solid var(--kgv-line, var(--wp--preset--color--linie));
	padding: 0.5rem 0.75rem;
}

.wp-block-post-navigation-link a {
	font-weight: 700;
	text-decoration: none;
}

/* ---------- Fußbereich ---------- */

.kgv-fuss a {
	text-decoration: none;
}

.kgv-fuss a:hover {
	text-decoration: underline;
}

.kgv-fuss .wp-block-list {
	list-style: none;
	padding-left: 0;
}

.kgv-fuss .wp-block-list li {
	padding: 0.2rem 0;
}

.kgv-fuss h2 {
	font-size: 1.2rem;
	color: var(--kgv-on-dark, var(--wp--preset--color--weiss));
}

.kgv-fuss .wp-block-separator {
	opacity: 0.25;
}

/* ---------- Formulare (alle Plugins: Anmeldungen, Kontakt, Kommentare) ----------
   Karte  = weiße Karte mit grüner Oberkante (wie die Termine-Karte, nur in Wald)
   Felder = volle Breite, 8px Radius, grüner Fokus
   Senden = Theme-Button (Waldgrün)
   Elementor-Formulare und die Suche behalten ihr eigenes Aussehen. */

/* Alle Eingabefelder: Grundaussehen */
.wp-site-blocks input:is([type="text"], [type="email"], [type="tel"], [type="url"], [type="number"], [type="date"], [type="time"], [type="datetime-local"], [type="search"], [type="password"]),
.wp-site-blocks textarea,
.wp-site-blocks select {
	box-sizing: border-box;
	max-width: 100%;
	font: inherit;
	font-size: 1.0625rem;
	line-height: 1.4;
	padding: 0.7rem 0.85rem;
	border: 1px solid var(--kgv-line-strong, #A9B5A2);
	border-radius: 8px;
	background-color: var(--kgv-white, var(--wp--preset--color--weiss));
	color: var(--kgv-text, var(--wp--preset--color--dunkel));
	box-shadow: inset 0 1px 2px rgba(22, 54, 31, 0.06);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wp-site-blocks :is(input, textarea, select)::placeholder {
	color: var(--kgv-gray, var(--wp--preset--color--grau));
	opacity: 1;
}

.wp-site-blocks :is(input, textarea, select):hover:not(:disabled) {
	border-color: var(--kgv-leaf, var(--wp--preset--color--blatt));
}

.wp-site-blocks :is(input:not([type="submit"], [type="button"], [type="reset"]), textarea, select):focus {
	border-color: var(--kgv-forest, var(--wp--preset--color--wald));
	box-shadow: 0 0 0 3px var(--kgv-moss, var(--wp--preset--color--moos));
	outline: none;
}

.wp-site-blocks :is(input:not([type="submit"], [type="button"], [type="reset"]), textarea, select):focus-visible {
	outline: 2px solid transparent; /* Felder: Rand wald + 3px Schein moos (siehe :focus); unsichtbarer Rahmen für den Kontrastmodus */
}

.wp-site-blocks input:is([type="checkbox"], [type="radio"], [type="file"], [type="submit"], [type="button"], [type="reset"]):focus-visible {
	outline: 3px solid var(--kgv-earth, var(--wp--preset--color--erde));
	outline-offset: 2px;
}

.wp-site-blocks :is(input, textarea, select):disabled {
	background-color: var(--kgv-surface, var(--wp--preset--color--creme));
	color: var(--kgv-gray, var(--wp--preset--color--grau));
	cursor: not-allowed;
}

/* Auswahllisten mit eigenem Pfeil in Waldgrün */
.wp-site-blocks select:not([multiple]):not([size]) {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 2.6rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1.5 1.5 7 7l5.5-5.5' fill='none' stroke='%231F4A2C' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.95rem center;
	background-size: 14px 9px;
	cursor: pointer;
}

/* Formulare im Inhalt: Felder immer volle Breite der Karte */
:is(.kgv-formular, .is-style-formular) :is(input:is([type="text"], [type="email"], [type="tel"], [type="url"], [type="number"], [type="date"], [type="time"], [type="datetime-local"], [type="password"]), textarea, select),
.wp-block-post-content form:not(.wp-block-search, .search-form, .elementor-form) :is(input:is([type="text"], [type="email"], [type="tel"], [type="url"], [type="number"], [type="date"], [type="time"], [type="datetime-local"], [type="password"]), textarea, select),
.wp-block-post-comments-form :is(input:is([type="text"], [type="email"], [type="url"]), textarea) {
	display: block;
	width: 100% !important;
	min-height: 3rem;
	margin: 0;
	padding: 0.7rem 0.85rem !important;
	font-size: 1.0625rem !important;
}

.wp-block-post-content form:not(.wp-block-search, .search-form, .elementor-form) select:not([multiple]):not([size]),
:is(.kgv-formular, .is-style-formular) select:not([multiple]):not([size]) {
	padding-right: 2.6rem !important;
}

.wp-block-post-content form:not(.wp-block-search, .search-form, .elementor-form) textarea,
:is(.kgv-formular, .is-style-formular) textarea,
.wp-block-post-comments-form textarea {
	min-height: 8rem;
	resize: vertical;
}

/* Die Karte: Formular hebt sich vom cremefarbenen Hintergrund ab.
   Greift auf den äußeren Rahmen des Plugins (Shortcode-Ausgabe) oder,
   wenn es keinen gibt, auf das Formular selbst. */
:is(.kgv-formular, .is-style-formular),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-members--anmelden):has(form:not(.wp-block-search, .search-form)),
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form) {
	box-sizing: border-box;
	max-width: 100%;
	background: var(--kgv-white, var(--wp--preset--color--weiss)) !important;
	border: 1px solid var(--kgv-line, var(--wp--preset--color--linie)) !important;
	border-top: 6px solid var(--kgv-forest, var(--wp--preset--color--wald)) !important;
	border-radius: 12px !important;
	box-shadow: 0 12px 32px rgba(22, 54, 31, 0.09), 0 1px 2px rgba(22, 54, 31, 0.05) !important;
	padding: clamp(1.25rem, 3vw, 2.25rem) !important;
	margin-block: var(--wp--preset--spacing--50) !important;
}

/* Innere Rahmen des Plugins neutralisieren, damit es keine Karte in der Karte gibt */
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-members--anmelden):has(form:not(.wp-block-search, .search-form)) form,
:is(.kgv-formular, .is-style-formular) form {
	background: transparent;
	border: 0;
	box-shadow: none;
	padding: 0;
	margin: 0;
}

:is(:is(.kgv-formular, .is-style-formular), .wp-block-post-content form:not(.wp-block-search, .search-form, .elementor-form), .wp-block-post-content > div:has(> form:not(.wp-block-search, .search-form))) > :first-child {
	margin-top: 0;
}

:is(:is(.kgv-formular, .is-style-formular), .wp-block-post-content > div:not([class*="wp-block-"], .kgv-t):has(form:not(.wp-block-search, .search-form))) > :is(h2, h3) {
	font-size: var(--wp--preset--font-size--large);
	margin-bottom: 1.25rem;
	padding-bottom: 0.85rem;
	border-bottom: 1px solid var(--kgv-line, var(--wp--preset--color--linie));
}

/* Beschriftungen */
.wp-block-post-content form:not(.wp-block-search, .search-form, .elementor-form) label,
:is(.kgv-formular, .is-style-formular) label,
.wp-block-post-comments-form label {
	font-weight: 600;
	color: var(--kgv-heading, var(--wp--preset--color--wald-tief));
	line-height: 1.35;
}

/* Abstand zwischen den Feldern */
.wp-block-post-content form:not(.wp-block-search, .search-form, .elementor-form) :is(p, div.form-group, div.form-row, div.field, div[class*="field"]):not(:last-child),
:is(.kgv-formular, .is-style-formular) form :is(p, div.form-group, div.form-row, div.field):not(:last-child) {
	margin-bottom: 1.15rem;
}

/* Viele Plugins setzen nach der Beschriftung ein <br>. Da Beschriftungen
   hier eine eigene Zeile sind, entstünde sonst eine Leerzeile. */
.wp-site-blocks form :is(label, .form-label):not(:has(input:is([type="checkbox"], [type="radio"]))) + br,
.wp-site-blocks form :is(label, .form-label):not(:has(input:is([type="checkbox"], [type="radio"]))) > br:last-child {
	display: none;
}

/* Checkboxen und Optionsfelder: klein, grün, links neben dem Text */
.wp-site-blocks input:is([type="checkbox"], [type="radio"]) {
	width: 1.2rem !important;
	height: 1.2rem !important;
	min-height: 0 !important;
	flex: 0 0 auto;
	margin: 0.2rem 0.55rem 0 0 !important;
	padding: 0 !important;
	vertical-align: top;
	accent-color: var(--kgv-forest, var(--wp--preset--color--wald));
	cursor: pointer;
	display: inline-block !important;
	float: none !important;
}

.wp-site-blocks label:has(> input:is([type="checkbox"], [type="radio"])),
.wp-site-blocks :is(p, div, span):has(> input:is([type="checkbox"], [type="radio"]) + label) {
	display: flex !important;
	align-items: flex-start;
	gap: 0;
	text-align: left !important;
	font-weight: 400;
	color: var(--kgv-text, var(--wp--preset--color--dunkel));
	cursor: pointer;
}

.wp-site-blocks input:is([type="checkbox"], [type="radio"]) + label {
	display: inline !important;
	width: auto !important;
	float: none !important;
	text-align: left !important;
	font-weight: 400;
	color: var(--kgv-text, var(--wp--preset--color--dunkel));
	cursor: pointer;
}

/* Gruppen (z. B. mehrere Optionen) */
.wp-site-blocks form fieldset {
	border: 1px solid var(--kgv-line, var(--wp--preset--color--linie));
	border-radius: 8px;
	padding: 1rem 1.25rem 1.1rem;
	margin: 0 0 1.25rem;
}

.wp-site-blocks form legend {
	font-weight: 700;
	color: var(--kgv-heading, var(--wp--preset--color--wald));
	padding: 0 0.4rem;
}

/* Senden-Knopf = Theme-Button */
.wp-site-blocks form:not(.wp-block-search, .search-form, .elementor-form) :is(input[type="submit"], button[type="submit"], button:not([type])),
.wp-block-post-comments-form input[type="submit"] {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: auto;
	min-height: 3rem;
	margin-top: 0.5rem;
	padding: 0.8rem 1.6rem !important;
	border: 0 !important;
	border-radius: 8px !important;
	background: var(--kgv-forest, var(--wp--preset--color--wald)) !important;
	color: var(--kgv-on-dark, var(--wp--preset--color--weiss)) !important;
	font-family: var(--wp--preset--font-family--body) !important;
	font-size: 1.0625rem !important;
	font-weight: 700 !important;
	line-height: 1.3;
	text-decoration: none;
	box-shadow: 0 2px 0 var(--kgv-forest-deep, var(--wp--preset--color--wald-tief));
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.wp-site-blocks form:not(.wp-block-search, .search-form, .elementor-form) :is(input[type="submit"], button[type="submit"], button:not([type])):hover,
.wp-block-post-comments-form input[type="submit"]:hover {
	background: var(--kgv-forest-deep, var(--wp--preset--color--wald-tief)) !important;
	transform: translateY(-1px);
}

.wp-site-blocks form:not(.wp-block-search, .search-form, .elementor-form) :is(input[type="submit"], button[type="submit"], button:not([type])):disabled {
	background: var(--kgv-gray, var(--wp--preset--color--grau)) !important;
	box-shadow: none;
	cursor: not-allowed;
	transform: none;
}

/* ---------- Baukasten-Formulare (Easy Form Builder u. ä.) ----------
   Diese Plugins bringen eigene Rahmen, Farben und Schriftgrößen mit (Bootstrap).
   Innerhalb der Formular-Karte wird das auf das Theme zurückgesetzt. */

/* Innere Boxen ohne eigenen Rahmen, keine Karte in der Karte */
:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b) :is(div, fieldset, section):has(input, textarea, select):not(.input-group, [class*="input-group"]),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b) :is(div, fieldset, section):has(input, textarea, select):not(.input-group, [class*="input-group"]),
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b) :is(div, fieldset, section):has(input, textarea, select):not(.input-group, [class*="input-group"]) {
	border: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
	border-radius: 0 !important;
}

:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b) :is(.card, .card-body, [class*="card-public"], [id*="body_efb"]),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b) :is(.card, .card-body, [class*="card-public"], [id*="body_efb"]),
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b) :is(.card, .card-body, [class*="card-public"], [id*="body_efb"]) {
	padding: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	margin-top: 0 !important;
}

:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b) :is([class*="col-"]):has(> :is(input, textarea, select, label)),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b) :is([class*="col-"]):has(> :is(input, textarea, select, label)) {
	margin-bottom: 1.1rem !important;
}

/* Beschriftungen: Theme-Größe statt Riesenschrift */
:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b) label,
:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b) legend,
:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b) .form-label,
:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b) [class*="label"]:not(input, textarea, select),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b) label,
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b) legend,
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b) .form-label,
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b) [class*="label"]:not(input, textarea, select),
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b) label,
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b) legend,
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b) .form-label,
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b) [class*="label"]:not(input, textarea, select) {
	font-family: var(--wp--preset--font-family--body) !important;
	font-size: 1.0625rem !important;
	font-weight: 600 !important;
	color: var(--kgv-heading, var(--wp--preset--color--wald-tief)) !important;
	line-height: 1.35 !important;
	margin-bottom: 0.4rem;
}

:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b) :is(.text-danger, [class*="danger"], .required, abbr[title]),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b) :is(.text-danger, [class*="danger"], .required, abbr[title]),
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b) :is(.text-danger, [class*="danger"], .required, abbr[title]) {
	color: var(--kgv-earth-text, var(--wp--preset--color--erde)) !important;
	text-decoration: none;
	font-weight: 700;
}

/* Felder: Theme-Rahmen, -Radius und -Schrift erzwingen */
:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b) :is(input:not([type="checkbox"], [type="radio"], [type="submit"], [type="button"], [type="hidden"], [type="range"], [type="color"]), textarea, select),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b) :is(input:not([type="checkbox"], [type="radio"], [type="submit"], [type="button"], [type="hidden"], [type="range"], [type="color"]), textarea, select),
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b) :is(input:not([type="checkbox"], [type="radio"], [type="submit"], [type="button"], [type="hidden"], [type="range"], [type="color"]), textarea, select) {
	box-sizing: border-box !important;
	border: 1px solid var(--kgv-line-strong, #A9B5A2) !important;
	border-radius: 8px !important;
	background-color: var(--kgv-white, var(--wp--preset--color--weiss)) !important;
	color: var(--kgv-text, var(--wp--preset--color--dunkel)) !important;
	font-family: var(--wp--preset--font-family--body) !important;
	font-size: 1.0625rem !important;
	box-shadow: inset 0 1px 2px rgba(22, 54, 31, 0.06) !important;
}

:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b) :is(input:not([type="submit"], [type="button"], [type="reset"]), textarea, select):focus,
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b) :is(input:not([type="submit"], [type="button"], [type="reset"]), textarea, select):focus,
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b) :is(input:not([type="submit"], [type="button"], [type="reset"]), textarea, select):focus {
	border-color: var(--kgv-forest, var(--wp--preset--color--wald)) !important;
	box-shadow: 0 0 0 3px var(--kgv-moss, var(--wp--preset--color--moos)) !important;
}

:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b) :is(input, textarea)::placeholder,
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b) :is(input, textarea)::placeholder,
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b) :is(input, textarea)::placeholder {
	color: var(--kgv-gray, var(--wp--preset--color--grau)) !important;
	opacity: 0.85 !important;
}

/* Text neben Checkboxen normal, nicht fett */
:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b) :is(input:is([type="checkbox"], [type="radio"]) + label, label:has(> input:is([type="checkbox"], [type="radio"])), input:is([type="checkbox"], [type="radio"]) ~ label),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b) :is(input:is([type="checkbox"], [type="radio"]) + label, label:has(> input:is([type="checkbox"], [type="radio"])), input:is([type="checkbox"], [type="radio"]) ~ label) {
	font-weight: 400 !important;
	color: var(--kgv-text, var(--wp--preset--color--dunkel)) !important;
	margin-bottom: 0;
}

/* Datei-Upload */
.wp-site-blocks:not(#kgv-a):not(#kgv-b) input[type="file"] {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	padding: 0.35rem !important;
	min-height: 3rem;
	border: 1px dashed var(--kgv-line-strong, #A9B5A2) !important;
	border-radius: 8px !important;
	background: var(--kgv-white, var(--wp--preset--color--weiss)) !important;
	color: var(--kgv-gray, var(--wp--preset--color--grau)) !important;
	font: inherit;
	font-size: var(--wp--preset--font-size--small) !important;
	cursor: pointer;
}

.wp-site-blocks:not(#kgv-a):not(#kgv-b) input[type="file"]::file-selector-button {
	margin-right: 0.85rem;
	padding: 0.55rem 1rem;
	border: 0;
	border-radius: 8px;
	background: var(--kgv-moss, var(--wp--preset--color--moos));
	color: var(--kgv-heading, var(--wp--preset--color--wald));
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.wp-site-blocks:not(#kgv-a):not(#kgv-b) input[type="file"]:hover::file-selector-button {
	background: var(--kgv-line, var(--wp--preset--color--linie));
}

/* Bootstrap-Gruppen um das Datei-Feld: Rahmen nur am Feld selbst */
:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b) :is(.input-group, [class*="input-group"]) :is(.input-group-text, label),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b) :is(.input-group, [class*="input-group"]) :is(.input-group-text, label),
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b) :is(.input-group, [class*="input-group"]) :is(.input-group-text, label) {
	border: 0 !important;
	background: transparent !important;
}

/* Knöpfe der Baukästen (Absenden, Weiter, Zurück) im Theme-Stil */
:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b) :is(button, a, input[type="button"], input[type="submit"]):is(.btn, [class*="btn-"], [id*="btn"]):not(.btn-close, [class*="close"]),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b) :is(button, a, input[type="button"], input[type="submit"]):is(.btn, [class*="btn-"], [id*="btn"]):not(.btn-close, [class*="close"]),
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b) :is(button, a, input[type="button"], input[type="submit"]):is(.btn, [class*="btn-"], [id*="btn"]):not(.btn-close, [class*="close"]) {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	justify-self: start;
	width: auto !important;
	min-height: 3rem;
	margin-top: 0.75rem;
	padding: 0.8rem 1.6rem !important;
	border: 0 !important;
	border-radius: 8px !important;
	background: var(--kgv-forest, var(--wp--preset--color--wald)) !important;
	background-image: none !important;
	color: var(--kgv-on-dark, var(--wp--preset--color--weiss)) !important;
	font-family: var(--wp--preset--font-family--body) !important;
	font-size: 1.0625rem !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	text-decoration: none !important;
	box-shadow: 0 2px 0 var(--kgv-forest-deep, var(--wp--preset--color--wald-tief)) !important;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b) :is(button, a, input[type="button"], input[type="submit"]):is(.btn, [class*="btn-"], [id*="btn"]):not(.btn-close, [class*="close"]):hover,
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b) :is(button, a, input[type="button"], input[type="submit"]):is(.btn, [class*="btn-"], [id*="btn"]):not(.btn-close, [class*="close"]):hover,
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b) :is(button, a, input[type="button"], input[type="submit"]):is(.btn, [class*="btn-"], [id*="btn"]):not(.btn-close, [class*="close"]):hover {
	background: var(--kgv-forest-deep, var(--wp--preset--color--wald-tief)) !important;
	transform: translateY(-1px);
}

/* „Zurück“-Knöpfe hell */
:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b) :is(button, a):is([id*="prev"], [class*="prev"], [class*="back"], .btn-outline-primary, .btn-secondary, .btn-light),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b) :is(button, a):is([id*="prev"], [class*="prev"], [class*="back"], .btn-outline-primary, .btn-secondary, .btn-light),
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b) :is(button, a):is([id*="prev"], [class*="prev"], [class*="back"], .btn-outline-primary, .btn-secondary, .btn-light) {
	background: var(--kgv-white, var(--wp--preset--color--weiss)) !important;
	color: var(--kgv-heading, var(--wp--preset--color--wald)) !important;
	box-shadow: inset 0 0 0 2px var(--kgv-forest, var(--wp--preset--color--wald)) !important;
}

/* Bootstrap-Blau in Fortschrittsbalken und Schritt-Anzeigen auf Waldgrün */
:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b) :is(.bg-primary, .progress-bar, [class*="bg-primary"]),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b) :is(.bg-primary, .progress-bar, [class*="bg-primary"]),
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b) :is(.bg-primary, .progress-bar, [class*="bg-primary"]) {
	background-color: var(--kgv-forest, var(--wp--preset--color--wald)) !important;
}

:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b) :is(.text-primary, [class*="text-primary"]),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b) :is(.text-primary, [class*="text-primary"]),
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b) :is(.text-primary, [class*="text-primary"]) {
	color: var(--kgv-heading, var(--wp--preset--color--wald)) !important;
}

/* Beschriftungen samt innerer Elemente (EFB packt den Text in eigene <span>s mit eigener Größe) */
:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(label, .form-label, [class*="labelEfb"], [id$="_labG"]):not(:has(input:is([type="checkbox"], [type="radio"])), input:is([type="checkbox"], [type="radio"]) ~ label, .form-check-label),
:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(label, .form-label, [class*="labelEfb"], [id$="_labG"]):not(:has(input:is([type="checkbox"], [type="radio"])), input:is([type="checkbox"], [type="radio"]) ~ label, .form-check-label) :not([class*="danger"], .text-danger, .required),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(label, .form-label, [class*="labelEfb"], [id$="_labG"]):not(:has(input:is([type="checkbox"], [type="radio"])), input:is([type="checkbox"], [type="radio"]) ~ label, .form-check-label),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(label, .form-label, [class*="labelEfb"], [id$="_labG"]):not(:has(input:is([type="checkbox"], [type="radio"])), input:is([type="checkbox"], [type="radio"]) ~ label, .form-check-label) :not([class*="danger"], .text-danger, .required),
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(label, .form-label, [class*="labelEfb"], [id$="_labG"]):not(:has(input:is([type="checkbox"], [type="radio"])), input:is([type="checkbox"], [type="radio"]) ~ label, .form-check-label),
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(label, .form-label, [class*="labelEfb"], [id$="_labG"]):not(:has(input:is([type="checkbox"], [type="radio"])), input:is([type="checkbox"], [type="radio"]) ~ label, .form-check-label) :not([class*="danger"], .text-danger, .required) {
	font-family: var(--wp--preset--font-family--body) !important;
	font-size: 1.0625rem !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
	color: var(--kgv-heading, var(--wp--preset--color--wald-tief)) !important;
	letter-spacing: 0 !important;
}

:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(label, .form-label):not(:has(input:is([type="checkbox"], [type="radio"])), input:is([type="checkbox"], [type="radio"]) ~ label, .form-check-label),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(label, .form-label):not(:has(input:is([type="checkbox"], [type="radio"])), input:is([type="checkbox"], [type="radio"]) ~ label, .form-check-label),
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(label, .form-label):not(:has(input:is([type="checkbox"], [type="radio"])), input:is([type="checkbox"], [type="radio"]) ~ label, .form-check-label) {
	display: block !important;
	padding: 0 !important;
	margin: 0 0 0.4rem !important;
}

:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(label, .form-label) :is([class*="danger"], .text-danger, .required),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(label, .form-label) :is([class*="danger"], .text-danger, .required),
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(label, .form-label) :is([class*="danger"], .text-danger, .required) {
	font-size: 1.0625rem !important;
	font-weight: 700 !important;
	color: var(--kgv-earth-text, var(--wp--preset--color--erde)) !important;
	margin: 0 0 0 0.15rem !important;
	vertical-align: baseline !important;
}

/* Checkbox-Text: normal, direkt neben dem Kästchen */
:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(input:is([type="checkbox"], [type="radio"]) ~ label, label:has(> input:is([type="checkbox"], [type="radio"])), .form-check-label),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(input:is([type="checkbox"], [type="radio"]) ~ label, label:has(> input:is([type="checkbox"], [type="radio"])), .form-check-label) {
	padding: 0 !important;
	margin: 0 !important;
	font-size: 1.0625rem !important;
	font-weight: 400 !important;
	line-height: 1.5 !important;
	color: var(--kgv-text, var(--wp--preset--color--dunkel)) !important;
}

/* Einheitliche Abstände wie bei einfachen Formularen:
   6 px Beschriftung → Feld, 20 px Feld → nächste Beschriftung.
   Baukästen verschachteln Felder in mehrere Container mit eigenen Abständen,
   die werden hier vertikal auf null gesetzt. */
:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(div, section, fieldset):has(input, textarea, select):not(.input-group, [class*="input-group"]),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(div, section, fieldset):has(input, textarea, select):not(.input-group, [class*="input-group"]) {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(div, section):has(> :is(label, .form-label)):has(input, textarea, select),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(div, section):has(> :is(label, .form-label)):has(input, textarea, select) {
	margin-bottom: 1.25rem !important;
}

:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(label, .form-label):not(:has(input:is([type="checkbox"], [type="radio"])), input:is([type="checkbox"], [type="radio"]) ~ label, .form-check-label),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(label, .form-label):not(:has(input:is([type="checkbox"], [type="radio"])), input:is([type="checkbox"], [type="radio"]) ~ label, .form-check-label) {
	margin: 0 0 0.4rem !important;
	padding: 0 !important;
}

/* Karte bündig in der Inhaltsspalte (EFB setzt negative Ränder an seinen äußeren Container) */
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) {
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/* Waagerechte Einrückung wie bei einfachen Formularen:
   Zwischen-Container ohne eigenen Innenabstand, Bootstrap-Zeilen gleichen
   den Spaltenabstand mit negativem Rand aus (Felder bleiben bündig, zweispaltige Felder behalten ihre Lücke). */
:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(div, form, p):not([class*="col-"], .row, .input-group, [class*="input-group"]):has(input, textarea, select, button, .btn, [id*="btn"]),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(div, form, p):not([class*="col-"], .row, .input-group, [class*="input-group"]):has(input, textarea, select, button, .btn, [id*="btn"]) {
	padding-left: 0 !important;
	padding-right: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(div, fieldset).row:has(> [class*="col-"]),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(div, fieldset).row:has(> [class*="col-"]) {
	margin-left: -0.75rem !important;
	margin-right: -0.75rem !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	width: auto !important;
}

:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(div, fieldset).row > [class*="col-"],
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(div, fieldset).row > [class*="col-"] {
	padding-left: 0.75rem !important;
	padding-right: 0.75rem !important;
}

/* Absenden links ausrichten wie im übrigen Theme */
:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(div, p):has(> :is(button, a, input[type="button"], input[type="submit"]):is(.btn, [class*="btn-"], [id*="btn"]):not(.btn-close, [class*="close"])),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(div, p):has(> :is(button, a, input[type="button"], input[type="submit"]):is(.btn, [class*="btn-"], [id*="btn"]):not(.btn-close, [class*="close"])),
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(div, p):has(> :is(button, a, input[type="button"], input[type="submit"]):is(.btn, [class*="btn-"], [id*="btn"]):not(.btn-close, [class*="close"])) {
	display: flex !important;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: flex-start !important;
	align-items: center;
	text-align: left !important;
}

:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(button, a, input[type="button"], input[type="submit"]):is(.btn, [class*="btn-"], [id*="btn"]):not(.btn-close, [class*="close"]),
:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(button, a, input[type="button"], input[type="submit"]):is(.btn, [class*="btn-"], [id*="btn"]):not(.btn-close, [class*="close"]) *,
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(button, a, input[type="button"], input[type="submit"]):is(.btn, [class*="btn-"], [id*="btn"]):not(.btn-close, [class*="close"]),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(button, a, input[type="button"], input[type="submit"]):is(.btn, [class*="btn-"], [id*="btn"]):not(.btn-close, [class*="close"]) *,
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(button, a, input[type="button"], input[type="submit"]):is(.btn, [class*="btn-"], [id*="btn"]):not(.btn-close, [class*="close"]),
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(button, a, input[type="button"], input[type="submit"]):is(.btn, [class*="btn-"], [id*="btn"]):not(.btn-close, [class*="close"]) * {
	font-family: var(--wp--preset--font-family--body) !important;
	font-size: 1.0625rem !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	color: var(--kgv-on-dark, var(--wp--preset--color--weiss)) !important;
}

:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(button, a, input[type="button"], input[type="submit"]):is(.btn, [class*="btn-"], [id*="btn"]):not(.btn-close, [class*="close"]),
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(button, a, input[type="button"], input[type="submit"]):is(.btn, [class*="btn-"], [id*="btn"]):not(.btn-close, [class*="close"]),
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b):not(#kgv-c) :is(button, a, input[type="button"], input[type="submit"]):is(.btn, [class*="btn-"], [id*="btn"]):not(.btn-close, [class*="close"]) {
	margin-left: 0 !important;
	margin-right: 0 !important;
	padding: 0.8rem 1.6rem !important;
	min-height: 3rem !important;
	height: auto !important;
	box-sizing: border-box !important;
	width: auto !important;
	flex: 0 0 auto !important;
}

/* Datei auswählen: Bootstrap-Ränder aufheben, Knopf als eigene Pille im Feld */
:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) input[type="file"],
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) input[type="file"],
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b):not(#kgv-c) input[type="file"] {
	display: block !important;
	width: 100% !important;
	height: auto !important;
	min-height: 3.25rem !important;
	padding: 0.4rem 0.75rem 0.4rem 0.4rem !important;
	line-height: 2.4rem !important;
	overflow: hidden;
	border: 1px dashed var(--kgv-line-strong, #A9B5A2) !important;
	color: var(--kgv-gray, var(--wp--preset--color--grau)) !important;
}

:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) input[type="file"]::file-selector-button,
:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) input[type="file"]::-webkit-file-upload-button,
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) input[type="file"]::file-selector-button,
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) input[type="file"]::-webkit-file-upload-button,
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b):not(#kgv-c) input[type="file"]::file-selector-button,
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b):not(#kgv-c) input[type="file"]::-webkit-file-upload-button {
	margin: 0 0.85rem 0 0 !important;
	margin-inline-end: 0.85rem !important;
	padding: 0.5rem 1rem !important;
	height: auto !important;
	line-height: 1.3 !important;
	border: 0 !important;
	border-inline-end-width: 0 !important;
	border-radius: 8px !important;
	background: var(--kgv-moss, var(--wp--preset--color--moos)) !important;
	color: var(--kgv-heading, var(--wp--preset--color--wald)) !important;
	font-family: var(--wp--preset--font-family--body) !important;
	font-size: var(--wp--preset--font-size--small) !important;
	font-weight: 700 !important;
	vertical-align: middle;
	cursor: pointer;
}

:is(.kgv-formular, .is-style-formular):not(:has(.kgv-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) input[type="file"]:hover::file-selector-button,
.wp-block-post-content > div:not([class*="wp-block-"], .elementor, [data-elementor-type], .kgv-form):has(form:not(.wp-block-search, .search-form)):not(#kgv-a):not(#kgv-b):not(#kgv-c) input[type="file"]:hover::file-selector-button,
.wp-block-post-content > form:not(.wp-block-search, .search-form, .elementor-form):not(#kgv-a):not(#kgv-b):not(#kgv-c) input[type="file"]:hover::file-selector-button {
	background: var(--kgv-line, var(--wp--preset--color--linie)) !important;
}

/* Formular-Karte (Gruppen-Block): Hinweistexte wie „mit * markierte Felder sind Pflichtfelder“ */
:is(.kgv-formular, .is-style-formular) > p {
	padding-inline: 0.75rem; /* bündig mit den Feldern der Formular-Plugins */
	font-size: var(--wp--preset--font-size--small);
	color: var(--kgv-gray, var(--wp--preset--color--grau));
	margin-block: 0 1.25rem;
}

:is(.kgv-formular, .is-style-formular) > :is(h2, h3) + p {
	margin-top: -0.5rem;
}

/* Meldungen der Plugins (Erfolg / Fehler), soweit erkennbar */
.wp-block-post-content :is(.success, .notice-success, .wpcf7-mail-sent-ok, [class*="success"]):not(input, button, form) {
	border-radius: 8px;
}

.wp-block-post-content :is(.error, .wpcf7-not-valid-tip, [class*="error"]):not(input, button, form, div) {
	color: var(--kgv-red, #A3261B);
	font-weight: 600;
}

.wp-site-blocks :is(input, textarea, select):is([aria-invalid="true"], .wpcf7-not-valid, .error) {
	border-color: var(--kgv-red-fill, #A3261B);
	box-shadow: 0 0 0 3px var(--kgv-red-light, #F6D9D4);
}

.wp-block-search__input {
	border-radius: 8px 0 0 8px !important;
}

.wp-block-search__button {
	border-radius: 0 8px 8px 0 !important;
	margin-left: 0 !important;
}

/* ---------- 404 ---------- */

.kgv-404-zahl {
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(5rem, 18vw, 9rem);
	line-height: 1;
	/* Umriss in blatt (Designsystem), Füllung moos: lesbar über den Umriss (blatt auf creme 5,9:1). */
	color: var(--kgv-on-dark-soft, var(--kgv-moss, var(--wp--preset--color--moos)));
	-webkit-text-stroke: 3px var(--kgv-leaf, var(--wp--preset--color--blatt));
}

/* ---------- Kleine Bildschirme ---------- */

@media (max-width: 781px) {
	.kgv-kopf-rechts {
		display: none !important;
	}

	.kgv-hero-bild {
		max-width: 420px;
		margin-inline: auto;
	}
}

/* ---------- Ergänzungen ---------- */

.kgv-kopf .wp-block-button__link {
	padding: 0.45rem 1rem;
	font-size: var(--wp--preset--font-size--small);
	border-width: 2px;
}

.kgv-kopf .wp-block-button__link:hover,
.kgv-fuss .is-style-outline .wp-block-button__link:hover {
	background: rgba(255, 255, 255, 0.12);
}

/* Fuß: Kontur-Button (Erde bleibt der einen wichtigsten Handlung einer Seite vorbehalten) */
.kgv-fuss .is-style-outline .wp-block-button__link {
	border-width: 2px;
}

.kgv-fakt-zahl {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.6rem;
	font-weight: 700;
	line-height: 1.1;
	min-width: 8rem;
	white-space: nowrap;
	margin: 0;
}

.is-style-karte > .kgv-fakt-zahl + p {
	margin: 0;
}

.wp-block-query-pagination {
	gap: 0.5rem 1rem;
	font-weight: 700;
}

.wp-block-query-pagination-numbers .page-numbers {
	display: inline-block;
	min-width: 2.4rem;
	padding: 0.3rem 0.6rem;
	text-align: center;
	border-radius: 8px;
	text-decoration: none;
}

.wp-block-query-pagination-numbers .page-numbers.current {
	background: var(--kgv-forest, var(--wp--preset--color--wald));
	color: var(--kgv-on-dark, var(--wp--preset--color--weiss));
}

.wp-block-query-pagination a {
	text-decoration: none;
}

h1, h2, h3, h4 {
	overflow-wrap: break-word;
	hyphens: auto;
}

/* Beiträge ohne Beitragsbild bekommen einen grünen Streifen */
.kgv-beitragskarte:not(:has(.wp-block-post-featured-image)) {
	border-top: 6px solid var(--kgv-leaf, var(--wp--preset--color--blatt));
}

.kgv-beitrag-meta .wp-block-post-author-name::before {
	content: "von ";
}

/* Menüpunkte ohne eigene Seite (z. B. „Allgemeine Infos“) nicht als aktiv markieren */
.kgv-menueleiste .wp-block-navigation-item__content[href="#"],
.kgv-menueleiste .wp-block-navigation-item__content[href$="/#"] {
	border-bottom-color: transparent !important;
}

/* ---------- Termine (Plugin „KGV Verein“) ---------- */

.kgv-termine .kgv-t-naechste {
	margin-bottom: 1.25rem;
}

.single-kgv_termin .wp-block-post-title {
	margin-bottom: var(--wp--preset--spacing--40) !important;
}

/* Beiträge: Absätze enger untereinander (statt des allgemeinen Blockabstands von 1.25rem). */
body.single-post .wp-block-post-content > .wp-block-paragraph:not(:first-child) {
	margin-block-start: 0.5rem;
}

/* ---------- Dark Mode: Knopf „Dunkel“ (assets/js/dunkel.js) ---------- */
.kgv-dunkel-knopf {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin: 0;
	padding: 0.3rem 0.85rem;
	border: 2px solid currentColor;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font-family: inherit;
	font-size: var(--wp--preset--font-size--small, 17px);
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
}
.kgv-dunkel-knopf[aria-pressed="true"] {
	background: var(--kgv-sun-strong, #F2C94C);
	border-color: var(--kgv-sun-strong, #F2C94C);
	color: #1A1405;
}
.kgv-dunkel-knopf:focus-visible {
	outline: 3px solid var(--kgv-earth, #A4561E);
	outline-offset: 3px;
}
.kgv-dunkel-knopf--handy {
	display: none;
}
.kgv-dunkel-knopf--frei {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 50;
	background: var(--kgv-white, #FFFFFF);
	color: var(--kgv-heading, #1F4A2C);
}
#wp-admin-bar-kgv-dunkel > .ab-item[aria-pressed="true"] {
	background: var(--kgv-sun-strong, #F2C94C) !important;
	color: #1A1405 !important;
}

@media (max-width: 781px) {
	.kgv-menueleiste {
		position: relative;
	}
	.kgv-dunkel-knopf--handy {
		display: inline-flex;
		position: absolute;
		right: 1rem;
		top: 50%;
		transform: translateY(-50%);
	}
}
.kgv-kopf-rechts > .kgv-dunkel-knopf {
	margin-left: auto;
}

/* 2.17.4: Instagram-Icon im Kopf (neben „Mein Konto“) und in der Fußzeile – in der Schriftfarbe, ohne Markenfarben. */
.wp-block-social-links.kgv-social {
	margin: 0;
	padding: 0;
	gap: 0.5rem;
	align-items: center;
}
.wp-block-social-links.kgv-social.is-style-logos-only .wp-social-link,
.wp-block-social-links.kgv-social.is-style-logos-only .wp-social-link a {
	color: currentColor;
	background: none;
	padding: 0;
}
.wp-block-social-links.kgv-social .wp-social-link svg {
	width: 1.5rem;
	height: 1.5rem;
}
.wp-block-social-links.kgv-social .wp-social-link a:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
	border-radius: 4px;
}
