/* Photo lightbox — the overlay a user photo opens in when clicked (issue #5182,
   restoring the W4 prettyPhoto behaviour). Markup is built by initPhotoLightbox()
   in js/app.js; the trigger is any <a data-w5-lightbox> (see widgets/UserPhoto). */

.w5-photo-zoom {
    display: inline-block;
    /* Kill the inline-box descender gap so the anchor hugs the photo. */
    line-height: 0;
    cursor: zoom-in;
    border-radius: 4px;
}

.w5-lightbox {
    position: fixed;
    inset: 0;
    /* Above the sidebar (1000) and dropdowns (1100); below the skip link (2000)
       is not an option here — the overlay is modal, so it takes 2050. */
    z-index: 2050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.75);
}

.w5-lightbox__figure {
    position: relative;
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.w5-lightbox__image {
    display: block;
    max-width: min(90vw, 640px);
    max-height: 85vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.w5-lightbox__caption {
    color: var(--white);
    font-size: var(--font-size-sm);
    text-align: center;
    max-width: 90vw;
}

.w5-lightbox__close {
    position: absolute;
    top: -0.75rem;
    right: -0.75rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--white);
    color: var(--gray-800);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.w5-lightbox__close:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

/* On a phone the close button would hang off the viewport edge — tuck it in. */
@media (max-width: 575.98px) {
    .w5-lightbox {
        padding: 1rem;
    }

    .w5-lightbox__close {
        top: 0.25rem;
        right: 0.25rem;
    }
}
