/* KGV Parzellen – Website (Liste, Dokumentation) und Backend. Farben vom Vereins-Theme. */

:where(.kgv-plots-frei, .kgv-plots-documentation, .kgv-plots-konto, .kgv-plots-admin) {
	--p-wald: var(--wp--preset--color--wald, #1F4A2C);
	--p-moos: var(--wp--preset--color--moos, #E8EFDD);
	--p-linie: var(--wp--preset--color--linie, #D9DFCF);
	--p-grau: var(--wp--preset--color--grau, #46534A);
	--p-erde: var(--wp--preset--color--erde, #A4561E);
	--p-sonne: var(--wp--preset--color--sonne, #F6E7C1);
	--p-weiss: #fff;
}

/* ---------- Freie Parzellen ---------- */
.kgv-plots-cards {
	list-style: none;
	margin: 1.5rem 0;
	padding: 0;
	display: grid;
	gap: 1.5rem;
}
.kgv-plots-card {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	gap: 1.25rem;
	background: var(--kgv-white, var(--p-weiss));
	border: 1px solid var(--kgv-line, var(--p-linie));
	border-top: 6px solid var(--kgv-forest, var(--p-wald));
	border-radius: 12px;
	padding: 1.25rem;
	box-shadow: 0 12px 32px rgba(22, 54, 31, 0.07);
}
.kgv-plots-card:not(:has(.kgv-plots-card__photos)) { grid-template-columns: 1fr; }
.kgv-plots-card .kgv-plots-card__title { margin: 0 0 0.5rem; font-size: var(--wp--preset--font-size--large, 1.5rem); }
.kgv-plots-card__photos {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
	align-content: start;
}
.kgv-plots-card__photos a:first-child { grid-column: 1 / -1; }
.kgv-plots-card__photos img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 8px;
}
.kgv-plots-card__photos a:focus-visible { outline: 3px solid var(--kgv-earth, var(--p-erde)); outline-offset: 2px; border-radius: 8px; }
.kgv-plots-key-data { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0 0 0.75rem; }
.kgv-plots-key-data div { margin: 0; }
.kgv-plots-key-data dt { font-size: var(--wp--preset--font-size--small, 1.0625rem); color: var(--kgv-gray, var(--p-grau)); margin: 0; }
.kgv-plots-key-data dd { margin: 0; font-weight: 700; font-size: 1.125rem; }
.kgv-plots-chips { list-style: none; margin: 0 0 0.75rem; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.kgv-plots-chips li { background: var(--kgv-moss, var(--p-moos)); color: var(--kgv-heading, var(--p-wald)); border-radius: 999px; padding: 0.2rem 0.75rem; font-size: var(--wp--preset--font-size--small, 1.0625rem); }
.kgv-plots-empty { background: var(--kgv-moss, var(--p-moos)); border-radius: 12px; padding: 1.25rem 1.4rem; }
.kgv-plots-intro { max-width: 46rem; font-size: 1.125rem; margin: 0 0 1.5rem; }
.kgv-plots-intro > :first-child { margin-top: 0; }
.kgv-plots-card__button { margin: 1rem 0 0; }
.kgv-plots-general { margin: 2rem 0 1rem; padding: 1.25rem 1.4rem; background: var(--kgv-moss, var(--p-moos)); border-radius: 12px; border-left: 6px solid var(--kgv-forest, var(--p-wald)); }
.kgv-plots-general h2 { margin: 0 0 0.5rem; font-size: var(--wp--preset--font-size--large, 1.5rem); }
.kgv-plots-general p:last-child { margin-bottom: 0; }
@media (max-width: 700px) {
	.kgv-plots-card { grid-template-columns: 1fr; padding: 1rem; }
}

/* ---------- Dokumentation (Handy zuerst) ---------- */
.kgv-plots-documentation { max-width: 46rem; }
.kgv-plots-documentation__daten { color: var(--kgv-gray, var(--p-grau)); }
.kgv-plots-documentation__notiz { background: var(--kgv-sun, var(--p-sonne)); border-radius: 8px; padding: 0.75rem 1rem; }
.kgv-plots-tasks { list-style: none; padding: 0; display: grid; gap: 0.5rem; }
.kgv-plots-small { color: var(--kgv-gray, var(--p-grau)); font-size: 0.9375rem; }
.kgv-plots-item {
	border: 1px solid var(--kgv-line, var(--p-linie));
	border-radius: 12px;
	padding: 0.9rem 1rem;
	margin: 0 0 0.75rem;
	background: var(--kgv-white, var(--p-weiss));
	min-width: 0;
}
.kgv-plots-item[hidden] { display: none; }
.kgv-plots-item.ist-fehlt { border-color: var(--kgv-red-fill, #A3261B); box-shadow: inset 4px 0 0 var(--kgv-red-fill, #A3261B); }
.kgv-plots-question { display: block; font-weight: 700; margin: 0 0 0.5rem; padding: 0; font-size: 1.0625rem; }
fieldset.kgv-plots-item > legend.kgv-plots-question { float: left; width: 100%; }
fieldset.kgv-plots-item > legend.kgv-plots-question + * { clear: both; }
.kgv-plots-choice { display: flex; flex-wrap: wrap; gap: 0.5rem; clear: both; }
.kgv-plots-choice label { position: relative; }
.kgv-plots-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.kgv-plots-choice span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 3.5rem;
	min-height: 2.75rem;
	padding: 0.55rem 1rem;
	border: 2px solid var(--kgv-line, var(--p-linie));
	border-radius: 999px;
	text-align: center;
	cursor: pointer;
	background: var(--kgv-white, var(--p-weiss));
	line-height: 1.4;
}
.kgv-plots-choice input:checked + span { background: var(--kgv-forest, var(--p-wald)); border-color: var(--kgv-forest, var(--p-wald)); color: var(--kgv-on-dark, #fff); font-weight: 700; }
.kgv-plots-choice input:checked + span::before { content: "✓ "; }
.kgv-plots-choice input:focus-visible + span { outline: 3px solid var(--kgv-earth, var(--p-erde)); outline-offset: 2px; }
.kgv-plots-choice--janein span { min-width: 5.5rem; }
.kgv-plots-documentation input[type="text"], .kgv-plots-documentation select, .kgv-plots-documentation textarea { width: 100%; max-width: 100%; min-height: 2.75rem; font-size: 1.0625rem; box-sizing: border-box; }
.kgv-plots-number { display: flex; align-items: center; gap: 0.5rem; }
.kgv-plots-number input[type="text"] { width: 8rem; }
.kgv-plots-documentation .kgv-note { display: block; color: var(--kgv-gray, var(--p-grau)); font-size: 0.9375rem; margin: 0 0 0.5rem; clear: both; }
.kgv-plots-documentation .kgv-field-error { display: block; color: var(--kgv-red, #A3261B); font-weight: 700; margin-top: 0.35rem; }
.kgv-plots-documentation .kgv-required { color: var(--kgv-red, #A3261B); font-weight: 700; }
.kgv-plots-photo-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
.kgv-plots-photo-list li { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9375rem; }
.kgv-plots-photo-list img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; display: block; }
.kgv-plots-upload { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.kgv-plots-buttons { display: flex; gap: 0.5rem; margin: 1.25rem 0 0; position: sticky; bottom: 0; padding: 0.6rem 0; background: var(--kgv-white, var(--p-weiss)); border-top: 1px solid var(--kgv-line, var(--p-linie)); z-index: 2; }
:is(#kgv-plots-documentation, .kgv-plots-documentation) .kgv-plots-buttons button { flex: 1 1 0; min-height: 3rem; margin: 0; padding: 0.5rem 0.75rem !important; font-size: var(--wp--preset--font-size--small, 1.0625rem) !important; line-height: 1.2; font-weight: 700 !important; border-radius: 8px !important; border: 2px solid var(--kgv-forest, var(--p-wald)) !important; background: var(--kgv-forest, var(--p-wald)) !important; color: var(--kgv-on-dark, #fff) !important; box-shadow: none; cursor: pointer; }
:is(#kgv-plots-documentation, .kgv-plots-documentation) .kgv-plots-buttons button:hover { background: var(--kgv-forest-deep, #16361F) !important; }
:is(#kgv-plots-documentation, .kgv-plots-documentation) .kgv-plots-buttons button.kgv-plots-second { background: var(--kgv-white, var(--p-weiss)) !important; color: var(--kgv-heading, var(--p-wald)) !important; }
:is(#kgv-plots-documentation, .kgv-plots-documentation) .kgv-plots-buttons button.kgv-plots-second:hover { background: var(--kgv-moss, var(--p-moos)) !important; }
:is(#kgv-plots-documentation, .kgv-plots-documentation) .kgv-plots-buttons button:disabled { background: var(--kgv-gray, var(--p-grau)) !important; border-color: var(--kgv-gray, var(--p-grau)) !important; color: var(--kgv-on-dark, #fff) !important; }
.kgv-plots-buttons button:focus-visible { outline: 3px solid var(--kgv-earth, var(--p-erde)); outline-offset: 2px; }
.kgv-plots-buttons button[disabled] { opacity: 0.7; cursor: progress; }
.kgv-plots-documentation .kgv-message--error { background: var(--kgv-red-light, #F6D9D4); color: var(--kgv-red, #A3261B); border-left: 6px solid var(--kgv-red-fill, #A3261B); border-radius: 8px; padding: 0.75rem 1rem; }
.kgv-plots-documentation .kgv-success { background: var(--kgv-moss, var(--p-moos)); border-left: 6px solid var(--kgv-forest, var(--p-wald)); border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 1rem; }

/* ---------- Backend ---------- */
/* Kästen, Marken, Raster, Verlauf und Tabellen kommen aus den Bausteinen des Themes (admin-bausteine.css). */
.kgv-plots-flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kgv-plots-narrow th { width: 9em; padding-right: 8px; }
.kgv-plots-cl td { vertical-align: top; }
.kgv-plots-cl__arrows button { display: block; font-size: 15px; line-height: 1.2; }
.kgv-plots-nowrap { white-space: nowrap; }
.kgv-plots-small-field { margin-top: 4px; font-size: 14px; }
.kgv-plots-status-form { border-top: 1px solid var(--kgv-line-light, #D9DFCF); margin-top: 8px; }
.kgv-plots-admin details > summary { cursor: pointer; font-weight: 600; margin: 10px 0; }
/* Checkliste im Backend (beim Anlegen, „Checkliste hier bearbeiten“): zweispaltig auf breiten Bildschirmen. */
.kgv-plots-admin .kgv-plots-advance { max-width: var(--kgv-width-medium, 1100px); display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 0 12px; align-items: start; }
.kgv-plots-admin .kgv-plots-advance .kgv-plots-item { margin-bottom: 12px; }
.kgv-plots-admin .kgv-plots-advance textarea { min-height: 5rem; }
.kgv-plots-documentation__advance { border-left: 6px solid var(--kgv-earth, var(--p-erde)); }

/* Website (nicht im Backend): Nebentext nie kleiner als 17px, Einleitung in Fließtextgröße (Designsystem). */
body:not(.wp-admin) :is(.kgv-plots-small, .kgv-plots-photo-list li, .kgv-plots-documentation .kgv-note) { font-size: var(--wp--preset--font-size--small, 1.0625rem); }
body:not(.wp-admin) .kgv-plots-intro { font-size: var(--wp--preset--font-size--medium, 1.25rem); }
