/* Projektkarte (.lag-karte) – Layout, Marker, Popup und Cluster-Farben.
   Die Farben --lag-color-* werden je Beitrag per Inline-Style aus den Site-Farben gesetzt. */

.lag-karte {
	--lag-color-primary: #083F73;
	--lag-color-secondary: #A7CBE6;
	--lag-color-link: #6897CB;
	--lag-color-lime: #C3E251;
	font-family: "Source Sans 3", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	margin: 1.5em 0;
}

.lag-karte__filter {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.75em 1.25em;
	margin-bottom: 1em;
}

.lag-karte__feld {
	display: flex;
	flex-direction: column;
	gap: 0.25em;
	font-size: 0.85em;
}

.lag-karte__feld span {
	font-weight: 600;
	color: #333;
}

.lag-karte__feld select {
	padding: 0.4em 0.6em;
	border: 1px solid #c9c9c9;
	border-radius: 6px;
	background: #fff;
	min-width: 10em;
}

.lag-karte .lag-karte__reset,
.lag-karte button.lag-karte__reset {
	border: 1px solid var(--lag-color-link);
	color: var(--lag-color-link);
	background: transparent;
	border-radius: 100px;
	padding: 6px 16px !important;
	min-height: 0;
	height: auto;
	line-height: 1.3;
	cursor: pointer;
	font-family: inherit;
	font-size: 14px !important;
	font-weight: 600;
	text-transform: none;
	box-shadow: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.lag-karte .lag-karte__reset:hover,
.lag-karte .lag-karte__reset:focus-visible {
	background: var(--lag-color-lime);
	border-color: var(--lag-color-lime);
	color: #16341c;
}

.lag-karte__zaehler {
	margin-left: auto;
	font-size: 0.9em;
	font-weight: 600;
	color: #444;
	align-self: center;
}

.lag-karte__map {
	width: 100%;
	min-height: 380px;
	border-radius: 10px;
	overflow: hidden;
	z-index: 0;
}

@media (max-width: 600px) {
	.lag-karte__map {
		height: 60vh !important;
		min-height: 380px;
	}
	.lag-karte__zaehler {
		margin-left: 0;
	}
}

.lag-karte__hinweis {
	text-align: center;
	padding: 2em 1em;
	color: #666;
}

.lag-karte__legende {
	display: flex;
	flex-wrap: wrap;
	gap: 1em 1.5em;
	margin-top: 0.85em;
	font-size: 0.85em;
	color: #444;
}

.lag-karte__legende-eintrag {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
}

.lag-karte__punkt {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 2px solid transparent;
	flex: 0 0 auto;
}

.lag-karte__punkt--gestrichelt,
i.lag-karte__punkt--gestrichelt {
	background: #fff !important;
	border-style: dashed;
	border-width: 2px;
}

.lag-karte__ohne-standort {
	margin-top: 1.5em;
}

.lag-karte__ohne-standort h3 {
	font-size: 1.05em;
	margin: 0 0 0.5em;
}

.lag-karte__ohne-standort ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.4em;
}

.lag-karte__ohne-standort-eintrag a {
	color: var(--lag-color-link);
	text-decoration: none;
	font-weight: 600;
}

.lag-karte__ohne-standort-eintrag a:hover,
.lag-karte__ohne-standort-eintrag a:focus-visible {
	text-decoration: underline;
}

.lag-karte__ohne-standort-meta {
	color: #666;
	font-size: 0.9em;
}

/* Fokus-Styles */
.lag-karte select:focus-visible,
.lag-karte button:focus-visible,
.lag-karte a:focus-visible {
	outline: 2px solid var(--lag-color-link);
	outline-offset: 2px;
}

/* Marker (divIcon) */
.lag-marker {
	background: transparent;
	border: none;
}

