/* ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆
   VARIABLES CSS - CONFIGURATION GLOBALE
   ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆ */

   :root {
    /* Couleurs */
    --color-bg: #000000;
    --color-text: #ffffff;
    --color-text-muted: #888888;
    --color-shadow: rgba(0, 0, 0, 0.55);
    
    /* Tailles et espacements */
    --grid-columns: 5;
    --grid-row-height: 10px;
    --padding-gallery: 20px;
    --border-radius: 12px;
    --shadow-default: 0 12px 30px var(--color-shadow);
    
    /* Filtres */
    --filter-blur: blur(8px);
    --filter-bright-dim: brightness(0.85);
    --filter-bright-normal: brightness(1);
    
    /* Animations */
    --transition-speed: 0.4s;
    --gallery-reveal-time: 0.8s;
    
    /* Texte */
    --font-family: Verdana, sans-serif;
    --font-size-h2: 42px;
    --font-size-p: 20px;
  }
  




  

  /* --- BARRE DE PROGRESSION --- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;        /* Commence à 0 */
  height: 5px;      /* Légèrement plus épais pour être sûr de la voir */
  background: #ffffff !important; /* Force le blanc par défaut */
  background: var(--progress-color, #ffffff) !important;
  z-index: 9999999 !important; /* Augmenté pour passer devant TOUT */
  transition: width 0.1s ease;
  pointer-events: none; /* Empêche la barre de bloquer les clics */
}

/* --- BOUTON PARAMÈTRES --- */
.settings-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99998;
  background: rgba(0, 0, 0, 0.65);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

/* --- PANNEAU PARAMÈTRES --- */
.settings-panel {
  position: fixed;
  top: 70px;
  right: 20px;
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid #444;
  padding: 20px;
  border-radius: 12px;
  z-index: 99998;
  color: white;
  min-width: 250px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.settings-panel.hidden {
  display: none;
}

.settings-panel label {
  display: block;
  margin: 10px 0;
  font-size: 14px;
  cursor: pointer;
}

/* Option de masquage via JS */
body.disable-progress #scroll-progress {
  display: none !important;
}




  /* ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆
     SECTION 1 : STYLES GLOBAUX
     ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆ */
  
  body {
    margin: 0;
    background: var(--color-bg);
    overflow-y: auto;
    cursor: crosshair;
    font-family: var(--font-family);
    
    /* Masqué par défaut */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  body::-webkit-scrollbar {
    display: none;
  }
  
  /* 🟢 Cette classe est ajoutée par le JS via ton panneau de paramètres */
  body.show-scrollbar {
    scrollbar-width: auto;
    -ms-overflow-style: auto;
  }
  
  body.show-scrollbar::-webkit-scrollbar {
    display: block; /* On la réaffiche si demandé */
    width: 8px;
  }


/* ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆
   SECTION 2 : MASONRY GRID - CONTENEUR
   ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆ */

.gallery {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), 1fr);
  grid-auto-rows: var(--grid-row-height);
  gap: 0;
  padding: var(--padding-gallery);
  opacity: 0;
  transition: opacity var(--gallery-reveal-time) ease;
}

body.no-animations .gallery {
  transition: none;
  opacity: 1;
}

.gallery.is-ready { 
  opacity: 1; 
}

body.no-animations .gallery.is-ready {
  opacity: 1;
}

/* ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆
   SECTION 3 : ITEMS - BASE
   ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆ */

.item {
  position: relative;
  transform: translate(var(--base-x, 0px), var(--base-y, 0px)) rotate(var(--base-rot, 0deg));
  z-index: 1;
  cursor: crosshair;
  contain: layout style paint;
}

/* Animation d'apparition progressive (Staggered Fade-in) */
.item {
  opacity: 0;
  animation: itemFadeIn 0.6s ease-out forwards;
}

body.no-animations .item {
  animation: none;
  opacity: 1;
}

@keyframes itemFadeIn {
  from {
    opacity: 0;
    transform: translate(var(--base-x, 0px), var(--base-y, 0px)) rotate(var(--base-rot, 0deg)) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translate(var(--base-x, 0px), var(--base-y, 0px)) rotate(var(--base-rot, 0deg)) translateY(0);
  }
}

/* Délai d'apparition staggered (IntersectionObserver applique cette classe) */
.item.inview {
  animation: itemFadeIn 0.6s ease-out forwards;
}

