/* Carte de France des centres (Carte/france.html.twig, 30/10/2026) : fond de l'Insee en six classes, centres du BO.
   Les étiquettes sont placées par le serveur pour une carte de 600 px de large (CarteFrance::$affichage) : en
   dessous de 440 px, elles sont masquées et la liste sous la carte prend le relais. */

.carte-france {
    /* Évolution de la population : deux classes en baisse (ardoise), une stable, trois en hausse (terre cuite).
       Clarté régulière de part et d'autre du gris (OKLCH, écarts d'au moins 0,06), mêmes clartés des deux côtés */
    --cf-c0: #859cc4;
    --cf-c1: #adc3e2;
    --cf-c2: #ebe9e6;
    --cf-c3: #e8c19d;
    --cf-c4: #da996a;
    --cf-c5: #bf6b42;
    --cf-encre: #1d1d1b;
    --cf-gris: #6b6b6b;
    --cf-rouge: #e40520;
    container-type: inline-size;
    margin: 36px 0 8px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--cf-encre);
}

.carte-france .cf-grille {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 200px;
    gap: 16px 28px;
    align-items: start;
}

.carte-france .cf-principale,
.carte-france .cf-encart {
    position: relative;
}

.carte-france .cf-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    /* Sans elle, Chrome arrondit la taille des lettres du dessin réduit : espaces irréguliers dans les noms */
    text-rendering: geometricPrecision;
}

/* Fond : classes séparées par un liseré blanc, légère ombre portée */
.carte-france .cf-fond {
    filter: drop-shadow(0 10px 18px rgba(29, 29, 27, .10));
}

.carte-france .cf-fond path {
    stroke: #fff;
    stroke-width: .8px;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

/* Limites des régions : trait anthracite fin et transparent, distinct du liseré blanc des classes */
.carte-france .cf-regions {
    fill: none;
    stroke: rgba(29, 29, 27, .5);
    stroke-width: 1px;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.carte-france .cf-c0 { fill: var(--cf-c0); background: var(--cf-c0); }
.carte-france .cf-c1 { fill: var(--cf-c1); background: var(--cf-c1); }
.carte-france .cf-c2 { fill: var(--cf-c2); background: var(--cf-c2); }
.carte-france .cf-c3 { fill: var(--cf-c3); background: var(--cf-c3); }
.carte-france .cf-c4 { fill: var(--cf-c4); background: var(--cf-c4); }
.carte-france .cf-c5 { fill: var(--cf-c5); background: var(--cf-c5); }

/* Centres : Shop•Park en point plein, autres catégories en cercle */
.carte-france .cf-centre {
    cursor: pointer;
    outline: none;
}

.carte-france .cf-cible {
    fill: transparent;
}

.carte-france .cf-point {
    fill: var(--cf-encre);
    stroke: #fff;
    stroke-width: 1.5px;
    vector-effect: non-scaling-stroke;
    transform-box: fill-box;
    transform-origin: center;
    transition: transform .15s ease, fill .15s ease;
}

.carte-france .cf-rang1 .cf-point {
    fill: #fff;
    stroke: var(--cf-encre);
    stroke-width: 2.2px;
}

.carte-france .cf-etiquette {
    fill: var(--cf-encre);
    font-weight: 500;
    letter-spacing: .01em;
    paint-order: stroke;
    stroke: rgba(255, 255, 255, .85);
    stroke-width: .3em;
    stroke-linejoin: round;
    transition: fill .15s ease;
}

.carte-france .cf-trait {
    stroke: var(--cf-encre);
    stroke-width: .8px;
    vector-effect: non-scaling-stroke;
}

.carte-france .cf-centre:hover .cf-point,
.carte-france .cf-centre:focus-visible .cf-point,
.carte-france .cf-centre.cf-actif .cf-point {
    fill: var(--cf-rouge);
    transform: scale(1.35);
}

.carte-france .cf-rang1:hover .cf-point,
.carte-france .cf-rang1:focus-visible .cf-point,
.carte-france .cf-rang1.cf-actif .cf-point {
    fill: #fff;
    stroke: var(--cf-rouge);
}

.carte-france .cf-centre:hover .cf-etiquette,
.carte-france .cf-centre:focus-visible .cf-etiquette,
.carte-france .cf-centre.cf-actif .cf-etiquette {
    fill: var(--cf-rouge);
}

/* Colonne de droite : légende, encart de La Réunion, source */
.carte-france .cf-titre {
    margin: 0 0 12px;
    font-weight: 600;
    line-height: 1.4;
    text-wrap: balance;
}

.carte-france .cf-classes,
.carte-france .cf-categories {
    margin: 0;
    padding: 0;
    list-style: none;
}

.carte-france .cf-classes li,
.carte-france .cf-categories li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 4px;
    font-variant-numeric: tabular-nums;
}

/* Listes de la carte : sans la puce en tiret ni le retrait des listes du texte (style.css, même force mais avant) */
.carte-france .cf-cote ul li,
.carte-france .cf-liste ul li {
    padding: 0;
    background: none;
}

.carte-france .cf-pastille {
    flex: none;
    width: 22px;
    height: 14px;
    border-radius: 4px;
}

.carte-france .cf-pastille.cf-c2 {
    box-shadow: inset 0 0 0 1px rgba(29, 29, 27, .08);
}

.carte-france .cf-france {
    margin: 10px 0 0;
    color: var(--cf-gris);
}

.carte-france .cf-categories {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #ebe6e4;
}

.carte-france .cf-repere {
    flex: none;
    width: 10px;
    height: 10px;
    margin: 0 6px;
    border-radius: 50%;
    background: var(--cf-encre);
}

.carte-france .cf-repere.cf-rang1 {
    background: #fff;
    box-shadow: inset 0 0 0 2px var(--cf-encre);
}

.carte-france .cf-repere-region {
    flex: none;
    width: 22px;
    height: 0;
    border-top: 1px solid rgba(29, 29, 27, .5);
}

.carte-france .cf-nombre {
    color: var(--cf-gris);
}

.carte-france .cf-encart {
    margin-top: 22px;
    padding: 12px 12px 6px;
    border: 1px solid #ebe6e4;
    border-radius: 12px;
}

.carte-france .cf-encart-titre {
    margin: 0;
    font-weight: 600;
}

.carte-france .cf-source {
    margin: 16px 0 0;
    font-size: 11px;
    color: var(--cf-gris);
}

/* Bulle d'un centre (carte-france.js) */
.carte-france .cf-bulle {
    position: absolute;
    z-index: 5;
    min-width: 150px;
    max-width: 280px;
    padding: 10px 14px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(29, 29, 27, .16);
    transform: translate(-50%, calc(-100% - 14px));
    pointer-events: auto;
    text-align: left;
}

.carte-france .cf-bulle[hidden] {
    display: none;
}

.carte-france .cf-bulle::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    background: #fff;
    transform: rotate(45deg);
}

