/* ═══════════════════════════════════════════════════════════════════════════
   MOROCCO INVESTOR HUB  v4.0.0  — Minimal clean investor map
   Shortcode: [morocco_map]
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Outer wrapper ───────────────────────────────────────────────────────── */
.mih-wrap {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    box-sizing: border-box;
}
.mih-wrap *,
.mih-wrap *::before,
.mih-wrap *::after { box-sizing: inherit; }

/* ── Map stage ───────────────────────────────────────────────────────────── */
.mih-stage {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.10);
    isolation: isolate;
    /* Soft background that matches the basemap */
    background: #eaf3f7;
}

/* ── Normalize embedded ONHYM wrapper ───────────────────────────────────── */
.mih-stage .onhym-map-wrapper {
    width: 100% !important;
    display: block !important;
    border-radius: 0 !important;
    background:  transparent !important;
    box-shadow:  none !important;
    border:      none !important;
    overflow:    hidden !important;
}
.mih-stage .onhym-map-container,
.mih-stage .mapboxgl-map,
.mih-stage .mapboxgl-canvas-container,
.mih-stage .mapboxgl-canvas {
    border-radius: 0 !important;
}

/* Hide ALL ONHYM visual noise — we are in investor mode */
.mih-stage .onhym-mobile-map-btn,
.mih-stage .onhym-topbar,
.mih-stage .onhym-legend-panel,
.mih-stage .onhym-cluster-carousel,
.mih-stage .onhym-esc-hint,
.mih-stage .onhym-marker,
.mih-stage .mapboxgl-popup,
.mih-stage .mapboxgl-ctrl-bottom-left,
.mih-stage .mapboxgl-ctrl-bottom-right,
.mih-stage .mapboxgl-ctrl-top-left,
.mih-stage .mapboxgl-ctrl-top-right { display: none !important; }

/* ── Infrastructure markers (Ports / Airports / Industrial / etc.) ─────── */
.mih-stage .mapboxgl-marker:has(.mih-infra-marker) { display: block !important; z-index: 5; }
.mih-infra-marker {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
    will-change: transform;   /* GPU-composite the hover animation */
}
.mih-infra-marker:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 10px rgba(15, 23, 42, .35);
}
.mih-infra-marker svg { width: 14px; height: 14px; display: block; }

/* ── Fullscreen toggle button ────────────────────────────────────── */
.mih-btn-fullscreen {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 20;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .10);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    color: #374151;
    transition: background .15s ease, box-shadow .15s ease, color .15s ease;
    pointer-events: auto;
}
.mih-btn-fullscreen:hover {
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .15);
    color: #0f766e;
}
.mih-btn-fullscreen svg { width: 16px; height: 16px; display: block; }

/* Show/hide expand ⇔ collapse icon */
.mih-btn-fullscreen .mih-btn-fs-collapse { display: none; }
.mih-is-fullscreen .mih-btn-fullscreen .mih-btn-fs-expand  { display: none; }
.mih-is-fullscreen .mih-btn-fullscreen .mih-btn-fs-collapse { display: block; }

/* Fullscreen stage adjustments */
.mih-is-fullscreen {
    border-radius: 0 !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999 !important;
    width: 100vw !important;
    height: 100vh !important;
}
.mih-is-fullscreen .mih-stage .onhym-map-wrapper,
.mih-is-fullscreen .onhym-map-wrapper { height: 100vh !important; }

/* ── Overlay ─────────────────────────────────────────────────────────────── */
.mih-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 15;
}

/* ── Panels (shared base) ────────────────────────────────────────────────── */
.mih-panel {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: auto;
    background: #ffffff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.08);
}

/* ── Right panel ─────────────────────────────────────────────────────────── */
.mih-panel--right {
    right: 24px;
    width: 220px;
    padding: 18px 20px;
}

