/* ============================================================
   GALLERY.CSS — styles communs à peintures.html & sculptures.html
   ============================================================ */

/* ===== TRANSITION D'ENTRÉE ===== */
@keyframes page-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ===== BASE ===== */
body {
  margin: 0;
  background: #000;
  color: #ffd700;
  overflow: hidden;
  font-family: 'Merriweather', serif;
  animation: page-fade-in 0.8s ease forwards;
}

/* Overlay de fondu au noir pour le retour */
#fade-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  z-index: 9999;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
#fade-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ===== ZONE IMAGE PRINCIPALE ===== */
#main-view {
  position: relative;
  width: 100%;
  height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Peintures : container zoomable */
#main-img-container {
  position: relative;
  width: 95%;
  height: 95%;
  overflow: hidden;
}

#main-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  user-select: none;
  pointer-events: auto;
  z-index: 5;
  transform-origin: 0 0; /* indispensable pour le calcul de zoom JS */
  -webkit-user-drag: none; /* bloque le glisser-déposer */
}

/* Surcouche transparente : bloque le clic droit natif sur l'image */
#main-img-container::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 7; /* au-dessus de l'image, sous le watermark */
  pointer-events: none; /* laisse passer les clics JS vers l'image */
}

/* Sculptures : image simple centrée */
#main-sculpt {
  max-width: 95%;
  max-height: 95%;
  user-select: none;
  box-shadow: 0 0 80px #000;
}

/* ===== WATERMARK ===== */
.watermark {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 15px;
  font-family: 'Cinzel', serif;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.65); /* plus visible qu'avant */
  pointer-events: none;
  z-index: 8; /* au-dessus de la surcouche de protection */
  text-shadow: 0 0 12px rgba(0,0,0,0.9), 0 0 4px rgba(0,0,0,1);
  white-space: nowrap;
  user-select: none;
}

/* ===== RUBAN THUMBNAILS ===== */
#thumbs {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 20vh;
  display: flex;
  flex-direction: row;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  background: rgba(0, 0, 0, 0.8);
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#thumbs::-webkit-scrollbar { display: none; }

.thumb {
  flex: 0 0 120px;
  height: 120px;
  margin: 0 5px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  transition: .3s;
}
.thumb:hover { transform: scale(1.05); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ===== FLÈCHES RUBAN (desktop) ===== */
#thumb-scroll {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 20vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1001;
  pointer-events: none;
  transition: opacity 0.3s;
}
.scroll-btn {
  pointer-events: auto;
  font-size: 50px;
  color: #ffd700;
  cursor: pointer;
  padding: 0 20px;
  line-height: 1;
  text-shadow: 0 0 10px #000;
}
.scroll-btn:hover { color: #fff; }

/* ===== BOUTON RETOUR ===== */
#back-home {
  position: fixed;
  top: 40px; left: 40px;
  width: 50px; height: 50px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 215, 0, 0.4);
  border-radius: 50%;
  cursor: pointer;
  z-index: 999;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  display: flex; align-items: center; justify-content: center;
}
#back-home img { width: 30px; height: 30px; }

/* ===== BOUTON PLEIN ÉCRAN ===== */
#fullscreen-btn {
  position: fixed;
  top: 40px; right: 40px;
  width: 50px; height: 50px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 215, 0, 0.4);
  border-radius: 50%;
  cursor: pointer;
  z-index: 999;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.3s;
}
#fullscreen-btn:hover { opacity: 1; }

/* ===== VUE PLEIN ÉCRAN ===== */
#fullscreen-view {
  position: fixed;
  inset: 0;
  background: #000;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  overflow: hidden;
}

/* Image plein écran — peintures */
#fullscreen-img {
  max-width: 98%;
  max-height: 98%;
  user-select: none;
  -webkit-user-drag: none;
  object-fit: contain;
}

/* Image plein écran — sculptures */
#fullscreen-sculpt {
  max-width: 98%;
  max-height: 98%;
  user-select: none;
  -webkit-user-drag: none;
  box-shadow: 0 0 80px #000;
}

#fullscreen-close {
  position: absolute;
  top: 25px; right: 40px;
  font-size: 50px;
  color: #ffd700;
  cursor: pointer;
  z-index: 2001;
  line-height: 1;
}

#fullscreen-prev,
#fullscreen-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 80px;
  color: #ffd700;
  cursor: pointer;
  z-index: 2002;
  user-select: none;
}
#fullscreen-prev { left: 30px; }
#fullscreen-next { right: 30px; }

#fullscreen-autoplay {
  position: absolute;
  top: 50%;
  right: 110px;  /* juste à gauche de #fullscreen-next (right:30px + 60px + 20px gap) */
  transform: translateY(-50%);
  width: 60px; height: 60px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 215, 0, 0.4);
  border-radius: 50%;
  cursor: pointer;
  z-index: 2001;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.3s;
}
#fullscreen-autoplay:hover { background: rgba(255, 215, 0, 0.2); }
#fullscreen-autoplay svg { width: 28px; height: 28px; fill: #ffd700; }

.fs-watermark {
  position: absolute;
  bottom: 14px; left: 50%;
  transform: translateX(-50%);
  font-size: 15px;
  font-family: 'Cinzel', serif;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.65);
  pointer-events: none;
  z-index: 2001;
  text-shadow: 0 0 12px rgba(0,0,0,0.9), 0 0 4px rgba(0,0,0,1);
  white-space: nowrap;
  user-select: none;
}


/* ===== FLÈCHES NAVIGATION OEUVRES (prev/next) ===== */
.gallery-nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-size: 80px;
  color: #ffd700;
  cursor: pointer;
  z-index: 100;
  user-select: none;
  text-shadow: 0 0 15px rgba(0,0,0,0.8);
  transition: color 0.2s, opacity 0.2s;
  opacity: 0.7;
  /* Ne pas empiéter sur la zone image */
  padding: 0 10px;
}
.gallery-nav-btn:hover { color: #fff; opacity: 1; }
.gallery-nav-btn.hidden { opacity: 0; pointer-events: none; }

#gallery-prev { left: 5px; }
#gallery-next { right: 5px; }
