/* =============================
   Fonts â€” single families, proper weights
   ============================= */
@font-face {
    font-family: "BeirutDisplay";
    src: url("./fonts/BeirutDisplayWeb-Book.woff2") format("woff2"),
    url("./fonts/BeirutDisplayWeb-Book.woff") format("woff");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "SCSI-Aeonik";
    src: url("./fonts/Aeonik-Regular.woff2") format("woff2"),
    url("./fonts/Aeonik-Regular.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "SCSI-Aeonik";
    src: url("./fonts/Aeonik-Bold.woff2") format("woff2"),
    url("./fonts/Aeonik-Bold.woff") format("woff");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* =============================
   Tokens (scoped to plugin)
   ============================= */
.scsi-ms {
    /* colors */
    --c-navy: #122C4B;
    --c-white: #FFF;
    --c-body: #0c1b2a;
    --tip-bg: #FFFFFF;
    --tip-fg: #122C4B;

    /* radii */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 15px;
    --r-xl: 20px;
    --r-xxl: 30px;
    --r-pill: 999px;
    --tip-radius: 5px;

    /* spacing */
    --sp-1: 6px;
    --sp-2: 10px;
    --sp-3: 18px;
    --sp-4: 26px;
    --sp-5: 41px;

    /* fonts */
    --ff-disp: "BeirutDisplay", "SCSI-Aeonik", sans-serif;
}

.scsi-ms {
    font-family: "SCSI-Aeonik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-synthesis: none;
}

.scsi-ms {
    font-size: 16px;
}

/* =============================
   Reset & base (scoped)
   ============================= */
.scsi-ms,
.scsi-ms * {
    box-sizing: border-box;
}

.scsi-ms {
    color: var(--c-body);
}

#project__intro {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

#project__intro-inner {
    max-width: unset !important;
}

#project__intro .container {
    max-width: 100% !important;
    padding: 0 !important;
    /*position: relative;*/
}

/* =============================
   Map - UPDATED FOR OVERLAY LAYOUT
   ============================= */
.mapwrap {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Map UI niceties */
.maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right {
    margin: 16px;
}

.maplibregl-ctrl button {
    border-radius: var(--r-md) !important;
}

/*
.scsi-ms { position: relative; width: 100%; }
*/
.scsi-ms .spinner-overlay {
    position: absolute;
    inset: 0;
}

/*
.scsi-ms .shell { height: 100%; min-height: 600px; }
.scsi-ms .mapwrap { position: absolute; inset: 0; height: 100%; min-height: 600px; }
*/
.scsi-ms .mapwrap {
    position: relative;
}

.scsi-ms #map {
    position: absolute;
    inset: 0;
}

/* =============================
   Shell: panel + map
   ============================= */
.scsi-ms .shell {
    display: grid;
    grid-template-columns: minmax(320px, 26rem) 1fr; /* responsive panel */
    height: 100%;
    /*position: relative;*/
}

/* =============================
   Panel - UPDATED TO MATCH IFRAME
   ============================= */
.scsi-ms .panel {
    background: var(--c-navy);
    color: #e7f0f7;
    padding: 26px 33px 26px 33px;
    overflow-y: auto;
    position: relative;
    z-index: 10; /* Ensure it sits above the map */
}

.scsi-ms .panel .search {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--sp-2);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--r-lg);
    padding: var(--sp-2) 12px;
    margin-bottom: var(--sp-3);
}

.scsi-ms .panel .search input {
    background: transparent;
    border: 0;
    outline: none;
    color: #fff;
}

.scsi-ms .panel .search input::placeholder {
    color: #c9d8e6;
}

.scsi-ms .panel .search .chev {
    border: 0;
    background: #102c4a;
    color: #cfe3f6;
    border-radius: var(--r-md);
    padding: 6px 10px;
    cursor: pointer;
}

.scsi-ms .intro > .header {
    color: var(--c-white);
    font-family: var(--ff-disp);
    font-size: 28px;
    font-style: normal;
    font-weight: 300;
    line-height: 32px; /* 114.286% */
    letter-spacing: -0.84px;
}

