/* =========================================================
   AI4ATLAS — additions à la charte graphique AI4VIGIL
   Fichier: css/ai4atlas.css
   Ne redéfinit aucun token : réutilise :root de ai4vigil.css
   (--a4v-navy, --a4v-red, --a4v-border, --a4v-radius, --a4v-font…)
   À charger APRÈS wnco-core.css / wnco-header-legacy.css / ai4vigil.css
   ========================================================= */

/* Centrage .container si bootstrap.min.css n'est pas chargé
   (ex. prévisualisation autonome) — sans effet si bootstrap est présent */
.container{margin-left:auto;margin-right:auto;}

/* ---------------------------------------------------------
   Logo AI4ATLAS : icône (globe extrait du logo AI4VIGIL,
   img/logo_globe_icon.png) + mot-symbole, même gabarit
   typographique que « Ai4VIGIL » (A capitale, i bas-de-casse,
   4 rouge, reste en capitales) */
.a4v-brand img.a4h-brand-icon{
  width:44px;
  height:44px;
  flex:0 0 44px;
  object-fit:contain;
}
.a4h-word{
  font-family:var(--a4v-font);
  font-weight:500;
  font-size:1.3rem;
  letter-spacing:.01em;
  color:var(--a4v-navy);
  white-space:nowrap;
}
.a4h-word .four{color:var(--a4v-red);font-weight:600}

/* Wordmark blanc dans les blocs logo sombres (wnco-logo-col) */
.a4h-wordmark-light{
  font-family:var(--a4v-font);
  font-weight:800;
  font-size:1.5rem;
  color:#fff;
  letter-spacing:-.01em;
  text-align:center;
}

/* ---------------------------------------------------------
   HERO — planète noir/rouge en rotation (couverture globale)
   Vraie 3D : js/ai4atlas-globe.js ray-trace la sphère dans un
   fragment shader WebGL (compression réelle des contours au
   limbe, éclairage et liseré rouge calculés en 3D, glisser pour
   manipuler). Texture : img/globe_map.png (2:1, tuilable en x,
   océan noir bleutéré + contours rouge charte, graticule discret).
   Repli sans WebGL : .globe-map défile en CSS (bande de 400%,
   tuiles à 50%, translation -50% → 0 = exactement une tuile,
   boucle sans couture responsive). La classe .a4h-gl (posée par
   le JS en cas de succès) bascule canvas ↔ repli. */
.a4v-hero .logo-orb{
  width:min(440px,88%);
  margin:0 auto;
  background:transparent;
  padding:0;
  overflow:visible;
  box-shadow:none;
  animation:a4h-globe-float 7s ease-in-out infinite;
}
/* Sphère : fond sombre (visible sous le canvas, disque de repli
   CSS), liseré rouge + ombre portée + halo rouge — le rendu 3D
   et l'éclairage sont dans le shader. */
.a4v-hero .logo-orb .globe-sphere{
  position:absolute;
  inset:0;
  border-radius:50%;
  overflow:hidden;
  background:#050f1e;
  box-shadow:
    inset 0 0 0 1px rgba(237,28,36,.38),
    0 0 0 8px rgba(6,29,58,.04),
    0 26px 70px rgba(6,29,58,.22),
    0 0 90px rgba(237,28,36,.15);
}
/* Canvas WebGL : masqué tant que le JS n'a pas confirmé le
   contexte + la texture (classe .a4h-gl sur .logo-orb). */
.a4v-hero .globe-canvas{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:none;
  cursor:grab;
  touch-action:none;
}
.a4v-hero .logo-orb.a4h-gl .globe-canvas{display:block}
.a4v-hero .logo-orb.a4h-gl .globe-map{display:none}

/* Repli CSS (sans WebGL) : carte équirectangulaire défilante. */
.a4v-hero .globe-map{
  position:absolute;
  top:0;
  left:0;
  width:400%;
  height:100%;
  background-image:url("../img/globe_map.png");
  background-repeat:repeat-x;
  background-size:50% 100%;
  animation:a4h-globe-spin 46s linear infinite;
  will-change:transform;
}
/* Rotation vers l'est (sens réel) : la texture part décalée d'une
   tuile vers la gauche puis glisse vers la droite, en boucle. */
@keyframes a4h-globe-spin{from{transform:translateX(-50%)}to{transform:translateX(0)}}
@keyframes a4h-globe-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-9px)}}

