/**
 * STANDORT SECTION - FULLWIDTH MAP LAYOUT
 * Desktop: Karte als Fullwidth-Hintergrund, Content schwebt darüber
 * Mobile: Karte unter dem Text
 */

/* ===== SECTION CONTAINER ===== */
.standort-fullwidth-section {
    position: relative;
    overflow: visible;
    background: transparent;
    display: flex;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .standort-fullwidth-section {
        display: block; /* Kein Flex auf Desktop */
        margin-top: -170px; /* Näher an Ganztag-Sektion */
    }
}

/* ===== MAP CONTAINER ===== */
.standort-map-background {
    /* Mobile: Block am Ende der Section */
    position: relative;
    order: 2; /* Nach dem Content */
    width: calc(100% - 2 * var(--container-padding-mobile));
    margin: var(--space-sm) auto 44px; /* Näher an Buttons, mehr Abstand unten */
    min-height: 500px; /* Mobile: doppelte Höhe */
    border-radius: 6px;
    overflow: hidden;
}

.standort-map-background #location-map {
    width: 100%;
    height: 100%;
    min-height: 500px; /* Mobile: doppelte Höhe */
}

@media (min-width: 700px) {
    .standort-map-background {
        width: calc(100% - 2 * var(--container-padding-tablet));
        min-height: 300px; /* Tablet: moderat */
    }

    .standort-map-background #location-map {
        min-height: 300px;
    }
}

/* Desktop: Fullwidth Background */
@media (min-width: 1024px) {
    .standort-map-background {
        position: absolute;
        top: -70px; /* Extend UP to cover top divider */
        left: 0;
        right: 0;
        bottom: -70px; /* Extend DOWN to cover bottom divider */
        width: 100%;
        margin: 0;
        border-radius: 0;
        min-height: auto;
        order: unset;
        z-index: 1;
    }

    .standort-map-background #location-map {
        min-height: auto;
        height: 100%;
    }
}

/* ===== CONTENT OVERLAY ===== */
.standort-content-overlay {
    position: relative;
    z-index: 10;
    order: 1; /* Vor der Karte auf Mobile */
    display: flex;
    flex-direction: column;
    padding-top: var(--space-md); /* Mobile: Abstand nach Divider */
    padding-bottom: var(--space-sm);
}

@media (min-width: 1024px) {
    .standort-content-overlay {
        align-items: flex-start;
        justify-content: center;
        padding-top: var(--space-2xl);
        padding-bottom: 0; /* Kartensektion kürzer */
        order: unset;
        pointer-events: none; /* Klicks zur Karte durchlassen */
    }

    .standort-content-box {
        pointer-events: auto; /* Content-Box bleibt klickbar */
    }
}

/* ===== CONTENT BOX ===== */
.standort-content-box {
    display: flex;
    flex-direction: column;
    background: #141B4D;
    padding: var(--space-sm); /* Mobile: kompaktes Padding (16px) */
    border-radius: 6px;
}

@media (min-width: 768px) {
    .standort-content-box {
        padding: var(--space-xl); /* Tablet+: mehr Padding */
    }
}

@media (min-width: 1024px) {
    .standort-content-box {
        position: relative;
        z-index: 10;
        max-width: 520px;
        min-height: 360px; /* 450px - 90px = 360px */
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
}

/* ===== TYPOGRAPHY ===== */
.standort-title {
    color: white;
    margin-bottom: 0.25rem;
}

.standort-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.25rem;
    margin: 0;
}

.standort-text {
    color: rgba(255, 255, 255, 0.9);
}

/* Desktop: Dunkle Texte auf hellem Glaseffekt */
@media (min-width: 1024px) {
    .standort-title {
        color: var(--penn-blue);
    }

    .standort-subtitle {
        color: #737373;
    }

    .standort-text {
        color: #4a4a4a;
    }
}

/* ===== DIVIDER HANDLING ===== */
/* Transform statt negative Margins - beeinflusst nicht den Dokumentfluss */
/* Die Karte erstreckt sich über die Section-Grenzen hinaus (top/bottom: -140px) */
.standort-divider-top,
.standort-divider-bottom {
    position: relative;
    z-index: 5;
}

/* Top-Divider: Position relativ zur Karte */
.standort-divider-top {
    transform: translateY(-101px); /* 1px extra Overlap gegen Sub-Pixel-Gap (iPad Air) */
}

