/* ORTkauf Standortkarte 1.0.0
 * Farben aus der Website: Gelb #F9D949, Schwarz. Schrift wird von der Seite geerbt.
 */
.ok {
	--ok-gelb: #f9d949;
	--ok-schwarz: #0b0b0b;
	--ok-grau: #d6d6d6;
	--ok-schatten: 0 12px 32px rgba(0, 0, 0, .28);
	position: relative;
	font-family: inherit;
}
.ok *, .ok *::before, .ok *::after { box-sizing: border-box; }

/* ---------- Bühne & Karte ---------- */

.ok__buehne {
	display: none; /* ohne JS: nur die Liste */
	position: relative;
	width: 100%;
	max-width: var(--ok-karte-breite, none);
	margin-left: auto; margin-right: auto;
	height: var(--ok-hoehe, 560px);
	overflow: hidden;
	isolation: isolate; /* Leaflet-Ebenen unter Header/Menü der Seite halten */
}
.ok--bereit .ok__buehne { display: block; }
.ok--schmal .ok__buehne { height: var(--ok-hoehe-mobil, 70vh); }

.ok__karte {
	position: absolute;
	inset: 0;
	background: var(--ok-grau);
	font-family: inherit;
}

/* Leaflet-Bedienelemente im ORTkauf-Look */
.ok .leaflet-bar { border: 0; border-radius: 0; box-shadow: 3px 3px 0 var(--ok-schwarz); }
.ok .leaflet-bar a,
.ok .leaflet-bar a:hover {
	width: 36px; height: 36px; line-height: 34px;
	background: var(--ok-gelb); color: var(--ok-schwarz);
	border: 2px solid var(--ok-schwarz); border-radius: 0;
	font-weight: 700;
}
.ok .leaflet-bar a + a { border-top: 0; }
/* Leaflet rundet erste/letzte Knöpfe (auch im Touch-Modus) und nimmt dem letzten die Unterkante.
   Spezifischer überschreiben, sonst entsteht unten rechts ein Spalt zwischen Rahmen und Schatten. */
