/* ============================================================
   PRAKTIKO - style_components-lightbox.css
   Einheitliche Lightbox für einzelne Bilder (Bildvergrößerung).
   Das Markup wird von assets/js/image-lightbox.js erzeugt.
   Auslöser im Markup: <div data-image-zoom> ... <img> ... </div>
   ============================================================ */

/* ── Auslöser ───────────────────────────────────────────── */
/* Die Klasse is-zoomable setzt das JS nur, wenn wirklich ein Bild
   vorhanden ist (Initialen-Platzhalter bleibt dadurch ohne Zoom-Cursor). */
[data-image-zoom].is-zoomable {
    cursor: zoom-in;
}

[data-image-zoom]:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 3px;
}

/* ── Overlay ─────────────────────────────────────────────── */
.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.image-lightbox[hidden] {
    display: none;
}

.image-lightbox.open {
    opacity: 1;
}

.image-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.92);
}

/* ── Bild ────────────────────────────────────────────────── */
.image-lightbox-figure {
    position: relative;
    z-index: 1;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
    transform: scale(0.96);
    transition: transform 0.18s ease;
}

.image-lightbox.open .image-lightbox-figure {
    transform: scale(1);
}

.image-lightbox-img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(92vw, 900px);
    max-height: min(82vh, 900px);
    object-fit: contain;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

/* ── Schließen ───────────────────────────────────────────── */
.image-lightbox-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    z-index: 2;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    cursor: pointer;
    transition: background 0.15s ease;
}

.image-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.image-lightbox-close:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* ── Handy (<= 480px) ────────────────────────────────────── */
@media (max-width: 480px) {
    .image-lightbox {
        padding: var(--space-2);
    }

    .image-lightbox-img {
        max-width: 96vw;
        max-height: 78vh;
        border-radius: var(--radius-md);
    }

    .image-lightbox-close {
        top: var(--space-2);
        right: var(--space-2);
    }
}
