/* ################ Version indexDiapo55_CSS--STABLE_SITE_1mod  = iindexDiapo55_CSS--STABLE_2 ################## 
indexDiapo55_CSS--STABLE_SITE_1
version réorganisée du 16/02/2026-10h30 -MISTRAL 

MISTRAL 
https://chat.mistral.ai/chat/0749770e-406f-4ff9-8de6-8416759717d4

voir aussi: 
https://developer.mozilla.org/fr/
*/


/* =============================================
   RESET ET STRUCTURE GLOBALE
   ============================================= */
/*
body{
    background:url("<?= $ground ?? '' ?>") center/cover no-repeat fixed;
    margin:0; height:100%;
}
*/

.page-diapo {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* =============================================
   HEADER (Barre supérieure)
   ============================================= */
.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    gap: 10px;
}

.header-left,
.header-center,
.header-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.header-left {
    justify-content: flex-start;
}

.header-center {
    justify-content: center;
}

.header-right {
    justify-content: flex-end;
}

.gallery-title {
    margin: 0;
    font-size: 1.4rem;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    white-space: nowrap;
}

.audio-player {
    max-width: 180px;
}

/* =============================================
   CAROUSEL (Zone principale d'affichage)
   ============================================= */
.viewer-diapo {
    width: 100%;
    flex: 1;
    overflow: hidden;
    position: relative;
    padding-bottom: 60px; /* Espace réservé pour les vignettes */
}

.carousel-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.carousel-item img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: auto;
}

.img-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* =============================================
   TITRES ET LÉGENDES (Sur les images)
   ============================================= */
.img-title {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 1rem;
    border-radius: 6px;
    white-space: nowrap;
    text-align: center;
    z-index: 5;
}

/* Titre hover */
.hover-title {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.55);
    color: white;
    font-size: 1rem;
    border-radius: 6px;
    white-space: nowrap;
    max-width: 90vw;
    width: fit-content;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.carousel-item:hover .hover-title {
    opacity: 1;
}

/* Titre vidéo */
.video-title {
    color: #4da3ff;
    font-weight: 600;
    cursor: pointer;
}

.video-title::before {
    content: "▶ ";
    font-size: 1.2em;
}

/* =============================================
   VIGNETTES (Zone inférieure)
   ============================================= */
.thumbs-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    overflow: hidden;
    position: relative;
    z-index: 10;
    padding: 10px 0;
    margin: 0;
}

.thumbs-strip {
    display: flex;
    gap: 6px;
    max-width: 80vw;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.thumbs-strip::-webkit-scrollbar {
    display: none;
}

.thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    aspect-ratio: 1/1;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 6px;
    flex-shrink: 0;
}

.thumb.active {
    border-color: #0d6efd;
    box-shadow: 0 0 6px rgba(13, 110, 253, 0.9);
}

/* =============================================
   BOUTONS DES VIGNETTES
   ============================================= */
.thumb-btn {
    background: rgba(13, 110, 253, 0.15);
    border: 2px solid #0d6efd;
    color: #0d6efd;
    font-size: 22px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s ease;
    outline: none;
    border: none;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
}

.thumb-btn:hover {
    background: #0d6efd;
    color: white;
    transform: scale(1.1);
}

.thumb-btn:active {
    transform: scale(0.95);
}

/* =============================================
   FLÈCHES DU CAROUSEL
   ============================================= */
.carousel-control-prev,
.carousel-control-next {
    width: 5%;
}

.carousel-control-prev,
.carousel-control-next {
    align-items: center;
    top: 0;
    bottom: 0;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    transform: translateY(0);
}

.carousel-control-prev,
.carousel-control-next {
    top: 50%;
    transform: translateY(-50%);
    height: auto;
    display: flex;
    align-items: center;
}

/* Positionnement flèches centré sur l'image */
body:not(.immersive) .carousel-control-prev,
body:not(.immersive) .carousel-control-next {
    top: 40vh;
    transform: translateY(-50%);
}

/* MODE IMMERSIF */
body.immersive .carousel-control-prev,
body.immersive .carousel-control-next {
    top: 50%;
    transform: translateY(-50%);
}

/* Flèches carousel plus visibles */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    background-size: 60% 60%;
}

.carousel-control-prev,
.carousel-control-next {
    opacity: 1;
}

.carousel-control-prev:hover .carousel-control-prev-icon,
.carousel-control-next:hover .carousel-control-next-icon {
    background-color: rgba(13, 110, 253, 0.9);
}

/* =============================================
   ADAPTATION MOBILE
   ============================================= */
@media (max-width: 767px) {
    .thumbs-zone {
        padding: 20px 0;
        gap: 10px;
    }

    .thumb {
        margin: 0 8px;
    }

    .thumb img {
        max-height: 70px;
    }

    .carousel-control-prev,
    .carousel-control-next {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        margin: 0 10px;
        top: 50%;
        transform: translateY(-50%);
        padding: 0;
    }

    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 24px;
        height: 24px;
        margin: 0;
    }
}

