/*
 * Lebenshilfe Standorte – Frontend.
 * Schrift und Farben erbt das Theme; Gestaltung nur über currentColor und Rahmen.
 * Einzige feste Farben: Akzent #c8102e und Marker-Text #fff (Kontrastmodi von OneTap müssen greifen).
 * Ausnahme: Die Kartenkacheln werden per SVG-Filter im Lebenshilfe-Blau eingefärbt (kartenstil="blau").
 */

.lh-standorte {
	--lh-standorte-akzent: #c8102e;
	--lh-standorte-hoehe: 640px;
	--lh-standorte-oben: 16px; /* Abstand der mitlaufenden Karte, z. B. bei Sticky-Header erhöhen */
	margin: 0 0 2em;
}

.lh-standorte a:hover,
.lh-standorte a:focus-visible {
	color: var(--lh-standorte-akzent);
}

.lh-standorte__kopf {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px 24px;
	margin-bottom: 20px;
}

.lh-standorte__kopf h2 {
	margin: 0;
}

.lh-standorte__kopf p {
	margin: 0;
	opacity: .75;
}

.lh-standorte__raster {
	display: grid;
	grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
	gap: 20px;
	align-items: start;
}

/* Liste */
.lh-standorte__liste {
	display: flex;
	flex-direction: column;
	gap: 22px;
	max-height: var(--lh-standorte-hoehe);
	overflow: auto;
	padding: 2px 4px 2px 2px;
}

.lh-standorte__gruppe h3 {
	font-size: .8rem;
	text-transform: uppercase;
	letter-spacing: .12em;
	margin: 0 0 8px;
	opacity: .75;
	font-weight: 600;
	line-height: 1.4;
}

.lh-standorte__gruppe ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.lh-standorte__gruppe li {
	margin: 0;
	padding: 0;
}

/* Der Rahmen sitzt am Eintrag, damit Button und Kontaktzeile (Links dürfen nicht in den Button) eine Karte bilden. */
.lh-standorte__eintrag {
	border: 1px solid currentColor;
	border-radius: 4px;
}

.lh-standorte__eintrag--ohne-karte {
	border-style: dashed;
}

/* Aktiv: Outline statt breiterem Rahmen – kein Springen, und Outlines bleiben in Kontrastmodi sichtbar. */
.lh-standorte__eintrag:has(> [aria-current="true"]) {
	outline: 1px solid currentColor;
	outline-offset: -2px;
}

.lh-standorte__ort {
	display: grid;
	grid-template-columns: 28px minmax(0, 1fr);
	gap: 12px;
	width: 100%;
	margin: 0;
	padding: 12px 14px;
	border: 0;
	border-radius: 3px;
	background: none;
	color: inherit;
	font: inherit;
	line-height: 1.45;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
}

button.lh-standorte__ort {
	cursor: pointer;
}

/* Theme-Buttonstile (Astra) neutralisieren. */
button.lh-standorte__ort:hover,
button.lh-standorte__ort:focus {
	background: none;
	color: inherit;
}

/* Hover/Fokus am ganzen Eintrag zeigen, nicht nur am Button (der endet über der Kontaktzeile). */
.lh-standorte__eintrag:has(> button.lh-standorte__ort:hover),
.lh-standorte__eintrag:has(> button.lh-standorte__ort:focus-visible) {
	outline: 2px solid currentColor;
	outline-offset: -3px;
}

button.lh-standorte__ort:focus-visible {
	outline: none;
}

/* Ohne :has()-Unterstützung bleibt die Markierung am Button. */
@supports not selector(:has(*)) {
	button.lh-standorte__ort:hover,
	button.lh-standorte__ort:focus-visible {
		outline: 2px solid currentColor;
		outline-offset: -4px;
	}
}

.lh-standorte__nr {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 1.5px solid currentColor;
	display: grid;
	place-items: center;
	font-weight: 700;
	font-size: .85rem;
}

.lh-standorte__ort--ohne-karte .lh-standorte__nr {
	visibility: hidden;
}

.lh-standorte__ort[aria-current="true"] .lh-standorte__nr {
	background: var(--lh-standorte-akzent);
	border-color: var(--lh-standorte-akzent);
	color: #fff;
}

.lh-standorte__text > span {
	display: block;
}

