/* Click-to-enlarge lightbox for public images. Uses the native <dialog> element for a free
   focus trap and Esc-to-close; the rest is styling and a backdrop-click handler in lightbox.js. */

.js-zoomable {
    cursor: zoom-in;
}

.lightbox {
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* avoids the mobile address-bar gap where supported */
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    overflow: visible;
}

/* Fill the viewport and flex-center the image so it is always dead-center. */
.lightbox[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox::backdrop {
    background: rgba(6, 10, 16, 0.88);
    backdrop-filter: blur(2px);
}

.lightbox-body {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    max-width: min(94vw, 1200px);
}

.lightbox-img {
    max-width: 100%;
    max-height: 82vh;
    width: auto;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    background: #0b0f14;
}

.lightbox-caption {
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    text-align: center;
    max-width: 60ch;
}

.lightbox-close {
    position: absolute;
    top: -0.9rem;
    inset-inline-end: -0.9rem;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #0b0f14;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.lightbox-close:hover {
    background: var(--admin-teal, #2dd4bf);
}

@media (max-width: 640px) {
    .lightbox-close {
        top: 0.5rem;
        inset-inline-end: 0.5rem;
    }
}
