/* ══════════════════════════════════════════════════════════════
   base.css — Shell commun partagé
   Reset, variables :root cœur, typographie de base, navbar desktop
   + dropdown + hamburger, footer, accessibilité (skip-link, focus).

   Chargé par les pages de la famille « formules / pages locales » :
   auto-ecole-anglet, auto-ecole-biarritz, espace-eleves,
   formules/conduite-accompagnee, formules/permis-b-manuel,
   formules/permis-b-automatique.

   Ordre de chargement impératif sur chaque page :
     fonts.css → base.css → <style> inline (spécifique page + overrides)
     → nav-mobile.css → nav.js
   Les variables custom se résolvant à l'usage, un override d'accent
   (ex. --page-accent, --aac) posé dans le <style> inline, placé après
   base.css, reste pris en compte. nav-mobile.css doit rester APRÈS pour
   neutraliser les règles inline de scroll horizontal.
   ══════════════════════════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --noir: #0a0a0a;
    --blanc: #fafaf8;
    --creme: #f5f0e8;
    --rouge: #c0392b;
    --rouge-doux: #e74c3c;
    --rouge-sombre: #922b21;
    --gris: #6b7280;
    --gris-clair: #e5e5e5;
    --basque-rouge: #d63031;
    --basque-vert: #00695c;
    --or: #d4a853;
    --ombre: 0 4px 30px rgba(0,0,0,0.08);
    --ombre-forte: 0 20px 60px rgba(0,0,0,0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: 'DM Sans', sans-serif; background: var(--blanc); color: var(--noir); line-height: 1.7; overflow-x: hidden; }

/* NAVBAR */
nav {
    position: fixed; top: 0; width: 100%; z-index: 1000;
    padding: 1rem 2rem; background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 30px rgba(0,0,0,0.06);
}
nav .nav-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
nav .logo { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700; color: var(--noir); text-decoration: none; letter-spacing: -0.02em; }
nav .logo span { color: var(--basque-rouge); }
nav .nav-links { display: flex; gap: 2rem; list-style: none; align-items: center; }
nav .nav-links a { text-decoration: none; color: var(--noir); font-size: 0.9rem; font-weight: 500; letter-spacing: 0.02em; transition: var(--transition); }
nav .nav-links a:hover { color: var(--basque-rouge); }
nav .nav-cta { background: var(--basque-rouge); color: white !important; padding: 0.6rem 1.4rem; border-radius: 50px; font-weight: 600; font-size: 0.85rem; transition: var(--transition); }
nav .nav-cta:hover { background: var(--rouge-sombre); transform: translateY(-1px); }

/* DROPDOWN */
.nav-dropdown { position: relative; }
.nav-dropdown > a { display: inline-flex; align-items: center; gap: 0.25rem; }
.nav-caret { font-size: 0.7em; transition: transform 0.25s ease; opacity: 0.7; }
.nav-dropdown:hover .nav-caret,
.nav-dropdown:focus-within .nav-caret { transform: rotate(-180deg); }
.nav-dropdown-menu {
    position: absolute; top: calc(100% + 0.6rem); left: -1rem;
    min-width: 260px; padding: 0.5rem;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 40px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.04);
    list-style: none; margin: 0;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
    z-index: 1002;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s;
}
.nav-dropdown-menu::before { content: ''; position: absolute; top: -0.6rem; left: 0; right: 0; height: 0.6rem; }
.nav-dropdown-menu li { display: block; }
.nav-dropdown-menu a {
    display: block; padding: 0.7rem 0.9rem; border-radius: 8px;
    font-size: 0.9rem; font-weight: 500; color: var(--noir);
    text-decoration: none; line-height: 1.3;
    transition: background 0.2s ease, color 0.2s ease;
}
.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus-visible { background: rgba(214,48,49,0.07); color: var(--basque-rouge); outline: none; }

/* HAMBURGER */
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; z-index: 1001; background: none; border: none; padding: 0; }
.hamburger span { width: 24px; height: 2px; background: var(--noir); transition: var(--transition); }
@media (max-width: 768px) {
    nav { padding: 0.6rem 1rem; }
    .nav-inner { flex-direction: column; align-items: stretch; gap: 0; }
    nav .logo { white-space: nowrap; font-size: 1.2rem; overflow: hidden; max-height: 2.5rem; opacity: 1; padding-bottom: 0.35rem; transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.35s ease; }
    .nav-links { display: flex !important; flex-direction: row; gap: 1rem; overflow-x: auto; flex-wrap: nowrap; justify-content: center; padding-bottom: 0; width: 100%; -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none; }
    .nav-links::-webkit-scrollbar { display: none; }
    .nav-links li { flex-shrink: 0; }
    .nav-links a { font-size: 0.82rem; }
    .hamburger { display: none !important; }
    .nav-dropdown-menu { display: none; }
    .nav-caret { display: none; }
}

/* FOOTER */
footer { background: var(--noir); color: rgba(255,255,255,0.7); padding: 3rem 2rem; text-align: center; font-size: 0.85rem; }
footer .logo-footer { font-family: 'Playfair Display', serif; font-size: 1.8rem; font-weight: 700; color: white; margin-bottom: 0.8rem; }
footer .logo-footer span { color: var(--basque-rouge); }
footer p { margin-bottom: 0.4rem; }
footer a { color: rgba(255,255,255,0.5); text-decoration: none; }
footer a:hover { color: white; }
footer .footer-links { display: flex; gap: 1.5rem; justify-content: center; margin: 1.2rem 0; flex-wrap: wrap; }

/* ACCESSIBILITY */
.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; z-index: 10000; }
.skip-link:focus { position: fixed; top: 0; left: 0; width: auto; height: auto; padding: 1rem 2rem; background: var(--basque-rouge); color: #fff; font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 1rem; text-decoration: none; z-index: 10000; }
:focus-visible { outline: 3px solid var(--basque-rouge); outline-offset: 2px; }