.lh-standorte__name {
	font-weight: 700;
}

.lh-standorte__sub,
.lh-standorte__adr {
	font-size: .92rem;
}

.lh-standorte__sub {
	opacity: .8;
}

.lh-standorte__adr {
	margin-top: 4px;
}

/* Eingerückt auf die Textspalte des Buttons: 14px Innenabstand + 28px Nummer + 12px Lücke. */
.lh-standorte__kontakt {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: -4px 0 0;
	padding: 0 14px 12px 54px;
	line-height: 1.45;
	font-size: .9rem;
	overflow-wrap: anywhere;
}

/* Karte */
.lh-standorte__karte {
	position: sticky;
	top: var(--lh-standorte-oben);
	height: var(--lh-standorte-hoehe);
	border: 1px solid currentColor;
	border-radius: 4px;
	overflow: hidden;
}

.lh-standorte__zustimmung {
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 24px;
	text-align: center;
	box-sizing: border-box;
}

.lh-standorte__zustimmung p {
	max-width: 42ch;
	margin: 0;
}

.lh-standorte__laden {
	padding: 10px 20px;
	border: 2px solid currentColor;
	border-radius: 4px;
	background: none;
	color: inherit;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.lh-standorte__laden:hover,
.lh-standorte__laden:focus {
	background: none;
	color: inherit;
}

.lh-standorte__laden:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.lh-standorte .leaflet-container {
	font: inherit;
}

.lh-standorte__filter {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

/* Nur die Kacheln färben – Marker, Popups und Attribution bleiben unverändert. */
.lh-standorte--blau .leaflet-tile-pane {
	filter: url(#lh-standorte-blau);
}

.lh-standorte .leaflet-container .leaflet-popup-content {
	font-size: .9rem;
	line-height: 1.45;
}

.lh-standorte .leaflet-container .leaflet-control-attribution {
	font-size: .75rem;
	line-height: 1.4;
}

.lh-standorte .leaflet-popup-content-wrapper {
	border-radius: 4px;
}

/* Popup */
.lh-standorte__popup {
	font: inherit;
	min-width: 220px;
}

.lh-standorte__popup h3 {
	margin: 0 0 4px;
	font-size: 1rem;
	line-height: 1.3;
}

.lh-standorte__popup h3:not(:first-child) {
	margin-top: 12px;
}

.lh-standorte__popup p {
	margin: 0 0 6px;
	font-size: .9rem;
}

.lh-standorte__popup dl {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 2px 10px;
	margin: 8px 0;
	font-size: .9rem;
}

.lh-standorte__popup dt {
	opacity: .7;
	font-weight: 400;
}

.lh-standorte__popup dd {
	margin: 0;
	overflow-wrap: anywhere;
}

.lh-standorte__popup .lh-standorte__route {
	display: inline-block;
	margin-top: 4px;
	font-size: .9rem;
	font-weight: 600;
}

/* Marker (Tropfenform, Nummer innen) */
.lh-marker {
	width: 30px;
	height: 30px;
	box-sizing: border-box;
	border-radius: 50% 50% 50% 0;
	transform: rotate(-45deg);
	background: #c8102e;
	border: 2px solid #fff;
	display: grid;
	place-items: center;
	transition: transform .15s ease;
}

.lh-marker span {
	transform: rotate(45deg);
	color: #fff;
	font-weight: 700;
	font-size: .8rem;
	line-height: 1;
}

/* Aktiver Marker: größer und mit doppeltem Rand statt weiterer Farbe. */
.lh-marker--aktiv {
	transform: rotate(-45deg) scale(1.3);
	border-width: 3px;
}

.lh-standorte .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.lh-standorte__hinweis {
	margin-top: 14px;
	font-size: .85rem;
	opacity: .75;
}

@media (max-width: 820px) {
	.lh-standorte__raster {
		grid-template-columns: minmax(0, 1fr);
	}

	.lh-standorte__karte {
		position: static;
		order: -1;
		height: 60vh;
		min-height: 360px;
	}

	.lh-standorte__liste {
		max-height: none;
		overflow: visible;
	}
}

@media (forced-colors: active) {
	.lh-standorte--blau .leaflet-tile-pane {
		filter: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lh-marker {
		transition: none;
	}
}
