/* Whole Earth Map — Country Explorer
   Production map + progressive city layer
*/

/* =========================================================
   Country explorer map
   ========================================================= */

.country-map-explorer {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #08151a;
    box-shadow:
        0 24px 70px rgba(0, 0, 0, .18),
        inset 0 1px 0 rgba(255, 255, 255, .025);
}

.country-map-explorer #map {
    width: 100%;
    height: min(72vh, 700px);
    min-height: 440px;
    background:
        radial-gradient(
            circle at 50% 45%,
            #10252b 0%,
            #08151a 58%,
            #061015 100%
        );
}

.country-map-explorer .leaflet-container {
    background: transparent;
    font-family: inherit;
}

/* =========================================================
   Map title / hint
   ========================================================= */

.country-map-explorer .map-title {
    position: absolute;
    z-index: 500;
    top: 18px;
    left: 70px;
    padding: 9px 12px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 10px;
    background: rgba(5,13,17,.78);
    backdrop-filter: blur(12px);
    color: #edf5f5;
    font-size: 12px;
    font-weight: 650;
    pointer-events: none;
}

.country-map-explorer .map-hint {
    position: absolute;
    z-index: 500;
    right: 16px;
    top: 16px;
    left: auto;
    transform: none;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 999px;
    background: rgba(5,13,17,.72);
    backdrop-filter: blur(12px);
    color: #9daeb3;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
}

/* =========================================================
   Leaflet controls
   ========================================================= */

.country-map-explorer .leaflet-control-zoom {
    border: 1px solid rgba(255,255,255,.12) !important;
    border-radius: 10px !important;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

.country-map-explorer .leaflet-control-zoom a {
    width: 34px !important;
    height: 34px !important;
    line-height: 32px !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    background: rgba(8,18,23,.90) !important;
    color: #dce7e9 !important;
}

.country-map-explorer .leaflet-control-zoom a:last-child {
    border-bottom: 0 !important;
}

.country-map-explorer .leaflet-control-zoom a:hover {
    background: rgba(19,39,46,.96) !important;
}

.country-map-explorer .leaflet-control-attribution {
    background: rgba(5,13,17,.72) !important;
    color: #708187 !important;
    font-size: 9px;
}

.country-map-explorer .leaflet-control-attribution a {
    color: #91aaa9 !important;
}

/* =========================================================
   Progressive city canvas
   ========================================================= */

.country-map-explorer .city-canvas {
    pointer-events: none;
    z-index: 450;
}

/* =========================================================
   City information card
   ========================================================= */

.country-map-explorer .city-info {
    position: absolute;
    z-index: 600;
    left: 18px;
    bottom: 18px;
    width: min(280px, calc(100% - 36px));
    padding: 18px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
    background: rgba(6,16,21,.94);
    backdrop-filter: blur(16px);
    box-shadow: 0 14px 40px rgba(0,0,0,.35);
}

.country-map-explorer .city-info__close {
    position: absolute;
    top: 9px;
    right: 10px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    color: #c8d4d7;
    font-size: 20px;
    line-height: 28px;
    cursor: pointer;
}

.country-map-explorer .city-info__eyebrow {
    margin-bottom: 5px;
    color: #7f9b9f;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.country-map-explorer .city-info__name {
    padding-right: 30px;
    color: #f3f7f8;
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -.025em;
}

.country-map-explorer .city-info__location {
    margin-top: 3px;
    color: #91a2a7;
    font-size: 12px;
}

.country-map-explorer .city-info__population-label {
    margin-top: 15px;
    color: #77898e;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.country-map-explorer .city-info__population {
    margin-top: 3px;
    color: #f3f7f8;
    font-size: 18px;
    font-weight: 700;
}

.country-map-explorer .city-info__link {
    display: inline-block;
    margin-top: 13px;
    color: #8fc5bd;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.country-map-explorer .city-info__link:hover {
    text-decoration: underline;
}

/* =========================================================
   Light theme
   ========================================================= */

html[data-theme="light"] .country-map-explorer .city-info {
    background: rgba(255,255,255,.95);
    border-color: #d7e0e3;
}

html[data-theme="light"] .country-map-explorer .city-info__name,
html[data-theme="light"] .country-map-explorer .city-info__population {
    color: #172126;
}

html[data-theme="light"] .country-map-explorer .city-info__location,
html[data-theme="light"] .country-map-explorer .city-info__population-label {
    color: #66777d;
}

html[data-theme="light"] .country-map-explorer .city-info__close {
    background: #edf2f4;
    color: #33454c;
}

/* =========================================================
   Light theme — map explorer
   ========================================================= */

html[data-theme="light"] .country-map-explorer {
    background: #f5f8f9;
    box-shadow:
        0 24px 70px rgba(15, 35, 42, .10),
        inset 0 1px 0 rgba(255,255,255,.8);
}

html[data-theme="light"] .country-map-explorer #map {
    background:
        radial-gradient(
            circle at 50% 45%,
            #eef4f5 0%,
            #e5edef 58%,
            #dce6e9 100%
        );
}

html[data-theme="light"] .country-map-explorer .map-title {
    border-color: rgba(20,40,48,.10);
    background: rgba(255,255,255,.88);
    color: #172126;
}

html[data-theme="light"] .country-map-explorer .map-hint {
    border-color: rgba(20,40,48,.10);
    background: rgba(255,255,255,.88);
    color: #53666d;
}

html[data-theme="light"] .country-map-explorer .leaflet-control-zoom {
    border-color: rgba(20,40,48,.12) !important;
    box-shadow: 0 8px 24px rgba(15,35,42,.14);
}

html[data-theme="light"] .country-map-explorer .leaflet-control-zoom a {
    border-bottom-color: rgba(20,40,48,.10) !important;
    background: rgba(255,255,255,.94) !important;
    color: #33454c !important;
}

html[data-theme="light"] .country-map-explorer .leaflet-control-zoom a:hover {
    background: #edf2f4 !important;
}

html[data-theme="light"] .country-map-explorer .leaflet-control-attribution {
    background: rgba(255,255,255,.82) !important;
    color: #687a81 !important;
}

html[data-theme="light"] .country-map-explorer .leaflet-control-attribution a {
    color: #4f7775 !important;
}

html[data-theme="light"] .country-map-explorer .city-info {
    box-shadow: 0 14px 40px rgba(15,35,42,.16);
}

html[data-theme="light"] .country-map-explorer .city-info__close {
    background: #edf2f4;
    color: #33454c;
}

html[data-theme="light"] .country-map-explorer .city-info__eyebrow {
    color: #63777d;
}

html[data-theme="light"] .country-map-explorer .city-info__link {
    color: #397b76;
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 800px) {
    .country-map-explorer #map {
        height: 68vh;
        min-height: 420px;
    }

    .country-map-explorer {
        border-radius: 16px;
    }

    .country-map-explorer .map-title {
        top: 12px;
        left: 70px;
    }

    .country-map-explorer .map-hint {
        top: 12px;
        max-width: calc(100% - 24px);
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .country-map-explorer .city-info {
        left: 12px;
        bottom: 12px;
        width: calc(100% - 24px);
    }
}

@media (max-width: 480px) {
    .country-map-explorer #map {
        min-height: 400px;
    }
}
