/* =========================================================
   García Recta Design — espacios-lightbox.css
   Visor en grande de las fotos de "Espacios" (portada).
   ========================================================= */
#espacios .esp-item { cursor: zoom-in; }
#espacios .esp-item:focus-visible { outline: 2px solid #f5f5f3; outline-offset: 3px; }

html.esp-lb-abierto, html.esp-lb-abierto body { overflow: hidden; }

.esp-lb {
    position: fixed; inset: 0; z-index: 550;
    display: flex; align-items: center; justify-content: center;
    padding: calc(70px + env(safe-area-inset-top, 0px)) max(70px, env(safe-area-inset-right, 0px)) calc(40px + env(safe-area-inset-bottom, 0px)) max(70px, env(safe-area-inset-left, 0px));
    opacity: 0; transition: opacity .25s ease;
}
.esp-lb.abierto { opacity: 1; }
.esp-lb[hidden] { display: none; }
.esp-lb-fondo { position: absolute; inset: 0; background: rgba(8, 8, 9, .94); backdrop-filter: blur(6px); }

.esp-lb-fig {
    position: relative; margin: 0; width: 100%; max-width: 1200px; max-height: 100%;
    display: flex; flex-direction: column; gap: 16px;
    transform: translateY(12px) scale(.985); transition: transform .35s cubic-bezier(.16, .84, .44, 1);
}
.esp-lb.abierto .esp-lb-fig { transform: none; }
.esp-lb-marco { min-height: 0; display: flex; justify-content: center; }
.esp-lb-img {
    display: block; max-width: 100%; max-height: calc(100vh - 230px); width: auto; height: auto;
    object-fit: contain; border-radius: 2px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
    transition: opacity .25s ease;
}
.esp-lb.cambiando .esp-lb-img { opacity: .25; }

.esp-lb-cap { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 4px 18px; color: #f5f5f3; }
.esp-lb-num { grid-row: span 2; font: 600 11px 'Inter', system-ui, sans-serif; letter-spacing: .2em; color: #c4121f; }
.esp-lb-titulo { font: 600 clamp(1.4rem, 2.6vw, 2rem)/1.1 'Fraunces', Georgia, serif; }
.esp-lb-texto { grid-column: 2; color: rgba(245, 245, 243, .65); font: 400 14.5px/1.5 'Inter', system-ui, sans-serif; max-width: 60ch; }
.esp-lb-cta {
    grid-row: 1 / span 2; grid-column: 3; align-self: center;
    color: #fff; text-decoration: none; font: 600 12px 'Inter', system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase;
    padding: 12px 18px; border-radius: 40px; background: #9A0C1A; white-space: nowrap; transition: background .2s ease;
}
.esp-lb-cta:hover { background: #c4121f; }

.esp-lb-btn, .esp-lb-cerrar {
    position: absolute; z-index: 2; width: 48px; height: 48px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    background: rgba(20, 20, 22, .7); border: 1px solid rgba(245, 245, 243, .22); color: #f5f5f3;
    transition: background .2s ease, border-color .2s ease;
}
.esp-lb-btn:hover, .esp-lb-cerrar:hover { background: #9A0C1A; border-color: #9A0C1A; }
.esp-lb-btn:focus-visible, .esp-lb-cerrar:focus-visible, .esp-lb-cta:focus-visible { outline: 2px solid #f5f5f3; outline-offset: 3px; }
.esp-lb-btn svg, .esp-lb-cerrar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.esp-lb-prev { left: max(14px, env(safe-area-inset-left, 0px)); top: 50%; transform: translateY(-50%); }
.esp-lb-next { right: max(14px, env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); }
.esp-lb-cerrar { top: calc(16px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); }

@media (max-width: 768px) {
    .esp-lb { padding: calc(70px + env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) calc(90px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px)); }
    .esp-lb-img { max-height: calc(100vh - 300px); }
    .esp-lb-cap { grid-template-columns: 1fr; }
    .esp-lb-num { grid-row: auto; }
    .esp-lb-texto { grid-column: 1; }
    .esp-lb-cta { grid-row: auto; grid-column: 1; justify-self: start; margin-top: 6px; }
    .esp-lb-prev, .esp-lb-next { top: auto; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: none; }
    .esp-lb-prev { left: calc(50% - 58px); }
    .esp-lb-next { right: calc(50% - 58px); }
}
@media (prefers-reduced-motion: reduce) {
    .esp-lb, .esp-lb-fig, .esp-lb-img { transition: none; }
}