.ok .leaflet-bar,
.ok .leaflet-bar a,
.ok .leaflet-bar a:first-child,
.ok .leaflet-bar a:last-child,
.ok.ok .leaflet-touch .leaflet-bar a:first-child,
.ok.ok .leaflet-touch .leaflet-bar a:last-child,
.leaflet-touch .ok .leaflet-bar a:first-child,
.leaflet-touch .ok .leaflet-bar a:last-child { border-radius: 0; }
.ok .leaflet-bar a:last-child,
.ok .leaflet-touch .leaflet-bar a:last-child { border-bottom: 2px solid var(--ok-schwarz); }
.ok .leaflet-touch .leaflet-bar,
.ok .leaflet-bar.leaflet-control { border: 0; background-clip: border-box; }
.ok .leaflet-bar a:hover { background: #fff; }
.ok .leaflet-bar a.leaflet-disabled { background: #e9e9e9; color: #9a9a9a; }
.ok .leaflet-control-attribution { font-size: 11px; background: rgba(255, 255, 255, .8); }
.ok--schmal .leaflet-control-zoom { display: none; } /* Touch: Pinch-Zoom, Platz sparen */
.ok .leaflet-bottom.leaflet-right .leaflet-control-zoom { margin-bottom: 8px; }

/* ---------- Pins ---------- */

.ok-pin { background: none; border: 0; }
.ok-pin .okp {
	display: block; width: 34px; height: 46px; overflow: visible;
	transform-origin: 50% 100%;
	transition: transform .18s ease;
	filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35));
}
.ok-pin:hover .okp,
.ok-pin:focus-visible .okp { transform: scale(1.12); }
.ok-pin--aktiv .okp { transform: scale(1.3); }
.ok-pin:focus { outline: none; }
.ok-pin:focus-visible .okp { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 4px #fff) drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }

/* 24/7: schwarzer Pin, gelber Kern. Partner: invertiert. */
.okp__form, .okp__punkt { stroke-linejoin: round; }
.ok-pin--eigen .okp__form, .ok-pin--eigen .okp__punkt { fill: var(--ok-schwarz); }
.ok-pin--eigen .okp__loch { fill: var(--ok-gelb); }
.ok-pin--eigen .okp__form { stroke: var(--ok-gelb); stroke-width: 22px; paint-order: stroke; }
.ok-pin--partner .okp__form, .ok-pin--partner .okp__punkt { fill: var(--ok-gelb); }
.ok-pin--partner .okp__loch { fill: var(--ok-schwarz); }
.ok-pin--partner .okp__form { stroke: var(--ok-schwarz); stroke-width: 22px; paint-order: stroke; }

/* Hover-Label */
.ok-tooltip {
	padding: 5px 9px;
	border: 0; border-radius: 0;
	box-shadow: 3px 3px 0 rgba(0, 0, 0, .25);
	font: inherit; font-size: 13px; font-weight: 700; letter-spacing: .02em;
	white-space: nowrap;
}
.ok-tooltip::before { display: none; }
.ok-tooltip--eigen { background: var(--ok-schwarz); color: var(--ok-gelb); }
.ok-tooltip--partner { background: var(--ok-gelb); color: var(--ok-schwarz); }

/* ---------- Panel (Card auf der Karte) ---------- */

.ok__panel {
	position: absolute;
	z-index: 1000;
	top: 16px; left: 16px; bottom: 16px;
	width: min(360px, calc(100% - 32px));
	display: flex; flex-direction: column; justify-content: flex-start;
	pointer-events: none;
	opacity: 0; transform: translateX(-12px);
	transition: opacity .22s ease, transform .22s ease;
}
.ok__panel[hidden] { display: none; }
.ok--card-offen .ok__panel { opacity: 1; transform: none; }
.ok__panel > .okc {
	pointer-events: auto;
	max-height: 100%;
	overflow-y: auto;
	overscroll-behavior: contain;
	box-shadow: var(--ok-schatten);
}

.ok--schmal .ok__panel {
	top: auto; left: 0; right: 0; bottom: 0;
	width: 100%;
	max-height: 70%;
	transform: translateY(24px);
}
.ok--schmal.ok--card-offen .ok__panel { transform: none; }
.ok--schmal .ok__panel > .okc { box-shadow: 0 -8px 24px rgba(0, 0, 0, .25); }
/* Bottom-Sheet: etwas kompakter */
.ok--schmal .ok__panel .okc__kopf { min-height: 44px; padding: 8px 20px; }
.ok--schmal .ok__panel .okc__inhalt { padding: 16px 20px 20px; }
.ok--schmal .ok__panel .okc__name { font-size: 26px; }
.ok--schmal .ok__panel .okc__adresse { margin-bottom: 12px; }
.ok--schmal .ok__panel .okc__infos { padding-top: 12px; margin-bottom: 14px; }
.ok--schmal .ok__panel .okc__fotos { --okc-foto-hoehe: 88px; margin-bottom: 14px; }
.ok--schmal .ok__panel .okc__name--lang { font-size: 22px; }
.ok--schmal .ok__panel .okc__aktionen { margin: 0 -20px -20px; padding: 10px 20px 16px; }

/* ---------- Card ---------- */

.okc {
	--okc-grund: var(--ok-schwarz);
	--okc-text: #f2f2f2;
	--okc-akzent: var(--ok-gelb);
	--okc-gegen: var(--ok-schwarz);
	position: relative;
	background: var(--okc-grund);
	color: var(--okc-text);
	line-height: 1.4;
	font-size: 15px;
	text-align: left;
}
.okc--partner {
	--okc-grund: var(--ok-gelb);
	--okc-text: var(--ok-schwarz);
	--okc-akzent: var(--ok-schwarz);
	--okc-gegen: var(--ok-gelb);
}

/* Kopfzeile: Zweifarben-Block wie die bisherigen Kartenlabels */
.okc__kopf {
	display: flex; align-items: center; gap: 10px;
	margin: 0;
	min-height: 48px;
	padding: 10px 24px;
	background: var(--okc-akzent); color: var(--okc-gegen);
	font-size: 12px; font-weight: 700; line-height: 1.25;
	letter-spacing: .12em; text-transform: uppercase;
}
.okc__kopf > span { flex: 1 1 auto; }
.okc__kopf .okp { width: 14px; height: 19px; flex: none; }
.okc__kopf .okp__form, .okc__kopf .okp__punkt { fill: currentColor; }
.okc__kopf .okp__loch { fill: transparent; }

.okc__inhalt { padding: 20px 24px 24px; }

.okc__name {
	margin: 0 0 6px;
	font-family: inherit;
	font-size: 30px; font-weight: 800; line-height: 1.05;
	letter-spacing: .01em; text-transform: uppercase;
	color: var(--okc-akzent);
	hyphens: auto; -webkit-hyphens: auto;
	overflow-wrap: break-word;
	outline: none;
}
.okc__name--lang { font-size: 24px; }

.okc__adresse { margin: 0 0 16px; font-size: 15px; }

.okc__infos {
	list-style: none; margin: 0 0 18px; padding: 16px 0 0;
	border-top: 1px solid currentColor;
	border-color: color-mix(in srgb, var(--okc-text) 30%, transparent);
}
.okc__infos li { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 9px; padding: 0; font-size: 15px; }
.okc__infos li:last-child { margin-bottom: 0; }
.okc__icon {
	width: 18px; height: 18px; flex: none; margin-top: 2px;
	fill: none; stroke: var(--okc-akzent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* Fotozeile: feste Höhe, Breite je nach Anzahl (1 breit, 2 halb, 3 Drittel) */
.okc__fotos {
	display: grid; gap: 8px;
	grid-template-columns: repeat(var(--ok-fotos, 3), minmax(0, 1fr));
	margin: 0 0 20px;
}
.okc__fotos img {
	display: block; width: 100%; height: var(--okc-foto-hoehe, 104px); max-width: none;
	object-fit: cover; margin: 0; border-radius: 0;
}

.okc__aktionen { display: flex; flex-wrap: wrap; gap: 10px; }
.okc__btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 46px; padding: 10px 16px;
	font-size: 15px; font-weight: 700; line-height: 1.2;
	text-align: center; white-space: nowrap;
	text-decoration: none !important;
	border: 2px solid var(--okc-akzent);
	transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.okc__btn--route { flex: 1 1 auto; background: var(--okc-akzent); color: var(--okc-gegen) !important; }
.okc__btn--google { flex: 1 1 auto; background: transparent; color: var(--okc-akzent) !important; }
.okc__btn:hover, .okc__btn:focus-visible {
	transform: translate(-2px, -2px);
	box-shadow: 4px 4px 0 var(--okc-text);
	outline: none;
}

/* Schließen: sitzt in der Kopfzeile. Werte bewusst vollständig gesetzt,
   damit Button-Stile des Themes (Padding, Zeilenhöhe, Schatten) nicht durchschlagen. */
.okc__zu {
	flex: none;
	box-sizing: border-box;
	width: 30px !important; height: 30px !important; min-width: 0; min-height: 0;
	margin: -4px -12px -4px 0; padding: 0 !important;
	display: inline-flex; align-items: center; justify-content: center;
	background: transparent; color: currentColor;
	border: 2px solid currentColor; border-radius: 0; box-shadow: none;
	font-size: 0; line-height: 0;
	cursor: pointer;
}
.okc__zu svg { display: block; width: 14px; height: 14px; margin: 0; stroke: currentColor; stroke-width: 2.6; fill: none; stroke-linecap: round; }
.okc__zu::before, .okc__zu::after { content: none; }
.okc__zu:hover, .okc__zu:focus-visible { background: var(--okc-gegen); color: var(--okc-akzent); border-color: var(--okc-gegen); outline: none; }

/* In der Karte: Buttons bleiben unten stehen, wenn der Inhalt scrollt */
.ok__panel .okc__fotos { margin-bottom: 8px; }
.ok__panel .okc__aktionen {
	position: sticky; bottom: 0; z-index: 1;
	margin: 0 -24px -24px; padding: 12px 24px 24px;
	background: var(--okc-grund);
}

/* ---------- Reset ---------- */

.ok__reset {
	position: absolute; z-index: 1000; top: 16px; right: 16px;
	display: inline-flex; align-items: center; gap: 8px;
	min-height: 40px; padding: 8px 14px 8px 12px;
	font: inherit; font-size: 14px; font-weight: 700;
	background: var(--ok-schwarz); color: var(--ok-gelb);
	border: 2px solid var(--ok-schwarz); border-radius: 0;
	box-shadow: 3px 3px 0 var(--ok-gelb);
	cursor: pointer;
}
.ok__reset::before { content: "←"; font-weight: 700; }
.ok__reset:hover, .ok__reset:focus-visible { background: var(--ok-gelb); color: var(--ok-schwarz); box-shadow: 3px 3px 0 var(--ok-schwarz); outline: none; }
.ok__reset[hidden] { display: none; }
.ok--schmal .ok__reset { top: 12px; right: 12px; }

/* ---------- Gesten-Hinweis ---------- */

.ok__hinweis {
	position: absolute; inset: 0; z-index: 999;
	display: grid; place-items: center;
	padding: 24px;
	background: rgba(11, 11, 11, .55);
	color: #fff; text-align: center;
	font-size: 18px; font-weight: 700;
	opacity: 0; pointer-events: none;
	transition: opacity .25s ease;
}
.ok--hinweis .ok__hinweis { opacity: 1; }

/* ---------- Card-Liste (Vorlage für die Karte, Fallback ohne JS) ---------- */

/* Mit Karte nur für Screenreader; ohne JS sichtbar als Raster. */
.ok--bereit .ok__liste {
	position: absolute !important;
	width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.ok__liste {
	display: grid; gap: 16px;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
	margin-top: 16px;
}
/* Buttons im Raster immer unten bündig */
.ok__liste .okc { display: flex; flex-direction: column; }
.ok__liste .okc__inhalt { flex: 1 1 auto; display: flex; flex-direction: column; }
.ok__liste .okc__aktionen { margin-top: auto; }

/* ---------- Verzeichnis (liste="1") ---------- */

.ok__verzeichnis {
	display: none; margin: 16px auto 0;
	max-width: var(--ok-liste-breite, none);
	background: var(--ok-schwarz); color: #f2f2f2;
}
.ok--bereit .ok__verzeichnis { display: block; }

.ok__vz-schalter {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	min-height: 52px; padding: 12px 24px;
	background: var(--ok-gelb); color: var(--ok-schwarz);
	font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
	cursor: pointer; list-style: none;
}
.ok__vz-schalter::-webkit-details-marker { display: none; }
.ok__vz-schalter::marker { content: ""; }
.ok__vz-schalter::after {
	content: ""; flex: none; width: 10px; height: 10px;
	border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor;
	transform: translateY(-3px) rotate(45deg); transition: transform .2s ease;
}
.ok__verzeichnis[open] > .ok__vz-schalter::after { transform: translateY(2px) rotate(-135deg); }
.ok__vz-schalter:focus-visible { outline: 3px solid var(--ok-schwarz); outline-offset: -6px; }

.ok__vz-inhalt { padding: 8px 24px 24px; }
.ok__vz-gruppe + .ok__vz-gruppe { margin-top: 12px; }

.ok__vz-titel {
	display: flex; align-items: center; gap: 8px;
	margin: 16px 0 4px; padding: 0;
	font-family: inherit; font-size: 12px; font-weight: 700; line-height: 1.3;
	letter-spacing: .12em; text-transform: uppercase; color: var(--ok-gelb);
}
.ok__vz-titel .okp { width: 12px; height: 16px; flex: none; }
.ok__vz-titel .okp__form, .ok__vz-titel .okp__punkt { fill: var(--ok-gelb); }
.ok__vz-titel .okp__loch { fill: transparent; }

.ok__vz-liste {
	list-style: none; margin: 0; padding: 0;
	columns: 260px 3; column-gap: 32px; /* alphabetisch spaltenweise lesen, höchstens 3 Spalten */
}
.ok__vz-eintrag {
	display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: start;
	break-inside: avoid;
	margin: 0; padding: 11px 0;
	border-bottom: 1px solid rgba(255, 255, 255, .14);
}
.ok__vz-name {
	grid-column: 1; grid-row: 1;
	font-size: 17px; font-weight: 800; line-height: 1.2; letter-spacing: .01em; text-transform: uppercase;
	color: #fff !important; text-decoration: none !important;
}
.ok__vz-name:hover, .ok__vz-name:focus-visible { color: var(--ok-gelb) !important; outline: none; }
.ok__vz-adresse { grid-column: 1; grid-row: 2; font-size: 13px; line-height: 1.35; color: rgba(255, 255, 255, .7); }
.ok__vz-route {
	grid-column: 2; grid-row: 1 / span 2; align-self: center;
	padding: 6px 10px;
	font-size: 13px; font-weight: 700;
	color: var(--ok-gelb) !important; text-decoration: none !important;
	border: 2px solid var(--ok-gelb);
}
.ok__vz-route:hover, .ok__vz-route:focus-visible { background: var(--ok-gelb); color: var(--ok-schwarz) !important; outline: none; }

/* ---------- Debug ---------- */

.ok__debug { font: 12px/1.4 monospace; padding: 6px 0; }
.ok__debug-fehler { color: #c00; }

@media (prefers-reduced-motion: reduce) {
	.ok__panel, .ok-pin .okp, .okc__btn, .ok__hinweis, .ok__vz-schalter::after { transition: none; }
}
