/* ==========================================================================
   Assurance Provisoire — interface 2026 : zone Carte Verte
   Chargée en plus de ap.css, ap-page.css et ap-article.css sur pages/zone-carte-verte.
   La carte (jQuery + jqvmap, chargés depuis des CDN) et le script de la vue (survol, clic,
   filtres, modale, compteurs) sont conservés : cette feuille ne change que l'apparence.

   Couleurs des trois zones : définies dans la vue (palette PHP), reprises ici pour les compteurs.
   Zone Carte Verte = bleu ciel, hors zone = bleu marine, outre-mer = gris bleuté.
   Le texte ne dépend jamais de ces couleurs seules : chaque zone est aussi nommée en toutes lettres.
   ========================================================================== */

:root {
  --zone-cv: #3ab8e0;
  --zone-hors: #1a2f4d;
  --zone-dom: #7c8898;
}

/* ---------- Compteurs de l'en-tête ---------- */
.zone-stats-grid { margin-top: 24px; border-top: 1px solid var(--line); }
.zone-stat { display: grid; grid-template-columns: 64px 1fr; column-gap: 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); }
.zone-stat__count { grid-row: 1 / span 2; align-self: center; font-size: 38px; line-height: 1; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.zone-stat__label { font-weight: 600; }
.zone-stat__sub { font-size: 14px; color: var(--muted); }
.zone-stat--cv .zone-stat__count { box-shadow: inset 0 -3px 0 var(--zone-cv); padding-bottom: 4px; }
.zone-stat--hors .zone-stat__count { box-shadow: inset 0 -3px 0 var(--zone-hors); padding-bottom: 4px; }
.zone-stat--dom .zone-stat__count { box-shadow: inset 0 -3px 0 var(--zone-dom); padding-bottom: 4px; }

/* ---------- Légende et carte ---------- */
.map-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 16px 0 12px; font-size: 14px; }
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.legend-item::before { content: ""; width: 14px; height: 14px; border-radius: 3px; background: var(--legend-color, #d4d4d4); }
.legend-other::before { background: #d4d4d4; }

#vmap { width: 100%; height: 280px; margin-bottom: 28px; border-radius: 12px; overflow: hidden; }
.jqvmap-label { padding: 4px 10px !important; border: 0 !important; border-radius: 6px !important; background: var(--navy) !important; color: #fff !important; font-family: var(--font) !important; font-size: 13px !important; }
.jqvmap-zoomin, .jqvmap-zoomout { width: 32px !important; height: 32px !important; padding: 0 !important; border-radius: 8px !important; background: var(--navy) !important; color: #fff !important; font-size: 18px !important; line-height: 32px !important; text-align: center !important; cursor: pointer !important; }

/* ---------- Filtres et liste des pays ---------- */
.countries-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filter-btn { min-height: 44px; padding: 0 12px; border: 1.5px solid #7c8898; border-radius: 10px; background: #fff; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; }
.filter-btn:hover { border-color: var(--navy); }
.filter-btn--active { background: var(--navy); border-color: var(--navy); color: #fff; }
.filter-btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }

.countries-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; border-top: 1px solid var(--line); }
.country-card { display: flex; flex-direction: column; gap: 1px; padding: 9px 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; }
.country-card:hover .country-card__name { text-decoration: underline; text-decoration-color: var(--card-zone-color, var(--sky)); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.country-card:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 4px; }
.country-card__name { font-size: 15px; font-weight: 500; line-height: 1.3; }
.country-card__badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.country-card__badge::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--card-zone-color, #d4d4d4); }
.countries-count { margin-top: 12px; font-size: 14px; color: var(--muted); }

/* ---------- Fenêtre pays ---------- */
.country-modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.country-modal[hidden] { display: none; }
.country-modal__overlay { position: absolute; inset: 0; background: rgba(26, 47, 77, 0.6); cursor: pointer; }
.country-modal__box { position: relative; z-index: 1; width: 100%; max-width: 400px; padding: 28px 24px 24px; background: #fff; border-radius: 16px; text-align: left; }
.country-modal__close { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 10px; background: none; font-size: 26px; line-height: 1; color: var(--ink); cursor: pointer; }
.country-modal__close:hover { background: var(--soft); }
.country-modal__close:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.country-modal__flag { display: none; }
.country-modal__name { margin: 0 44px 10px 0; font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; }
/* Le script pose couleur, fond et bordure du badge en ligne : on garde la bordure (couleur de la zone) et on impose un texte lisible */
.country-modal__badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--soft) !important; color: var(--ink) !important; }
.country-modal__desc { margin: 14px 0 20px; font-size: 15px; color: var(--muted); }
.country-modal__cta { display: inline-flex; width: 100%; margin-top: 0; }
body.modal-open { overflow: hidden; }

/* ---------- Tablette ---------- */
@media (min-width: 600px) {
  #vmap { height: 360px; }
  .countries-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .country-modal__cta { width: auto; padding: 0 28px; }
}

/* ---------- Ordinateur ---------- */
@media (min-width: 960px) {
  .zone-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 32px; border-top: 0; margin-top: 36px; }
  .zone-stat { grid-template-columns: auto 1fr; border-top: 1px solid var(--line); border-bottom: 0; padding: 18px 0 0; }
  #vmap { height: 420px; }
  .countries-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
