/**
 * Figure Image Zoom (lightbox) styles.
 * Applies only to images inside {figure} directives (screenshots).
 */

/* Make figure screenshots read as clickable, and give them a light frame */
figure.image-zoomable img {
    cursor: zoom-in;
    border: 1px solid var(--color-background-border, rgba(0, 0, 0, 0.1));
    border-radius: 4px;
    max-width: 100%;
    height: auto;
    transition: filter 0.15s ease;
}

figure.image-zoomable img:hover {
    filter: brightness(0.97);
}

/* Fullscreen overlay */
.image-zoom-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    cursor: zoom-out;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    box-sizing: border-box;
}

.image-zoom-overlay.active {
    display: flex;
    animation: image-zoom-in 0.18s ease-out;
}

.image-zoom-overlay .image-zoom-img {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    background: white;
    padding: 0.25rem;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    cursor: zoom-out;
}

.image-zoom-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: white;
    font-size: 2rem;
    line-height: 1;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10000;
}

.image-zoom-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.image-zoom-close:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

@keyframes image-zoom-in {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
}

@media (max-width: 768px) {
    .image-zoom-overlay { padding: 1rem; }
    .image-zoom-overlay .image-zoom-img { max-width: 98vw; max-height: 98vh; }
    .image-zoom-close { top: 0.5rem; right: 0.5rem; width: 36px; height: 36px; font-size: 1.5rem; }
}

@media print {
    .image-zoom-overlay, .image-zoom-close { display: none !important; }
}
