/* VERSION CSS PROPRE — indexDiapoNew2 (2F CLEAN) >> devient CSS_AMP5_DiapoNew3  APRES NETTOYAGE GPT 12/02/2026 */

/*
>>>>>>>>>>> Version 3.1 de GPT avec gestion correcte des iphone -12/02/26-17h
*/

/* ==========================================
   DIAPO CSS 3.1 – CLEAN STABLE VERSION
   Desktop + Mobile + iOS Safe + Fullscreen
========================================== */





/* =============== RESET =============== */
*{
  box-sizing:border-box;
  margin:0;
  padding:0;
}

html, body{
  height:100%;
}

body{
  background:#000;
  color:#fff;
  font-family:system-ui, sans-serif;
  overflow:hidden;
}

/* evite video vide au départ */
#video {
  display: none;
}

/* =============== BACKGROUND OPTIONNEL =============== */
body.with-bg{
  background: var(--bg-url) center center / cover no-repeat fixed;
}

body.with-bg #diapo{
  background: rgba(0,0,0,0.35);
}

/* =============== LAYOUT PRINCIPAL =============== */
#diapo{
  height:100vh;   /* desktop stable */
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
/* =============== HEADER =============== */
.hidden{
  display:none !important;
}

/* ajout pour Safari -webkit-backdrop-filter: blur(5px);  */
/* =================== nouvelle version 14/02/2026============================================== */

/* =========================================
   HEADER RESPONSIVE SIMPLIFIÉ
========================================= */

#header{
  position:relative;
  z-index:50;

  display:flex;
  flex-direction:column;

  padding:
    calc(8px + env(safe-area-inset-top))
    12px
    8px;

  background:rgba(0,0,0,0.35);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(6px);
}

/* ===== LIGNE HAUTE ===== */
.header-top{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:16px;
}

/* bloc gauche (retour + compteur) */
.header-left{
  display:flex;
  align-items:center;
  gap:8px;
}

/* bloc boutons */
.header-right{
  display:flex;
  align-items:center;
  gap:8px;
}

/* ===== LIGNE BASSE ===== */
.header-bottom{
  margin-top:6px;
}

.gallery-title{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:16px;
}

/* =========================================
   DESKTOP
========================================= */
@media (min-width:768px){

  #header{
    flex-direction:row;
    align-items:center;
    justify-content:flex-start;
  }

  .header-bottom{
    margin-top:0;
    margin-left:20px; /* espace entre boutons et titre */
  }

  .gallery-title{
    font-size:17px;
  }



  
}

/* =========================================
   MOBILE
========================================= */
@media (max-width:767px){

  #header{
    gap:6px;
  }

  .header-top{
    justify-content:space-between;
  }

  .header-bottom{
    text-align:center;
  }

  .gallery-title{
    font-size:14px;
  }

  .ui-btn{
    width:40px;
    height:40px;
  }
  /* ----- ICONES  HEADER ---*/

}

.icon2{
  width:22px;
  height:22px;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;      /* 🔑 important */
  stroke-linejoin:round;     /* 🔑 important */
  fill:none;
  pointer-events:none;
}

.icon{
  width:22px;
  height:22px;
  stroke:currentColor;
  fill:none;
  pointer-events:none;
}

/* =================== nouvelle version 14/02/2026============================================== */

/* ===== Titre ===== */
.gallery-title{
  font-size:20px;
  font-weight:500;
  text-align:center;

  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}


/* ===== COMPTEUR ===== */
.counter{
  font-size:13px;
  padding:4px 8px;
  border-radius:12px;
  background:rgba(255,255,255,0.15);
  white-space:nowrap;
}

/* ===== BOUTONS ===== */
/* ======================= BOUTONS  NEW ==================== */
/* ===============================
   BOUTONS HEADER – VERSION PRO
================================ */

.ui-btn{
  width:42px;
  height:42px;

  display:flex;
  align-items:center;
  justify-content:center;

  background:rgba(0,0,0,0.55);
  border:1px solid rgba(255,255,255,0.25);
  border-radius:12px;

  color:#ffffff;
  cursor:pointer;

  transition:
    background .25s ease,
    border-color .25s ease,
    box-shadow .25s ease,
    transform .12s ease;
}

.ui-btn:hover{
  background:rgba(13,110,253,.85);
  border-color:#0d6efd;
  box-shadow:0 0 12px rgba(13,110,253,.6);
}

.ui-btn:active{
  transform:scale(.94);
}

/* icônes SVG */
.icon{
  width:22px;
  height:22px;
  stroke:#ffffff;
  stroke-width:2.2;
  fill:none;
  pointer-events:none;
  transition:transform .2s ease;
}


/* ===== BOUTON ACTIF (audio / immersive / autoplay) ===== */
.ui-btn.active{
  background:rgba(13,110,253,.95);
  border-color:#0d6efd;
  box-shadow:0 0 14px rgba(13,110,253,.8);
}

/* Immersive ON / OFF plus lisible*/
body.immersive #btnImmersive{
  background:rgba(13,110,253,.95);
  border-color:#0d6efd;
  box-shadow:0 0 14px rgba(13,110,253,.8);
}

/*  Améliorer PLAY/PAUSE visuellement */
#playPause{
  font-size:18px;
  font-weight:600;
}

