/* =========================================================
   Menu « le rideau et le projecteur » (sous 1240 px)
   Remplace le menu plein écran générique : à l'ouverture, le rideau s'écarte
   et laisse la scène nuit, avec un projecteur sur rail qui éclaire l'entrée
   active (survol, focus ou groupe ouvert). Entrées numérotées, sous-pages
   avec leur description, bouton jaune et coordonnées en bas.
   - Se charge après hero-v4.css (et hero-v5.css / fiche.css) ; le balisage est
     produit par `bak/build-menu.py`.
   - Sans JS : projecteur droit, tout est lisible ; le JS (`menu-da.js`) ne
     fait qu'orienter le projecteur et marquer l'entrée éclairée.
   - Mouvement réduit : le rideau est déjà ouvert, rien ne bouge.
   Le bouton fermé (`.burger`) est une pastille verre « Menu » + pastille jaune
   à deux barres, du même verre que la barre de navigation (ton clair / sombre
   via --nv-*).
   ========================================================= */

/* ---------- Le bouton ---------- */
/* ≥ 520 px : pastille verre « Menu » + pastille jaune à deux barres.
   < 520 px : rond jaune plein, deux barres (le rond de l'Afrique reste à sa gauche). */
:root { --burger-w: 114px; }
.burger {
  height: 48px;
  padding: 0 7px 0 20px;
  gap: 14px;
  grid-auto-flow: column;
  border-color: transparent;     /* pas de contour : le verre suffit */
  border-radius: 999px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
}
@media (max-width: 1239px) {
  .burger { display: inline-grid; width: auto; }
  /* le rond de l'Afrique se pose toujours à gauche du bouton menu */
  .spot { right: calc(var(--pad-x) + var(--burger-w) + 22px); }
}
.burger__bars {
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 5px;
  width: 34px;
  height: 34px;
  padding-right: 9px;
  border-radius: 50%;
  background: var(--gold);
  transition: background-color 0.25s;
}
.burger__bars i {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: width 0.3s var(--ease-out);
}
.burger__bars i:first-child { width: 16px; }
.burger__bars i:last-child { width: 10px; }
.burger:hover .burger__bars i:last-child,
.burger:focus-visible .burger__bars i:last-child { width: 16px; }
.burger:hover .burger__bars { background: var(--gold-strong); }
.burger:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
@media (max-width: 519px) {
  :root { --burger-w: 46px; }
  .burger {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border-color: transparent;
    background: var(--gold);
    color: var(--ink);
    box-shadow: 0 6px 18px rgb(0 0 0 / 0.28);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .burger:hover { background: var(--gold-strong); }
  .burger__label { display: none; }
  .burger__bars { width: auto; height: auto; padding: 0; background: none; }
}

/* ---------- Le menu ---------- */
.menu--da {
  --rig-x: 58%;
  --rig-y: 0px;
  --rig-w: 60px;
  --rig-tilt: -10deg;
  --drape-w: clamp(10px, 3vw, 44px);
  --menu-pad: max(24px, calc(var(--drape-w) + 16px));
  position: fixed;
  inset: 0;
  display: none;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(110% 60% at 58% 0%, rgb(34 54 88 / 0.55), transparent 70%),
    var(--night);
  color: var(--paper);
}
.menu--da[open] { display: block; }
.menu--da::backdrop { background: var(--night); }

/* la scène : lumière, rail et projecteur, rideaux ; jamais cliquable */
.menu--da .menu__stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.menu--da .menu__light { position: absolute; inset: 0; z-index: 0; }
.menu--da .cone { --spread: 17deg; --throw: max(900px, 120vh); opacity: 0.8; }
.menu--da .rig { z-index: 0; }

/* les rideaux : fermés à l'ouverture, ils s'écartent et restent en retrait sur les bords */
.menu--da .menu__drape {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: 50.5%;
  background:
    linear-gradient(rgb(8 15 30 / 0.4), rgb(8 15 30 / 0.4)),
    url("../img/v4/rideau-1200.webp") center / cover;
  box-shadow: 0 0 30px rgb(0 0 0 / 0.55);
}
.menu--da .menu__drape--l { left: 0; transform: translateX(calc(-100% + var(--drape-w))); }
.menu--da .menu__drape--r { right: 0; transform: translateX(calc(100% - var(--drape-w))); }

/* le corps, qui défile ; le projecteur et les rideaux ne bougent pas */
.menu--da .menu__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0 var(--menu-pad) calc(28px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.menu--da .menu__body::-webkit-scrollbar { display: none; }

.menu--da .menu__head {
  flex: none;
  height: 48px;
  margin-top: calc(18px + env(safe-area-inset-top));
}
.menu--da .menu__brand { display: block; border-radius: 6px; }
.menu--da .menu__brand:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }
.menu--da .menu__logo { height: 34px; }
.menu--da .icon-btn {
  width: 46px;
  height: 46px;
  border-color: transparent;
  background: rgb(255 255 255 / 0.09);
  transition: background-color 0.25s, color 0.25s;
}
.menu--da .icon-btn:hover { background: rgb(255 255 255 / 0.17); }
.menu--da .icon-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
/* fermer : le seul aplat jaune de l'en-tête */
.menu--da .menu__tools .icon-btn:last-child { background: var(--gold); color: var(--ink); }
.menu--da .menu__tools .icon-btn:last-child:hover { background: var(--gold-strong); }
.menu--da .icon-btn svg { stroke-width: 1.8; }

/* ---------- Les entrées ---------- */
.menu--da .menu__nav {
  display: grid;
  margin-top: clamp(20px, 4.5vh, 40px);
  align-content: start;
}
.menu--da .menu__link,
.menu--da .menu__group > summary {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 14px;
  padding: clamp(10px, 1.7vh, 15px) 0;
  border-bottom: 1px solid rgb(255 255 255 / 0.09);
  font-size: 1rem;
  color: var(--paper);
  cursor: pointer;
}
.menu--da .menu__group > summary::-webkit-details-marker { display: none; }
.menu--da .menu__group[open] > summary { border-bottom-color: transparent; }
.menu--da .menu__num {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  opacity: 0.9;
}
.menu--da .menu__title {
  font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.75rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.012em;
  color: var(--paper);
  transition: color 0.3s;
}
.menu--da .menu__chev {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.08);
  color: var(--paper);
  opacity: 1;
  transition: background-color 0.3s, color 0.3s;
}
.menu--da .menu__chev svg { width: 20px; height: 20px; stroke-width: 1.8; transition: transform 0.35s var(--ease-out); }
.menu--da .menu__group[open] > summary .menu__chev { transform: none; background: var(--gold); color: var(--ink); }
.menu--da .menu__group[open] > summary .menu__chev svg { transform: rotate(180deg); }
.menu--da .menu__link:hover .menu__chev--go { background: var(--gold); color: var(--ink); }
.menu--da .menu__group > summary:hover .menu__chev { background: rgb(255 255 255 / 0.16); }
.menu--da .menu__group[open] > summary:hover .menu__chev { background: var(--gold-strong); }
.menu--da :is(.menu__link, .menu__group > summary):focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 10px; }