/* ── Left panel (investor hub) ───────────────────────────────────────────── */
.mih-panel--left {
    left: 25px;
    top: 43px;
    transform: none;
    width: 300px;
    max-height: calc(110% - 220px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 22px 22px 18px;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}
.mih-panel--left::-webkit-scrollbar { width: 4px; }
.mih-panel--left::-webkit-scrollbar-track { background: transparent; }
.mih-panel--left::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* ── Left panel: header ──────────────────────────────────────────────────── */
.mih-lp-header { margin-bottom: 14px; }

.mih-lp-title {
    margin: 0 0 5px;
    font-size: 14px;
    font-weight: 700;
    color: #0f766e;
    letter-spacing: -0.2px;
    line-height: 1.25;
}

.mih-lp-subtitle {
    margin: 0 0 12px;
    font-size: 11px;
    font-weight: 400;
    color: #6b7280;
    line-height: 1.55;
}

.mih-lp-divider {
    height: 1px;
    background: #f3f4f6;
}

/* ── Left panel: item list ───────────────────────────────────────────────── */
.mih-lp-list {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.mih-lp-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

/* Circular icon */
.mih-lp-icon-wrap {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f0fdf4;
    border: 1px solid #d1fae5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f766e;
    margin-top: 1px;
}
.mih-lp-icon-wrap svg { width: 15px; height: 15px; }

/* Accent variant (yellow) */
.mih-lp-icon-wrap--accent {
    background: #fffbeb;
    border-color: #fde68a;
    color: #d97706;
}

/* Text block */
.mih-lp-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mih-lp-item-title {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.mih-lp-item-desc {
    display: block;
    font-size: 10.5px;
    font-weight: 400;
    color: #6b7280;
    line-height: 1.5;
}

/* ── Right panel: Infrastructure (icon list) ─────────────────────────────── */
.mih-rp-title {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: #0f766e;
    letter-spacing: -0.2px;
    line-height: 1.2;
}
.mih-rp-divider {
    height: 2px;
    width: 32px;
    background: #ffb400;
    border-radius: 2px;
    margin-bottom: 12px;
}
.mih-rp-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.mih-rp-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    font-size: 12.5px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
    border-bottom: 1px solid #f3f4f6;
}
.mih-rp-item:last-child { border-bottom: none; }
.mih-rp-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f766e;            /* unified primary */
}
.mih-rp-icon--accent { color: #ffb400; } /* highlight */
.mih-rp-icon svg { width: 20px; height: 20px; }

/* ── City marker ─────────────────────────────────────────────────────────── */
.mih-marker { position: relative; pointer-events: none; }
.mih-marker-pin {
    display: block;
    width: 10px;
    height: 10px;
    background: #ffb400;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.mih-marker-label {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    font-size: 10px;
    font-weight: 600;
    color: #111827;
    background: rgba(255, 255, 255, 0.92);
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    pointer-events: none;
}

/* ── Entrance animations ─────────────────────────────────────────────────── */
@keyframes mihSlideLeft {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes mihSlideRight {
    from { opacity: 0; transform: translateY(-50%) translateX(14px); }
    to   { opacity: 1; transform: translateY(-50%) translateX(0); }
}
.mih-panel--left  { animation: mihSlideLeft  0.4s ease 0.2s both; }
.mih-panel--right { animation: mihSlideRight 0.4s ease 0.3s both; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .mih-panel--left { width: 260px; }
}

@media (max-width: 900px) {
    .mih-panel--left  { width: 230px; left: 10px; }
    .mih-panel--right { width: 148px; right: 10px; }
}

@media (max-width: 680px) {
    .mih-overlay {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-top: 10px;
        pointer-events: auto;
    }
    .mih-panel {
        position: static;
        transform: none;
        width: 100% !important;
        max-height: none !important;
        animation: none;
    }
    .mih-stage .onhym-map-wrapper { height: 380px !important; }
}

@media (max-width: 420px) {
    .mih-overlay { grid-template-columns: 1fr; }
    .mih-stage .onhym-map-wrapper { height: 300px !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   GEO LABELS (Europe / Africa / Ocean / 14 km annotation)
   ═══════════════════════════════════════════════════════════════════════════ */
.mih-geo-labels {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 14;
    font-family: "Inter", -apple-system, sans-serif;
}
.mih-geo-label {
    position: absolute;
    font-style: italic;
    color: #0f766e;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}
.mih-geo-label--europe { top: 4%;   right: 22%; font-size: 18px; font-style: normal; }
.mih-geo-label--africa { bottom: 18%; right: 30%; font-size: 18px; font-style: normal; }
.mih-geo-label--ocean  { top: 22%;  left: 28%;  font-size: 12px; color: #4b8aa8; max-width: 110px; line-height: 1.4; }

/* 14 km from Europe annotation */
.mih-14km {
    position: absolute;
    top: 22%;
    left: 39%;
    text-align: center;
    line-height: 1.2;
}
.mih-14km strong {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: #d97706;
    letter-spacing: -0.3px;
}
.mih-14km em {
    display: block;
    font-style: normal;
    font-size: 11px;
    font-weight: 600;
    color: #4b5563;
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BOTTOM KPI STRIP
   ═══════════════════════════════════════════════════════════════════════════ */
.mih-kpi-strip {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 18px;
    z-index: 16;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px 22px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    pointer-events: auto;
    animation: mihFadeUp 0.5s ease 0.4s both;
}
.mih-kpi {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
    border-right: 1px solid #f3f4f6;
}
.mih-kpi:last-child { border-right: none; }

.mih-kpi-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0fdf4;
    border: 1px solid #d1fae5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f766e;
}
.mih-kpi-icon svg { width: 18px; height: 18px; }

.mih-kpi-text { display: flex; flex-direction: column; line-height: 1.2; }
.mih-kpi-text strong {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.2px;
}
.mih-kpi-text span {
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    margin-top: 2px;
}

@keyframes mihFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Lift the panels above the KPI strip clearance */
/* max-height set in .mih-panel--left above */

/* Hide geo labels and 14km annotation on small screens */
@media (max-width: 900px) {
    .mih-geo-labels { display: none; }
    .mih-kpi-strip {
        position: static;
        margin-top: 12px;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px 0;
    }
    .mih-kpi { border-right: none; }
}
@media (max-width: 480px) {
    .mih-kpi-strip { grid-template-columns: 1fr; }
    .mih-kpi-text strong { font-size: 13px; }
}
