/**
 * Image Lightbox Styles - Vollbildanzeige
 *
 * @package twentytwentyfive
 */

/* ============================================
   Trigger Button (Vollbild-Icon)
   ============================================ */
.image-lightbox__trigger {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    z-index: 10;
    padding: 0;
}

.image-lightbox__trigger:hover,
.image-lightbox__trigger:focus {
    background: rgba(0, 0, 0, 0.8);
    outline: none;
}

.image-lightbox__trigger svg {
    width: 22px;
    height: 22px;
    color: #fff;
}

/* Icon anzeigen bei Hover über das Bild */
.project-hero__image-wrapper:hover .image-lightbox__trigger,
.custom-project-tabs__image:hover .image-lightbox__trigger {
    opacity: 1;
}

/* Icon immer sichtbar auf Touch-Geräten */
@media (hover: none) and (pointer: coarse) {
    .image-lightbox__trigger {
        opacity: 1;
    }
}

/* Icon immer sichtbar wenn Bild fokussiert (Accessibility) */
.image-lightbox__trigger:focus-visible {
    opacity: 1;
}

/* ============================================
   Lightbox Overlay
   ============================================ */
.image-lightbox__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-lightbox__overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   Close Button
   ============================================ */
.image-lightbox__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    z-index: 1000000;
    padding: 0;
}

.image-lightbox__close:hover,
.image-lightbox__close:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
    outline: none;
}

.image-lightbox__close svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

/* ============================================
   Image Container
   ============================================ */
.image-lightbox__container {
    position: relative;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-lightbox__image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.image-lightbox__overlay.is-active .image-lightbox__image {
    transform: scale(1);
    opacity: 1;
}

/* ============================================
   Caption
   ============================================ */
.image-lightbox__caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 16px;
    text-align: center;
    max-width: 80%;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
}

.image-lightbox__overlay.is-active .image-lightbox__caption {
    opacity: 1;
}

.image-lightbox__caption:empty {
    display: none;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .image-lightbox__close {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
    }

    .image-lightbox__close svg {
        width: 20px;
        height: 20px;
    }

    .image-lightbox__caption {
        font-size: 14px;
        padding: 10px 16px;
        max-width: 90%;
        bottom: 12px;
    }

    /* Auf Mobile immer das Icon anzeigen */
    .image-lightbox__trigger {
        opacity: 1;
        top: 8px;
        right: 8px;
        width: 40px;
        height: 40px;
    }

    .image-lightbox__trigger svg {
        width: 20px;
        height: 20px;
    }
}
