/* =============================================================================
   WORLD PAGE — Globe + Country Panel
   ============================================================================ */

:root {
    --globe-sphere-1: #1d1f23;
    --globe-sphere-2: #0e0f12;
    --globe-edge:     rgba(255,255,255,0.35);
    --globe-country:  rgba(255,255,255,0.10);
    --globe-country-hover: rgba(255,255,255,0.18);
    --globe-graticule: rgba(255,255,255,0.06);
    --globe-pin:      var(--accent, #FF7544);
    --globe-pin-active: #FFFFFF;
    --globe-arc:      rgba(255,255,255,0.35);
}
[data-theme="light"] {
    --globe-sphere-1: #f3eee8;
    --globe-sphere-2: #d9d1c4;
    --globe-edge:     rgba(40,40,50,0.30);
    --globe-country:  rgba(40,40,50,0.10);
    --globe-country-hover: rgba(40,40,50,0.20);
    --globe-graticule: rgba(40,40,50,0.05);
    --globe-pin:      var(--accent, #E8501F);
    --globe-pin-active: #1d1d1f;
    --globe-arc:      rgba(40,40,50,0.40);
}

/* Intro */
.world-intro {
    padding: clamp(60px, 12vh, 140px) var(--gutter) clamp(40px, 8vh, 80px);
    max-width: 1400px;
    margin: 0 auto;
}
.world-intro__inner { max-width: 760px; }
.world-intro__eyebrow {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 24px;
}
.world-intro__title {
    font-family: var(--display, var(--sans));
    font-weight: 700;
    font-size: clamp(40px, 6vw, 88px);
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--ink);
    margin: 0 0 24px;
}
.world-intro__sub {
    font-family: var(--display, var(--sans));
    font-size: clamp(16px, 1.4vw, 19px);
    line-height: 1.55;
    color: var(--ink-soft);
    margin: 0;
}

/* Two-column world layout */
.world {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: clamp(32px, 5vw, 80px);
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 var(--gutter) clamp(80px, 12vh, 160px);
    align-items: start;
}

/* Globe wrap (left column, sticky) */
.globe-wrap {
    position: sticky;
    top: 100px;
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}
.whirl {
    position: absolute;
    inset: -5%;
    pointer-events: none;
    opacity: 0.7;
}
.whirl svg { width: 100%; height: 100%; }
.whirl-ring.r1 { animation: whirl 38s linear infinite; transform-origin: center; }
.whirl-ring.r2 { animation: whirl 26s linear infinite reverse; transform-origin: center; }
@keyframes whirl { to { transform: rotate(360deg); } }

#globe-svg {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    touch-action: none;
}
#globe-svg:active { cursor: grabbing; }
#globe-svg .sphere-fill { fill: url(#sphereGrad); }
#globe-svg .sphere-edge {
    fill: none;
    stroke: var(--globe-edge);
    stroke-width: 0.5;
}
#globe-svg .graticule path {
    fill: none;
    stroke: var(--globe-graticule);
    stroke-width: 0.4;
}
#globe-svg .country {
    fill: var(--globe-country);
    stroke: none;
    transition: fill 0.2s ease;
}
#globe-svg .country.is-active { fill: var(--globe-country-hover); }
#globe-svg .pin {
    fill: var(--globe-pin);
    stroke: rgba(255,255,255,0.85);
    stroke-width: 0.5;
    cursor: pointer;
    transition: r 0.2s ease, fill 0.2s ease;
}
#globe-svg .pin.is-active {
    fill: var(--globe-pin-active);
    r: 3;
}
#globe-svg .pin-glow {
    fill: var(--globe-pin);
    opacity: 0.18;
    pointer-events: none;
}
#globe-svg .arc {
    fill: none;
    stroke: var(--globe-arc);
    stroke-width: 0.5;
    stroke-dasharray: 2 2;
    pointer-events: none;
}

/* Globe overlays */
.globe-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-mute);
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.globe-loading.is-hidden { opacity: 0; }
.globe-loading__spinner {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--rule);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.globe-hint {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-mute);
    pointer-events: none;
    transition: opacity 0.4s ease;
    white-space: nowrap;
}
.globe-hint.is-hidden { opacity: 0; }

.globe-recenter {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-elev);
    border: 0.5px solid var(--rule);
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    opacity: 0;
    pointer-events: none;
}
.globe-recenter.is-visible {
    opacity: 1;
    pointer-events: auto;
}
.globe-recenter:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.globe-recenter svg { width: 12px; height: 12px; }

/* Panel (right column) */
.panel {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 480px;
    scrollbar-width: thin;
}
.panel__placeholder {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 0;
}
.panel__placeholder-icon {
    width: 28px;
    height: 28px;
    color: var(--ink-mute);
    opacity: 0.5;
}
.panel__placeholder-text {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin: 0 0 8px;
    line-height: 1.6;
}
.panel__country-list {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 0.5px solid var(--rule);
}
.panel__country-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 0;
    border: none;
    border-bottom: 0.5px solid var(--rule);
    background: transparent;
    text-align: left;
    color: var(--ink);
    font-family: var(--display, var(--sans));
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: padding-left 0.25s var(--ease), color 0.2s;
}
.panel__country-btn:hover {
    padding-left: 12px;
    color: var(--accent);
}
.panel__country-flag {
    font-size: 22px;
    line-height: 1;
}
.panel__country-name { flex: 1; }
.panel__country-count {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--ink-mute);
    padding: 2px 8px;
    border: 0.5px solid var(--rule);
    border-radius: 999px;
}

/* Active panel state */
.panel__active { display: none; flex-direction: column; gap: 28px; padding: 24px 0; }
.panel.is-active .panel__placeholder { display: none; }
.panel.is-active .panel__active { display: flex; }

.panel__head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 20px;
    border-bottom: 0.5px solid var(--rule);
}
.panel__city {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-mute);
}
.panel__title {
    font-family: var(--display, var(--sans));
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 700;
    letter-spacing: -0.022em;
    line-height: 1.05;
    margin: 0;
    color: var(--ink);
}
.panel__caption {
    font-family: var(--display, var(--sans));
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink-soft);
    margin: 8px 0 0;
}

.panel__gallery { display: flex; flex-direction: column; gap: 12px; }
.panel__gallery:empty,
.panel__gallery.is-empty { display: none; }
.panel__section-label {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin: 0;
    font-weight: 500;
}
.panel__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}
.panel__grid img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    display: block;
    border-radius: 2px;
    cursor: pointer;
    transition: transform 0.4s var(--ease);
}
.panel__grid img:hover { transform: scale(1.02); }
.panel__grid--single { grid-template-columns: 1fr; }
.panel__grid--single img { aspect-ratio: 16 / 10; }

.panel__close {
    align-self: flex-start;
    padding: 10px 18px;
    background: transparent;
    border: 0.5px solid var(--rule);
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-soft);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.panel__close:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* Mobile: single column, globe on top */
@media (max-width: 900px) {
    .world {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .globe-wrap {
        position: relative;
        top: 0;
        max-width: 500px;
    }
    .panel {
        position: relative;
        top: 0;
        max-height: none;
        overflow-y: visible;
    }
    .world-intro {
        padding-top: clamp(40px, 8vh, 80px);
    }
    .world-intro__title {
        font-size: clamp(36px, 11vw, 56px);
    }
}
@media (max-width: 600px) {
    .globe-wrap {
        max-width: 100%;
    }
    .whirl { opacity: 0.4; }
    .panel__grid { grid-template-columns: repeat(2, 1fr); gap: 4px; }
}
