/* Caja de luz (fotos). Fondo oscuro, foto al centro sin recortar, controles de 48 px. */
html.lb-abierta { overflow: hidden; }
.lb { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: transparent; color: #fff; overflow: hidden; }
.lb[open] { display: grid; place-items: center; animation: lb-aparece .22s ease-out; }
.lb::backdrop { background: rgba(8, 12, 11, .92); animation: lb-fondo .22s ease-out; }
.lb.lb-saliendo { animation: lb-desaparece .18s ease-in forwards; }
.lb.lb-saliendo::backdrop { animation: lb-fondo-sale .18s ease-in forwards; }
.lb-fig { margin: 0; display: grid; justify-items: center; gap: .6rem; padding: 3.5rem 4rem 1rem; width: 100%; height: 100%; box-sizing: border-box; align-content: center; }
.lb-img { display: block; max-width: min(100%, 1080px); max-height: calc(100dvh - 8rem); width: auto; height: auto; object-fit: contain; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); background: #222; user-select: none; -webkit-user-drag: none; touch-action: pan-y; }
.lb-cap { display: flex; gap: 1rem; justify-content: space-between; width: min(100%, 1080px); font: 500 .92rem/1.4 system-ui, sans-serif; color: rgba(255,255,255,.85); }
.lb-cuenta { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lb-btn { position: absolute; display: grid; place-items: center; width: 3rem; height: 3rem; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; transition: background .15s, transform .15s; }
.lb-btn:hover { background: rgba(255,255,255,.26); }
.lb-btn:active { transform: scale(.94); }
.lb-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.lb-cerrar { top: .9rem; right: .9rem; }
.lb-ant { left: .9rem; top: 50%; margin-top: -1.5rem; }
.lb-sig { right: .9rem; top: 50%; margin-top: -1.5rem; }
.lb-btn[hidden] { display: none; }
.lb-entra-der { animation: lb-der .24s cubic-bezier(.2,.8,.2,1); }
.lb-entra-izq { animation: lb-izq .24s cubic-bezier(.2,.8,.2,1); }
@keyframes lb-aparece { from { opacity: 0; } to { opacity: 1; } }
@keyframes lb-desaparece { to { opacity: 0; transform: scale(.97); } }
@keyframes lb-fondo { from { background: rgba(8,12,11,0); } }
@keyframes lb-fondo-sale { to { background: rgba(8,12,11,0); } }
@keyframes lb-der { from { opacity: 0; transform: translateX(40px); } }
@keyframes lb-izq { from { opacity: 0; transform: translateX(-40px); } }
@media (max-width: 40rem) {
  .lb-fig { padding: 3.5rem .5rem 4.5rem; }
  .lb-img { max-height: calc(100dvh - 9rem); }
  .lb-cap { padding: 0 .5rem; }
  .lb-ant, .lb-sig { top: auto; bottom: .9rem; margin-top: 0; }
  .lb-ant { left: calc(50% - 3.75rem); } .lb-sig { right: calc(50% - 3.75rem); }
}
@media (prefers-reduced-motion: reduce) {
  .lb[open], .lb::backdrop, .lb.lb-saliendo, .lb.lb-saliendo::backdrop, .lb-entra-der, .lb-entra-izq { animation: none; }
}
/* Miniaturas que abren la caja de luz: misma medida y un acercamiento suave al pasar. */
a[data-lightbox]:has(img) { display: block; position: relative; overflow: hidden; }
a[data-lightbox] { cursor: zoom-in; }
a[data-lightbox] img { transition: transform .35s cubic-bezier(.2,.8,.2,1), filter .2s; }
a[data-lightbox]:hover img { transform: scale(1.04); }
a[data-lightbox]:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { a[data-lightbox] img { transition: none; } a[data-lightbox]:hover img { transform: none; } }
