/**
 * Stadtteil-Karte (Komponente stadtteil-karte) — Optik wie der Einsatzgebiete-Globus (30-karten.css):
 * Iris-Flächen mit weißen Grenzen, gewählt Indigo mit Neon-Rand (Idee), weiße Pillen mit Indigo-Schrift.
 * Nur var(--zy-…); eigene Werte als lokale Tokens auf .zy-stadtteile.
 */

.zy-stadtteile {
	--zy-st-flaeche: var(--zy-globus-gebiet-2);
	--zy-st-aktiv: var(--zy-globus-aktiv-2);
	--zy-st-grenze: var(--zy-farbe-grund);
	--zy-st-bezirk: rgb(255 255 255 / .26);
	--zy-st-neon: var(--zy-farbe-akzent-auf-dunkel);
	--zy-st-schatten: rgb(20 39 74 / .28);
	--zy-st-licht-1: rgb(255 255 255 / .26);
	--zy-st-licht-2: rgb(20 39 74 / .2);
	--zy-st-pille-schatten: 0 2px 6px rgb(20 39 74 / .25);
	--zy-st-dauer: var(--zy-dauer-globus);
	--zy-st-karte-max: 720px;

	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--zy-abstand-xl);
	align-items: center;
}

@media (min-width: 1100px) {
	.zy-stadtteile {
		grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
		gap: var(--zy-abstand-3xl);
	}
}

/* ---------- Karte ---------- */
.zy-stadtteile__karte {
	min-width: 0;
}