/* Accessibilité : planète figée si prefers-reduced-motion (le JS
   fait de même pour le rendu WebGL). */
@media (prefers-reduced-motion: reduce){
  .a4v-hero .logo-orb,
  .a4v-hero .globe-map{animation:none}
}

/* ---------------------------------------------------------
   HERO — caractéristiques du modèle sous le globe :
   même langage graphique que .stat-item (carte blanche,
   bordure, ombre douce) en version centrée. */
.globe-stats{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  margin-top:26px;
}
.globe-stat{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:5px;
  padding:16px 12px;
  text-align:center;
  background:#fff;
  border:1px solid var(--a4v-border);
  border-radius:18px;
  box-shadow:0 12px 28px rgba(6,29,58,.07);
}
.globe-stat .gs-val{
  font-size:.98rem;
  font-weight:800;
  color:var(--a4v-navy);
  line-height:1.15;
}
.globe-stat:first-child .gs-val{color:var(--a4v-red)}
.globe-stat .gs-label{
  font-size:.72rem;
  font-weight:600;
  color:var(--a4v-muted);
  line-height:1.35;
}
@media (max-width:575px){
  .globe-stats{grid-template-columns:1fr}
}

/* Correctif : .team-initial hérite un flex-basis:58px de l'ancienne
   règle .team-initial (ligne ~158 d'ai4vigil.css, non ré-écrit par le
   correctif plus récent qui ne fixe que width/height) — l'avatar rendait
   ovale (58px de large réellement affiché pour 95px de haut). On force
   le flex-basis à la même valeur que width/height pour un cercle net. */
.team-initial{flex:0 0 95px}

/* Valeur non encore définie (placeholder explicite) */
.ph{
  color:var(--a4v-muted);
  border-bottom:1px dashed rgba(8,26,52,.3);
  font-style:italic;
}

/* ---------------------------------------------------------
   Callout / note de méthode (prudence scientifique) */
.a4h-callout{
  margin-top:30px;
  padding:24px 28px;
  display:flex;
  gap:18px;
  align-items:flex-start;
  border-radius:var(--a4v-radius-sm);
  background:rgba(237,28,36,.045);
  border:1px solid rgba(237,28,36,.22);
}
.a4h-callout-mark{
  flex:0 0 auto;
  padding:6px 11px;
  border-radius:999px;
  background:var(--a4v-red);
  color:#fff;
  font-size:.66rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
  white-space:nowrap;
}
.a4h-callout p{
  margin:0;
  color:var(--a4v-muted);
  font-size:.92rem;
  line-height:1.65;
  font-weight:500;
}
.a4h-callout p b{color:var(--a4v-navy)}

/* ---------------------------------------------------------
   Schéma d'assimilation (remplace ai4vigil_concept.png) */
.a4h-flow{display:flex;flex-direction:column;gap:0;width:100%;max-width:420px;margin:0 auto;}
.a4h-flow-node{
  padding:16px 18px;
  border:1px solid var(--a4v-border);
  border-radius:14px;
  background:#fff;
  box-shadow:0 8px 20px rgba(6,29,58,.06);
}
.a4h-flow-node .k{
  display:block;
  margin-bottom:4px;
  font-size:.64rem;
  font-weight:800;
  letter-spacing:.09em;
  text-transform:uppercase;
  color:var(--a4v-red);
}
.a4h-flow-node .v{font-size:.85rem;font-weight:600;color:var(--a4v-navy);line-height:1.45}
.a4h-flow-node.dest{border-color:rgba(237,28,36,.35);box-shadow:0 10px 26px rgba(237,28,36,.12)}
.a4h-flow-arrow{align-self:center;padding:8px 0;font-size:.72rem;font-weight:700;color:var(--a4v-muted)}

/* ===========================================================
   BENCHMARK — cartes modèles + tableau comparatif
   =========================================================== */
