/*
 * SVG Wohnen - Standortkarte, AP-5 (Ticket standortkarte-9)
 *
 * Eigene, committete Quelldatei (bewusst unter web/standortkarte/ statt
 * web/assets/, siehe contao/config/config.php).
 *
 * Design-Vorgabe: UI-Design-Kartenansicht.md (Clara, Ticket standortkarte-5).
 * Farb-/Typo-Werte wurden gegen das tatsaechliche svg-eg.de-Theme abgeglichen
 * (files/SVG-WOHNEN/css-js/svg.scss, siehe Dev-Seed/files.tar.gz) statt gegen
 * Claras neutralen Fallback - siehe dev_requirements des Tickets:
 *   - Primaerfarbe ($hauptfarbe):  #a81829
 *   - Sekundaerfarbe ($schmuckfarbe): #707173
 *   - Schrift: 'Open Sans' (bereits sitebreit per @font-face geladen)
 *   - Max-Breite: 1400px, Gutter Desktop 25px / Mobil 15px
 *   - Flaches Erscheinungsbild (border-radius 0), passend zur restlichen Seite
 */

.standortkarte {
    --sk-primary: #a81829;
    --sk-secondary: #707173;
    --sk-text: #000;
    --sk-border: #ddd;
    --sk-bg-muted: #f0f0f0;
    --sk-bg: #fff;
    --sk-focus: #0b63ce;
    --sk-gutter: 25px;
    --sk-radius: 0;

    box-sizing: border-box;
    max-width: 1400px;
    margin: 0 auto;
    font-family: 'Open Sans', sans-serif;
    color: var(--sk-text);
}

.standortkarte *,
.standortkarte *::before,
.standortkarte *::after {
    box-sizing: inherit;
}

.standortkarte__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Sichtbarer Fokusring auf allen interaktiven Elementen (A11y-Vorgabe 5) */
.standortkarte button:focus-visible,
.standortkarte [tabindex]:focus-visible {
    outline: 3px solid var(--sk-focus);
    outline-offset: 2px;
}

.standortkarte__layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 0 var(--sk-gutter);
}

.standortkarte__map-col {
    position: relative;
    width: 100%;
    height: 420px;
    background: var(--sk-bg-muted);
}

.standortkarte__map {
    width: 100%;
    height: 100%;
}

.standortkarte__noscript {
    padding: 16px;
    margin: 0;
    background: var(--sk-bg-muted);
    color: var(--sk-text);
}

/* Platzhalter/Consent-Button, den Cookiebar automatisch in .standortkarte__map einfuegt */
.standortkarte__map .cc_module_placeholder,
.standortkarte__map .standortkarte__consent-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    height: 100%;
    padding: 24px;
    text-align: center;
    background: var(--sk-bg-muted);
}

.standortkarte__consent-button {
    padding: 12px 24px;
    min-height: 44px;
    border: 0;
    border-radius: var(--sk-radius);
    background: var(--sk-primary);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    cursor: pointer;
}

.standortkarte__panel {
    width: 100%;
}

.standortkarte__panel-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.standortkarte__panel-title {
    flex: 1;
    margin: 0;
    font-size: 18px;
    line-height: 24px;
    color: var(--sk-primary);
    font-weight: normal;
}

.standortkarte__mobile-toggle {
    display: none;
}

.standortkarte__sheet-close {
    display: none;
}

.standortkarte__list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--sk-border);
}

.standortkarte__item {
    border-bottom: 1px solid var(--sk-border);
}

.standortkarte__row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 12px 8px;
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    color: var(--sk-text);
    text-align: left;
    cursor: pointer;
}

.standortkarte__row:hover {
    background: var(--sk-bg-muted);
}

.standortkarte__item[data-standortkarte-active] .standortkarte__row {
    background: var(--sk-bg-muted);
    font-weight: 600;
}

.standortkarte__row-dot {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--sk-secondary);
}

.standortkarte__row-dot[data-has-marker="0"] {
    background: transparent;
    border: 1px dashed var(--sk-secondary);
}

.standortkarte__item[data-standortkarte-active] .standortkarte__row-dot {
    background: var(--sk-primary);
}

.standortkarte__row-name {
    flex: 1;
}

.standortkarte__row-count {
    color: var(--sk-secondary);
    font-size: 13px;
}

.standortkarte__details {
    padding: 0 8px 16px 32px;
}

.standortkarte__details[hidden] {
    display: none;
}

.standortkarte__addresses {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.standortkarte__address {
    padding: 8px 0;
    font-size: 14px;
    line-height: 20px;
    border-top: 1px solid var(--sk-border);
}

.standortkarte__address:first-child {
    border-top: 0;
}

/* --- Tablet/Zwischenbereich (768-1023px): gestapelt, aber kein Bottom-Sheet ---
 * Nicht explizit im UI-Design spezifiziert (dort nur <768 / >=1024). Bewusste
 * Zwischenloesung: gleiche gestapelte Darstellung wie Mobile, aber ohne
 * fixiertes Sheet (genug vertikaler Platz vorhanden). */

/* --- Desktop Split-View (>=1024px, UI-Design Abschnitt 2) --- */
@media (min-width: 1024px) {
    .standortkarte__layout {
        flex-direction: row;
        align-items: flex-start;
    }

    .standortkarte__map-col {
        flex: 0 0 65%;
        height: 560px;
    }

    .standortkarte__panel {
        flex: 1;
        min-width: 320px;
        max-height: 560px;
        overflow-y: auto;
    }
}

/* --- Mobile Bottom Sheet (<768px, UI-Design Abschnitt 3) --- */
@media (max-width: 767px) {
    .standortkarte__layout {
        padding: 0 15px;
        gap: 0;
    }

    .standortkarte__map-col {
        height: 55vh;
    }

    .standortkarte__mobile-toggle {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        min-height: 44px;
        padding: 12px;
        border: 1px solid var(--sk-border);
        border-bottom: 0;
        background: var(--sk-bg);
        font-family: inherit;
        font-size: 14px;
        font-weight: 600;
        color: var(--sk-primary);
        cursor: pointer;
    }

    .standortkarte__mobile-toggle-handle {
        flex: 0 0 auto;
        width: 32px;
        height: 4px;
        border-radius: 2px;
        background: var(--sk-border);
    }

    .standortkarte__panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        background: var(--sk-bg);
        border-top: 1px solid var(--sk-border);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
        transform: translateY(calc(100% - 52px));
        transition: transform 0.25s ease;
        max-height: 85vh;
        display: flex;
        flex-direction: column;
    }

    .standortkarte__panel[data-standortkarte-open] {
        transform: translateY(0);
    }

    .standortkarte__panel-head {
        margin-bottom: 0;
    }

    .standortkarte__panel-title,
    .standortkarte__sheet-close {
        display: none;
    }

    .standortkarte__panel[data-standortkarte-open] .standortkarte__panel-title,
    .standortkarte__panel[data-standortkarte-open] .standortkarte__sheet-close {
        display: block;
    }

    .standortkarte__panel[data-standortkarte-open] .standortkarte__mobile-toggle {
        display: none;
    }

    .standortkarte__sheet-close {
        flex: 0 0 auto;
        min-width: 44px;
        min-height: 44px;
        border: 0;
        background: transparent;
        font-size: 22px;
        line-height: 1;
        color: var(--sk-text);
        cursor: pointer;
    }

    .standortkarte__list {
        overflow-y: auto;
        padding-bottom: 16px;
    }
}

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