/* Overlay du diaporama - superposition sur le site */
#diaporama3-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bouton de fermeture */
#diaporama3-overlay .bt_quit {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    width: 30px;
    height: 30px;
    top: 20px;
    right: 170px;
    z-index: 10001;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease;
    background: none;
}

#diaporama3-overlay .bt_quit:hover {
    transform: scale(1.2);
}

/* Conteneur principal - ratio fixe 2048x1280 (8:5) */
#diaporama3-container {
    aspect-ratio: 2048 / 1280;
    width: min(calc(100vw - 240px), calc((100vh - 120px) * 1.6));
    height: auto;
    max-width: calc(100vw - 240px);
    max-height: calc(100vh - 120px);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 40px 120px 80px;
}

/* Cadre sans contour ni fond */
.diaporama3-frame {
    position: relative;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

/* Zone d'affichage des images */
.diaporama3-viewer {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
}

/* Conteneur des images */
.diaporama3-images {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Style des slides individuels */
.diaporama3-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none;
}

.diaporama3-slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

.diaporama3-slide.fading-out {
    opacity: 0;
    z-index: 1;
}

/* Barre de progression — masquée */
.diaporama3-progress-bar {
    display: none;
}

/* Boutons de navigation */
.diaporama3-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    box-shadow: none;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.3s ease;
    outline: none;
}

.diaporama3-nav:hover {
    transform: translateY(-50%) scale(1.1);
}

.diaporama3-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.diaporama3-prev {
    left: -100px;
}

.diaporama3-next {
    right: -100px;
}

/* Barre inférieure — fixed, toujours visible même en fullscreen */
.diaporama3-bottom-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 20px;
    white-space: nowrap;
    z-index: 10001;
}

.diaporama3-bottom-bar .current-slide,
.diaporama3-bottom-bar .total-slides {
    color: #c6be99;
    font-size: 14px;
    letter-spacing: 1px;
}

/* Bouton play/pause dans la barre */
.diaporama3-playpause {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    padding: 0 4px;
    transition: transform 0.2s ease;
}

.diaporama3-playpause:hover {
    transform: scale(1.2);
}

/* Boutons chevrons double */
.diaporama3-batch-prev,
.diaporama3-batch-next {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
    outline: none;
}

.diaporama3-batch-prev:hover,
.diaporama3-batch-next:hover {
    transform: scale(1.2);
}

/* Responsive */
@media screen and (max-width: 1200px) {
    #diaporama3-container {
        width: min(calc(100vw - 180px), calc((100vh - 120px) * 1.6));
        max-width: calc(100vw - 180px);
        max-height: calc(100vh - 120px);
        margin: 40px 90px 80px;
    }

    .diaporama3-prev {
        left: -80px;
    }

    .diaporama3-next {
        right: -80px;
    }

    #diaporama3-overlay .bt_quit {
        right: 25px;
    }
}

@media screen and (max-width: 768px) {
    #diaporama3-container {
        width: calc(100vw - 40px);
        height: auto;
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 80px);
        margin: 20px 20px 60px;
    }

    .diaporama3-nav {
        width: 50px;
        height: 50px;
    }

    .diaporama3-prev {
        left: 10px;
    }

    .diaporama3-next {
        right: 10px;
    }

    .diaporama3-bottom-bar {
        gap: 14px;
    }

    .diaporama3-bottom-bar .current-slide,
    .diaporama3-bottom-bar .total-slides {
        font-size: 12px;
    }
}

/* Animation de chargement */
@keyframes pulse {
    0%,
    100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

.diaporama3-slide.loading {
    animation: pulse 1.5s ease-in-out infinite;
    background-color: #333;
}
