/* =========================================================
   SECTION SPECTACLES
   ========================================================= */

.section-spectacles {
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  margin-left: calc(50% - 50vw);
  padding: 2rem;
  box-sizing: border-box;
  background-color: var(--blanc);
  color: var(--noir);
  display: flex;
  flex-direction: column;
}


#spectacles {
  scroll-margin-top: 100px;
}


.section-spectacles h1 {
  color: var(--noir);
  margin: 0 0 4rem;
}


/* =========================================================
   MENU DES 3 SPECTACLES
   ========================================================= */

.spectacles-grid {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns:
  repeat(3, 1fr);
  gap: 1.5rem;
}


/* =========================================================
   CARTE D'UN SPECTACLE
   ========================================================= */

.spectacle-preview {
  position: relative;
  background-color: var(--fond);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: center;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.spectacle-preview:hover {
  transform: translateY(-5px);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.15);
}

/* =========================================================
   IMAGE DES 3 CARTES
   ========================================================= */

.preview-image {
  position: relative;
  width: 100%;
  height: 520px;
  overflow: hidden;
  background-color: #eee;
}

.preview-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s ease;
}

/* ZOOM AU SURVOL*/
.spectacle-preview:hover .preview-image img {
  transform: scale(1.08);
}

/* DÉGRADÉ POUR FAIRE RESSORTIR LES INFORMATIONS */
.preview-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,rgba(0, 0, 0, 0.75) 0%,rgba(0, 0, 0, 0.35) 35%,rgba(0, 0, 0, 0) 65%);
  pointer-events: none;
}

/* INFORMATIONS SUR L'IMAGE */
.preview-info {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4rem 1.2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: white;
}

/* TITRE */
.preview-info h2 {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.3;
  font-weight: bold;
  color: white;
  text-shadow:0 2px 8px rgba(0, 0, 0, 0.6);
}

/* ANNÉE */
.preview-date {
  margin: 0.35rem 0 0;
  font-size: 1rem;
  font-style: italic;
  font-weight: bold;
  color: white;
  text-shadow:0 2px 8px rgba(0, 0, 0, 0.6);
}

/* BOUTON */
.btn-decouvrir {
  margin-top: 1rem;
}

/* CARROUSEL DÉTAILLÉ */
.spectacles-details {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  display: none;
}

.spectacles-details.visible {
  display: block;
  margin-bottom: 4rem;
  animation: apparitionSpectacle 0.5s ease;
}

/* ANIMATION D'APPARITION */
@keyframes apparitionSpectacle {
  from {
    opacity: 0;
    transform:
      translateY(-20px);
  }

  to {
    opacity: 1;
    transform:
      translateY(0);
  }
}

/* BOUTON FERMER */
.fermer-details {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 42px;
  height: 42px;
  padding: 0;

  border: 2px solid var(--vert);
  border-radius: 50%;

  background: var(--vert);
  color: white;

  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;

  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12);

  transition:
    transform 0.3s ease,
    background 0.3s ease,
    color 0.3s ease;
}

.fermer-details:hover {
  transform: scale(1.1);
  background: white;
  color: var(--vert);
  border-color: var(--vert);
}

/* CARROUSSEL */
.carousel {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.carousel-viewport {
  overflow: hidden;
  border-radius: 24px;
}

.carousel-track {
  display: flex;
  align-items: stretch;
  transition:transform 0.5s ease;
}

.slide {
  min-width: 100%;
  display: flex;
  align-items: stretch;
}


/* CARD DU CARROUSSEL */
.card {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  background-color: var(--fond);
  border-radius: 24px;
  padding: 1.5rem 2.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
}

/* INFORMATIONS */

.info-intitule {
  font-size: 16pt;
  line-height: 1.3;
  font-weight: bold;
}

.info-date {
  font-size: 12pt;
  line-height: 1.3;
  margin-top: 0.5rem;
  font-style: italic;
  font-weight: bold;
}

/* IMAGE + TEXTE */
.spectacle-content {
  display: grid;
  grid-template-columns:1fr 1fr;
  gap: 3rem;
  width: 100%;
  margin-top: 1.5rem;
  text-align: left;
  align-items: start;
}

/* PHOTO DU CARROUSSEL */
.photos-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 16px;
  background: #eee;
}