.bench-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;margin-top:36px}
.bench-card{
  display:flex;
  flex-direction:column;
  gap:16px;
  padding:26px;
  background:#fff;
  border:1px solid var(--a4v-border);
  border-radius:var(--a4v-radius-sm);
  box-shadow:0 18px 44px rgba(6,29,58,.08);
}
.bench-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.bench-name{font-size:1.1rem;font-weight:800;color:var(--a4v-navy);line-height:1.2}
.bench-org{margin-top:4px;font-size:.76rem;color:var(--a4v-muted);font-weight:600}
.bench-tag{
  flex:0 0 auto;
  padding:5px 10px;
  border-radius:999px;
  font-size:.6rem;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
  background:rgba(6,29,58,.06);
  color:var(--a4v-navy);
  white-space:nowrap;
}
.bench-tag.live{background:rgba(237,28,36,.10);color:var(--a4v-red)}
.bench-desc{font-size:.85rem;line-height:1.6;color:var(--a4v-muted);font-weight:500}
.bench-facts{display:flex;flex-direction:column;gap:10px;padding-top:14px;border-top:1px solid var(--a4v-border)}
.bench-fact{display:flex;gap:10px;font-size:.78rem}
.bench-fact .k{flex:0 0 90px;font-size:.62rem;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:var(--a4v-muted);padding-top:1px}
.bench-fact .v{color:var(--a4v-navy);font-weight:600;line-height:1.5}
.bench-diff{margin-top:auto;padding-top:14px;border-top:1px dashed rgba(6,29,58,.16);font-size:.78rem;color:var(--a4v-navy);font-weight:500;line-height:1.55}
.bench-diff b{color:var(--a4v-red)}
.bench-src{font-size:.68rem;color:var(--a4v-muted)}
.bench-src a{color:var(--a4v-navy);border-bottom:1px dotted rgba(6,29,58,.3)}
.bench-src a:hover{color:var(--a4v-red)}

.cmp-wrap{
  margin-top:34px;
  overflow-x:auto;
  background:#fff;
  border:1px solid var(--a4v-border);
  border-radius:var(--a4v-radius-sm);
  box-shadow:0 18px 44px rgba(6,29,58,.08);
}
table.cmp{width:100%;min-width:680px;border-collapse:collapse;font-size:.85rem}
table.cmp th{
  padding:14px 18px;
  text-align:left;
  font-size:.64rem;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--a4v-muted);
  background:rgba(6,29,58,.03);
  border-bottom:1px solid var(--a4v-border);
  white-space:nowrap;
}
table.cmp td{padding:16px 18px;border-bottom:1px solid var(--a4v-border);color:var(--a4v-muted);font-weight:500;vertical-align:top}
table.cmp tr:last-child td{border-bottom:0}
table.cmp td.model{color:var(--a4v-navy);font-weight:800}
table.cmp tr.us{background:rgba(237,28,36,.035)}
table.cmp tr.us td{color:var(--a4v-navy)}
table.cmp tr.us td.model{color:var(--a4v-red)}

/* ── Mascotte 3D en pied de page (port de FluffyMascot3D — meteolibre) ── */
.a4v-mascot{display:flex;flex-direction:column;align-items:center;padding-top:26px}
#fluffy-mount{width:100%;max-width:620px;height:380px;cursor:pointer;user-select:none;-webkit-user-select:none}
#fluffy-mount canvas{display:block}
.mascot-hint{margin:0 0 10px;font-size:.75rem;font-weight:500;letter-spacing:.08em;color:var(--a4v-muted);opacity:.75;text-align:center}

@media (max-width:991px){
  .bench-grid{grid-template-columns:1fr}
}

@media (max-width:767px){
  #fluffy-mount{height:290px}
}

/* ===========================================================
   CARTE DE PRÉVISION GLOBALE LIVE (section Concept)
   Port vanilla de la GlobalForecast Mapbox de meteolibre :
   frame sombre pleine largeur, tuiles raster du modèle global,
   barre de lecture + canaux IR/VIS/RADAR. Repli statique via
   .fc-poster tant que la classe .fc-ready n'est pas posée.
   =========================================================== */
.fc-showcase{margin-top:36px}
.fc-frame{
  position:relative;
  height:min(62vh,560px);
  min-height:430px;
  border-radius:var(--a4v-radius-sm);
  overflow:hidden;
  background:#050f1e;
  border:1px solid var(--a4v-border);
  box-shadow:var(--a4v-shadow);
}
/* Capture statique de repli : au-dessus de la carte tant que
   celle-ci n'est pas prête, puis fondu (classe .fc-ready posée
   par js/ai4atlas-forecast-map.js sur l'évènement 'load'). */
