/* Reset de base */
body, html {
  margin: 0;
  padding: 0;
  box-sizing: border-box; /* À appliquer globalement pour éviter les soucis */
}

*, *::before, *::after {
  box-sizing: inherit;
}

/* Menu fixé en haut */
.menu {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1100; /* pour être au-dessus */
}

/* Contenu principal */
main {
  flex: 1;
  width: 100%;
  padding: 10px;
  margin-top: 10px;   /* Espace pour header */
  margin-bottom: 60px; /* Espace pour footer */
  /* background-color: lightgray; */
  /* border: 1px solid black; */
}

/* Titre centré */
.titre h1 {
  text-align: center;
}

/* Animation pulse sur la fiche actuelle */
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 128, 255, 0.4); }
  70%  { box-shadow: 0 0 0 10px rgba(0, 128, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 128, 255, 0); }
}

.fiche-actuelle {
  border: 2px solid #007BFF;
  animation: pulse 2s infinite;
}

/* Container des fiches */
.agenda-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* <-- centrage des fiches */
  gap: 1.5%;
  padding: 10px;
}

/* Carte fiche agenda */
.fiche-agenda {
  cursor: pointer;
  width: 23%;
  min-width: 250px;
  max-width: 280px;
  background: #fff;
  box-shadow: 0 0 5px rgba(0,0,0,0.5);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: justify;
}

/* Détail fiche - fenêtre modale */
.fiche-agenda-detail {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 700px;
  max-height: calc(100vh - 100px);
  background-color: #f8e0e0;
  padding: 10px 0; /* réduit l'espace en haut */
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  z-index: 1000;
  border-radius: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Image dans la fiche détail */
.fiche-agenda-detail img,
.agenda-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  margin-bottom: 10px;
  border-radius: 5px;
  aspect-ratio: 4/3;
}

.fiche-img {
  margin: 0 auto 20px;
  display: block;
  object-fit: contain;
}

/* En-tête de la fiche */
.fiche-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
}

.fiche-header h1,
.fiche-content h1 {
  font-size: 2.5em;
  margin: 0 auto;
  width: 80%;
  text-align: center;
}

/* Bouton fermeture (croix) */
.fiche-agenda-detail .close {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 40px;
  width: 40px;
  height: 40px;
  background-color: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  transition: background-color 0.3s ease;
}

.fiche-agenda-detail .close:hover {
  background-color: rgba(0,0,0,0.8);
}

/* Contenu fiche */
.fiche-content {
  text-align: center;
  margin-top: 0;
}

.fiche-content p strong {
  display: block;
  width: 60%;
  margin: 0 auto 15px;
  font-size: 1.2em;
  text-align: center;
}

/* Paragraphes dans fiche détail */
.fiche-agenda-detail > p {
  padding: 0 10px 10px;
  font-size: 1em;
  line-height: 1.5em;
  text-align: justify;
}

/* Dates */
.fiche-dates {
  font-size: 1.2em;
  width: 60%;
  margin: 10px auto;
  text-align: center;
  font-weight: bold;
}

/* Location */
.fiche-agenda-location {
  font-size: 1.5em;
  width: 90%;
  margin: 10px auto;
  text-align: center;
  line-height: 1.4em;
}

.fiche-agenda-location p {
  margin: 5px 0;
}

.agenda-location {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px;
}

.agenda-location p strong {
  font-size: 1.2em;
  text-align: center;
  margin: 5px 0;
}

/* Description */
.fiche-agenda-description {
  width: 85%;
  margin: 20px auto;
  font-size: 1.1em;
  text-align: justify;
  line-height: 1.6em;
}

/* Responsive */
@media (max-width: 768px) {
  .fiche-agenda-detail {
    width: 90%;
    max-height: calc(100vh - 130px);
    top: 35px;
  }

  .fiche-dates {
    width: 99%;
    white-space: nowrap;
    text-align: center;
  }

  .fiche-content {
    margin: auto;
    width: 99%;
    font-size: 0.8em;
    text-align: center;
  }

  .fiche-agenda-location {
    font-size: 1.2em;
    width: 100%;
    margin: auto;
    text-align: left;
    line-height: 1.5em;
  }

  .adresse {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .Lieu {
    text-align: center;
    margin: 0 auto;
  }

  footer {
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}
