/* =========================================
   NETWORK ANIMATION  (template-parts/services/network-animation.php)
   Everything is scoped to .dts-na — no global rules.
========================================= */
.dts-na {
    /* background: #0d2b6e url('../images/background.png') center / cover no-repeat; */
    overflow: hidden;
}

.dts-na__stage {
    position: relative;
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    aspect-ratio: 1920 / 1000;
    overflow: hidden;
    isolation: isolate;
}

/* The image and the SVG share exactly the same box, so routes land on the right cities */
.dts-na__map-wrap {
    position: absolute;
    inset: 40px -72px;
}

.dts-na__map,
.dts-na__signals {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.dts-na__map {
    object-fit: contain;
    filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.28));
}

/* ---- Routes ---- */
.dts-na__route {
    fill: none;
    stroke: var(--dts-secondary, #d81b60);
    stroke-width: 3.4;
    stroke-linecap: round;
    stroke-dasharray: 4 10;
    opacity: 0.9;
    animation: dts-na-route-flow 2.6s linear infinite;
}

.dts-na__route:nth-of-type(2) { animation-delay: 0.12s; }
.dts-na__route:nth-of-type(3) { animation-delay: 0.24s; }
.dts-na__route:nth-of-type(4) { animation-delay: 0.34s; }
.dts-na__route:nth-of-type(5) { animation-delay: 0.44s; }
.dts-na__route:nth-of-type(6) { animation-delay: 0.54s; }

/* ---- Signal dots (moved along the routes by the SVG itself) ---- */
.dts-na__signal {
    fill: #00c274;
    opacity: 0;
}

/* ---- City nodes ---- */
.dts-na__node {
    fill: var(--dts-secondary, #d81b60);
    transform-box: fill-box;
    transform-origin: center;
    animation: dts-na-node-pulse 2.4s ease-in-out infinite;
}

.dts-na__node:nth-of-type(2n) {
    animation-delay: 0.42s;
}

/* ---- City labels ---- */
.dts-na__labels {
    fill: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.3px;
    paint-order: stroke;
    stroke: #07182f;
    stroke-width: 7px;
    stroke-linejoin: round;
}

/* Section scrolled off-screen: freeze the CSS animations too (the script pauses the SVG ones) */
.dts-na.is-paused .dts-na__route,
.dts-na.is-paused .dts-na__node {
    animation-play-state: paused;
}

@keyframes dts-na-route-flow {
    to { stroke-dashoffset: -42; }
}

@keyframes dts-na-node-pulse {
    0%, 100% { transform: scale(1); opacity: 0.55; }
    50%      { transform: scale(1.55); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .dts-na__route,
    .dts-na__node {
        animation: none;
        opacity: 1;
    }

    .dts-na__route {
        stroke-dasharray: none;
    }
}

/* ---- Tablet: the whole map shrinks with the screen, so labels and lines are scaled up to stay readable ---- */
@media (max-width: 1100px) {
    .dts-na__labels {
        font-size: 26px;
        stroke-width: 9px;
    }

    .dts-na__route {
        stroke-width: 4.6;
    }

    .dts-na__node {
        r: 9px;
    }

    .dts-na__signal {
        r: 7px;
    }
}

/* ---- Phone: crop the empty sea either side of the map, make it taller, drop the labels ---- */
@media (max-width: 700px) {
    .dts-na__stage {
        aspect-ratio: 8 / 5;
    }

    .dts-na__map-wrap {
        inset: 0 -11.8% 0 -21.1%;
    }

    .dts-na__labels {
        display: none;
    }

    .dts-na__route {
        stroke-width: 6;
        stroke-dasharray: 6 15; /* 21 x 2 = 42, matches the animation distance so it loops smoothly */
    }

    .dts-na__node {
        r: 12px;
    }

    .dts-na__signal {
        r: 9px;
    }
}
