/* Carte interactive de la couverture légale africaine (voir assets/africa-map.js).
   Les couleurs vivent ici : la légende et les pays partagent les mêmes classes,
   le script n'écrit aucune couleur. Palette validée sur le fond sombre du site
   (bande de luminosité, seuil de chroma, séparation daltonismes, contraste). */
#africaMap {
    --map-on: #0891b2;
    --map-on-hover: #22d3ee;
    --map-active: #ea580c;
    --map-off: #16202f;
    --map-off-stroke: #2b3b52;
    --map-gap: #040711;
}

.africa-map-svg {
    display: block;
    width: 100%;
    height: auto;
    touch-action: manipulation;
}

.africa-country {
    stroke: var(--map-gap);
    stroke-width: 1.6;
    stroke-linejoin: round;
    transition: fill .18s ease, opacity .18s ease;
}

.africa-country.is-on {
    fill: var(--map-on);
}

.africa-country.is-off {
    fill: var(--map-off);
    stroke: var(--map-off-stroke);
    stroke-width: .8;
}

/* Survol, focus clavier et pays sélectionné : même mise en avant. */
.africa-map-svg a:hover .africa-country.is-on,
.africa-map-svg a:focus-visible .africa-country.is-on,
.africa-country.is-on.is-active {
    fill: var(--map-on-hover);
}

.africa-country.is-on.is-active {
    stroke: var(--map-active);
    stroke-width: 2.2;
}

.africa-map-svg a {
    cursor: pointer;
    outline: none;
}

.africa-map-svg a:focus-visible {
    outline: 2px solid var(--map-active);
    outline-offset: 2px;
}

/* Filtre régional ou recherche actifs : les pays hors sélection reculent. */
.africa-country.is-dim {
    opacity: .28;
}

.africa-island {
    stroke-width: 1.2;
}

.africa-hit {
    fill: transparent;
    stroke: none;
    cursor: pointer;
}

/* Info-bulle flottante */
.africa-tip {
    position: absolute;
    z-index: 20;
    max-width: 230px;
    padding: .6rem .7rem;
    border-radius: .75rem;
    border: 1px solid #1e293b;
    background: rgba(4, 7, 17, .96);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
    font-size: 11px;
    line-height: 1.45;
    color: #f8fafc;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .15s ease, transform .15s ease;
}

.africa-tip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Pastilles de légende : mêmes couleurs que les pays, par construction. */
.africa-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex: 0 0 auto;
}

.africa-swatch.is-on {
    background: var(--map-on);
}

.africa-swatch.is-off {
    background: var(--map-off);
    box-shadow: inset 0 0 0 1px var(--map-off-stroke);
}

@media (prefers-reduced-motion: reduce) {
    .africa-country,
    .africa-tip {
        transition: none;
    }
}
