/* Global reach section - front page, placed right before .section_testimonials */
.section_global-reach {
    overflow: hidden;
    /* Map palette: tweak here to recolour the whole map */
    --gm-land: #e40072;
    --gm-dot: #c9cdd1;
    --gm-accent: #e40072;
    --gm-accent-opacity: .6;
    --gm-leader: #9aa0a6;
    --gm-label: #111;
    --gm-office: #111;          /* clickable office markers */
    --gm-office-ring: #fff;
}

.global-reach_component {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
}

.global-reach_header {
    display: flex;
    align-items: flex-end;      /* stat sits level with the h3 */
    justify-content: space-between;
    gap: 2rem;
}

.global-reach_title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    max-width: 44rem;
}

.global-reach_stat {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex: none;
}

.global-reach_stat-number {
    color: var(--gm-land);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.global-reach_stat-label {
    text-transform: uppercase;
    letter-spacing: .02em;
}

/* ---- Map ---- */
.global-reach_map-wrap {
    position: relative;
    width: 100%;
}

.gm-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.gm-dot { fill: var(--gm-dot); }
.gm-dot--accent { fill: var(--gm-accent); fill-opacity: var(--gm-accent-opacity); }
.gm-land { fill: var(--gm-land); }

.gm-leader {
    fill: none;
    stroke: var(--gm-leader);
    stroke-width: 1.5;
}
.gm-bullets circle { fill: var(--gm-label); }
.gm-labels text {
    fill: var(--gm-label);
    font-size: 22px;
    font-family: inherit;
    font-weight: 300;
}

/* ---- Office markers (clickable): dark badge, readable over pink, grey and white ---- */
.gm-marker { cursor: pointer; outline: none; }
.gm-hit { fill: transparent; }
.gm-disc {
    fill: var(--gm-office);
    stroke: var(--gm-office-ring);
    stroke-width: 2.5;
    transform-box: fill-box;
    transform-origin: center;
    transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.gm-ring { fill: none; stroke: var(--gm-office-ring); stroke-width: 1.5; }
.gm-core {
    fill: var(--gm-office-ring);
    transition: fill .2s;
}
.gm-pulse {
    fill: var(--gm-office);
    fill-opacity: .18;
    stroke: var(--gm-office);
    stroke-width: 1.5;
    transform-box: fill-box;
    transform-origin: center;
    animation: gm-pulse 2.6s ease-out infinite;
    pointer-events: none;
}
.gm-pulse--2 { animation-delay: 1.3s; }
.gm-marker:nth-child(3n) .gm-pulse { animation-delay: .4s; }
.gm-marker:nth-child(3n) .gm-pulse--2 { animation-delay: 1.7s; }
.gm-marker:nth-child(3n+1) .gm-pulse { animation-delay: .9s; }
.gm-marker:nth-child(3n+1) .gm-pulse--2 { animation-delay: 2.2s; }

@keyframes gm-pulse {
    0%   { transform: scale(1);   opacity: .9; }
    100% { transform: scale(2.8); opacity: 0; }
}

.gm-marker:hover .gm-disc,
.gm-marker:focus-visible .gm-disc,
.gm-marker.is-active .gm-disc { transform: scale(1.2); }
.gm-marker:hover .gm-core,
.gm-marker:focus-visible .gm-core,
.gm-marker.is-active .gm-core { fill: var(--gm-land); }
.gm-marker:focus-visible .gm-disc { stroke: var(--gm-land); }

/* ---- Static markers (no office): small, quiet, not interactive ---- */
.gm-marker--static { pointer-events: none; cursor: default; }
.gm-static-dot {
    fill: #fff;
    stroke: var(--gm-leader);
    stroke-width: 1.5;
}

@media (prefers-reduced-motion: reduce) {
    .gm-pulse { animation: none !important; }
    .gm-pulse { opacity: 0; }
}

/* ---- Tooltip ---- */
.global-reach_tooltip {
    position: absolute;
    z-index: 2;
    max-width: 16rem;
    padding: .5rem .75rem;
    background: var(--gm-label);
    color: #fff;
    font-size: .875rem;
    line-height: 1.3;
    border-radius: .25rem;
    pointer-events: none;
    white-space: normal;
    transform: translate(-50%, calc(-100% - 22px));
}
.global-reach_tooltip[hidden] { display: none; }

/* ---- Office panel (opens on marker click). Never scrolls on desktop: offices flow into columns ---- */
.global-reach_panel {
    --cols: 1;
    position: absolute;
    z-index: 3;
    width: min(calc(var(--cols) * 15.5rem + 2.5rem), calc(100% - 1rem));
    padding: 1.5rem 1.25rem 1.25rem;
    background: #fff;
    color: var(--gm-label);
    border: 1px solid #e3e5e8;
    border-top: 3px solid var(--gm-land);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .16);
    font-size: .9375rem;
    line-height: 1.4;
}
.global-reach_panel[hidden] { display: none; }

.global-reach_panel-body {
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    gap: 1.25rem 1.5rem;
}

.global-reach_panel-close {
    position: absolute;
    top: .25rem;
    right: .5rem;
    padding: .25rem .5rem;
    background: none;
    border: 0;
    font-size: 1.5rem;
    line-height: 1;
    color: inherit;
    cursor: pointer;
}

.gm-office__city {
    margin: 0 0 .5rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid #e3e5e8;
    font-size: 1.125rem;
    font-weight: 500;
}
.gm-office__line {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin-top: .375rem;
    color: inherit;
    text-decoration: none;
}
.gm-office__line svg { flex: none; margin-top: .2em; color: var(--gm-land); }
.gm-office__line:hover span,
.gm-office__line:focus-visible span { text-decoration: underline; }

/* Small screens: labels would be unreadably small, panel takes over */
@media screen and (max-width: 991px) {
    .gm-labels,
    .gm-bullets,
    .gm-leader { display: none; }
}

@media screen and (max-width: 767px) {
    .global-reach_component { gap: 2rem; }
    .global-reach_header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Panel becomes a bottom sheet (single column, scrolls if many offices) */
    .global-reach_panel {
        --cols: 1 !important;
        position: fixed;
        left: .5rem;
        right: .5rem;
        bottom: .5rem;
        width: auto;
        max-height: 70vh;
        overflow-y: auto;
    }

    /* Let the map bleed to the screen edges so the dots stay legible */
    .global-reach_map-wrap {
        width: calc(100% + 2rem);
        margin-left: -1rem;
    }
}