.photo-change {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 16px;
  opacity: 0;
  transition: opacity 1.8s ease-in-out;
}

.photo-1 {
  opacity: 1;
  z-index: 1;
}

.photo-2 {
  opacity: 0;
  z-index: 2;
}

/* TEXTE DU SPECTACLE */
.info-texte {
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  overflow-y: auto;
  font-size: 13pt;
  line-height: 1.6;
  padding-right: 1rem;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color:var(--vert) transparent;
}

.info-texte p {
  margin:0 0 1.2rem 0;
}

.info-texte p:last-child {
  margin-bottom: 0;
}

/* SCROLLBAR */
.info-texte::-webkit-scrollbar {
  width: 7px;
}

.info-texte::-webkit-scrollbar-track {
  background:transparent;
}

.info-texte::-webkit-scrollbar-thumb {
  background-color:var(--bleu);
  border-radius: 10px;
}

.info-texte::-webkit-scrollbar-thumb:hover {
  background-color:var(--bleu);
}

.info-texte::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

/* BOUTONS */
.btn {
  flex-shrink: 0;
  align-self: center;
  display: inline-block;
  margin-top: 1rem;
  padding:0.8rem 1.8rem;
  border-radius: 40px;
  background:
  var(--vert);
  color: white;
  font-weight: 600;
  text-decoration: none;
  border:2px solid var(--vert);
  cursor: pointer;
  transition:transform 0.3s ease,box-shadow 0.3s ease,background 0.3s ease,color 0.3s ease;
}

.btn:hover {
  transform:scale(1.08) translateY(-2px);
  background: white;
  color:var(--noir);
  box-shadow:0 8px 20px rgba(0, 0, 0, 0.25);
}

/* BOUTONS VIDÉOS */
.boutons {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.boutons .btn {
  display: inline-block;
}

/* TABLETTE */
@media (max-width: 850px) {
	
  .spectacles-grid {
    grid-template-columns: 1;
    max-width: 500px;
    gap: 1.5rem;
  }

  .preview-image {
    aspect-ratio: 16 / 9;
  }
}


/* MOBILE */
@media (max-width: 600px) {

  .section-spectacles {
    height: auto;
    min-height: 100vh;
    padding: 3rem 1rem;
    overflow: visible;
  }

  /* ---------- MENU DES SPECTACLES ---------- */

  .spectacles-grid {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .spectacle-preview {
    width: 100%;
    height: 480px;
    border-radius: 20px;
  }

  .preview-image {
    position: relative;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }

  .preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* INFORMATIONS SUR L'IMAGE */

  .preview-info {
    position: absolute;
    z-index: 2;

    left: 0;
    right: 0;
    bottom: 0;

    padding: 4rem 1rem 1.5rem;

    display: flex;
    flex-direction: column;
    align-items: center;

    color: white;
  }

  .preview-info h2 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.3;
    color: white;
  }

  .preview-date {
    margin: 0.35rem 0 0;
    font-size: 1rem;
    color: white;
  }

  .btn-decouvrir {
    margin-top: 1rem;
  }


  /* ---------- CARROUSSEL ---------- */

  .spectacles-details {
    max-width: 100%;
  }

  .spectacles-details.visible {
    margin-bottom: 3rem;
  }

  .carousel {
    max-width: 100%;
  }

  .carousel-viewport {
    border-radius: 20px;
  }

  .carousel-track {
    height: auto;
  }

  .slide {
    height: auto;
  }

  .card {
    height: auto;
    padding: 1.5rem;
  }

  /* ---------- IMAGE + TEXTE ---------- */

  .spectacle-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .photos-carousel {
    aspect-ratio: 1 / 1;
    order: -1;
  }

  .info-texte {
    width: 100%;
    aspect-ratio: auto;
    height: auto;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }

  /* ---------- FERMER ---------- */

  .fermer-details {
    margin-bottom: 0.8rem;
  }

}