.carte-france .cf-bulle-nom {
    margin: 0;
    font-weight: 600;
    font-size: 14px;
}

.carte-france .cf-bulle-detail {
    margin: 2px 0 0;
    color: var(--cf-gris);
}

.carte-france .cf-bulle-lien {
    display: inline-block;
    margin-top: 6px;
    color: var(--cf-rouge);
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
}

.carte-france .cf-bulle-lien:hover,
.carte-france .cf-bulle-lien:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Liste des centres : version texte de la carte */
.carte-france .cf-liste {
    margin-top: 20px;
    border-top: 1px solid #ebe6e4;
}

.carte-france .cf-liste summary {
    padding: 12px 0;
    font-weight: 500;
    cursor: pointer;
}

.carte-france .cf-liste-titre {
    margin: 4px 0 6px;
    font-weight: 600;
}

.carte-france .cf-liste ul {
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
    columns: 3 180px;
    column-gap: 24px;
}

.carte-france .cf-liste li {
    margin: 0 0 4px;
    break-inside: avoid;
}

.carte-france .cf-liste li span {
    color: var(--cf-gris);
}

.carte-france .cf-liste a {
    color: var(--cf-encre);
    text-decoration: none;
    transition: color .15s ease;
}

.carte-france .cf-liste a:hover,
.carte-france .cf-liste a:focus-visible {
    color: var(--cf-rouge);
}

/* Carte étroite : légende et encart sous la carte, côte à côte */
@container (max-width: 720px) {
    .carte-france .cf-grille {
        grid-template-columns: minmax(0, 1fr);
    }

    .carte-france .cf-cote {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 220px);
        gap: 0 28px;
    }

    .carte-france .cf-encart {
        grid-column: 2;
        grid-row: 1 / span 4;
        align-self: start;
        margin-top: 0;
    }
}

/* Téléphone : étiquettes de la métropole trop petites, masquées (bulle au toucher, liste sous la carte) */
@container (max-width: 440px) {
    .carte-france .cf-metropole .cf-etiquette,
    .carte-france .cf-metropole .cf-trait {
        display: none;
    }

    .carte-france .cf-cote {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Encart à l'échelle de la carte : pas plus grand que la métropole */
    .carte-france .cf-encart {
        grid-column: auto;
        grid-row: auto;
        max-width: 240px;
        margin-top: 18px;
    }
}
