/* ============================================================================
VARIABLES GLOBALES & IMPORTATIONS
============================================================================ */
@import url('/css/variables.css');

/* ============================================================================
ACCESSIBILITÉ : texte uniquement pour les lecteurs d'écran
============================================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================================
STRUCTURE GÉNÉRALE
============================================================================ */
main {
  padding-top: 62px;
  padding-bottom: 160px;
  padding-left: 7%;
  padding-right: 7%;
  margin: auto;
  /* background-color: aquamarine; */ /* Utile pour debug */
}

.main-container {
  margin: 0 auto;
  max-width: 100%;
}

/* ============================================================================
ICÔNES
============================================================================ */
.icons {
  width: 24px;
  height: 24px;
  border-radius: 0px;
}

/* ============================================================================
GRILLE DE VISUELS
============================================================================ */
.grid-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 3.75vw;
  list-style: none;
  padding: 0;
}

.grid-wrapper li {
  width: 100%;
  height: 100%;
}

/* ============================================================================
MEDIA : IMAGES & VIDÉOS
============================================================================ */
img {
  width: 100%;
  height: auto;
  cursor: zoom-in;
  border-radius: 24px;
}

video {
  cursor: zoom-in;
  border-radius: 24px;
}

/* ============================================================================
LÉGENDES DES MÉDIAS
============================================================================ */
figcaption {
  color: var(--title-color);
  font-family: var(--font-secondary);
  font-size: 20px;
  font-style: normal;
  font-weight: 400;
  line-height: 40px;
  padding: 8px 0px;
}

/* ============================================================================
MODALE : ZOOM SUR IMAGE/VIDÉO
============================================================================ */
.modal {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  z-index: 9999999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  /* overflow: auto; */ /* supprimé */
  overflow: hidden; /* ou juste retirer */
  background-color: rgba(0, 0, 0, 0.9);
}


.modal-content {
  display: block;
  max-width: 700px;
  max-height: 80%;
  align-self: center; /* Centrer verticalement */
}

.close {
  color: #fff;
  position: absolute;
  top: 10px;
  right: 25px;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000; /* <-- Ajoute ça */
  pointer-events: auto; /* au cas où */
}


/* ============================================================================
NAVIGATION DANS LA MODALE (précédent / suivant)
============================================================================ */
.modal-navigation {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transform: translateY(-50%);
}

.modal-prev,
.modal-next {
  font-size: 30px;
  color: #fff;
  cursor: pointer;
}

.modal-prev {
  margin-left: 25px;
}

.modal-next {
  margin-right: 25px;
}

.modal-prev:hover,
.modal-next:hover {
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.7);
}

/* ============================================================================
RESPONSIVE DESIGN : tablette et mobile
============================================================================ */
@media only screen and (max-width: 768px) {

  .grid-wrapper {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3.75vw;
    list-style: none;
    padding: 0;
  }

  main {
    padding-bottom: 64px;
  }

  .modal-content {
    max-width: 90vw;   /* Pas plus large que 90% de la largeur de l'écran */
    max-height: 70vh;  /* Hauteur max relative à la fenêtre */
    margin: 0 40px;    /* Laisser un peu de marge à gauche/droite */
  }

  .modal-content img,
  .modal-content video {
    border-radius: 16px;
  }

  .close {
    font-size: 28px;
    top: 8px;
    right: 16px;
  }

  .modal-prev,
  .modal-next {
    font-size: 24px;
    margin-left: 16px;
    margin-right: 16px;
  }

.modal-navigation {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transform: translateY(-50%);
  z-index: 10000000;
  pointer-events: auto;
}}