.lag-marker__punkt {
	display: block;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.lag-marker__punkt--gestrichelt {
	/* Ungefährer Standort: weiße Füllung, farbiger gestrichelter Ring (wie in der Legende). !important, weil die Farbe inline als background gesetzt wird. */
	background: #fff !important;
	border-style: dashed;
	border-width: 3px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* Cluster-Farben aus der Sekundärfarbe der Site */
.lag-karte .marker-cluster-small,
.lag-karte .marker-cluster-medium,
.lag-karte .marker-cluster-large {
	background-color: color-mix(in srgb, var(--lag-color-secondary) 55%, transparent);
}

.lag-karte .marker-cluster-small div,
.lag-karte .marker-cluster-medium div,
.lag-karte .marker-cluster-large div {
	background-color: var(--lag-color-secondary);
	color: #1a1a1a;
	font-weight: 700;
}

/* Popup */
.lag-karte .leaflet-popup-content-wrapper {
	border-radius: 10px;
	padding: 0;
	overflow: hidden;
}

.lag-karte .leaflet-popup-content {
	margin: 0;
	width: 240px !important;
}

.lag-popup__bild img {
	display: block;
	width: 100%;
	height: 120px;
	object-fit: cover;
}

.lag-popup__inhalt {
	padding: 0.75em 0.9em 0.9em;
}

.lag-popup__titel {
	/* Lange Projekttitel auf drei Zeilen begrenzen, damit Vorschaubild, Meta-Zeile und
	   Button im Popup sichtbar bleiben (Rueckmeldung der LAG 09/2026). */
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-weight: 700;
	font-size: 1.02em;
	line-height: 1.3;
	color: var(--lag-color-primary);
	text-decoration: none;
	margin-bottom: 0.35em;
}

.lag-popup__titel:hover,
.lag-popup__titel:focus-visible {
	text-decoration: underline;
}

.lag-popup__meta {
	margin: 0 0 0.4em;
	font-size: 0.82em;
	color: #555;
}

.lag-popup__stand {
	margin: 0 0 0.6em;
	font-size: 0.82em;
	color: #333;
	font-weight: 600;
}

.leaflet-popup-content a.lag-popup__button,
.lag-popup__button {
	display: inline-block;
	border-radius: 100px;
	background: var(--lag-color-link);
	color: #fff !important;
	text-decoration: none !important;
	padding: 8px 18px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	transition: background 0.15s ease, color 0.15s ease;
}

.leaflet-popup-content a.lag-popup__button:hover,
.leaflet-popup-content a.lag-popup__button:focus-visible,
.lag-popup__button:hover,
.lag-popup__button:focus-visible {
	background: var(--lag-color-lime);
	color: #16341c !important;
}

/* Quellenangabe dezent (OpenStreetMap-Attribution ist lizenzrechtlich Pflicht) */
.lag-karte .leaflet-control-attribution {
	font-size: 10px;
	line-height: 1.4;
	background: rgba(255, 255, 255, 0.75);
	color: #555;
	padding: 1px 6px;
}
.lag-karte .leaflet-control-attribution a {
	color: #555;
	text-decoration: underline;
	font-weight: normal;
}

/* Einleitung ueber der Liste der Projekte ohne eigenen Kartenpunkt */
.lag-karte__ohne-standort-text {
	margin: 0 0 0.6em;
	font-size: 0.9em;
	color: #555;
	max-width: 62ch;
}

/* Flächen: Symbol für Projekte einer ganzen Kommune bzw. der gesamten Region.
   Abgerundetes Quadrat mit Anzahl, damit es sich klar von den runden Projektpunkten
   und den Clusterkreisen abhebt (Rückmeldung der LAG 10/2026: gestrichelte Kreise
   gingen auf der Karte unter). */
.lag-karte .lag-flaeche-marker {
	background: none;
	border: 0;
}

.lag-karte .lag-flaeche {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	box-sizing: border-box;
	border-radius: 8px;
	border: 3px solid var(--lag-flaeche-farbe, var(--lag-color-primary));
	background: #fff;
	color: var(--lag-flaeche-farbe, var(--lag-color-primary));
	font-weight: 800;
	font-size: 14px;
	line-height: 1;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
	cursor: pointer;
	transition: transform 0.12s ease;
}

.lag-karte .lag-flaeche:hover {
	transform: scale(1.1);
}

/* Symbol der gesamten Region: Raute in der Akzentfarbe (Limette) mit dunkler Zahl. Form und
   Farbe unterscheiden sich damit von den quadratischen Kommunen-Symbolen in der Projektfarbe,
   den runden Punkten und den Clustern. Mittig in der Region (Rückmeldung der LAG 10/2026). */
.lag-karte .lag-region {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	margin: 7px;
	box-sizing: border-box;
	border-radius: 6px;
	border: 3px solid var(--lag-color-primary);
	background: var(--lag-color-lime);
	box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(0, 0, 0, 0.35);
	transform: rotate(45deg);
	cursor: pointer;
	transition: transform 0.12s ease;
}

.lag-karte .lag-region__zahl {
	display: block;
	transform: rotate(-45deg);
	color: var(--lag-color-primary);
	font-weight: 800;
	font-size: 14px;
	line-height: 1;
}

.lag-karte .lag-region:hover {
	transform: rotate(45deg) scale(1.1);
}

/* Legende: Flächensymbol klein */
.lag-karte__flaeche {
	display: inline-block;
	width: 16px;
	height: 16px;
	box-sizing: border-box;
	border-radius: 4px;
	border: 2px solid var(--lag-color-primary);
	background: #fff;
}

.lag-karte__flaeche--region {
	width: 13px;
	height: 13px;
	margin: 2px;
	border-radius: 3px;
	border: 2px solid var(--lag-color-primary);
	background: var(--lag-color-lime);
	transform: rotate(45deg);
}

.lag-karte__legende-hinweis {
	flex-basis: 100%;
	font-size: 0.92em;
	color: #666;
}

/* Beim Auffächern einer Fläche treten die übrigen Punkte und Cluster zurück */
.lag-karte--fokus .leaflet-marker-pane .leaflet-marker-icon:not(.lag-spinne):not(.lag-flaeche-marker) {
	/* !important, weil Markercluster die Deckkraft als Inline-Stil setzt */
	opacity: 0.22 !important;
	transition: opacity 0.15s ease;
}

/* Gedämpftes Kartenmaterial: dieselben OpenStreetMap-Kacheln, Farben zurückgenommen.
   Symbole wie die Dreiecke für Erhebungen im Wiehengebirge, Wälder und Straßen treten in
   den Hintergrund, Projektpunkte und Flächen bleiben kräftig, weil der Filter nur auf die
   Kachelebene wirkt. Entscheidung 10/2026 statt Wechsel zu Stadia Maps (kein Konto, keine
   Abrufgrenze, kein weiterer Dienst). Abschaltbar per Shortcode-Attribut gedaempft="0". */
.lag-karte--gedaempft .leaflet-tile-pane {
	filter: grayscale(0.65) brightness(1.06) contrast(0.9);
}