.fc-poster{
  position:absolute;
  inset:0;
  z-index:2;
  width:100%;
  height:100%;
  max-width:none;
  object-fit:cover;
  transition:opacity .7s ease;
}
.fc-frame.fc-ready .fc-poster{opacity:0;pointer-events:none}
/* ATTENTION spécificité : mapbox-gl.css est injecté au démarrage de la carte
   (donc APRÈS cette feuille) et pose .mapboxgl-map{position:relative} —
   sans ce sélecteur double-classe, le conteneur retomberait en flux avec
   une hauteur nulle et la carte resterait invisible (canvas 0px). */
.fc-frame .fc-map{position:absolute;inset:0;z-index:1}
.fc-map .mapboxgl-canvas:focus{outline:none}

/* ── Bandeau haut : puce live ── */
.fc-topbar{
  position:absolute;
  top:14px;left:14px;right:14px;
  z-index:5;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  pointer-events:none;
}
.fc-caption{
  display:inline-flex;
  align-items:center;
  gap:9px;
  padding:9px 15px;
  background:rgba(5,15,30,.82);
  backdrop-filter:blur(6px);
  border:1px solid rgba(255,255,255,.14);
  border-radius:999px;
  color:#fff;
  font-size:.7rem;
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
  pointer-events:auto;
}
.fc-caption .live-dot{background:var(--a4v-red-2);box-shadow:0 0 0 4px rgba(255,58,66,.16);animation:fc-dot 1.6s ease-in-out infinite}
@keyframes fc-dot{0%,100%{box-shadow:0 0 0 3px rgba(255,58,66,.10)}50%{box-shadow:0 0 0 6px rgba(255,58,66,.03)}}

/* ── Barre de contrôle basse ── */
.fc-bar{
  position:absolute;
  left:14px;right:14px;bottom:34px; /* laisse la ligne d'attribution Mapbox visible dessous */
  z-index:5;
  display:flex;
  align-items:center;
  gap:14px;
  padding:10px 14px;
  background:rgba(5,15,30,.86);
  backdrop-filter:blur(8px);
  border:1px solid rgba(255,255,255,.14);
  border-radius:16px;
}
.fc-timeline{
  flex:1 1 160px;
  display:flex;
  align-items:center;
  gap:10px;
  min-width:120px;
}
.fc-t-edge{
  font-size:.66rem;
  font-weight:700;
  color:rgba(255,255,255,.55);
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
#fc-slider{
  -webkit-appearance:none;
  appearance:none;
  flex:1;
  height:4px;
  margin:0;
  border-radius:2px;
  background:linear-gradient(to right,var(--a4v-red) 0%,var(--a4v-red) var(--fill,0%),rgba(255,255,255,.18) var(--fill,0%),rgba(255,255,255,.18) 100%);
  cursor:pointer;
}
#fc-slider::-webkit-slider-thumb{
  -webkit-appearance:none;
  width:16px;height:16px;
  border-radius:50%;
  background:#fff;
  border:3px solid var(--a4v-red);
  box-shadow:0 2px 8px rgba(0,0,0,.5);
}
#fc-slider::-moz-range-thumb{
  width:10px;height:10px;
  border-radius:50%;
  background:#fff;
  border:3px solid var(--a4v-red);
  box-shadow:0 2px 8px rgba(0,0,0,.5);
}

