/* =========================================================
   FOND GLOBAL DE LA PAGE
   → gère l’image de fond et l’ambiance générale
   ========================================================= */
.fond-salle-art {
  background-image: url("../images/fonds/fond_salle_art.webp");

  /* image de fond principale */
  background-size: cover; /* étire l’image pour remplir tout l’écran */
  background-position: center; /* centre l’image */
  background-attachment: fixed; /* effet fixe (parallaxe sur desktop) */
  background-repeat: no-repeat; /* empêche la répétition */
  color: #fff; /* couleur de texte par défaut */
}


/* =========================================================
   CONTENEUR PRINCIPAL DE LA PAGE
   → largeur globale et centrage du contenu
   ========================================================= */
.content_salle_art {
  max-width: 1000px; /* largeur maximale du contenu */
  margin: 0 auto; /* centre horizontalement */
  padding: 2rem; /* espace intérieur */
  display: flex;
  flex-direction: column; /* empile les éléments verticalement */
  align-items: center; /* centre horizontalement */
  gap: 2rem; /* espace entre les blocs */
  background: transparent;
}


/* =========================================================
   SECTION GALERIE (style musée)
   ========================================================= */
.salle-art-musee {
  position: relative;
  width: 100%;
  max-width: 1200px; /* largeur max de la galerie */
  margin: 1rem auto;
  overflow: hidden; /* cache le débordement horizontal */
  padding-top: 2rem; /* espace en haut */
}


/* =========================================================
   RAIL HORIZONTAL DES ŒUVRES
   → conteneur du scroll horizontal
   ========================================================= */
.galerie-rail {
  display: flex; /* alignement horizontal */
  gap: 2rem; /* espace entre les œuvres */
  overflow-x: hidden; /* scroll géré en JS */
  scroll-behavior: smooth; /* défilement fluide */
  padding: 0 2rem; /* marges gauche/droite */
  margin-top: -50px; /* remonte visuellement la galerie */
}


/* =========================================================
   CARTE D’UNE ŒUVRE (miniature dans la galerie)
   ========================================================= */
.oeuvre {
  flex: 0 0 auto;
  width: 160px; /* ⚠️ taille des images dans la galerie */
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}


/* image de l’œuvre */
.oeuvre img {
  width: 100%;
  border-radius: 8px; /* coins arrondis */
  box-shadow: 0 0 20px rgba(0,0,0,0.7); /* effet de profondeur */
  border: 2px solid rgba(255,215,0,0.3); /* contour doré léger */

  /* effet de perspective léger */
  transform: perspective(500px) rotateY(0deg);
}


/* effet au survol (desktop uniquement) */
.oeuvre:hover img {
  transform: perspective(500px) rotateY(2deg) scale(1.05);
  box-shadow: 0 0 30px rgba(255,215,0,0.8);
}


/* =========================================================
   FLÈCHES DE NAVIGATION GALERIE
   ========================================================= */
