/* Visionneuse des photos de la fiche ferme et du mini-site (partials/_lightbox.html.twig, contrôleur « lightbox ») */
.lb { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(12, 16, 13, .94); color: #fff; overflow: hidden; }
.lb::backdrop { background: rgba(12, 16, 13, .94); }
/* Page figée derrière la visionneuse ouverte */
html:has(.lb[open]), body:has(.lb[open]) { overflow: hidden; }
.lb[open] { display: grid; place-items: center; }
/* Image et légende tiennent dans l'écran (zoom du navigateur, paysage, légende longue : la figure défile) */
.lb-figure { margin: 0; max-width: min(1100px, 92vw); max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); overflow: auto; text-align: center; }
.lb-figure img { display: block; max-width: 100%; max-height: calc(100vh - 200px); max-height: calc(100dvh - 200px); width: auto; height: auto; margin: 0 auto; border-radius: 8px; object-fit: contain; transition: opacity .15s; }
.lb-figure img.is-loading { opacity: .35; }
.lb-figure figcaption { margin-top: 12px; font-size: 16px; line-height: 1.4; color: #eef2ef; }
.lb-counter { position: absolute; top: 18px; left: 20px; margin: 0; font-weight: 700; font-size: 15px; color: #dfe6e0; }
.lb-btn { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; }
.lb-btn:hover { background: rgba(255, 255, 255, .26); }
.lb-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-btn[hidden] { display: none; }
.lb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .lb-figure img { transition: none; } }
@media (max-width: 640px) {
    /* Téléphone : flèches en bas, l'image garde toute la largeur */
    .lb-prev, .lb-next { top: auto; bottom: 18px; transform: none; }
    .lb-prev { left: calc(50% - 60px); }
    .lb-next { right: calc(50% - 60px); }
    /* Place réservée aux flèches du bas */
    .lb[open] { padding-bottom: 76px; }
}