/* Bottom-Divider: IN die Karte schieben (nach oben = negativ) */
.standort-divider-bottom {
    transform: translateY(-30px);
}

.standort-divider-top svg,
.standort-divider-bottom svg {
    height: 140px; /* Feste Höhe für konsistente Überlappung */
}

/* Desktop: Divider transparent (Karte scheint durch) */
@media (min-width: 1024px) {
    .standort-divider-fill {
        fill: transparent !important;
    }
}

/* Mobile: Divider blau (passend zum Content-Box Hintergrund) */
@media (max-width: 1023px) {
    .standort-divider-fill {
        fill: #141B4D !important;
    }

    /* Mobile: Divider leicht nach oben */
    .standort-divider-top {
        transform: translateY(-2px);
    }

    .standort-divider-bottom {
        transform: translateY(-2px);
    }

    /* Mobile: Divider flach aber proportional */
    .standort-divider-top svg,
    .standort-divider-bottom svg {
        height: 40px !important;
        min-height: 40px !important;
    }

    /* Mobile: Section bekommt blauen Hintergrund */
    .standort-fullwidth-section {
        background: #141B4D;
        padding-bottom: 20px; /* 32px - 12px */
        /* Kein margin-top - Divider regelt den Übergang */
    }

    /* Mobile: Buttons müssen hell sein (auf blauem Hintergrund) */
    .standort-content-box .transport-btn,
    .standort-content-box .time-btn {
        background: transparent;
        border-color: rgba(255, 255, 255, 0.5);
        color: white;
    }

    .standort-content-box .transport-btn:hover,
    .standort-content-box .time-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: white;
    }

    .standort-content-box .transport-btn.active,
    .standort-content-box .time-btn.active {
        background: white;
        border-color: white;
        color: var(--penn-blue);
    }

    .standort-content-box .standort-link {
        color: white !important;
        text-decoration-color: rgba(255, 255, 255, 0.5);
    }

    .standort-content-box .standort-link:hover {
        color: var(--old-gold) !important;
        text-decoration-color: var(--old-gold);
    }
}

/* ===== ZOOM CONTROLS POSITIONING ===== */
/* Desktop: Zoom-Buttons neben der Textbox */
@media (min-width: 1024px) {
    .standort-map-background .leaflet-bottom.leaflet-left {
        /* Position: Container-Padding (5vw) + Textbox (520px) - 60px Korrektur */
        left: calc(5vw + 480px) !important;
        bottom: 45% !important; /* Vertikal zentriert neben Textbox */
    }

    .standort-map-background .leaflet-control-zoom.leaflet-bar {
        border: none;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
        border-radius: 8px;
        overflow: hidden;
    }

    .standort-map-background .leaflet-control-zoom.leaflet-bar a {
        background: rgba(255, 255, 255, 0.92) !important;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: none !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
        color: var(--penn-blue) !important;
        width: 40px !important;
        height: 40px !important;
        line-height: 40px !important;
        font-size: 20px;
    }

    .standort-map-background .leaflet-control-zoom.leaflet-bar a:last-child {
        border-bottom: none !important;
    }

    .standort-map-background .leaflet-control-zoom.leaflet-bar a:hover {
        background: white !important;
        color: var(--penn-blue) !important;
    }
}

/* Mobile: Zoom-Buttons sichtbar lassen (nicht jeder kennt Pinch-to-Zoom) */

/* ===== BUTTON OVERRIDES (für hellen Hintergrund auf Desktop) ===== */
@media (min-width: 1024px) {
    .standort-content-box .transport-btn,
    .standort-content-box .time-btn {
        background: white;
        border: 1px solid #e0e0e0;
        color: var(--penn-blue);
    }

    .standort-content-box .transport-btn:hover,
    .standort-content-box .time-btn:hover {
        background: #f5f5f5;
        border-color: var(--penn-blue);
    }

    .standort-content-box .transport-btn.active,
    .standort-content-box .time-btn.active {
        background: var(--penn-blue);
        border-color: var(--penn-blue);
        color: white;
    }
}

/* ===== EXTERNE LINKS IM TEXT ===== */
.standort-link {
    color: var(--penn-blue);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.standort-link:hover {
    color: var(--old-gold);
    text-decoration-color: var(--old-gold);
}