.zy-stadtteile__buehne {
	position: relative;
	width: 100%;
	max-width: var(--zy-st-karte-max);
	margin-inline: auto;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.zy-stadtteile__svg {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.zy-stadtteile__licht-1 { stop-color: var(--zy-st-licht-1); }
.zy-stadtteile__licht-2 { stop-color: var(--zy-st-licht-2); }

.zy-stadtteile__schatten {
	fill: var(--zy-st-schatten);
	pointer-events: none;
}

.zy-stadtteile__teil {
	fill: var(--zy-st-flaeche);
	stroke: var(--zy-st-grenze);
	stroke-width: 2.5;
	stroke-linejoin: round;
	cursor: pointer;
	outline: none;
	transition: fill var(--zy-st-dauer) var(--zy-ease);
}

/* Ohne JS: einfacher Farbwechsel beim Überfahren. Mit JS breitet sich die Indigo-Ebene vom Mauszeiger aus. */
.zy-stadtteile:not(.ist-bereit) .zy-stadtteile__teil:hover {
	fill: var(--zy-st-aktiv);
}

.zy-stadtteile__teil:focus-visible {
	stroke: var(--zy-farbe-fokus);
	stroke-width: 5;
}

.zy-stadtteile__linien {
	fill: none;
	stroke: var(--zy-st-bezirk);
	stroke-width: 1;
	stroke-linejoin: round;
	stroke-linecap: round;
	pointer-events: none;
}

/* Punkte-Modus: Gemeinde als eine Fläche im gleichen Look (nicht wählbar), Ortsteile als Punkte. */
.zy-stadtteile__stadt {
	fill: var(--zy-st-flaeche);
	stroke: var(--zy-st-grenze);
	stroke-width: 2.5;
	stroke-linejoin: round;
	pointer-events: none;
}

.zy-stadtteile__ort {
	cursor: pointer;
	outline: none;
}

/* Unsichtbare, größere Trefferfläche (Finger); Radius setzt stadtteile.js in Bildschirm-Pixeln. */
.zy-stadtteile__ort-treffer {
	fill: transparent;
}

.zy-stadtteile__ort-punkt {
	fill: var(--zy-farbe-grund);
	stroke: var(--zy-st-aktiv);
	stroke-width: 2;
	vector-effect: non-scaling-stroke;
	transform-box: fill-box;
	transform-origin: center;
	pointer-events: none;
	transition: fill var(--zy-st-dauer) var(--zy-ease), stroke var(--zy-st-dauer) var(--zy-ease), transform var(--zy-st-dauer) var(--zy-ease);
}

.zy-stadtteile__ort:hover .zy-stadtteile__ort-punkt,
.zy-stadtteile__ort.ist-aktiv .zy-stadtteile__ort-punkt {
	fill: var(--zy-st-neon);
	stroke: var(--zy-st-aktiv);
	stroke-width: 3;
	transform: scale(1.5);
}

.zy-stadtteile__ort:focus-visible .zy-stadtteile__ort-punkt {
	stroke: var(--zy-farbe-fokus);
	stroke-width: 4;
}

/* Leichte Kugel-Schattierung über der ganzen Stadt (oben links Licht, unten rechts Schatten). */
.zy-stadtteile__licht {
	pointer-events: none;
}

.zy-stadtteile__fuellung {
	fill: var(--zy-st-aktiv);
	stroke: var(--zy-st-neon);
	stroke-width: 4;
	stroke-linejoin: round;
	pointer-events: none;
}

/* ---------- HTML-Ebene über dem SVG (Pillen, Sitz, Name) ---------- */
.zy-stadtteile__ebene {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.zy-stadtteile__pille,
.zy-stadtteile__sitz,
.zy-stadtteile__name {
	position: absolute;
	white-space: nowrap;
	font-family: var(--zy-schrift-text);
	line-height: 1.2;
}

/* Pille: der Punkt sitzt genau auf der Lage, der Name läuft nach rechts (am rechten Rand nach links). */
.zy-stadtteile__pille {
	--zy-st-punkt: 12px;
	--zy-st-innen: 6px;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	padding: 5px 12px 5px var(--zy-st-innen);
	border: 0;
	border-radius: 999px;
	background: var(--zy-farbe-grund);
	color: var(--zy-farbe-dunkel);
	font-size: 13px;
	font-weight: 600;
	box-shadow: var(--zy-st-pille-schatten);
	cursor: pointer;
	pointer-events: auto;
	transform: translate(calc(-1 * (var(--zy-st-innen) + var(--zy-st-punkt) / 2)), -50%);
	transition: background-color var(--zy-st-dauer) var(--zy-ease), color var(--zy-st-dauer) var(--zy-ease), box-shadow var(--zy-st-dauer) var(--zy-ease);
}

.zy-stadtteile__pille.ist-links {
	flex-direction: row-reverse;
	padding: 5px var(--zy-st-innen) 5px 12px;
	transform: translate(calc(-100% + var(--zy-st-innen) + var(--zy-st-punkt) / 2), -50%);
}

.zy-stadtteile__punkt {
	flex: none;
	width: var(--zy-st-punkt);
	height: var(--zy-st-punkt);
	border-radius: 50%;
	background: var(--zy-farbe-blau);
	box-shadow: 0 0 0 3px rgb(27 70 210 / .18);
	transition: background-color var(--zy-st-dauer) var(--zy-ease), box-shadow var(--zy-st-dauer) var(--zy-ease);
}

/* Kompakt (stadtteile.js, wenn der Platz für den Namen fehlt): nur der Punkt, Name beim Überfahren/Antippen. */
.zy-stadtteile__pille:not(.ist-kompakt) {
	z-index: 1; /* Namen liegen über den kompakten Punkten */
}

.zy-stadtteile__pille.ist-kompakt:not(:hover, :focus-visible, .ist-aktiv) {
	z-index: 0;
	gap: 0;
	padding: 5px var(--zy-st-innen);
}

.zy-stadtteile__pille.ist-kompakt:not(:hover, :focus-visible, .ist-aktiv) .zy-stadtteile__pille-name {
	display: none;
}

.zy-stadtteile__pille.ist-kompakt.ist-links:not(:hover, :focus-visible, .ist-aktiv) {
	transform: translate(calc(-1 * (var(--zy-st-innen) + var(--zy-st-punkt) / 2)), -50%);
}

.zy-stadtteile__pille.ist-kompakt:is(:hover, :focus-visible, .ist-aktiv) {
	z-index: 3;
}

.zy-stadtteile__pille:hover,
.zy-stadtteile__pille.ist-aktiv {
	background: var(--zy-farbe-dunkel);
	color: var(--zy-farbe-akzent-auf-dunkel);
	z-index: 2;
}

.zy-stadtteile__pille:hover .zy-stadtteile__punkt,
.zy-stadtteile__pille.ist-aktiv .zy-stadtteile__punkt {
	background: var(--zy-farbe-akzent-auf-dunkel);
	box-shadow: 0 0 0 3px rgb(223 252 99 / .3);
}

.zy-stadtteile__pille:focus-visible {
	outline: 3px solid var(--zy-farbe-fokus);
	outline-offset: 2px;
}

/* Kurztext der Pille: mit JS in der Info-Fläche; ohne JS als kleine Sprechblase beim Überfahren/Fokus. */
.zy-stadtteile__pille-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.zy-stadtteile:not(.ist-bereit) .zy-stadtteile__pille:is(:hover, :focus-visible) .zy-stadtteile__pille-text {
	top: calc(100% + 6px);
	left: 0;
	width: max-content;
	max-width: 240px;
	height: auto;
	padding: 8px 12px;
	clip-path: none;
	border-radius: 10px;
	background: var(--zy-farbe-dunkel);
	color: var(--zy-farbe-dunkel-text);
	font-weight: 400;
	white-space: normal;
}

/* Sitz Fürth: Idee-Punkt mit Indigo-Ring, daneben kleines Schild mit Fahrzeit. */
.zy-stadtteile__sitz {
	--zy-st-punkt: 18px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	transform: translate(calc(-1 * var(--zy-st-punkt) / 2), -50%);
	color: var(--zy-farbe-dunkel);
	font-size: 13px;
}

.zy-stadtteile__sitz.ist-links {
	flex-direction: row-reverse;
	transform: translate(calc(-100% + var(--zy-st-punkt) / 2), -50%);
}

.zy-stadtteile__sitz-punkt {
	flex: none;
	width: var(--zy-st-punkt);
	height: var(--zy-st-punkt);
	border-radius: 50%;
	background: var(--zy-farbe-akzent-auf-dunkel);
	border: 4px solid var(--zy-farbe-dunkel);
	box-shadow: var(--zy-st-pille-schatten);
}

.zy-stadtteile__sitz-text {
	display: inline-flex;
	flex-direction: column;
	padding: 5px 12px;
	border-radius: 12px;
	background: var(--zy-farbe-dunkel);
	color: var(--zy-farbe-dunkel-text);
	box-shadow: var(--zy-st-pille-schatten);
}

.zy-stadtteile__sitz-text strong {
	color: var(--zy-farbe-akzent-auf-dunkel);
	font-weight: 600;
}

.zy-stadtteile__sitz-text span {
	color: var(--zy-farbe-dunkel-leise);
	font-size: 12px;
}

/* Name des überfahrenen Stadtteils (nur mit JS). */
.zy-stadtteile__name {
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--zy-farbe-grund);
	color: var(--zy-farbe-dunkel);
	font-size: 14px;
	font-weight: 600;
	box-shadow: var(--zy-st-pille-schatten);
	opacity: 0;
	transform: translate(-50%, calc(-100% - 6px)) scale(.94);
	transition: opacity var(--zy-st-dauer) var(--zy-ease), transform var(--zy-st-dauer) var(--zy-ease);
	z-index: 3;
}

.zy-stadtteile__name:empty {
	display: none;
}

.zy-stadtteile__name.ist-sichtbar {
	opacity: 1;
	transform: translate(-50%, calc(-100% - 6px)) scale(1);
}

.zy-stadtteile__vermerk {
	text-align: center;
}

/* ---------- Info-Fläche ---------- */
.zy-stadtteile__info {
	padding: var(--zy-abstand-xl);
	border-radius: var(--zy-radius-karte);
	background: var(--zy-farbe-grund);
	box-shadow: var(--zy-schatten-karte);
}

.zy-stadtteile__inhalt {
	min-height: 10em; /* kein Springen zwischen Grundzustand und Auswahl */
}

.zy-stadtteile__marke {
	margin: 0 0 var(--zy-abstand-sm);
	color: var(--zy-farbe-blau);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.zy-stadtteile__titel {
	margin: 0 0 var(--zy-abstand-md);
	font-size: var(--zy-titel-h3);
}

.zy-stadtteile__text {
	margin: 0;
}

.zy-stadtteile__ua {
	margin: var(--zy-abstand-md) 0 0;
	color: var(--zy-farbe-text-leise);
	font-size: 15px;
}

.zy-stadtteile__zurueck {
	margin: var(--zy-abstand-md) 0 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--zy-farbe-blau);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.zy-stadtteile__zurueck[hidden] {
	display: none;
}

.zy-stadtteile__knopf {
	margin-top: var(--zy-abstand-lg);
}

/* ---------- Handy ---------- */
@media (max-width: 639.98px) {
	.zy-stadtteile__info {
		padding: var(--zy-abstand-lg);
	}

	.zy-stadtteile__inhalt {
		min-height: 9em;
	}

	.zy-stadtteile__pille {
		--zy-st-punkt: 9px;
		--zy-st-innen: 4px;
		gap: 5px;
		padding: 3px 8px 3px var(--zy-st-innen);
		font-size: 11px;
	}

	.zy-stadtteile__pille.ist-links {
		padding: 3px var(--zy-st-innen) 3px 8px;
	}

	.zy-stadtteile__sitz {
		--zy-st-punkt: 14px;
		gap: 5px;
		font-size: 11px;
	}

	.zy-stadtteile__sitz-punkt {
		border-width: 3px;
	}

	.zy-stadtteile__sitz-text {
		padding: 3px 8px;
		border-radius: 9px;
	}

	.zy-stadtteile__sitz-text span {
		font-size: 10px;
	}

	.zy-stadtteile__name {
		padding: 4px 10px;
		font-size: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.zy-stadtteile * {
		animation: none !important;
		transition: none !important;
	}
}
