/* Lightbox v2 — transitions fluides, design immersif */

.lightbox {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.97);
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255, 255, 255, 0.025) 39px, rgba(255, 255, 255, 0.025) 40px),
        repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255, 255, 255, 0.025) 39px, rgba(255, 255, 255, 0.025) 40px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Slider — conteneur horizontal avec 3 slides (prev, current, next) */
.lightbox-slider {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    will-change: transform;
    transform: translateX(-100%);
}

.lightbox-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-slide img {
    max-width: 75vw;
    max-height: 90vh;
    object-fit: contain;
}

/* Info photo — en bas à gauche, très discret */
.lightbox-info {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    text-align: left;
    width: fit-content;
    max-width: calc(100vw - 3rem);
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active .lightbox-info {
    opacity: 1;
    transition-delay: 0.2s;
}

.lightbox-location {
    font-size: 0.9rem;
    font-weight: 400;
    margin-bottom: 0.2rem;
    letter-spacing: 0.03em;
}

.lightbox-description {
    font-size: 0.8rem;
    opacity: 0.6;
    font-style: italic;
}

/* Bouton fermer — double bordure arrondie */
.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    color: var(--text-color, #e8e8e8);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.5;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-shadow:
        0 0 0 6px rgba(0, 0, 0, 0.97),
        0 0 0 7px rgba(255, 255, 255, 0.15);
    transition: opacity 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    padding: 0;
    z-index: 1002;
}

.lightbox-close:hover {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow:
        0 0 0 6px rgba(0, 0, 0, 0.97),
        0 0 0 7px transparent;
}

/* Navigation — flèches avec double bordure arrondie */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    color: var(--text-color, #e8e8e8);
    font-size: 1.2rem;
    cursor: pointer;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    opacity: 0.5;
    border-radius: 12px;
    box-shadow:
        0 0 0 6px rgba(0, 0, 0, 0.97),
        0 0 0 7px rgba(255, 255, 255, 0.15);
    transition: opacity 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    z-index: 1002;
}

.lightbox-prev {
    left: 1.5rem;
}

.lightbox-next {
    right: 1.5rem;
}

.lightbox-nav:hover {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow:
        0 0 0 6px rgba(0, 0, 0, 0.97),
        0 0 0 7px transparent;
}

/* Indicateur de swipe — masqué par défaut (desktop) */
.swipe-hint {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .lightbox-slide img {
        max-width: 100vw;
        max-height: 85vh;
    }

    /* Flèches cachées sur mobile (navigation par swipe) */
    .lightbox-nav {
        display: none;
    }

    .lightbox-close {
        top: 0.75rem;
        right: 0.75rem;
        font-size: 1rem;
        width: 2rem;
        height: 2rem;
        border-radius: 8px;
        box-shadow:
            0 0 0 4px rgba(0, 0, 0, 0.97),
            0 0 0 5px rgba(255, 255, 255, 0.15);
    }

    .lightbox-info {
        left: 0.75rem;
        bottom: 0.75rem;
        max-width: calc(100vw - 1.5rem);
        padding: 0.4rem 0.6rem;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .lightbox-location {
        font-size: 0.8rem;
    }

    .lightbox-description {
        font-size: 0.75rem;
    }

    /* Indicateur de swipe mobile */
    .swipe-hint {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        position: fixed;
        bottom: 0.75rem;
        right: 0.75rem;
        color: var(--text-color, #e8e8e8);
        font-size: 0.7rem;
        font-family: inherit;
        letter-spacing: 0.05em;
        opacity: 0;
        pointer-events: none;
        z-index: 1001;
        animation: swipeHintAppear 0.5s ease 0.6s forwards;
    }

    .swipe-hint svg {
        animation: swipeBounce 1.2s ease-in-out infinite;
    }

    .swipe-hint.hidden {
        animation: swipeHintFade 0.3s ease forwards;
    }

    @keyframes swipeHintAppear {
        from { opacity: 0; transform: translateX(-5px); }
        to { opacity: 0.5; transform: translateX(0); }
    }

    @keyframes swipeHintFade {
        from { opacity: 0.5; }
        to { opacity: 0; }
    }

    @keyframes swipeBounce {
        0%, 100% { transform: translateX(0); }
        50% { transform: translateX(6px); }
    }
}