.fc-current{
  flex:0 0 auto;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:2px;
  text-align:right;
}
.fc-cur-date{
  font-size:.85rem;
  font-weight:800;
  color:#fff;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.fc-cur-meta{
  display:flex;align-items:center;gap:8px;
  font-size:.62rem;
  font-weight:700;
  letter-spacing:.05em;
  text-transform:uppercase;
  color:rgba(255,255,255,.6);
  white-space:nowrap;
}
.fc-tz{
  border:1px solid rgba(255,255,255,.25);
  background:transparent;
  color:rgba(255,255,255,.78);
  font-family:var(--a4v-font);
  font-size:.56rem;
  font-weight:800;
  letter-spacing:.07em;
  padding:2px 9px;
  border-radius:999px;
  cursor:pointer;
  transition:color .15s ease,border-color .15s ease;
}
.fc-tz:hover,.fc-tz[aria-pressed="true"]{color:#fff;border-color:rgba(255,255,255,.55)}

/* ── Pilules de canaux (IR / VIS / RADAR) ── */
.fc-channels{
  flex:0 0 auto;
  display:flex;
  gap:4px;
  padding:4px;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.12);
  border-radius:999px;
}
.fc-chip{
  border:0;
  background:transparent;
  color:rgba(255,255,255,.72);
  font-family:var(--a4v-font);
  font-size:.66rem;
  font-weight:800;
  letter-spacing:.07em;
  padding:6px 13px;
  border-radius:999px;
  cursor:pointer;
  transition:background .15s ease,color .15s ease;
}
.fc-chip:hover{color:#fff}
.fc-chip.is-active{background:var(--a4v-red);color:#fff;box-shadow:0 4px 14px rgba(237,28,36,.45)}
.fc-chip[disabled]{opacity:.32;cursor:not-allowed}

/* ── Légende radar (dBZ) — palette NWS du backend (5–65 dBZ) ── */
.fc-legend{
  position:absolute;
  left:14px;
  bottom:106px;
  z-index:5;
  width:216px;
  padding:10px 12px;
  background:rgba(5,15,30,.86);
  backdrop-filter:blur(8px);
  border:1px solid rgba(255,255,255,.14);
  border-radius:12px;
}
.fc-legend-title{
  font-size:.6rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:rgba(255,255,255,.72);
  margin-bottom:7px;
}
.fc-legend-bar{
  height:9px;
  border-radius:4px;
  background:linear-gradient(to right,
    #04E904 0%,#04AA04 8.3%,#047704 16.7%,
    #FDF604 25%,#E3C304 33.3%,#F9A504 41.7%,#F97304 50%,
    #F92904 58.3%,#C00000 66.7%,#FF00FF 75%,
    #A759C2 83.3%,#731FA5 91.7%,#04D5D5 100%);
}
.fc-legend-ticks{
  display:flex;
  justify-content:space-between;
  margin-top:4px;
  font-size:.58rem;
  color:rgba(255,255,255,.55);
  font-variant-numeric:tabular-nums;
}
.fc-legend-note{
  margin-top:6px;
  font-size:.56rem;
  line-height:1.35;
  color:rgba(255,255,255,.45);
}

/* ── Statut (chargement / erreur) ── */
.fc-status{
  position:absolute;
  top:50%;left:50%;
  transform:translate(-50%,-50%);
  z-index:6;
  padding:10px 20px;
  border-radius:999px;
  background:rgba(5,15,30,.9);
  border:1px solid rgba(255,255,255,.16);
  color:rgba(255,255,255,.88);
  font-size:.74rem;
  font-weight:700;
  text-align:center;
  max-width:80%;
}
.fc-status[data-kind="load"]{animation:fc-pulse 1.2s ease-in-out infinite}
.fc-status[data-kind="error"]{background:rgba(58,7,11,.93);border-color:rgba(237,28,36,.5);color:#ffd9db}
@keyframes fc-pulse{0%,100%{opacity:.9}50%{opacity:.5}}

/* ── Zone sous la carte ── */
.fc-under{
  margin-top:22px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:16px;
  text-align:center;
}
.fc-under-txt{
  margin:0;
  max-width:680px;
  font-size:.88rem;
  font-weight:500;
  line-height:1.65;
  color:var(--a4v-muted);
}
.radar-badge-live{
  display:inline-block;
  padding:7px 15px;
  border-radius:999px;
  background:rgba(237,28,36,.06);
  border:1px solid rgba(237,28,36,.25);
  color:var(--a4v-red);
  font-size:.64rem;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}

/* ── Accessibilité clavier ── */
.fc-chip:focus-visible,.fc-tz:focus-visible,#fc-slider:focus-visible{
  outline:2px solid var(--a4v-red-2);
  outline-offset:2px;
}

/* ── Mobile ── */
@media (max-width:767px){
  .fc-frame{height:470px;min-height:0}
  .fc-bar{
    flex-wrap:wrap;
    justify-content:space-between;
    gap:10px;
    bottom:30px;
    padding:10px 12px;
  }
  .fc-timeline{order:1;flex-basis:100%}
  .fc-t-edge{display:none}
  .fc-current{order:2;flex:1 1 auto;align-items:flex-start;text-align:left}
  .fc-channels{order:3}
  .fc-legend{bottom:auto;top:64px;width:184px}
  .fc-caption{font-size:.6rem;padding:7px 12px}
}
@media (prefers-reduced-motion:reduce){
  .fc-status[data-kind="load"],.fc-caption .live-dot{animation:none}
}