.scroll-btn {
  position: absolute;
  top: 50%; /* centre vertical */
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  border: none;
  color: #ffd700;
  font-size: 2rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  z-index: 10;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.scroll-btn:hover {
  background: rgba(0,0,0,0.85);
}

.scroll-btn.left { left: 0.5rem; }
.scroll-btn.right { right: 0.5rem; }


/* =========================================================
   OVERLAY (plein écran)
   → popup de lecture des œuvres
   ========================================================= */
.overlay-art {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  /* fond sombre + image de décor */
  background: linear-gradient(rgba(5,5,10,0.7), rgba(5,5,10,0.7)),
              url("../images/fonds/fond_salle_art_overlay.webp") no-repeat center center;

  background-size: cover;
  backdrop-filter: blur(6px); /* flou de l’arrière-plan */
  z-index: 999;

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

  overflow: hidden;
  padding: 2rem; /* marge intérieure globale */
}


/* état caché */
.overlay-art.hidden {
  display: none;
}


/* =========================================================
   STRUCTURE INTERNE DE L’OVERLAY
   → image à gauche / texte à droite
   ========================================================= */
.overlay-content {
  display: grid;

  grid-template-columns: 40% 60%; /* ⚠️ répartition image / texte */

  gap: 1rem;
  max-width: 1100px;
  width: 80%;
  max-height: 90vh;
}


/* =========================================================
   PARTIE IMAGE (GAUCHE)
   ========================================================= */
.overlay-left {
  display: flex;
  justify-content: center;
  align-items: center;

  transform: rotate(-2deg) translateY(-10%); /* effet “tableau incliné” */
  position: relative;
  
  /* AJOUT IMPORTANT */
  width: fit-content; /* le conteneur prend la taille de l’image */
  margin: 0 auto;     /* centre horizontalement */
}


/* image principale de l’œuvre */
.overlay-left img {
  max-width: 100%;
  max-height: 80vh; /* ⚠️ taille de l’image sur desktop */

  border-radius: 8px;
  box-shadow: 0 0 40px rgba(0,0,0,0.8);

  transform: rotate(-2deg);
}


/* texte en diagonale sur l’image (état / mention) */
.overlay-state {
  position: absolute;
  top: 0;
  left: 0;

  width: 100%;
  height: 100%;

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

  pointer-events: none;
}


/* texte diagonal sur l’image */
.overlay-state span {
  transform: rotate(-30deg);

  font-size: 5rem; /* ⚠️ taille du texte diagonal */
  font-weight: bold;

  color: rgba(255, 215, 0, 0.25); /* transparence dorée */
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}


/* =========================================================
   PARTIE TEXTE (DROITE)
   ========================================================= */
.overlay-right {
  color: #f5f5f5;

  display: flex;
  flex-direction: column;
  gap: 1rem;

  max-height: 80vh;
  overflow-y: auto; /* scroll si texte trop long */

  padding-right: 0.5rem;
  text-align: justify;
}


/* titre principal */
.overlay-right h2 {
  font-size: 2.2rem; /* ⚠️ taille titre */
  color: #ffd700;
  margin: 0;
}


/* sous-titre */
.overlay-right h3 {
  font-size: 1.4rem;
  font-style: italic;
  opacity: 0.85;
  margin: 0;
}


/* texte principal */
.overlay-right p {
  line-height: 1.6;
  font-size: 1.1rem; /* ⚠️ taille texte lecture */
  margin: 0;
}


/* état / information secondaire */
.overlay-right .overlay-state-text-right {
  font-weight: bold;
  color: #ffd700;
  margin-top: 0.5rem;
}


/* empêche scroll du fond quand overlay ouvert */
body.overlay-open {
  overflow: hidden;
}

/* =========================================================
   RESPONSIVE TABLETTE / MOBILE
   ========================================================= */
@media (max-width: 800px) {
  .oeuvre {
    width: 130px;
  }

  .overlay-art {
    padding: 0.5rem;
  }

  .overlay-content {
    grid-template-rows: auto auto;
    gap: 1rem;

    width: 100%;
    max-width: 90%;
    max-height: 100vh;
  }

  .overlay-left {
    transform: none;
  }

  .overlay-left img {
    max-height: 30vh; /* ⚠️ taille image mobile */
    width: auto;
    margin: 0 auto;
  }

  .overlay-state span {
    font-size: 2.5rem; /* texte diagonal mobile */
  }

  .overlay-right {
    max-height: none;
    font-size: 0.9rem;
    text-align: left;
    align-items: flex-start;
  }

  .overlay-right h2 {
    font-size: 1.5rem;
  }

  .overlay-right h3 {
    font-size: 1rem;
  }

  .overlay-right p {
    font-size: 0.9rem;
  }
}


/* =========================================================
   AJUSTEMENT ORIENTATION PORTRAIT
   ========================================================= */
@media (orientation: portrait) {
  .fond-salle-art {
    background-position-x: 55%;
    background-position-y: center;
  }
  
  .overlay-content {
    grid-template-columns: 1fr; /* image au-dessus du texte */
    grid-template-rows: auto auto;
  }
  
  .overlay-right {
	max-height: 60vh;
    overflow-y: auto;
  }  
}

/* =========================================================
   MASQUAGE DU FOOTER PENDANT L'OVERLAY
   → améliore immersion + gain de place écran
   ========================================================= */
body.overlay-open footer {
  display: none;
}

/* =========================================================
   OVERLAY - MOBILE PAYSAGE
   → priorité à l'image, texte réduit
   ========================================================= */
@media (max-width: 800px) and (orientation: landscape) {

  /* agrandit la zone globale */
  .overlay-content {
    grid-template-columns: 50% 50%; /* ⚠️ image plus large que texte */
    gap: 1rem;
    max-height: 100vh;
    width: 100%;
  }

  /* IMAGE : beaucoup plus présente */
  .overlay-left img {
    max-height: 85vh; /* ⚠️ augmente la taille de l’image */
    width: auto;
  }

  /* texte : réduit pour éviter bloc trop dominant */
  .overlay-right {
    font-size: 0.9rem; /* ⚠️ taille globale du texte */
    max-height: 85vh;
    overflow-y: auto;
  }

  /* titre réduit */
  .overlay-right h2 {
    font-size: 1.4rem;
  }

  /* sous-titre réduit */
  .overlay-right h3 {
    font-size: 1rem;
  }

  /* paragraphes plus compacts */
  .overlay-right p {
    font-size: 0.95rem;
    line-height: 1.4;
  }

  /* texte diagonal sur image */
  .overlay-state span {
    font-size: 2rem; /* ⚠️ watermark réduit aussi */
  }
}