/* ================================================================
   SUPRADRAMA — nav.css v5
   v5: animation fermeture menu + touch target burger WCAG 44px
================================================================ */
:root {
  --nav-bg:      rgba(0,0,0,0.92);
  --nav-ink:     #fff;
  --nav-ink-dim: rgba(255,255,255,0.78);
  --z-overlay:   9000;
  --z-header:    10000;
  --z-menu:      10001;
  --safe-top:    env(safe-area-inset-top);
}

body.nav-open { overflow: hidden; overscroll-behavior: none; }

/* Header */
.header {
  position: fixed; top: 0; left: 0; right: 0;
  height: calc(72px + var(--safe-top));
  padding-top: var(--safe-top);
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  filter: none !important; transform: none !important;
  z-index: var(--z-header); pointer-events: auto;
}

/* Logo (centré) */
.logo { position: relative; z-index: calc(var(--z-header) + 1); text-align: center; }
.logo img {
  height: 48px; display: block;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.55)) drop-shadow(0 0 10px rgba(255,255,255,0.18));
  transition: transform 0.2s ease;
}
.logo:hover img { transform: scale(1.03); }

/* Burger — touch target 44px WCAG (fix [7]: padding 3px → 7px) */
.burger-menu {
  position: absolute; left: 20px;
  top: calc(50% + var(--safe-top) / 2); transform: translateY(-50%);
  width: 34px; height: 30px;
  padding: 7px;                /* ← v5: 3px→7px = zone de tap ~48×44px */
  display: flex; flex-direction: column; justify-content: space-between;
  border: 0; background: transparent; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  z-index: calc(var(--z-header) + 2);
}
.burger-menu span {
  display: block; width: 100%; height: 3px; border-radius: 2px;
  background: #fff !important;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.7));
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.burger-menu.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger-menu.open span:nth-child(2) { opacity: 0; }
.burger-menu.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.burger-menu:focus-visible { outline: 2px solid rgba(255,255,255,0.55); outline-offset: 6px; border-radius: 10px; }

/* Overlay */
[data-menu-overlay] {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  background: rgba(0,0,0,0.35); opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
}
body.nav-open [data-menu-overlay] { opacity: 1; pointer-events: auto; }
[data-menu-overlay][hidden]       { display: none !important; pointer-events: none !important; }

/* ── Menu fullscreen — fix [6]: animation fermeture ──────────────────────────
   Problème v4 : display:none s'appliquait immédiatement à la fermeture,
   coupant l'animation opacity/scale avant qu'elle se joue.
   Solution : on utilise visibility + pointer-events à la place de display.
   L'élément reste dans le flux mais invisible et non-interactif.
   On retarde visibility:hidden de 220ms (durée de la transition) pour que
   l'animation ait le temps de finir avant que l'élément disparaisse.
   ──────────────────────────────────────────────────────────────────────────── */
.menu {
  position: fixed; inset: 0; z-index: var(--z-menu);
  width: 100vw; height: 100vh; height: 100dvh; background: var(--nav-bg);
  display: flex;                            /* toujours flex, jamais display:none */
  justify-content: center; align-items: center; flex-direction: column; gap: 16px;
  opacity: 0;
  transform: scale(1.03);
  visibility: hidden;                       /* masqué par défaut */
  pointer-events: none;                     /* non-interactif quand fermé */
  transition: opacity 0.22s ease, transform 0.22s ease,
              visibility 0s linear 0.22s;   /* visibility delayed = attend la fin de l'anim */
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
}
.menu.open {
  opacity: 1;
  transform: scale(1);
  visibility: visible;                      /* visible immédiatement à l'ouverture */
  pointer-events: auto;
  transition: opacity 0.22s ease, transform 0.22s ease,
              visibility 0s linear 0s;      /* pas de délai à l'ouverture */
}
.menu a {
  color: var(--nav-ink); text-decoration: none; text-transform: uppercase;
  font-weight: 900; letter-spacing: 0.06em; font-size: clamp(1.12rem,3.2vw,1.6rem);
  display: flex; flex-direction: column; align-items: center; gap: 6px; line-height: 1;
  padding: 10px 14px; border-radius: 999px;
  transition: transform 0.16s ease, color 0.16s ease, background 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}
.menu a:hover         { color: var(--nav-ink-dim); transform: translateY(-1px); background: rgba(255,255,255,0.06); }
.menu a:focus-visible { outline: 2px solid rgba(255,255,255,0.55); outline-offset: 4px; }
.menu a .nav-sub      { font-size: 0.72rem; letter-spacing: 0.14em; opacity: 0.62; color: var(--nav-ink-dim); }
.menu a.is-active     {
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.menu a.is-active .nav-main {
  background: linear-gradient(90deg, var(--accent-color, #ff4d6d), var(--accent-hover, #ff7a9e));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.menu a.is-active .nav-sub { opacity: 0.85; }

/* Lang Switcher */
.lang-switcher-wrap {
  position: absolute; right: 20px;
  top: calc(50% + var(--safe-top) / 2); transform: translateY(-50%);
  z-index: calc(var(--z-header) + 2);
  display: flex; align-items: center; gap: 2px;
  padding: 5px 8px; border-radius: 999px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18);
  pointer-events: auto;
}
.lang-switcher {
  background: transparent; border: none; cursor: pointer; font-family: inherit;
  font-weight: 900; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.65); min-width: 36px; min-height: 36px; padding: 4px 8px;
  border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.16s ease, background 0.16s ease; -webkit-tap-highlight-color: transparent;
}
.lang-switcher:hover     { color: #fff; background: rgba(255,255,255,0.10); }
.lang-switcher.is-active { color: #fff; background: rgba(255,255,255,0.14); }
.lang-divider { color: rgba(255,255,255,0.28); font-size: 0.72rem; user-select: none; pointer-events: none; }

@media (max-width: 768px) {
  .logo img           { height: 46px; }
  .burger-menu        { left: 16px; }
  .lang-switcher-wrap { right: 16px; }
}

/* PATCH_MINEURS */

/* ── Fix logo homothétique (Phase 7 injecte des dims fixes) ─ */
.logo img {
  width: auto !important;
  height: 48px !important;
  object-fit: contain;
}
@media (max-width: 768px) {
  .logo img { height: 46px !important; }
}
