/* =========================================
   Font
   ========================================= */

.delegates-map-trigger,
.delegates-map-modal {
    font-family: "orpheuspro", serif;
}

/* =========================================
   Trigger Container - adapts to sibling height
   ========================================= */

.delegates-map-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 200px;
    box-sizing: border-box;
}

/* =========================================
   Button
   ========================================= */

.delegates-map-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 30px;
    background: #db331a;
    color: #fff;
    border: 1px solid #e53b22;
    border-radius: 40px;
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    line-height: 17px;
    cursor: pointer;
    box-shadow: none;
    transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}

.delegates-map-button:hover {
    background: #f9c1a3;
    color: #060108;
    border-color: #f9c1a3;
}

.delegates-map-button:active {
    background: #f9c1a3;
    color: #060108;
    border-color: #f9c1a3;
}

.delegates-map-button__icon {
    display: flex;
    flex-shrink: 0;
}

/* =========================================
   Overlay + Modal (shared)
   ========================================= */

.delegates-map-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s ease;
    background: rgba(0, 0, 0, 0);
    transition: visibility 0.3s, opacity 0.3s ease, background 0.3s ease;
}

.delegates-map-overlay.is-active {
    visibility: visible;
    opacity: 1;
    background: rgba(0, 0, 0, 0.6);
}

/* =========================================
   Modal - Desktop (centered, wide landscape)
   ========================================= */

.delegates-map-modal {
    width: 96vw;
    max-width: 1600px;
    height: 75vh;
    background: #fff;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1),
                opacity 0.3s ease;
}

.delegates-map-overlay.is-active .delegates-map-modal {
    transform: scale(1);
    opacity: 1;
}

/* =========================================
   Modal Header
   ========================================= */

.delegates-map-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.delegates-map-modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 400;
    color: #1a1a1a;
}

.delegates-map-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: 0;
    cursor: pointer;
    color: #000;
    transition: opacity 0.15s ease;
}

.delegates-map-modal__close:hover {
    opacity: 0.6;
}

/* =========================================
   Modal Body / Map
   ========================================= */

.delegates-map-modal__body {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#delegates-leaflet-map {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}

/* =========================================
   Popup styling
   ========================================= */

.leaflet-popup-content-wrapper {
    border-radius: 0 !important;
}

.delegate-popup {
    min-width: 180px;
    text-align: center;
    font-family: "orpheuspro", serif;
}

.delegate-popup .delegate-popup__title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 400;
    color: #1a1a1a;
}

.delegate-popup p {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 400;
    color: #4b5563;
    line-height: 1.5;
}

.delegate-popup a {
    color: #2d6a4f;
    text-decoration: none;
}

.delegate-popup a:hover {
    text-decoration: underline;
}

/* =========================================
   Mobile - Bottom sheet slide-up
   ========================================= */

@media (max-width: 768px) {
    .delegates-map-overlay {
        align-items: flex-end;
    }

    .delegates-map-modal {
        width: 100%;
        max-width: 100%;
        height: 92vh;
        border-radius: 0;
        transform: none;
        opacity: 1;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    }

    .delegates-map-overlay.is-active .delegates-map-modal {
        transform: translateY(0);
        opacity: 1;
    }

    .delegates-map-modal__header {
        padding: 12px 16px;
    }

    .delegates-map-modal__header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background: #d1d5db;
        border-radius: 2px;
    }

    .delegates-map-button {
        padding: 14px 24px;
        font-size: 15px;
    }
}