/* =============================================
   MODE IMMERSIF (Plein écran)
   ============================================= */
body.immersive {
    overflow: hidden;
}

body.immersive .carousel,
body.immersive .carousel-inner,
body.immersive .carousel-item,
body.immersive .img-wrap {
    height: 100vh !important;
}

body.immersive .carousel-item img {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
}

body.immersive .thumbs-zone,
body.immersive audio {
    display: none !important;
}

body.immersive .img-title {
    display: none !important;
}

body.immersive .header-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

body.immersive .header-bar.visible {
    opacity: 1;
    pointer-events: auto;
}

/* =============================================
   POPUP VIDÉO
   ============================================= */
.video-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    cursor: pointer;
}

.video-overlay.show {
    display: flex;
}

.video-box {
    max-width: 90%;
    max-height: 90%;
    pointer-events: none;
}

.video-box video {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 10px;
    pointer-events: auto;
    display: block;
}

/* =============================================
   NOUVEAUX ÉLÉMENTS (Vue Galerie, etc.)
   ============================================= */
.vue-galerie {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 40px;
}

.vue-item {
    position: relative;
    cursor: pointer;
}

.vue-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
}

.vue-video {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: #000a;
    color: #fff;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 14px;
}

/* =============================================
   ADAPTATIONS POUR SMARTPHONE
   ============================================= */
@media (max-width: 640px) {
    .header-bar {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 6px;
    }

    .header-left,
    .header-center,
    .header-right {
        flex: 0 0 100%;
        justify-content: center;
    }

    .header-left {
        order: 1;
    }

    .header-center {
        order: 2;
        text-align: center;
    }

    .header-right {
        order: 3;
        gap: 8px;
    }

    .gallery-title {
        font-size: 1.05rem;
        white-space: normal;
    }

    .audio-player {
        max-width: 160px;
    }
}

/* =============================================
   BOUTONS ET STYLES SUPPLÉMENTAIRES
   ============================================= */
/* =============================================
   HARMONISATION DES BOUTONS DU HEADER
   ============================================= */
/* Style commun pour tous les boutons et le compteur */
.btn-back,
#toggleCarousel,
button[onclick="toggleImmersive()"],
.bg-dark.text-white {
    height: 36px; /* Hauteur uniforme pour tous les éléments */
    padding: 0 12px; /* Padding horizontal uniforme */
    border-radius: 0.25rem; /* Coins arrondis */
    display: inline-flex; /* Alignement en ligne */
    align-items: center; /* Centrage vertical */
    justify-content: center; /* Centrage horizontal */
    font-size: 0.875rem; /* Taille de texte uniforme */
    line-height: 1; /* Alignement vertical du texte */
    transition: all 0.3s ease; /* Transition fluide */
}

/* Style spécifique pour les boutons */
.btn-back,
#toggleCarousel,
button[onclick="toggleImmersive()"] {
    background-color: #000; /* Fond noir */
    color: white; /* Texte blanc */
    border: none; /* Pas de bordure */
    cursor: pointer; /* Curseur pointer */
    margin: 0 4px; /* Espacement entre les boutons */
}

/* Style au survol pour les boutons */
.btn-back:hover,
#toggleCarousel:hover,
button[onclick="toggleImmersive()"]:hover {
    background-color: #007bff; /* Fond bleu au survol */
}

/* Style des icônes SVG dans les boutons */
.btn-back svg,
#toggleCarousel svg,
button[onclick="toggleImmersive()"] svg {
    width: 16px; /* Largeur uniforme des icônes */
    height: 16px; /* Hauteur uniforme des icônes */
    fill: currentColor; /* Couleur héritée */
    margin-right: 6px; /* Espacement entre l'icône et le texte */
}

/* =============================================
   CORRECTION POUR SAFARI (min-width: fit-content)
   ============================================= */
/* Style spécifique pour le compteur */
.bg-dark.text-white {
    background-color: #000;
    color: white;
    padding: 0 8px;
    min-width: -webkit-fit-content; /* Pour Safari */
    min-width: -moz-fit-content; /* Pour Firefox (anciennes versions) */
    min-width: fit-content; /* Standard */
}

/* Style de l'icône dans le compteur */
.bg-dark.text-white svg {
    width: 12px; /* Taille réduite pour l'icône du compteur */
    height: 12px; /* Taille réduite pour l'icône du compteur */
    margin-right: 4px; /* Espacement réduit */
}

/*
.btn-outline-info:hover svg {
    color: #007bff;
    fill: #007bff;
}

.btn-back {
    background-color: #000;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-back:hover {
    background-color: #007bff;
    color: white;
}

.btn-back svg {
    fill: currentColor;
}

.bg-dark.text-white {
    background-color: #000;
    color: white;
    border-radius: 0.25rem;
    padding: 0.2rem 0.5rem;
}
*/
/* =============================================
   LECTEUR AUDIO PERSONNALISÉ
   ============================================= */
