/* ===== Интерактивная карта Леониды ===== */

.map-page {
    margin: 0;
    padding: 0;
    background: #05090d;
    color: var(--white, #fff);
    font-family: 'Helvetica Neue', Arial, sans-serif;
    overflow-x: hidden;
}

.map-main {
    margin: 0;
    padding: 0;
}

/* ---------- Сцена: карта на весь экран ---------- */

.map-stage {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: #05090d;
    isolation: isolate;
}

/* размытая копия карты закрывает поля по бокам, когда штат виден целиком */
.map-stage::before {
    content: '';
    position: absolute;
    inset: -60px;
    z-index: 0;
    background-image: var(--stage-bg);
    background-size: cover;
    background-position: center;
    filter: blur(30px) brightness(0.45) saturate(1.15);
    opacity: 0.9;
}

.map-stage-map {
    position: absolute;
    inset: 0;
    z-index: 1;
}

#leonidaMap {
    position: absolute;
    inset: 0;
    background: transparent;
    outline: none;
}

.map-stage .leaflet-container {
    background: transparent;
    font: inherit;
    color: inherit;
}

.map-stage .leaflet-image-layer {
    image-rendering: auto;
    border-radius: 12px;
    box-shadow: 0 34px 110px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* лёгкая вигнетка по краям, чтобы карта «садилась» в тёмный фон */
.map-stage::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    box-shadow: inset 0 0 140px 30px rgba(5, 9, 13, 0.55);
}

/* ---------- Панель слева ---------- */