#playPause.active{
  background:rgba(13,110,253,.95);
  border-color:#0d6efd;
}


/* ======================= BOUTONS  NEW ==================== */




/* ===== IMMERSIVE ===== */
body.immersive #header{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  opacity:.25;
  transition:opacity .3s ease;
}

body.immersive #header:hover{
  opacity:1;
}

#btnImmersive.active{
  background:rgba(13,110,253,.85);
}


/* =============== VIEWER =============== */
#viewer{
  flex:1 1 auto;
  min-height:0;          /* obligatoire */
  position:relative;     /* PAS fixed */
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

#viewer img,
#viewer video{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
}

/* =============== FLECHES PRINCIPALES =============== */
.arrow{
  position:absolute;
  top:50%;
  transform:translateY(-50%);

  width:48px;
  height:48px;

  display:flex;
  align-items:center;
  justify-content:center;

  font-size:32px;
  font-weight:600;
  line-height:1;

  color:white;
  background:rgba(0,0,0,0.45);
  border-radius:50%;
  cursor:pointer;
  z-index:20;

  transition:background .25s ease, box-shadow .25s ease;
}

.arrow:hover{
  background:rgba(13,110,253,.85);
  box-shadow:0 0 10px rgba(13,110,253,.7);
}

.arrow.left{ left:12px; }
.arrow.right{ right:12px; }

/* suppression focus outline */
button{
  outline:none;
  border:none;
  box-shadow:none;
  -webkit-tap-highlight-color: transparent;
}

/* =============== VIGNETTES new =============== */

/* ================= VIGNETTES STABLE ================= */

#thumbsWrapper{
  position:relative;
  display:flex;
  justify-content:center;
  background:transparent;
  padding:8px 0;
}

/* barre centrale */
#thumbsBar{
  display:flex;
  align-items:center;
  gap:8px;
  max-width:100%;
}

/* zone scrollable */
#thumbs{
  display:flex;
  gap:8px;
  overflow-x:auto;
  scroll-behavior:smooth;
  max-width:80vw;
}

#thumbs::-webkit-scrollbar{
  display:none;
}

/* vignette */
.thumb{
  width:72px;
  height:72px;
  flex-shrink:0;
  border:2px solid transparent;
  cursor:pointer;
}

.thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
}

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

/* flèches */
.thumb-arrow{
  width:34px;
  height:34px;

  display:flex;
  align-items:center;
  justify-content:center;

  font-size:18px;
  cursor:pointer;

  background:rgba(0,0,0,0.45);
  color:white;

  border-radius:50%;

  flex-shrink:0;

  -webkit-user-select:none;
  user-select:none;

  transition:background .25s ease, box-shadow .25s ease;
}

.thumb-arrow:hover{
  background:rgba(13,110,253,.85);
  box-shadow:0 0 8px rgba(13,110,253,.6);
}


/* =============== VIDEO =============== */


#video{
  background:black;
}

#videoHint{
  position:absolute;
  bottom:20px;
  left:50%;
  transform:translateX(-50%);
  padding:6px 12px;
  background:rgba(0,0,0,0.6);
  border-radius:6px;
  font-size:14px;
  display:none;
  pointer-events:none;
}

#videoHint.show{
  display:block;
}

/* =============== LEGENDE =============== */
#caption{
  position:absolute;
  bottom:20px;
  left:50%;
  transform:translateX(-50%);
  padding:6px 14px;
  background:rgba(0,0,0,0.6);
  border-radius:6px;
  font-size:14px;
  opacity:0;
  transition:opacity .4s ease;
  pointer-events:none;
}

#caption.show{
  opacity:1;
}

body.immersive #caption{
  display:none;
}

/* =============== IMMERSIVE NAVIGATEUR =============== */
body.immersive{
  overflow:hidden;
}

body.immersive #viewer{
  position:fixed;
  inset:0;
  width:100vw;
  height:100vh;
}

body.immersive #thumbsWrapper{
  display:none !important;
}

/* header discret */
body.immersive #header{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  opacity:.2;
  transition:opacity .3s;
}

body.immersive #header:hover{
  opacity:1;
}

/* =============== FULLSCREEN OS =============== */
:fullscreen #viewer,
:-webkit-full-screen #viewer{
  position:fixed;
  inset:0;
  width:100vw;
  height:100dvh;
  display:flex;
  align-items:center;
  justify-content:center;
}

:fullscreen #header,
:fullscreen #thumbsWrapper,
:-webkit-full-screen #header,
:-webkit-full-screen #thumbsWrapper{
  display:none !important;
}

/* bouton sortie fullscreen */
.fs-exit{
  position:fixed;
  top:16px;
  right:16px;
  width:40px;
  height:40px;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,0.55);
  border-radius:50%;
  color:white;
  cursor:pointer;
  z-index:9999;
}

:fullscreen .fs-exit{
  display:flex;
}

/* =============== RESPONSIVE =============== */
@media(max-width:640px){

  .arrow{
    width:38px;
    height:38px;
    font-size:22px;
  }

  .thumb{
    width:60px;
    height:60px;
  }

  .ui-btn{
    width:36px;
    height:36px;
  }

  .gallery-title{
    font-size:1rem;
    white-space:normal;
    text-align:center;
  }

}

@media (max-width:640px){
  #diapo{
    height:100svh;
  }
}