/* SECTION TRAJETS */

.routes-map {
    padding: 24px 24px 100px;

    background: #ffffff;
}

.routes-map__container {
    width: 100%;
    max-width: 1200px;

    margin: 0 auto;

    display: grid;
    grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
    gap: 70px;

    align-items: start;
}


/* CONTENU */

.routes-map__content {
    min-width: 0;
}

.routes-map__header {
    max-width: 480px;
}

.routes-map__eyebrow {
    margin: 0 0 14px;

    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    color: var(--color-primary);
}

.routes-map__title {
    margin: 0;

    font-size: clamp(36px, 4vw, 52px);
    line-height: 1.08;
    letter-spacing: -0.03em;

    color: var(--color-text);
}

.routes-map__description {
    margin: 20px 0 0;

    font-size: 17px;
    line-height: 1.7;

    color: var(--color-text-secondary);
}


/* CHOIX DES TRAJETS */

.routes-map__choices {
    display: flex;
    flex-direction: column;
    gap: 12px;

    margin-top: 34px;
}

.route-choice {
    position: relative;

    width: 100%;

    padding: 17px 20px 17px 24px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;

    border: 1px solid var(--color-primary-border-soft);
    border-radius: 14px;

    background: #ffffff;

    font: inherit;
    text-align: left;

    cursor: pointer;

    overflow: hidden;

    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        transform 0.2s ease;
}

.route-choice__select {
    width: 100%;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;

    border: 0;

    background: transparent;

    font: inherit;
    text-align: left;

    cursor: pointer;
}


/* Petite barre verticale à gauche */

.route-choice::before {
    content: "";

    position: absolute;

    top: 15px;
    bottom: 15px;
    left: 0;

    width: 4px;

    border-radius: 0 4px 4px 0;

    background: transparent;

    transition: background-color 0.2s ease;
}


@media (hover: hover) and (pointer: fine) {

    .route-choice:hover {
        transform: translateX(4px);

        border-color: var(--color-primary-border);

        background: var(--color-primary-soft-hover);
    }
}


/* Trajet actuellement sélectionné */

.route-choice.is-active {
    border-color: var(--color-primary-border);

    background: var(--color-primary-soft);
}

.route-choice.is-active::before {
    background: var(--color-primary);
}


/* Nom de la région */

.route-choice__region {
    font-size: 16px;
    font-weight: 800;

    color: var(--color-text);
}


/* Liste des villes */

.route-choice__path {
    font-size: 14px;
    line-height: 1.5;

    color: var(--color-text-secondary);
}

/* liste des arrêts */

.route-choice__stops {
    width: 100%;

    display: none;
    flex-direction: column;
    gap: 10px;

    margin-top: 14px;
    padding-top: 14px;

    border-top: 1px solid var(--color-primary-border-soft);
}

.route-choice.is-active .route-choice__stops {
    display: flex;
}

.route-choice__stop {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.route-choice__stop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    font-size: 13px;
}

.route-choice__stop-header strong {
    color: var(--color-text);
}

.route-choice__stop-header span {
    flex-shrink: 0;

    font-weight: 800;

    color: var(--color-primary);
}

.route-choice__stop--destination {
    margin-top: 4px;
    padding-top: 12px;

    border-top: 1px dashed var(--color-primary-border-soft);
}

.route-choice__stop--destination .route-choice__stop-header span {
    color: var(--color-primary);
}