.scsi-ms .intro > .content {
    margin-top: 30px;
    color: var(--c-white);
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    line-height: 125%;
}

.scsi-ms .hidden {
    display: none;
}

.scsi-ms .detail > .header {
    color: var(--c-white);
    text-align: center;
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    line-height: 125%;
}

.scsi-ms .detail > .title {
    margin-top: 20px;
    color: var(--c-white);
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
    line-height: 16px;
    letter-spacing: 2.4px;
    text-transform: uppercase;
}

.scsi-ms .detail > .score {
    color: var(--c-white);
    text-align: center;
    font-size: clamp(40px, 7vw, 70px); /* responsive big numerals */
    font-style: normal;
    font-weight: 700;
    line-height: 1.05;
}

.scsi-ms .badge-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.scsi-ms .badge {
    padding: 6px 10px;
    border-radius: var(--r-pill);
    font-size: 12px;
    font-weight: 600;
    background: #0b2b49;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.scsi-ms .kpi {
    margin-top: 62px;
    display: grid;
    grid-auto-flow: column;
    align-items: center;
    justify-content: center;
    column-gap: 5px;
}

.scsi-ms .kpi .title {
    color: var(--c-white);
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
    line-height: 16px;
    letter-spacing: 2.4px;
    text-transform: uppercase;
}

.scsi-ms .kpi-sub {
    color: var(--c-white);
    text-align: center;
    font-size: clamp(40px, 7vw, 70px);
    font-style: normal;
    font-weight: 700;
    line-height: 1.05;
    margin-top: 6px;
}

.scsi-ms .dynamic-text {
    color: var(--c-white);
    text-align: center;
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    line-height: 125%;
    margin: 13px 0 22px 0;
}

.scsi-ms .learn-more a {
    color: #6B8AFF;
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    line-height: 125%;
    text-decoration: underline;
    text-decoration-skip-ink: none;
    text-underline-offset: auto;
    text-underline-position: from-font;
}

.scsi-ms .kpi-circles {
    margin: 44px 0;
    text-align: center;
}

.scsi-ms .kpi-circles svg {
    display: inline-block; /* or inline */
    max-width: none; /* if you want fixed sizing */
    height: auto; /* or a fixed height if needed */
}

/* =============================
   Spinner overlay
   ============================= */
.scsi-ms .spinner-overlay {
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    transition: opacity .25s ease;
    opacity: 1;
    pointer-events: auto;
}

.scsi-ms .spinner-overlay.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.scsi-ms .spinner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 8px solid #eaf1f7;
    border-top: 8px solid #0f3359;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =============================
   Popup styles
   ============================= */
.scsi-ms .popup-content {
    width: 220.014px;
    fill: var(--c-navy);
    filter: drop-shadow(0 0 6px rgba(18, 44, 75, 0.50));
}

.scsi-ms .popup-title {
    color: #F8F8F8;
    text-align: center;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    line-height: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.scsi-ms .popup-score {
    color: var(--c-white);
    text-align: center;
    font-size: clamp(28px, 6vw, 40px);
    font-style: normal;
    font-weight: 700;
    line-height: 1.2;
}

/* Example styling; replace with your own */
.scsi-ms .dom-overlay {
    background: #0f3359;
    color: #fff;
    padding: 10px 12px;
    border-radius: var(--r-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .2);
    font: 600 13px/1.3 var(--ff-sans);
    opacity: 0;
    transition: opacity .15s ease;
}

.scsi-ms .dom-overlay .title {
    font-weight: 800;
    font-size: 18px;
    margin-bottom: 2px;
}

.scsi-ms .dom-overlay .sub {
    opacity: .9;
    font-weight: 600;
}

/* =============================
   Responsive
   ============================= */

@media (max-width: 900px) {

    :root {
        --wp-header-h: 75px;
        --scsi-map-h: min(50dvh, 320px); /* tweak */
    }

    body #header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10000;
        height: var(--wp-header-h)
    }

    .scsi-ms .mapwrap {
        position: fixed;
        left: 0;
        right: 0;
        top: calc(var(--wp-header-h));
        height: var(--scsi-map-h);
        z-index: 9990;
        overflow: hidden;
        background: #fff;
    }

    .scsi-ms .panel {
        overflow: visible;
        margin-top: calc(
                var(--wp-header-h) + var(--scsi-map-h)
        );
    }

    .scsi-ms .spinner-overlay {
        position: fixed;
        left: 0;
        right: 0;
        top: calc(var(--wp-header-h));
        height: var(--scsi-map-h);
        z-index: 9995;
    }
}