/* l'entrée éclairée : les autres s'éteignent un peu ; groupe ouvert = jaune */
.menu--da .menu__nav.has-lit > :not(.is-lit) .menu__title { color: rgb(255 255 255 / 0.46); }
.menu--da .menu__nav > .is-lit .menu__title { color: var(--paper); }
.menu--da .menu__group[open].is-lit > summary .menu__title { color: var(--gold); }
.menu--da .menu__group[open]:not(.is-lit) > summary .menu__title { color: rgb(226 174 12 / 0.55); }

/* ---------- Les sous-pages ---------- */
.menu--da .menu__sub {
  display: grid;
  gap: 2px;
  padding: 2px 0 18px calc(2.25rem + 14px);
  border-bottom: 1px solid rgb(255 255 255 / 0.09);
}
.menu--da .menu__label {
  margin: 12px 0 2px;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
.menu--da .menu__label:first-child { margin-top: 4px; }
.menu--da .menu__sub a.menu__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 14px;
  margin: 0 -12px;
  padding: 9px 12px;
  border-radius: 14px;
  color: var(--paper);
  text-decoration: none;
  transition: background-color 0.2s;
}
.menu--da .menu__sub a.menu__item:hover,
.menu--da .menu__sub a.menu__item:focus-visible { background: rgb(255 255 255 / 0.07); outline: 0; }
.menu--da .menu__name { font-size: 1.125rem; font-weight: 400; line-height: 1.25; color: var(--paper); }
.menu--da .menu__desc { grid-column: 1; font-size: 0.875rem; line-height: 1.35; color: var(--muted); }
.menu--da .menu__arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
  color: var(--faint);
  transition: color 0.2s, translate 0.3s var(--ease-out);
}
.menu--da .menu__item:hover .menu__arrow { color: var(--gold); translate: 2px 0; }
.menu--da .menu__sub a.menu__all {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 8px;
  margin: 12px 0 0;
  padding: 9px 14px 9px 16px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.1);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--paper);
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.menu--da .menu__all .menu__arrow { grid-column: auto; grid-row: auto; width: 16px; height: 16px; color: currentColor; }
.menu--da .menu__sub a.menu__all:hover,
.menu--da .menu__sub a.menu__all:focus-visible { background: var(--gold); color: var(--ink); outline: 0; }
/* page du site réel pas encore maquettée */
.menu--da .menu__todo {
  margin-left: 10px;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  vertical-align: middle;
  color: var(--faint);
}
.menu--da .menu__title .menu__todo { margin-left: 12px; }
.menu--da[data-todo="off"] .menu__todo { display: none; }

