/* PuW Steckbriefkarte – Gestaltung wie die WiA-Quartierskarte (1.7.0),
   in den Hausfarben von bayern-pflege-wohnen.de.

   Nadelfarben gegen den weißen Kartengrund (gemessen 22.11.2026, Ziel 3:1
   aus WCAG 1.4.11): Weinrot #AC3E66 5,8:1, Petrol #2E7366 5,6:1,
   Blau #4F6C9C 5,3:1. Die Hausfarben Mint #BAE1D9 und Blau #7E9BC8 der
   alten Legende kämen nur auf 1,4:1 und 2,8:1. Untereinander sind die drei
   Farben gleich hell, deshalb trägt jede Nadel zusätzlich ihr Zeichen
   (Kreis, Quadrat, Dreieck) und die Projektart im Namen. */
.puw-sk {
  --puw-sk-landkreis: var(--primary, #AC3E66);
  --puw-sk-einzelkommune: #2E7366;
  --puw-sk-interkommunal: #4F6C9C;
  --puw-sk-flaeche: var(--primary-ultra-light, #f8ecf1);
  --puw-sk-fokus: var(--primary-dark, #5e2238);
  position: relative;
  max-width: 100%;
}
.puw-sk [hidden] { display: none !important; }

/* ---- Filterleiste ---- */
.puw-sk__filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 0 0 16px;
  position: relative;
  z-index: 6;
}
.puw-sk__wahl { position: relative; }
.puw-sk__wahl-knopf {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-height: 44px;
  padding: 10px 40px 10px 16px;
  background: #fff;
  border: 1.5px solid rgba(0,0,0,.25);
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
  color: #000;
  cursor: pointer;
  position: relative;
}
.puw-sk__wahl-knopf::after {
  content: "";
  position: absolute;
  right: 16px; top: 50%;
  width: 8px; height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
}
.puw-sk__wahl-knopf[aria-expanded="true"]::after { transform: translateY(-20%) rotate(225deg); }
.puw-sk__wahl-titel { font-weight: 600; }
.puw-sk__wahl-stand { color: rgba(0,0,0,.62); }
.puw-sk__wahl.is-aktiv .puw-sk__wahl-knopf { border-color: var(--puw-sk-landkreis); }
.puw-sk__wahl.is-aktiv .puw-sk__wahl-stand { color: var(--puw-sk-fokus); font-weight: 600; }
.puw-sk__wahl-knopf:hover { border-color: rgba(0,0,0,.45); }
.puw-sk__wahl-knopf:focus-visible,
.puw-sk__zuruecksetzen:focus-visible {
  outline: 3px solid var(--puw-sk-fokus);
  outline-offset: 2px;
}
.puw-sk__wahl-liste {
  position: absolute;
  z-index: 20; /* über dem nächsten Auswahlknopf, auf dem Handy stehen sie untereinander */
  top: calc(100% + 6px); left: 0;
  min-width: 260px;
  max-height: 340px;
  overflow-y: auto;
  margin: 0; padding: 6px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 10px;
  box-shadow: 0 8px 26px rgba(0,0,0,.16);
}
.puw-sk__wahl-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 15px;
  color: #000; /* das Theme setzt Beschriftungen grau, hier zu schwach */
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.puw-sk__wahl-option span { flex: 1 1 auto; cursor: pointer; }
.puw-sk__wahl-option:hover { background: var(--puw-sk-flaeche); }
.puw-sk__wahl-option input {
  width: 18px; height: 18px;
  margin: 0;
  accent-color: var(--puw-sk-landkreis);
  flex: 0 0 auto;
}
.puw-sk__wahl-option input:focus-visible { outline: 3px solid var(--puw-sk-fokus); outline-offset: 2px; }
.puw-sk__zuruecksetzen {
  min-height: 44px;
  padding: 0 4px;
  background: none;
  border: 0;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--puw-sk-fokus);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.puw-sk__anzahl {
  margin: 0 0 0 auto;
  font-size: 15px;
  color: rgba(0,0,0,.62);
}

/* ---- Karte ---- */
.puw-sk__karte { position: relative; }
.puw-sk__viewport {
  width: 100%;
  border-radius: var(--radius, 8px);
  outline: none;
}
.puw-sk__viewport:focus-visible { outline: 3px solid var(--puw-sk-fokus); outline-offset: 2px; }
.puw-sk__viewport svg {
  width: 100%;
  height: auto;
  display: block;
  touch-action: pan-y;
}
.puw-sk.is-zoomed .puw-sk__viewport svg { touch-action: none; cursor: grab; }
.puw-sk__viewport svg.is-dragging { cursor: grabbing; }

/* Nadeln */
.puw-sk__marker { cursor: pointer; }
.puw-sk__marker > * { transition: transform .13s ease; transform-origin: 0 0; } /* Spitze bleibt am Ort */
.puw-sk__pin { stroke: #fff; stroke-width: 1.5; }
.puw-sk__glyph { fill: #fff; pointer-events: none; }
.is-landkreis .puw-sk__pin { fill: var(--puw-sk-landkreis); }
.is-einzelkommune .puw-sk__pin { fill: var(--puw-sk-einzelkommune); }
.is-interkommunal .puw-sk__pin { fill: var(--puw-sk-interkommunal); }
.puw-sk__marker:hover > *,
.puw-sk__marker:focus-visible > * { transform: scale(1.35); }
.puw-sk__marker:hover .puw-sk__pin,
.puw-sk__marker:focus .puw-sk__pin { filter: brightness(1.12); }
.puw-sk__marker:focus { outline: none; }
.puw-sk__marker:focus-visible .puw-sk__pin { stroke: var(--puw-sk-fokus); stroke-width: 3; }

/* Zoom-Steuerung */
.puw-sk__controls {
  position: absolute;
  top: 14px; right: 14px;
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid rgba(0,0,0,.14);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  overflow: hidden;
  z-index: 3;
}
.puw-sk__zoom {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  font-size: 20px; line-height: 1;
  background: #fff;
  border: 0;
  border-bottom: 1px solid rgba(0,0,0,.1);
  cursor: pointer;
  color: #2b2b2b;
  padding: 0;
}
.puw-sk__zoom:last-child { border-bottom: 0; }
.puw-sk__zoom:hover { background: var(--puw-sk-flaeche); }
.puw-sk__zoom:focus-visible { outline: 3px solid var(--puw-sk-fokus); outline-offset: -3px; }
.puw-sk__zoom[data-zoom="reset"] { font-size: 15px; }

/* Hinweis beim Scrollen über der Karte */
.puw-sk__hint {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  background: rgba(43,43,43,.75);
  color: #fff;
  font-size: 17px;
  text-align: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  border-radius: var(--radius, 8px);
  z-index: 2;
}
.puw-sk__hint.is-visible { opacity: 1; }

/* Tooltip */
.puw-sk__tooltip {
  position: absolute;
  transform: translate(-50%, -100%);
  max-width: min(420px, 90%);
  background: #2b2b2b; color: #fff;
  padding: 10px 18px;
  border-radius: 9px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
  z-index: 4;
}
.puw-sk__tooltip.is-visible { opacity: 1; }
.puw-sk__tooltip.is-unten { transform: translate(-50%, 0); }

/* Popup */
.puw-sk__popup {
  position: absolute;
  top: 12%; left: 50%;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  background: var(--puw-sk-flaeche);
  border-radius: 13px;
  box-shadow: 0 10px 34px rgba(0,0,0,.28);
  padding: 22px 35px 35px 40px;
  z-index: 5;
}
.puw-sk__popup-title {
  margin: 0 0 18px;
  padding-right: 40px;
  padding-bottom: 12px;
  font-size: 2.4rem;
  font-weight: 600;
  color: #000;
  line-height: 1.25;
  border-bottom: 2px solid rgba(0,0,0,.14);
}
.puw-sk__row { margin: 0 0 12px; display: flex; flex-direction: column; gap: 2px; }
.puw-sk__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(0,0,0,.6);
}
.puw-sk__value { font-size: 17px; font-weight: 600; color: #000; }
.puw-sk__nosb { font-size: 16px; color: #000; margin: 10px 0 0; }
.puw-sk__close {
  position: absolute;
  top: 14px; right: 14px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: transparent;
  border: 0; cursor: pointer;
  font-size: 17px; line-height: 1;
  color: #2b2b2b;
  border-radius: 6px;
}
.puw-sk__close:hover { background: rgba(0,0,0,.07); }
.puw-sk__close:focus-visible { outline: 3px solid var(--puw-sk-fokus); }
.puw-sk__download {
  margin-top: 18px;
  display: block;
  width: 100%;
  text-align: center;
  background-color: var(--puw-sk-landkreis) !important;
  color: #fff !important;
  border-radius: var(--radius, 8px) !important;
  padding: 16px 24px !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  border: 0 !important;
  box-sizing: border-box;
}
.puw-sk__download:hover { background-color: var(--puw-sk-fokus) !important; }
.puw-sk__download:focus-visible { outline: 3px solid var(--puw-sk-fokus); outline-offset: 2px; }
.puw-sk__stand { margin-top: 10px; }

.puw-sk__sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---- Unter der Karte: Legende und Suche ---- */
.puw-sk__below {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 14px;
}
.puw-sk__legend {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  font-size: 15px;
}
.puw-sk__legend li { display: flex; align-items: center; gap: 6px; margin: 0; }
.puw-sk__legend-pin, .puw-sk__opt-pin { width: 22px; height: 33px; flex: 0 0 auto; overflow: visible; }

.puw-sk__search { position: relative; min-width: min(340px, 100%); }
.puw-sk__search-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: rgba(0,0,0,.62);
}
.puw-sk__search-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 16px;
  border: 1.5px solid rgba(0,0,0,.25);
  border-radius: 10px;
  background: #fff;
}
.puw-sk__search-input:focus-visible { outline: 3px solid var(--puw-sk-fokus); outline-offset: 1px; }
.puw-sk__search-list {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 6px);
  max-height: 300px;
  overflow-y: auto;
  margin: 0; padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 10px;
  box-shadow: 0 8px 26px rgba(0,0,0,.16);
  z-index: 10;
}
.puw-sk__search-list li {
  display: flex; align-items: center; gap: 10px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.3;
}
.puw-sk__opt-name { display: block; }
.puw-sk__opt-ort { display: block; font-size: 13px; color: rgba(0,0,0,.62); }
.puw-sk__search-list li:hover,
.puw-sk__search-list li[aria-selected="true"] { background: var(--puw-sk-flaeche); }

/* Sprungmarke über der Karte: unsichtbar, bis sie den Fokus bekommt. */
.puw-sk__skip {
  position: absolute;
  inline-size: 1px; block-size: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.puw-sk__skip:focus {
  inset-block-start: 8px; inset-inline-start: 8px;
  z-index: 5;
  inline-size: auto; block-size: auto;
  margin: 0;
  padding: 10px 16px;
  overflow: visible;
  clip-path: none;
  white-space: normal;
  background: #fff;
  color: var(--puw-sk-fokus);
  border: 2px solid var(--puw-sk-fokus);
  border-radius: 6px;
  font-weight: 600;
  text-decoration: underline;
}
.puw-sk__nach-karte { scroll-margin-block-start: 90px; }
.puw-sk__nach-karte:focus { outline: none; }

@media (prefers-reduced-motion: reduce) {
  .puw-sk__tooltip, .puw-sk__hint, .puw-sk__marker > * { transition: none; }
}
@media only screen and (max-width: 812px) {
  .puw-sk__popup { padding: 16px 20px 22px; }
  .puw-sk__popup-title { font-size: 1.9rem; }
  .puw-sk__anzahl { margin-left: 0; flex-basis: 100%; }
}
@media only screen and (max-width: 500px) {
  .puw-sk__popup { top: 4%; width: calc(100% - 16px); }
  .puw-sk__value { font-size: 15px; }
  .puw-sk__wahl { flex: 1 1 100%; }
  .puw-sk__wahl-knopf { width: 100%; }
  .puw-sk__wahl-liste { right: 0; min-width: 0; }
  .puw-sk__search { flex: 1 1 100%; }
}