.route-choice__address {
    width: fit-content;

    display: inline-flex;
    align-items: center;
    gap: 5px;

    margin-top: 3px;

    font-size: 12px;
    line-height: 1.4;

    color: var(--color-text-secondary);

    text-decoration: none;

    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.route-choice__address svg {
    flex-shrink: 0;
}

.route-choice__address-arrow {
    opacity: 0.55;

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {

    .route-choice__address:hover {
        color: var(--color-primary);
    }

    .route-choice__address:hover .route-choice__address-arrow {
        opacity: 1;

        transform: translate(1px, -1px);
    }
}

.route-choice__address:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;

    border-radius: 3px;
}


/* CARTE */

.routes-map__visual {
    width: 100%;
    min-width: 0;
    margin-top: 20px;
}

.routes-map__canvas {
    width: 100%;
    max-width: 620px;

    margin: 0 auto;
}

.routes-map__viewport {
    position: relative;

    width: 100%;
    aspect-ratio: 1 / 1;

    overflow: hidden;
}

.routes-map__france {
    position: absolute;

    width: 240%;
    max-width: none;

    left: -105%;
    top: -105%;

    user-select: none;
}

.routes-map__overlay {
    position: absolute;

    width: 240%;
    height: 240%;

    left: -105%;
    top: -105%;

    overflow: visible;
    pointer-events: none;
}


/* GROUPES DE TRAJETS */

.route-group {
    opacity: 0;

    pointer-events: none;

    transition: opacity 0.25s ease;
}

.route-group.is-active {
    opacity: 1;
}


/* LIGNES DES TRAJETS */

.routes-map__route {
    fill: none;

    stroke: var(--color-primary);
    stroke-width: 2;

    stroke-linecap: round;
    stroke-linejoin: round;

    vector-effect: non-scaling-stroke;
}

.route-group .routes-map__route {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
}

.route-group.is-active .routes-map__route {
    animation: route-draw 0.9s ease forwards;
}

@keyframes route-draw {

    from {
        stroke-dashoffset: 300;
    }

    to {
        stroke-dashoffset: 0;
    }
}


/* ARRÊTS */

.routes-map__stop circle {
    fill: #ffffff;

    stroke: var(--color-primary);
    stroke-width: 1.5;

    vector-effect: non-scaling-stroke;
}

.routes-map__stop text {
    fill: var(--color-text);

    font-size: 5px;
    font-weight: 700;

    paint-order: stroke;

    stroke: #ffffff;
    stroke-width: 1.2px;
    stroke-linejoin: round;
}


/* DESTINATION : NÎMES */

.routes-map__stop--destination circle {
    fill: var(--color-primary);

    stroke: #ffffff;
    stroke-width: 1.5;

    vector-effect: non-scaling-stroke;
}

.routes-map__stop--destination text {
    fill: var(--color-primary);

    font-size: 5.5px;
    font-weight: 800;
}

.routes-map__destination-highlight {
    fill: #ffe866;
}


/* ACCESSIBILITÉ */

.route-choice:focus-visible {
    outline: 3px solid rgba(115, 82, 184, 0.25);
    outline-offset: 3px;
}

@media (max-width: 900px) {

    .routes-map {
        padding: 50px 20px 80px;
    }

    .routes-map__container {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .routes-map__header {
        max-width: 650px;
    }

    .routes-map__choices {
        max-width: 650px;

        margin-top: 28px;
    }

    .routes-map__canvas {
        max-width: 560px;
    }
}

@media (max-width: 550px) {

    .routes-map {
        padding: 40px 18px 60px;
    }

    .routes-map__container {
        gap: 35px;
    }

    .routes-map__title {
        font-size: 34px;
    }

    .routes-map__description {
        margin-top: 16px;

        font-size: 16px;
        line-height: 1.6;
    }

    .routes-map__choices {
        gap: 10px;

        margin-top: 24px;
    }

    .route-choice {
        padding: 15px 16px 15px 20px;

        border-radius: 12px;
    }

    .route-choice__region {
        font-size: 15px;
    }

    .route-choice__path {
        font-size: 13px;
    }

    .routes-map__canvas {
        max-width: 100%;
    }
}


/* RÉDUCTION DES ANIMATIONS */

@media (prefers-reduced-motion: reduce) {

    .route-choice,
    .route-group {
        transition: none;
    }

    .route-group .routes-map__route,
    .route-group.is-active .routes-map__route {
        animation: none;

        stroke-dashoffset: 0;
    }
}