/* ---------- Le pied : jaune + coordonnées ---------- */
.menu--da .menu__foot { margin-top: auto; padding-top: clamp(24px, 4vh, 36px); gap: 18px; }
.menu--da .menu__foot .btn--gold { justify-self: start; }
.menu--da .menu__contact { display: grid; gap: 4px; }
.menu--da .menu__contact a {
  gap: 12px;
  padding: 4px 0;
  font-size: 0.9375rem;
  color: var(--muted);
  transition: color 0.2s;
}
.menu--da .menu__contact a:hover { color: var(--paper); }
.menu--da .menu__ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.08);
  color: var(--gold);
}
.menu--da .menu__ico svg { width: 18px; height: 18px; stroke-width: 1.7; }

/* ---------- Tablette large : entrées à gauche, carte de contact à droite ---------- */
@media (min-width: 600px) {
  .menu--da { --rig-x: 46%; }
}
@media (min-width: 900px) {
  .menu--da { --rig-x: 32%; --menu-pad: max(48px, calc(var(--drape-w) + 36px)); }
  .menu--da .menu__body {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.8fr);
    grid-template-rows: auto 1fr;
    column-gap: clamp(40px, 7vw, 110px);
  }
  .menu--da .menu__head { grid-column: 1 / -1; }
  .menu--da .menu__nav { grid-column: 1; grid-row: 2; }
  .menu--da .menu__foot {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    margin-top: 0;
    padding: 28px 28px 24px;
    border-radius: 28px;
    background: rgb(255 255 255 / 0.05);
  }
}

/* ---------- Petite hauteur (téléphone à plat) ---------- */
@media (max-height: 520px) {
  .menu--da .menu__title { font-size: 1.5rem; }
  .menu--da .menu__link,
  .menu--da .menu__group > summary { padding: 7px 0; }
  .menu--da .menu__chev { width: 34px; height: 34px; }
}

/* ---------- L'ouverture : le rideau s'écarte, le projecteur s'allume ---------- */
@keyframes mda-drape-l { from { transform: translateX(0); } }
@keyframes mda-drape-r { from { transform: translateX(0); } }
@keyframes mda-light { from { opacity: 0; } }
@keyframes mda-rise { from { opacity: 0; translate: 0 16px; } }
@keyframes mda-sub { from { opacity: 0; translate: 0 8px; } }

@media (prefers-reduced-motion: no-preference) {
  .menu--da[open] .menu__drape--l { animation: mda-drape-l 0.95s 0.05s cubic-bezier(0.65, 0, 0.25, 1) backwards; }
  .menu--da[open] .menu__drape--r { animation: mda-drape-r 0.95s 0.05s cubic-bezier(0.65, 0, 0.25, 1) backwards; }
  .menu--da[open] .menu__light,
  .menu--da[open] .rig__lamp .rig__glow { animation: mda-light 0.7s 0.45s ease-out backwards; }
  .menu--da[open] .menu__head { animation: mda-rise 0.6s 0.3s var(--ease-out) backwards; }
  .menu--da[open] .menu__nav > * { animation: mda-rise 0.6s calc(0.38s + var(--i, 0) * 0.06s) var(--ease-out) backwards; }
  .menu--da[open] .menu__foot { animation: mda-rise 0.6s 0.78s var(--ease-out) backwards; }
  .menu--da .menu__group[open] .menu__sub > * { animation: mda-sub 0.4s calc(var(--k, 0) * 0.03s) var(--ease-out) backwards; }
}
@media (prefers-reduced-motion: reduce) {
  .menu--da * { transition: none !important; }
}
