/* ==========================================================================
   lightbox.css — navigation dans la visionneuse
   Chargé après le <style> de la page : il a le dernier mot.
   Les éléments ci-dessous sont créés par js/lightbox.js.
   ========================================================================== */

.lightbox img {
  transition: opacity 0.18s ease;
}
.lightbox.lb-charge img { opacity: 0.35; }

/* --- Flèches précédent / suivant --- */
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  /* Pas de fond : la zone reste large pour le doigt, mais invisible. */
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  cursor: pointer;
}
.lb-nav svg {
  width: 26px; height: 26px;
  stroke: #fff; fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* L'ombre garde la flèche lisible, y compris sur une photo très claire. */
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.75));
  transition: transform 0.18s ease, opacity 0.18s ease;
  opacity: 0.9;
}
.lb-nav:hover svg { opacity: 1; }

/* Photo claire derrière la flèche : on inverse pour rester lisible. */
.lightbox.lb-prec-sombre .lb-prec svg,
.lightbox.lb-suiv-sombre .lb-suiv svg {
  stroke: #17150f;
  filter: drop-shadow(0 1px 4px rgba(255, 255, 255, 0.7));
}
.lb-prec:hover svg { transform: translateX(-3px); }
.lb-suiv:hover svg { transform: translateX(3px); }
.lb-prec { left: 18px; }
.lb-suiv { right: 18px; }

/* --- Compteur --- */
.lb-compteur {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12.5px;
  letter-spacing: 0.16em;
  font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.32);
  padding: 6px 14px;
  border-radius: 20px;
}

/* --- Écran tactile : les flèches s'effacent après 2 s --- */
.lightbox.lb-repos .lb-nav,
.lightbox.lb-repos .lb-compteur {
  opacity: 0;
  pointer-events: none;
}
.lightbox .lb-nav,
.lightbox .lb-compteur {
  transition: opacity 0.5s ease;
}

/* --- Le bouton de menu ne doit pas flotter au-dessus d'une photo --- */
body.lb-ouvert .mnav-btn { display: none; }

/* --- Une seule photo : pas de navigation --- */
.lightbox.lb-seule .lb-nav,
.lightbox.lb-seule .lb-compteur { display: none; }

/* --- Écrans tactiles : le doigt remplace les flèches, on les allège --- */
@media (max-width: 860px) {
  .lb-nav { width: 50px; height: 50px; }
  .lb-prec { left: 2px; }
  .lb-suiv { right: 2px; }
  .lb-nav svg { width: 23px; height: 23px; }
  .lb-compteur { bottom: 16px; font-size: 12px; }
  .lightbox img { max-width: 94vw; max-height: 74vh; }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox img, .lb-nav svg,
  .lightbox .lb-nav, .lightbox .lb-compteur { transition: none; }
}