/* Rotations légères pour l'effet artistique */
.item:nth-child(3n + 1) { --base-x: -6px; --base-y: 4px;  --base-rot: -1.25deg; }
.item:nth-child(3n + 2) { --base-x:  5px; --base-y: 0px;  --base-rot:  1.05deg; }
.item:nth-child(3n)     { --base-x:  0px; --base-y: 6px;  --base-rot: -0.6deg;  }

.item:hover {
  z-index: 2;
  transform: translate(0, 0) rotate(0deg) !important;
}

.item.is-hidden { 
  opacity: 0; 
  pointer-events: none; 
}

/* ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆
   SECTION 4 : ITEMS - TAILLES ÉTENDUES
   ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆ */

.item.is-wide-2 { grid-column: span 2; --base-x: 0; --base-y: 0; --base-rot: 0; }
.item.is-wide-3 { grid-column: span 3; --base-x: 0; --base-y: 0; --base-rot: 0; }
.item.is-wide   { grid-column: span 5; --base-x: 0; --base-y: 0; --base-rot: 0; }

.item.is-wide iframe,
.item.is-wide-2 iframe,
.item.is-wide-3 iframe {
  width: 100% !important;
  max-width: 100%;
  display: block;
  border: 0;
}

/* ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆
   SECTION 5 : IMAGES
   ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆ */

.gallery img {
  width: 100%;
  display: block;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-default);
  filter: var(--filter-blur) var(--filter-bright-dim);
  transition: filter var(--transition-speed), transform var(--transition-speed);
  cursor: crosshair;
  /* 🚀 OPTIMISATIONS */
  backface-visibility: hidden;
}

body.no-blur .gallery img {
  filter: none;
}

body.no-animations .gallery img {
  transition: none;
}

.gallery img:hover { 
  filter: var(--filter-bright-normal); 
}

body.no-blur .gallery img:hover {
  filter: none;
}

.item:hover img { 
  transform: scale(1.03); 
}

body.no-animations .item:hover img {
  transform: none;
}

/* ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆
   SECTION 6 : VIDÉOS
   ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆ */

.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--color-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-default);
  filter: var(--filter-blur) brightness(0.8);
  transition: filter var(--transition-speed);
  cursor: crosshair;
  /* 🚀 OPTIMISATIONS */
  contain: layout style paint;
  backface-visibility: hidden;
}

body.no-blur .video-wrap {
  filter: none;
}

body.no-animations .video-wrap {
  transition: none;
}

.video-wrap.video-vertical { 
  aspect-ratio: 9 / 16; 
}

.item:hover .video-wrap { 
  filter: blur(0) var(--filter-bright-normal); 
}

body.no-blur .item:hover .video-wrap {
  filter: none;
}

/* FAÇADE VIDEO - Placeholder avant chargement de l'iframe */
.video-facade {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  z-index: 2;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.video-facade img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--border-radius);
}

.video-facade-button {
  position: absolute;
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 28px;
  color: var(--color-bg);
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
  z-index: 3;
}

.video-facade:hover .video-facade-button {
  transform: scale(1.1);
  background: white;
}

.video-facade.hidden {
  opacity: 0;
  pointer-events: none;
}

.video-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: pointer;
  background: transparent;
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* 🚀 OPTIMISATION */
  will-change: auto;
}

/* FAÇADE AUDIO (Deezer/Widgets) - Placeholder avant chargement */
.audio-facade {
  position: relative;
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border-radius: var(--border-radius);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-default);
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease;
  will-change: opacity;
  contain: layout style paint;
}

.audio-facade:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
}

.audio-facade-button {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  color: var(--color-bg);
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
}

.audio-facade:hover .audio-facade-button {
  transform: scale(1.15);
  background: white;
}

.audio-facade.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Conteneur pour l'iframe réelle (caché initialement) */
.audio-container {
  width: 100%;
  display: none;
}

.audio-container.loaded {
  display: block;
}

/* ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆
   SECTION 7 : CASSURE TEXTE (LE TROU)
   ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆ */

