/* Rail de navigation (desktop + mobile) + tiroir mobile.
   Extrait de base.css (retour Noé 2026-08-09 : fichier au plafond de 300 lignes). */

/* ── Rail de navigation (pleine largeur, horizontal) ── */
/* Rail : posé sur la ligne du fond (.bg-band), fondu doux — pas de barre opaque ni de trait en plus */
.rail {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: 8px max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(5, 7, 13, 0.96) 30%, rgba(6, 8, 13, 0.5) 75%, transparent);
}
.rail-track {
  max-width: 1180px; margin: 0 auto;
  display: flex; gap: 4px; align-items: flex-end; justify-content: center;
}
.rail-group { flex: 1 1 0; min-width: 0; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.rail-group::-webkit-scrollbar { display: none; }
.rail-group.left { justify-content: flex-end; }
.rail-group.right { justify-content: flex-start; }
.rail-item {
  position: relative; flex: 0 0 auto; min-width: 62px; scroll-snap-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 9px 6px 6px; border-radius: var(--r-sm);
  font-size: 0.58rem; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim);
  transition: color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
/* Pull — action reine, au centre, mis en avant */
.rail-item--hero { flex: 0 0 auto; margin: 0 var(--s3); color: var(--ink); }
.rail-item--hero .rail-ico {
  width: 48px; height: 48px; border-radius: 50%; margin-bottom: 2px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 34%, rgba(188, 215, 255, 0.22), rgba(188, 215, 255, 0.05));
  border: 1px solid rgba(188, 215, 255, 0.4); box-shadow: 0 0 20px rgba(188, 215, 255, 0.22);
  transition: box-shadow var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.rail-item--hero .rail-ico svg { width: 24px; height: 24px; }
.rail-item--hero::before { display: none; }
.rail-item--hero:hover .rail-ico { box-shadow: 0 0 28px rgba(188, 215, 255, 0.35); }
.rail-item--hero[aria-current="page"] { color: var(--accent); }
.rail-item--hero[aria-current="page"] .rail-ico { border-color: var(--accent); box-shadow: 0 0 30px rgba(188, 215, 255, 0.45); }
.rail-item::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%) scaleX(0);
  width: 26px; height: 3px; border-radius: 3px; background: var(--gold);
  transition: transform 220ms var(--ease-spring); transform-origin: center;
}
.rail-ico { position: relative; display: flex; align-items: center; justify-content: center; }
.rail-ico svg { width: 22px; height: 22px; }
.rail-item:hover { color: var(--ink); background: rgba(237, 239, 247, 0.05); }
.rail-item:active { transform: scale(0.94); }
.rail-item[aria-current="page"] { color: var(--gold); }
.rail-item[aria-current="page"]::before { transform: translateX(-50%) scaleX(1); }
.rail-item[aria-current="page"] .rail-ico { filter: drop-shadow(0 0 8px rgba(245, 198, 79, 0.5)); }
.rail-badge {
  position: absolute; top: -5px; right: -8px;
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: var(--r-pill);
  background: var(--danger); color: #fff; font-size: 0.58rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--bg);
}

/* ── Nav mobile (≤720px) : barre allégée (Menu + Pull + Profil) + tiroir ──
   Le rail complet (11 entrées) ne tient pas sur petit écran : mesuré à l'exécution, le
   groupe de droite avait un scrollWidth de 360px pour 130px visibles (flick horizontal
   dans une bande minuscule, à peine praticable). Caché sur mobile, remplacé par ce qui suit. */
.rail-mobile { display: none; }
.nav-drawer { position: fixed; inset: 0; z-index: 90; }
.nav-drawer-backdrop { position: fixed; inset: 0; background: rgba(5, 7, 13, 0.7); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.nav-drawer-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1;
  max-height: 78svh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg-raised); border-top: 1px solid var(--border-strong);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: var(--s3) var(--s4) max(var(--s5), env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform var(--t-med) var(--ease-spring);
}
.nav-drawer-sheet.dragging { transition: none; }
/* Poignée de glissement (pas de bouton croix — fermeture par glissé vers le bas ou tap en dehors). */
.nav-drawer-handle { width: 36px; height: 4px; border-radius: var(--r-pill); background: var(--border-strong); margin: 0 auto var(--s4); touch-action: none; padding: 10px 40px; background-clip: content-box; }
.nav-drawer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.drawer-item {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--s2);
  padding: var(--s4) var(--s2); border-radius: var(--r-md); border: 1px solid var(--border);
  font-size: 0.72rem; color: var(--ink-soft); text-align: center;
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.drawer-item:active { transform: scale(0.96); }
.drawer-item[aria-current="page"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.drawer-item .rail-ico svg { width: 22px; height: 22px; }

@media (max-width: 720px) {
  .rail--app { display: none; }
  .rail-mobile {
    display: flex; align-items: flex-end; justify-content: center; gap: var(--s7);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 8px max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(5, 7, 13, 0.96) 30%, rgba(6, 8, 13, 0.5) 75%, transparent);
  }
  .nav-drawer.open .nav-drawer-sheet { transform: translateY(0); }
}
