/* ── Toolbar ──────────────────────────────────────────────────── */
.map-toolbar {
    padding: 8px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    background: #1a1a1a;
    border-bottom: 1px solid rgba(201,168,76,0.25);
}

/* ── Search autocomplete ──────────────────────────────────────── */
.map-search-wrap {
    position: relative;
    flex: 0 0 auto;
}
.map-search-input {
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.06);
    color: #e0e0e0;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1.4;
    font-family: inherit;
    width: 180px;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}
.map-search-input::placeholder { color: #555; }
.map-search-input:focus {
    border-color: rgba(201,168,76,0.6);
    background: rgba(255,255,255,0.1);
    border-radius: 10px 10px 0 0;
}
.map-search-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 260px;
    background: #1e1e1e;
    border: 1px solid rgba(201,168,76,0.3);
    border-top: none;
    border-radius: 0 0 10px 10px;
    z-index: 9999;
    max-height: 280px;
    overflow-y: auto;
}
.map-search-suggestion {
    display: flex;
    flex-direction: column;
    padding: 8px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.1s;
}
.map-search-suggestion:last-child { border-bottom: none; }
.map-search-suggestion:hover { background: rgba(201,168,76,0.1); }
.map-search-suggestion__name { font-size: 13px; color: #e8e8e8; line-height: 1.3; }
.map-search-suggestion__meta { font-size: 11px; color: #666; margin-top: 2px; }

/* ── Dropdowns ────────────────────────────────────────────────── */
.map-category-select {
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.06);
    color: #e0e0e0;
    padding: 5px 30px 5px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.4;
    font-family: inherit;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    transition: border-color 0.15s;
}
.map-category-select:focus,
.map-category-select:hover { border-color: rgba(201,168,76,0.6); }
.map-category-select option { background: #1a1a1a; color: #e0e0e0; }

/* ── Map + List layout ────────────────────────────────────────── */
.map-layout {
    display: flex;
    height: 650px;    /* taller on desktop */
    position: relative;
}
#map { flex: 1 1 auto; min-width: 0; }

/* ── Scroll interaction overlay ───────────────────────────────── */
.map-interact-overlay {
    position: absolute;
    inset: 0;
    z-index: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.18);
    pointer-events: all;
    transition: opacity 0.25s;
    cursor: pointer;
}
.map-interact-overlay span {
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 13px;
    padding: 8px 18px;
    border-radius: 999px;
    pointer-events: none;
    font-family: sans-serif;
}
.map-interact-overlay--hidden {
    opacity: 0;
    pointer-events: none;
}

/* ── Fullscreen link button ───────────────────────────────────── */
.map-fullscreen-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}
.map-fullscreen-btn:hover {
    background: #f0f0f0;
    color: #111;
}

/* ── Studio name labels (zoom ≥ 15) ──────────────────────────── */
.leaflet-tooltip.studio-label {
    display: none;
    background: rgba(0,0,0,0.55);
    border: none;
    border-radius: 3px;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    white-space: nowrap;
    box-shadow: none;
    pointer-events: none;
}
.leaflet-tooltip.studio-label::before { display: none; }
#map.map--show-labels .leaflet-tooltip.studio-label { display: block; }

/* ── Studio list ──────────────────────────────────────────────── */
#studio-list {
    width: 280px;
    flex: 0 0 280px;
    overflow-y: auto;
    background: #111;
    border-left: 1px solid rgba(201,168,76,0.2);
}
#studio-list::-webkit-scrollbar { width: 4px; }
#studio-list::-webkit-scrollbar-track { background: #111; }
#studio-list::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

.studio-list__item {
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    transition: background 0.12s;
    min-height: 58px;
}
.studio-list__item:hover    { background: rgba(255,255,255,0.04); }
.studio-list__item.is-active { background: rgba(201,168,76,0.12); }

.studio-list__thumb {
    flex: 0 0 46px;
    width: 46px;
    border-radius: 4px;
    object-fit: cover;
    display: block;
    align-self: stretch;
    background: #222;
}
.studio-list__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 0;
}
.studio-list__name {
    font-size: 12px;
    color: #e8e8e8;
    line-height: 1.3;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.studio-list__meta { font-size: 11px; color: #666; line-height: 1.3; }
.studio-list__empty { padding: 16px 14px; font-size: 13px; color: #555; margin: 0; }

/* ── Popup ────────────────────────────────────────────────────── */
.popup-studio {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    min-width: 200px;
    max-width: 280px;
}
/* Reduce Leaflet's default popup padding so thumbnail fills ~90% */
.leaflet-popup-content { margin: 6px 10px !important; }

.popup-thumb {
    flex: 0 0 90px;
    width: 90px;
    height: 90px;
    border-radius: 5px;
    object-fit: cover;
    background: #eee;
    display: block;
}
.popup-info { font-size: 13px; line-height: 1.6; padding-top: 2px; }
.popup-info strong { display: block; margin-bottom: 4px; font-size: 14px; }
.popup-styles {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #888;
    margin-bottom: 4px;
    line-height: 1.4;
}
.popup-address {
    display: block;
    font-size: 12px;
    color: #555;
    margin-bottom: 5px;
    line-height: 1.4;
}
.popup-info a { color: #C9A84C; text-decoration: none; font-size: 12px; }
.popup-info a:hover { text-decoration: underline; }

/* ── Dance-style page embed ───────────────────────────────────── */
.style-map-wrapper {
    margin: 2rem 0 2.5rem;
}
.style-map-wrapper .map-layout {
    height: 580px;
}

@media (max-width: 768px) {
    .style-map-wrapper {
        /* Break out of .style-article padding (0 1.5rem on mobile) */
        margin-left:  -1.5rem;
        margin-right: -1.5rem;
        margin-top:   1.5rem;
        margin-bottom: 2rem;
    }
    .style-map-wrapper .map-layout {
        height: 72vw;
        min-height: 280px;
    }
}

/* ── Fullscreen overrides (map-module standalone page) ───────── */
.map-layout--fullscreen #studio-list {
    width: 340px;
    flex: 0 0 340px;
}
.map-layout--fullscreen .studio-list__item {
    padding: 12px 14px;
    min-height: 76px;
    gap: 12px;
}
.map-layout--fullscreen .studio-list__thumb {
    flex: 0 0 62px;
    width: 62px;
}
.map-layout--fullscreen .studio-list__name {
    font-size: 13px;
    white-space: normal;     /* allow wrapping on wider panel */
}
.map-layout--fullscreen .studio-list__meta {
    font-size: 12px;
    color: #777;
}

/* ── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .map-layout {
        flex-direction: column;
        height: auto;
    }
    #map {
        height: 75vw;
        min-height: 300px;
    }
    #studio-list { display: none; }        /* no space on mobile */

    .map-toolbar {
        padding: 6px 8px;
        gap: 6px;
    }
    .map-search-input { width: 130px; }
    .map-category-select { font-size: 12px; padding: 4px 26px 4px 10px; }

    /* Remove any side margins from parent section on mobile */
    .map-section__embed { padding: 0 !important; margin: 0 !important; }
}