.item.text-section {
  grid-column: 1 / -1 !important;
  /* On réduit la marge externe pour remonter l'ensemble */
  margin: 100px 0 !important; 
  /* On définit une hauteur fixe ou minimale pour le "trou" */
  min-height: 400px !important;
  
  display: flex !important;
  flex-direction: column;
  /* Ces deux lignes assurent le centrage parfait du texte */
  justify-content: center; 
  align-items: center;
  
  text-align: center;
  background: transparent !important;
  position: relative;
  z-index: 10;
  
  --base-x: 0px !important;
  --base-y: 0px !important;
  --base-rot: 0deg !important;
  transform: none !important;
}

.item.text-section h2 {
  margin: 0 0 30px 0 !important;
  font-size: var(--font-size-h2);
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 4px;
  font-weight: bold;
}

.item.text-section p {
  margin: 12px 0;
  font-size: var(--font-size-p);
  color: var(--color-text-muted);
  max-width: 800px;
  line-height: 1.8;
}

.item.text-section:hover {
  transform: none !important;
}
/* ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆
   SECTION 8 : FULLSCREEN VIEWER
   ◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆ */

.fullscreen {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  display: none; /* Piloté par JS */
  justify-content: center;
  align-items: center;
  z-index: 99999;
  cursor: zoom-out;
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-text);
  font-size: 22px;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
  z-index: 2;
  transition: background 0.3s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* 🟢 L'IMAGE EN GRAND (Ciblée par son ID HTML #fullImg) */
#fullImg {
  /* Empêche l'image de dépasser de l'écran */
  max-width: 90%;
  max-height: 90%;
  
  /* 🛡️ EMPÊCHE L'UPSCALE (Déformation) */
  width: auto;
  height: auto;
  object-fit: scale-down; 
  
  /* Esthétique */
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  user-select: none;
  
  /* Animation initiale */
  opacity: 0;
  will-change: opacity, transform;
  animation: viewerImageFadeIn 0.4s ease-out forwards;

   filter: none !important; /* Force la suppression de tout filtre */
  -webkit-filter: none !important;
  image-rendering: auto; /* Assure un rendu net */
}

/* Petit effet de zoom au survol seulement si l'image n'est pas déjà au max */
#fullImg:hover {
  transform: scale(1.01);
  transition: transform 0.3s ease;
}

/* Animation d'entrée */
@keyframes viewerImageFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* --- GESTION DES OPTIONS DU PANNEAU --- */

/* Désactive l'animation si l'option est cochée */
body.no-anim #fullImg {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Aligner les photos (parallèle) */
body.no-tilt .item {
  --base-x: 0px !important;
  --base-y: 0px !important;
  --base-rot: 0deg !important;
  transform: none !important;
}

/* Assure que le survol reste propre même sans tilt */
body.no-tilt .item:hover img {
  transform: scale(1.03) !important;
}

/* Animation d'apparition des miniatures au scroll */
.item img {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}

.item img.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Labels des paramètres */
.settings-panel label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  user-select: none;
}

/* Style pour le nom de l'image en haut à droite */
.viewer-caption {
  position: absolute;
  top: 30px;
  right: 85px; /* Décalé pour ne pas chevaucher le bouton fermer */
  color: white;
  font-size: 18px;
  font-family: var(--font-family);
  letter-spacing: 1px;
  z-index: 100001;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.4);
  padding: 5px 15px;
  border-radius: 20px;
  pointer-events: none; /* Pour pouvoir cliquer à travers si besoin */
}



/* 1. ÉTAT PAR DÉFAUT / PERSONNALISÉ */
body.scroll-custom {
    scrollbar-width: auto; /* */
}

body.scroll-custom::-webkit-scrollbar {
    display: block; /* */
    width: 14px;    /* Largeur augmentée pour une meilleure visibilité */
}

body.scroll-custom::-webkit-scrollbar-thumb {
    background: var(--progress-color, #ffffff); /* */
    border-radius: 11px; /* */
    border: 2px solid black; /* */
    
    /* TAILLE FIXE / MINIMUM */
    min-height: 100px; /* Force le curseur à garder une grande taille même si la page est très longue */
}

body.scroll-custom::-webkit-scrollbar-track {
    background: #111; /* */
}

/* 2. ÉTAT NATIVE (Standard) */
body.scroll-native {
    scrollbar-width: auto !important;
    -ms-overflow-style: auto !important;
}
body.scroll-native::-webkit-scrollbar {
    display: block !important;
    width: auto !important;
}

/* 3. ÉTAT MASQUÉ */
body.scroll-none {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
body.scroll-none::-webkit-scrollbar {
    display: none !important;
}