.scsi-ms .area-details {
    margin-top: 11px;
    color: var(--c-white);
    text-align: center;
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    line-height: 125%;
}

/* =============================
   Segmented toggle
   ============================= */
.scsi-ms .segmented {
    margin-top: 29px;
    text-align: center;
    display: grid;
    grid-template-columns: 134px 1fr;
    justify-content: center;
    align-items: center;
    border-radius: var(--r-xxl);
    background-color: #2A415D;
    color: var(--c-navy);
    height: 37px;
}

.scsi-ms .segmented div {
    font-size: 17px;
    font-style: normal;
    font-weight: 400;
    line-height: 28px;
    color: rgba(255, 255, 255, 0.60);
    margin: 3px 4px;
    cursor: pointer;
}

.scsi-ms .segmented div.on {
    border-radius: var(--r-pill);
    color: var(--c-navy);
    background: var(--c-white);
}

/* =============================
   Metrics & SI rows
   ============================= */
.scsi-ms .metric-group, .si-group {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}

.scsi-ms .metric-row, .si-row {
    display: grid;
    grid-auto-flow: column;
    align-items: center;
    grid-template-columns: auto 1fr auto;
    gap: 9px;
    color: var(--c-white);
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    line-height: 28px;
}

.scsi-ms .metric-row svg:focus, .si-row svg:focus {
    outline: none;
}

.scsi-ms .metric-row .button, .si-row .button {
    height: 19px;
    border-radius: 10.2px;
}

.scsi-ms .metric-row .button:not(.is-active) {
    cursor: pointer;
}

.scsi-ms .si-row .button {
    cursor: pointer;
}

.scsi-ms .metric-row .title, .si-row .title {
    justify-self: start;
    display: grid;
    grid-auto-flow: column;
    align-items: center;
    gap: 2px;
}

.scsi-ms .metric-row .value, .si-row .value {
    justify-self: end;
}

/* Consolidated SI group specifics */
.scsi-ms .si-group {
    gap: 10px;
    margin-top: 8px;
}

.scsi-ms .si-row {
    grid-template-columns: 26px 1fr auto;
}

/* =============================
   Gradients
   ============================= */
.scsi-ms .gradient-container {
    margin-top: 20px;
    position: relative;
}

.scsi-ms .gradient {
    position: relative;
    height: 20px;
    border-radius: 20px;
}

.scsi-ms .gradient .indicator {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    left: var(--indicator-pos, 50%);
}

.scsi-ms .gradient-labels {
    display: grid;
    grid-auto-flow: column;
    justify-content: space-between;
    color: var(--c-white);
    text-align: right;
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: 28px;
}