.custom-audio-player {
    width: 100%;
    max-width: 200px;
    font-size: 0.7rem;
    color: #333;
    background: #f8f9fa;
    border-radius: 20px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 30px;
}

.player-controls {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
}

.play-pause-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    color: #0d6efd;
    height: 22px;
    display: flex;
    align-items: center;
}

.play-pause-btn svg {
    width: 14px;
    height: 14px;
}

.progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    width: 120px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #6c757d;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: #d8570c;
    border-radius: 2px;
}

.time-display {
    font-size: 0.6rem;
    min-width: 35px;
    text-align: right;
    color: #495057;
}

.volume-control {
    cursor: pointer;
    padding: 2px;
    color: #6c757d;
    height: 22px;
}

.volume-control svg {
    width: 14px;
    height: 14px;
}

/* =============================================
   BOUTON DE CONTRÔLE DU CAROUSEL
   ============================================= */
.carousel-control-btn {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    margin-left: 10px;
    outline: none;
    border: none;
}

.carousel-control-btn:hover {
    opacity: 0.7;
}

/* Solution pour les Images Très Grandes (4000px) */
/* =============================================
   CORRECTION POUR LES IMAGES TRÈS GRANDES (4000px+)
   ============================================= */
.carousel-item img {
    max-width: 1200px !important; /* Limite la largeur max à 1200px */
    max-height: calc(100vh - 200px) !important; /* Limite la hauteur max à la hauteur de l'écran moins 200px */
    width: auto !important; /* Conserve les proportions */
    height: auto !important;
}

/* Pour les écrans larges (desktop) */
@media (min-width: 1200px) {
    .carousel-item img {
        max-width: 80vw !important; /* 80% de la largeur de l'écran pour les très grandes images */
    }
}

/* Pour les écrans mobiles */
@media (max-width: 767px) {
    .carousel-item img {
        max-width: 95vw !important; /* 95% de la largeur de l'écran sur mobile */
        max-height: 60vh !important; /* 60% de la hauteur de l'écran sur mobile */
    }
}

/* gestion de IMMERSIF VERSION FULLSCREEN complet (avec toncature */


/* =============================================
   MODE IMMERSIF (Fullscreen pour les grandes images)
   ============================================= */
/* =============================================
   MODE IMMERSIF (Images entières + fond visible)
   ============================================= */
/* =============================================
   MODE IMMERSIF (Images entières + fond visible)
   ============================================= */
/* =============================================
   MODE IMMERSIF (Solution finale)
   ============================================= */
/* =============================================
   MODE IMMERSIF (Correction définitive)
   ============================================= */
body.immersive {
    overflow: hidden;
}

body.immersive .carousel,
body.immersive .carousel-inner {
    height: 100vh;
    width: 100vw;
    display: flex !important;
    position: relative;
}

body.immersive .carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background-color: transparent !important;
}

body.immersive .carousel-item img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin: auto !important;
    position: relative;
    left: 0 !important;
    right: 0 !important;
}


/* =============================================
   BOUTON DE FERMETURE (X) POUR LE MODE IMMERSIF
   ============================================= */
/* =============================================
   BOUTON DE FERMETURE (X) POUR LE MODE IMMERSIF
   ============================================= */
/* =============================================
   BOUTON DE FERMETURE IMMERSIF (X)
   ============================================= */
/* =============================================
   BOUTON SVG DE FERMETURE IMMERSIF (Style bleu)
   ============================================= */
.immersive-close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
    outline: none;
    /*font-weight: bold; ne change rien */
}
.immersive-close-btn.visible {
    opacity: 1;
}
.immersive-close-btn:hover {
    background: #007bff; /* Bleu Bootstrap */
}
.immersive-close-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
    transition: transform 0.2s ease;
}
.immersive-close-btn:hover svg {
    transform: scale(1.1);
}

/* Plein écran au démararge */
/* =============================================
   PLEIN ÉCRAN AU CHARGEMENT
   ============================================= */
/* =============================================
   PLEIN ÉCRAN AU CHARGEMENT (Desktop & Mobile)
   ============================================= */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Désactive le défilement */
}

.page-diapo {
    height: 100vh; /* Pleine hauteur de l'écran */
    width: 100vw;  /* Pleine largeur de l'écran */
}

.viewer-diapo {
    height: calc(100vh - 60px); /* Ajustez 60px selon la hauteur de votre header */
}

/* Pour les appareils mobiles */
@media (max-width: 767px) {
    html, body {
        height: -webkit-fill-available; /* Pour iOS */
    }
    .viewer-diapo {
        height: calc(100vh - 100px); /* Ajustez selon votre header mobile */
    }
}

/* Pour forcer le plein écran sur desktop */
@media (min-width: 768px) {
    html, body {
        height: 100vh;
        width: 100vw;
    }
}




   /* bouton X seulement */
   /*
.immersive-close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.immersive-close-btn.visible {
    opacity: 1;
}
.immersive-close-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}
    */

