.body1 {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(250px, 1fr)
  ); /* Colonne flexible */
  max-width: 1280px; /* Pour ne pas dépasser 4 éléments par ligne */
  gap: 20px;
  justify-content: center;
  padding: 20px;
  min-height: 600px;
  height: auto;
  margin: auto;
}

.trace-item {
  width: 300px;
  height: 400px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
  padding: 15px;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Assure que le contenu reste aligné à gauche */
  justify-self: center;
}

.trace-item:hover {
  transform: translateY(-5px);
}

.trace-item h2 {
  font-size: 20px;
  color: #333;
  margin-bottom: 10px;
  text-align: center;
  width: 100%;
  font-weight: 600;
}

.trace-item p {
  font-size: 15px;
  color: #555;
  margin-bottom: 10px;
}

.trace-item img {
  width: 100%;
  height: 150px;
  border-radius: 5px;
  margin: 10px 0;
}

.trace-item strong {
  color: #222;
}

.trace-item .ue {
  font-weight: bold;
  color: #007bff;
}

.trace-item .comp {
  font-weight: bold;
  color: #28a745;
}

/* Ajout pour aligner "En voir plus" à gauche */
.trace-voirplus {
  color: black;
  font-weight: bold;
  text-decoration: none;
  margin-top: auto; /* Permet de pousser le lien en bas */
  align-self: flex-end; /* Aligné à gauche */
  padding: 4px 6px;
  border: 1px solid #000;
  border-radius: 5px;
  transition: background-color 0.3s, color 0.3s;
}

.trace-voirplus:hover {
  background-color: black;
  color: white;
}

/* Limite la description à 3 lignes avec "..." */
.trace-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Conteneur des tags */
.ue-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 5px;
  margin-top: auto;
}

/* Style des tags */
.ue-tag {
  background-color: #007bff;
  color: white;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 14px;
}

.ue-comp {
  background-color: #28a745;
  color: white;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 14px;
}

/* MODALE */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  overflow: hidden;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  width: 80%;
  max-width: 600px;
  padding: 20px;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  color: #555;
}
#modal-title {
  font-weight: 600;
}
.modal-close:hover {
  color: black;
}
#modal-images {
  display: flex;
  overflow-x: auto; /* Permet le défilement horizontal */
  gap: 10px;
  padding: 10px 0;
  white-space: nowrap; /* Empêche le retour à la ligne */
  max-width: 100%;
  scroll-behavior: smooth; /* Animation fluide du scroll */
}
#modal-desc {
  padding-top: 10px;
  max-height: 350px;
  overflow-y: auto;
  overflow-x: hidden;
}
#modal-images img {
  width: 100%;
  max-height: 300px;
  border-radius: 5px;
  flex-shrink: 0; /* Empêche les images de rétrécir */
  cursor: pointer;
}
#modal-tags {
  margin-bottom: 8px;
}
@media (max-width: 760px) {
  .modal_content {
    top: 25px;
  }
  #modal-desc {
    max-height: 200px;
  }
  /* Conteneur des tags */
  .ue-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 2px;
    margin-top: auto;
  }

  /* Style des tags */
  .ue-tag {
    background-color: #007bff;
    color: white;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
  }

  .ue-comp {
    background-color: #28a745;
    color: white;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
  }
}
