/* ═══════════════════════════════════════════════════════
   NAV MOBILE — burger menu + CTA réduit
   Inclus sur toutes les pages via <link>+<script> (cf. nav-mobile.js)
   Patch le pattern .nav-window inline (avec !important pour override
   les media queries inline qui masquaient les liens sans alternative).
   ═══════════════════════════════════════════════════════ */

/* Brand cliquable (retour accueil) : style discret, hover subtil */
a.nav-brand,
.nav-brand a.nav-name {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
a.nav-brand:hover,
.nav-brand a.nav-name:hover {
  opacity: 0.7;
}
a.nav-brand:active,
.nav-brand a.nav-name:active {
  transform: scale(0.98);
}
a.nav-brand:focus-visible,
.nav-brand a.nav-name:focus-visible {
  outline: 2px solid var(--accent, #007AFF);
  outline-offset: 4px;
  border-radius: 4px;
}

.nav-burger {
  display: none;
  background: transparent;
  border: 1px solid var(--border, rgba(0,0,0,0.10));
  border-radius: 9px;
  width: 36px;
  height: 36px;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text, #1D1D1F);
  transition: background 0.15s, border-color 0.15s;
}
.nav-burger:hover { background: rgba(0,0,0,0.04); }
body[data-theme="dark"] .nav-burger:hover { background: rgba(255,255,255,0.06); }
.nav-burger svg { display: block; width: 18px; height: 18px; }

@media (max-width: 800px) {
  .nav-window {
    flex-wrap: wrap;
    padding: 10px 14px !important;
    gap: 10px !important;
  }
  .nav-burger {
    display: inline-flex;
    margin-left: auto;
  }
  /* services.html : nav-window est un grid 3 col → on simplifie en 2 col mobile */
  .nav-window:has(.nav-right) {
    grid-template-columns: 1fr auto !important;
  }
  .nav-window .nav-center { display: none !important; }
  .nav-window .nav-right {
    gap: 8px !important;
    flex-wrap: wrap;
    justify-content: flex-end !important;
  }
  .nav-window .nav-title kbd { display: none !important; }
  .nav-window .nav-tagline-row { display: none !important; }
  /* services.html : quand drawer ouvert, le nav-right span toute la largeur */
  .nav-window[data-nav-open="true"]:has(.nav-right) {
    grid-template-columns: 1fr !important;
  }
  .nav-window[data-nav-open="true"]:has(.nav-right) .nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .nav-window[data-nav-open="true"]:has(.nav-right) .nav-right {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  /* Sound toggle et traffic-lights : masqués dans le drawer mobile pour épurer */
  .nav-window[data-nav-open="true"] #sound-toggle { display: none !important; }

  /* Drawer fermé : tout est caché sauf brand+dots+burger */
  .nav-links {
    display: none !important;
    width: 100%;
    flex-direction: column;
    margin-left: 0 !important;
    gap: 2px !important;
    padding-top: 12px !important;
    margin-top: 8px !important;
    border-top: 1px solid var(--border, rgba(0,0,0,0.08));
    align-items: stretch !important;
    list-style: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .nav-links li { display: block !important; width: 100% !important; margin: 0 !important; }

  /* Drawer ouvert : matche les 2 patterns (a direct OU li>a) */
  .nav-window[data-nav-open="true"] .nav-links {
    display: flex !important;
  }
  .nav-window[data-nav-open="true"] .nav-links > a,
  .nav-window[data-nav-open="true"] .nav-links > li > a {
    display: block !important;
    padding: 11px 4px !important;
    font-size: 15px !important;
    border-bottom: 1px solid var(--border, rgba(0,0,0,0.06));
  }
  .nav-window[data-nav-open="true"] .nav-links > a:last-child,
  .nav-window[data-nav-open="true"] .nav-links > li:last-child > a {
    border-bottom: none;
  }
  .nav-window[data-nav-open="true"] .nav-links .nav-cta {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin-top: 10px !important;
    padding: 11px 18px !important;
    font-size: 14.5px !important;
    border-bottom: none !important;
    width: auto !important;
  }
  /* Si .nav-cta est dans un li, on étend le li pour centrer le CTA */
  .nav-window[data-nav-open="true"] .nav-links > li:has(.nav-cta) {
    text-align: left;
    margin-top: 6px !important;
  }
}

@media (max-width: 600px) {
  .nav-burger { width: 34px; height: 34px; border-radius: 8px; }
  .nav-burger svg { width: 17px; height: 17px; }
  .nav-window { padding: 9px 12px !important; }
}
