/* Lightbox / Visionneuse pour Gallery Mansory Custom */

/* Overlay de la lightbox */
.gmc-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gmc-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* Conteneur du contenu */
.gmc-lightbox-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Image dans la lightbox */
.gmc-lightbox-content img {
    max-width: 100%;
    max-height: 95vh;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

/* Conteneur vidéo responsive (Cloudflare Stream, Vimeo, YouTube…) */
.gmc-lightbox-video-wrapper {
    position: relative;
    width: 90vw;
    max-width: 1200px;
    aspect-ratio: 16 / 9;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.gmc-lightbox-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    max-height: none;
    border: none;
}

/* Fallback sans aspect-ratio (navigateurs anciens) */
@supports not (aspect-ratio: 16 / 9) {
    .gmc-lightbox-video-wrapper {
        height: 0;
        padding-bottom: 56.25%;
    }
}

/* Bouton fermer */
.gmc-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.gmc-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.gmc-lightbox-close::before,
.gmc-lightbox-close::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: white;
}

.gmc-lightbox-close::before {
    transform: rotate(45deg);
}

.gmc-lightbox-close::after {
    transform: rotate(-45deg);
}

/* Flèche précédente */
.gmc-lightbox-prev {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.gmc-lightbox-prev:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.gmc-lightbox-prev::before {
    content: '';
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-right: 16px solid white;
    margin-left: -4px;
}

/* Flèche suivante */
.gmc-lightbox-next {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.gmc-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.gmc-lightbox-next::before {
    content: '';
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 16px solid white;
    margin-right: -4px;
}

/* Compteur */
.gmc-lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    z-index: 10;
}

/* Loading spinner */
.gmc-lightbox-loading {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: gmc-lightbox-spin 0.8s linear infinite;
}

@keyframes gmc-lightbox-spin {
    to { transform: rotate(360deg); }
}

/* Responsive mobile */
@media (max-width: 767px) {
    .gmc-lightbox-prev,
    .gmc-lightbox-next {
        width: 50px;
        height: 50px;
    }
    
    .gmc-lightbox-prev {
        left: 10px;
    }
    
    .gmc-lightbox-next {
        right: 10px;
    }
    
    .gmc-lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
    
    .gmc-lightbox-counter {
        bottom: 20px;
        font-size: 14px;
        padding: 6px 12px;
    }
    
    /* Vidéo adaptable en mobile (portrait et paysage) */
    .gmc-lightbox-video-wrapper {
        width: 98vw;
        max-height: 85vh;
        aspect-ratio: auto;
    }

    .gmc-lightbox-video-wrapper iframe {
        position: relative;
        width: 100% !important;
        height: 85vh !important;
        max-height: 85vh;
    }
}

/* Curseur pour les images cliquables */
.gmc-gallery img {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gmc-gallery img:hover {
    transform: scale(1.05);
}

/* Featured image cliquable */
.post-thumbnail img,
.wp-post-image,
.entry-figure img {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.post-thumbnail img:hover,
.wp-post-image:hover,
.entry-figure img:hover {
    /* transform: scale(1.05); */
}

.entry-figure > span:hover {
    /* transform: scale(1)!important; */
}

/* Lien de l'image d'entête */
.entry-figure a,
.post-thumbnail a {
    cursor: pointer;
}

.entry-figure img:hover, .post-thumbnail img:hover, .wp-post-image:hover, .gmc-gallery img:hover {
    opacity: 1!important;
}