/* ---------- Agrandissement des captures : ouverture depuis la vignette, navigation, fermeture ---------- */
.zoom { display: block; width: 100%; padding: 0; margin: 0; border: 0; background: none; color: inherit; font: inherit; cursor: zoom-in; position: relative; -webkit-tap-highlight-color: transparent; }
.zoom::after { content: "⤢"; position: absolute; top: 12px; right: 12px; z-index: 2; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-size: 16px; line-height: 1;
  color: #fff; background: rgba(12, 10, 22, .55); border: 1px solid rgba(255, 255, 255, .22); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transform: scale(.85); transition: opacity .3s, transform .4s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
.zoom:hover::after, .zoom:focus-visible::after { opacity: 1; transform: none; }
@media (hover: none) { .zoom::after { opacity: .9; transform: none; } }
.zoom:focus-visible { outline: 2px solid var(--peche, #F4A297); outline-offset: 3px; }

html.lb-ouvert { overflow: hidden; }
dialog.lb { border: 0; padding: 0; margin: 0; max-width: none; max-height: none; width: 100vw; height: 100vh; height: 100dvh; background: transparent; color: #fff; overflow: hidden; }
dialog.lb[open] { display: grid; place-items: center; }
dialog.lb::backdrop { background: rgba(6, 5, 12, .88); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); animation: lb-fond .35s ease both; }
.lb.sort::backdrop { animation: lb-fond .22s ease reverse both; }
.lb.sort .lb-cadre, .lb.sort .lb-fermer, .lb.sort .lb-prec, .lb.sort .lb-suiv { opacity: 0; transition: opacity .2s; }
.lb-cadre { display: grid; justify-items: center; gap: 14px; max-width: 100vw; margin: 0; padding: 0 clamp(12px, 3vw, 56px); }
.lb-img { display: block; width: auto; height: auto; max-width: min(96vw, 2000px); max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); object-fit: contain; border-radius: 12px; background: #fff; box-shadow: 0 30px 90px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .1); will-change: transform; }
.lb-imgs { display: flex; justify-content: center; align-items: flex-start; gap: 16px; max-width: 100%; }
.lb-imgs.bascule { animation: lb-bascule .4s cubic-bezier(.2, .8, .2, 1); }
/* captures hautes (téléphone) : taille réelle, défilement vertical, plus lisibles qu'une image réduite à la hauteur de l'écran */
.lb-imgs.natif { max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); overflow-y: auto; overscroll-behavior: contain; padding: 2px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.35) transparent; }
.lb-imgs.natif .lb-img { max-width: none; max-height: none; flex: none; }
.lb-pied { display: flex; align-items: baseline; justify-content: center; gap: 18px; font: 11px/1.6 var(--mono, ui-monospace, monospace); letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .78); text-align: center; }
.lb-compteur { color: var(--peche, #F4A297); }
.lb-fermer, .lb-prec, .lb-suiv { position: fixed; z-index: 3; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border-radius: 50%; cursor: pointer; font: 300 26px/1 var(--sans, system-ui);
  color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: background .25s, transform .35s cubic-bezier(.2, .8, .2, 1); }
.lb-fermer:hover, .lb-prec:hover, .lb-suiv:hover { background: rgba(255, 255, 255, .22); }
.lb-fermer { top: clamp(12px, 2.4vw, 28px); right: clamp(12px, 2.4vw, 28px); }
.lb-fermer:hover { transform: rotate(90deg); }
.lb-prec, .lb-suiv { top: 50%; margin-top: -24px; }
.lb-prec { left: clamp(10px, 2vw, 28px); }
.lb-suiv { right: clamp(10px, 2vw, 28px); }
.lb-prec:hover { transform: translateX(-3px); }
.lb-suiv:hover { transform: translateX(3px); }
.lb-fermer:focus-visible, .lb-prec:focus-visible, .lb-suiv:focus-visible { outline: 2px solid var(--peche, #F4A297); outline-offset: 3px; }
.lb[data-seul="true"] .lb-prec, .lb[data-seul="true"] .lb-suiv, .lb[data-seul="true"] .lb-compteur { display: none; }
@keyframes lb-fond { from { opacity: 0; } to { opacity: 1; } }
@keyframes lb-bascule { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
/* mobile : l'image garde une taille lisible, on la fait défiler horizontalement */
@media (max-width: 700px) {
  .lb-cadre { max-width: 100vw; overflow-x: auto; justify-items: start; padding: 0 12px; -webkit-overflow-scrolling: touch; }
  .lb-imgs:not(.natif) .lb-img { max-width: none; max-height: none; height: min(66vh, 520px); width: auto; }
  .lb-imgs.natif { max-width: none; justify-content: flex-start; }
  .lb-pied { position: sticky; left: 0; width: calc(100vw - 24px); }
  .lb-prec, .lb-suiv { top: auto; bottom: 18px; margin-top: 0; }
  .lb-prec { left: 14px; } .lb-suiv { right: 14px; }
}
@media (prefers-reduced-motion: reduce) { dialog.lb::backdrop, .lb-imgs.bascule { animation: none; } .lb-img { transition: none !important; } }

/* Vidéos d'éventail : lecteur en grand, format portrait ou paysage selon la vidéo */
.lb-video { display: block; width: auto; height: auto; max-width: min(96vw, 1400px); max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); border-radius: 12px; background: #000;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .1); }
@media (max-width: 700px) { .lb-video { max-width: calc(100vw - 24px); } .lb-imgs.video { max-width: 100vw; } }
