/* ============================================================
   Reusable image lightbox
   ============================================================ */

/* Trigger button wrapping the inline image */
.copyright-info__image-btn {
    display: inline-block;
    padding: 0;
    margin: 0;
    background: none;
    border: 0;
    cursor: zoom-in;
    border-radius: var(--radius-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .copyright-info__image-btn:hover .copyright-info__image,
    .copyright-info__image-btn:focus-visible .copyright-info__image {
        transform: scale(1.01);
        box-shadow: var(--shadow-md, 0 4px 16px rgba(0, 0, 0, .15));
    }

    .copyright-info__image-btn:focus-visible {
        outline: 2px solid var(--color-primary);
        outline-offset: 3px;
    }

.copyright-info__image-btn .copyright-info__image {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Overlay */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1080;                  /* above Bootstrap modals (1055) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 2vw, 2rem);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.18s ease;
}

    .lightbox[hidden] {
        display: none !important;
    }

    .lightbox.is-open {
        opacity: 1;
    }

/* Figure + image */
.lightbox__figure {
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox__image {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    /* Allow native pinch-zoom on touch devices */
    touch-action: pinch-zoom;
    user-select: none;
    -webkit-user-drag: none;
}

/* Close button */
.lightbox__close {
    position: absolute;
    top: clamp(0.5rem, 2vw, 1rem);
    right: clamp(0.5rem, 2vw, 1rem);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;                    /* min touch target */
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

    .lightbox__close:hover,
    .lightbox__close:focus-visible {
        background: rgba(255, 255, 255, 0.25);
        transform: scale(1.05);
    }

    .lightbox__close:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }

/* Body lock when lightbox is open */
body.lightbox-open {
    overflow: hidden;
}

/* Visually-hidden helper (only add if not present in site.css) */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .lightbox,
    .copyright-info__image-btn,
    .copyright-info__image-btn .copyright-info__image,
    .lightbox__close {
        transition: none;
    }
}