/* css/lightbox.css */

#popover-image-lightbox {
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    width: 90vw;
    height: 85vh;
    max-width: 1200px;
    max-height: 900px;
    box-sizing: border-box;
    overflow: hidden;
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
    height: 35px;
    box-sizing: border-box;
}

.lightbox-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.lightbox-zoom-text {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-left: 0.5rem;
}

.lightbox-viewport {
    width: 100%;
    height: calc(100% - 75px);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    cursor: grab;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;

    /* Isolates the viewport into its own compositing layer so rapid zoom/pan doesn't
       leave visual artifacts (tearing/ghosting) behind. */
    isolation: isolate;
    transform: translateZ(0);
}

.lightbox-target {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.1s ease-out;
    display: block;
    margin: auto;

    /* Keeps the transform on the GPU and skips backface rendering during scaling —
       same anti-artifact fix as .lightbox-viewport above, applied to the image itself. */
    will-change: transform;
    backface-visibility: hidden;
}

.lightbox-caption {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 20px;
    line-height: 20px;
    margin-bottom: 0;
}