.map-panel {
    position: absolute;
    left: 20px;
    top: calc(var(--map-top, 88px) + 16px);
    bottom: 20px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    width: 340px;
    max-width: calc(100% - 40px);
    background: rgba(8, 11, 14, 0.84);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.map-panel-head {
    padding: 18px 18px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.map-eyebrow {
    color: var(--neon-cyan, #00f5ff);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.map-title {
    margin: 0.35rem 0 0.4rem;
    color: var(--white, #fff);
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.map-lead {
    margin: 0 0 14px;
    max-width: 280px;
    color: var(--grey-text, #b0b0b0);
    font-size: 0.84rem;
    line-height: 1.45;
}

.map-search {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0 0.75rem;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 8px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.map-search:focus-within {
    border-color: var(--neon-cyan, #00f5ff);
    background: rgba(0, 245, 255, 0.05);
}

.map-search svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    stroke: #7d8790;
}

.map-search input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    outline: none;
    color: var(--white, #fff);
    font: inherit;
    font-size: 0.86rem;
}

.map-search input::placeholder {
    color: #6c757d;
}

.map-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.map-chip {
    padding: 5px 10px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    color: var(--grey-text, #b0b0b0);
    font: inherit;
    font-size: 0.74rem;
    line-height: 1.2;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.map-chip:hover {
    color: var(--white, #fff);
    border-color: rgba(255, 255, 255, 0.3);
}

.map-chip.is-active {
    background: var(--neon-cyan, #00f5ff);
    border-color: var(--neon-cyan, #00f5ff);
    color: #04121a;
    font-weight: 700;
}

/* ---------- Список точек ---------- */

.map-list {
    flex: 1;
    min-height: 0;
    margin: 0;
    padding: 8px;
    overflow-y: auto;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.map-list::-webkit-scrollbar {
    width: 6px;
}

.map-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 3px;
}

.map-list li {
    margin: 0;
}

.map-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--white, #fff);
    font: inherit;
    font-size: 0.88rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.map-item[hidden] {
    display: none;
}

.map-item:hover,
.map-item:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

.map-item.is-active {
    background: rgba(0, 245, 255, 0.10);
}

.map-item-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

.map-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-item small {
    flex: 0 0 auto;
    color: #7d8790;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.map-empty {
    margin: 0;
    padding: 6px 18px 14px;
    color: #7d8790;
    font-size: 0.82rem;
}

.map-panel-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    color: #6c757d;
    font-size: 0.68rem;
    line-height: 1.3;
}

.map-credit {
    text-align: right;
}

/* ---------- Кластеры ---------- */

.lm-cluster {
    background: transparent;
    border: 0;
}

.lm-cluster span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(0, 245, 255, 0.20), rgba(6, 16, 22, 0.74) 72%);
    border: 1px solid rgba(0, 245, 255, 0.55);
    box-shadow: 0 0 12px rgba(0, 245, 255, 0.22);
    color: #dffbff;
    font: 700 0.72rem/1 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.02em;
}

.lm-cluster:hover span {
    border-color: #fff;
    box-shadow: 0 0 24px rgba(0, 245, 255, 0.55), inset 0 0 14px rgba(0, 245, 255, 0.2);
}

/* ---------- Маркеры ---------- */

.lm-marker {
    background: transparent;
    border: 0;
}

.lm-marker > span:first-child {
    display: block;
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 12px 2px currentColor, 0 2px 6px rgba(0, 0, 0, 0.5);
    transition: transform 0.18s ease;
}

.lm-marker:hover > span:first-child,
.lm-marker.is-active > span:first-child {
    transform: scale(1.35);
}

.lm-label {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    padding: 3px 7px;
    background: rgba(5, 9, 13, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 5px;
    color: #fff;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.72rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.lm-marker:hover .lm-label,
.lm-marker.is-active .lm-label {
    opacity: 1;
}

/* ---------- Попап ---------- */

.leaflet-popup-content-wrapper {
    background: #0f1418;
    border: 1px solid rgba(0, 245, 255, 0.35);
    border-radius: 10px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6);
    color: #fff;
}

.leaflet-popup-tip {
    background: #0f1418;
    border: 1px solid rgba(0, 245, 255, 0.35);
}

.leaflet-popup-content {
    width: 200px !important;
    margin: 12px 14px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.4;
}

.leaflet-popup {
    max-width: 240px;
}

.leaflet-container a.leaflet-popup-close-button {
    color: #7d8790;
    padding: 6px 8px 0 0;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: #fff;
}

.map-pop-title {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
}

.map-pop-type {
    margin: 2px 0 6px;
    color: var(--neon-cyan, #00f5ff);
    font-size: 0.64rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.map-pop-text {
    color: #b0b0b0;
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.map-pop-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--neon-cyan, #00f5ff);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
}

.map-pop-link:hover,
.map-pop-link:focus-visible {
    color: #fff;
    outline: none;
}

/* ---------- Управление ---------- */

.map-zoom {
    position: absolute;
    right: 20px;
    top: calc(var(--map-top, 88px) + 16px);
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.map-zoom button {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(8, 11, 14, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #fff;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.map-zoom button svg {
    width: 17px;
    height: 17px;
}

.map-zoom button:hover {
    border-color: var(--neon-cyan, #00f5ff);
    color: var(--neon-cyan, #00f5ff);
}

.map-hint {
    position: absolute;
    left: calc(50% + 170px);
    bottom: 22px;
    z-index: 400;
    transform: translateX(-50%);
    padding: 7px 14px;
    background: rgba(8, 11, 14, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: #9aa4ad;
    font-size: 0.74rem;
    white-space: nowrap;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.map-hint.is-hidden {
    opacity: 0;
    visibility: hidden;
}

/* ---------- Доступность ---------- */

.map-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.map-credit a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.map-credit a:hover,
.map-credit a:focus-visible {
    color: var(--white, #fff);
    border-bottom-color: currentColor;
}

/* ---------- Планшеты ---------- */

@media (max-width: 1100px) {
    .map-panel {
        width: 300px;
    }

    .map-hint {
        left: calc(50% + 150px);
    }
}

/* ---------- Телефоны: панель уходит вниз ---------- */

@media (max-width: 860px) {
    .map-panel {
        left: 8px;
        right: 8px;
        bottom: 8px;
        top: auto;
        width: auto;
        max-height: 44vh;
        /* страховка от горизонтального выезда на очень узких экранах */
        max-width: calc(100vw - 16px);
    }

    .map-panel-head {
        padding: 12px 14px 10px;
    }

    .map-title {
        font-size: 1.45rem;
        margin: 0.2rem 0;
    }

    .map-lead {
        display: none;
    }

    .map-search {
        height: 36px;
    }

    .map-item small {
        display: none;
    }

    .map-zoom {
        top: calc(var(--map-top, 64px) + 10px);
        right: 10px;
    }

    .map-hint {
        display: none;
    }
}

@media (max-width: 560px) {
    .map-panel {
        max-height: 44vh;
    }

    .map-chips {
        gap: 4px;
    }

    .map-chip {
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    .map-panel-foot {
        padding: 8px 14px;
    }

    .map-credit {
        display: none;
    }
}

/* ============================================
   Текстовый блок под картой (внутренняя перелинковка)
   ============================================ */

.map-about {
    max-width: 980px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

.map-about__title {
    margin: 0 0 1.2rem;
    color: #fff;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.map-about p {
    margin: 0 0 1rem;
    color: var(--grey-text, #b0b0b0);
    font-size: 1.02rem;
    line-height: 1.75;
}

.map-about a {
    color: var(--neon-cyan, #00f5ff);
    text-decoration: underline;
    text-decoration-color: rgba(0, 245, 255, 0.4);
    text-underline-offset: 3px;
}

.map-about a:hover {
    color: var(--neon-pink, #ff006e);
    text-decoration-color: rgba(255, 0, 110, 0.6);
}

.map-about a:focus-visible {
    outline: 2px solid var(--neon-cyan, #00f5ff);
    outline-offset: 3px;
}

@media (max-width: 720px) {
    .map-about {
        padding: 2rem 1.1rem 3rem;
    }

    .map-about__title {
        font-size: 1.25rem;
    }

    .map-about p {
        font-size: 0.96rem;
        line-height: 1.65;
    }
}