.scsi-ms .gradient.all {
    background: linear-gradient(90deg, #CFDDFF 0%, #9DB3FF 25%, #6B8AFF 50%, #4C6ADB 75%, #2D49B6 100%);
}

.scsi-ms .gradient.bonding {
    background: linear-gradient(90deg, #ABE8F3 0%, #56CDDA 25%, #00B2C1 50%, #008AA0 75%, #005D79 100%);
}

.scsi-ms .gradient.bridging {
    background: linear-gradient(90deg, #B6E1FF 0%, #52B9FF 50%, #3D8ACD 75%, #275B9B 100%);
}

.scsi-ms .gradient.linking {
    background: linear-gradient(90deg, #C1F2DE 0%, #8BE7C2 25%, #56DCA6 50%, #2B9C84 75%, #005D62 100%);
}

.scsi-ms .gradient.none {
    background: linear-gradient(90deg, #4D6178 0%, #4D6178 100%);
}

/* =============================
   Dropdown
   ============================= */
.scsi-ms .dropdown {
    position: relative;
    font-size: 17px;
    font-style: normal;
    font-weight: 400;
    line-height: 28px;
    color: var(--c-white);
}

.scsi-ms .dropdown-btn {
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 18px;
    height: 41px;
    border-radius: var(--r-lg);
    border: 1px solid var(--c-white);
    background: var(--c-navy);
}

.scsi-ms .dropdown-btn svg {
    transition: transform 0.2s ease;
}

.scsi-ms .dropdown.open .dropdown-btn svg {
    transform: rotate(180deg);
}

.scsi-ms .dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: none;
    border-radius: var(--r-lg);
    border: 1px solid var(--c-white);
    background: var(--c-navy);
}

.scsi-ms .dropdown.open .dropdown-menu {
    display: block;
}

.scsi-ms .dropdown-item {
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    height: 41px;
    padding: 4px 18px;
    align-items: center;
    gap: 10px;
    align-self: stretch;
}

.scsi-ms .dropdown-item:hover {
    background: linear-gradient(90deg, #2A415D 0%, #4D6178 100%);
}

/* =============================
   Steps
   ============================= */
.scsi-ms .steps {
    display: grid;
    grid-auto-flow: row;
    gap: 39px;
    margin-top: 40px;
    line-height: normal;
}

.scsi-ms .step {
    display: grid;
    grid-auto-flow: row;
    gap: 6px;
}

.scsi-ms .intro-step {
    color: var(--c-white);
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
    line-height: 16px;
    letter-spacing: 2.4px;
    text-transform: uppercase;
}

.scsi-ms .intro-item {
    color: var(--c-white);
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    line-height: 125%;
}

.scsi-ms .intro-item ul {
    margin-top: 6px;
    padding-left: 25px;
}

.scsi-ms .intro-item-bold {
    font-weight: 700;
    font-family: var(--ff-sans);
}

/* =============================
   Tooltip (accessible, animated)
   ============================= */
.scsi-ms .tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.scsi-ms .tip__icon {
    cursor: help;
}

.scsi-ms .tip__bubble {
    position: absolute;
    bottom: calc(100% + 20px);
    left: 50%;
    transform: translate(-50%, 6px);
    min-width: 270px;
    padding: 10px 12px 10px;
    border-radius: var(--tip-radius);
    background: var(--tip-bg);
    z-index: 20;
    color: var(--tip-fg);
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.25;
    display: block;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .15s ease, visibility .15s ease, transform .15s ease;
}

.scsi-ms .tip__bubble::before {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 14px;
    height: 14px;
    background: var(--tip-bg);
    border-radius: 2px;
}

.scsi-ms .tip:hover .tip__bubble,
.scsi-ms .tip:focus-within .tip__bubble,
.scsi-ms .tip.is-open .tip__bubble {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

/*
@media (hover: none) {
    .tip:hover .tip__bubble {
        opacity: 0;
        visibility: hidden;
    }
}
 */

/* =============================
   Bubble pack
   ============================= */
.scsi-ms .bubble-pack {
    position: relative;
    width: 100%;
    height: 260px;
    max-width: 100%;
    margin: 12px auto 6px;
}

.scsi-ms .bubble-pack .bubble {
    position: absolute;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    display: grid;
    place-items: center;
    pointer-events: none;
    color: var(--c-white);
    text-align: center;
    font-size: 14px;
    font-style: normal;
    font-weight: 700;
    line-height: 100%;
}

.scsi-ms .video {
    position: relative;
    margin-block: 41px 64px;
    text-align: center;
    border-radius: var(--r-lg);
    border: 1px solid var(--c-white);
    padding: 22px 54px;
}

.scsi-ms .video a {
    position: absolute;
    inset: 0; /* fill the entire div */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-white);
    font-family: var(--ff-sans);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.3;
    text-decoration: none;
}