.actualites {
  background: #fff;
  color: #000;
  padding: 80px 40px; /* Réduit le padding latéral */
  max-width: 1400px;
  margin: 0 auto;
  overflow: hidden; /* Empêche le débordement */
  position: relative; /* Pour positionner les flèches par rapport à ce conteneur */
}

.actualites h2 {
  font-family: var(--avenir-font-family);
  font-size: 36px;
  margin-bottom: 40px;
  color: #39434c;
  text-align: left;
  padding-left: 10px;
}

.actualites .accent {
  display: inline-block;
  width: 6px;
  height: 24px;
  background: var(--jaune);
  margin-right: 10px;
  vertical-align: middle;
}

.actualites-content {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
  padding: 20px 0;
}

/* Conteneur principal du carrousel */
.carousel-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 60px; /* Espace pour les flèches */
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
  gap: 30px;
  padding: 10px 0;
  width: 100%;
  will-change: transform;
}

.carousel-slide {
  min-width: calc(33.333% - 20px);
  flex: 0 0 calc(33.333% - 20px);
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}

.card {
  display: flex;
  flex-direction: column;
  position: relative;
  background: #fff;
  border-radius: 10px;
  overflow: hidden; /* découpe tout dépassement */
  height: 100%; /* prend toute la hauteur du slide */
}

/* Limiter le texte pour ne pas agrandir la carte */
.card-body p {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 4; /* nombre de lignes à afficher */
  -webkit-box-orient: vertical;
}
.carousel-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background-color: var(--vert);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  margin: 0;
  opacity: 0.9;
}

.carousel-button:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
  background-color: var(--jaune);
  color: #000;
}

.carousel-button:hover {
  background-color: var(--jaune);
  transform: translateY(-50%) scale(1.1);
}

.carousel-button.prev {
  left: 10px;
}

.carousel-button.next {
  right: 10px;
}

/* Désactiver le style des boutons désactivés */
.carousel-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: translateY(-50%);
}

.carousel-button:disabled:hover {
  transform: translateY(-50%);
  background-color: var(--vert);
  color: white;
}

/* Styles pour les tablettes */
@media (max-width: 992px) {
  .carousel-slide {
    min-width: calc(50% - 15px);
    flex: 0 0 calc(50% - 15px);
  }
}

/* Styles pour les mobiles */
@media (max-width: 768px) {
  .actualites {
    padding: 30px 0;
    overflow: hidden;
  }
  
  .carousel-container {
    padding: 0 15px;
    margin: 0;
    width: 100%;
    overflow: hidden;
  }
  
  .carousel-slide {
    min-width: 100%;
    flex: 0 0 100%;
    padding: 0 10px;
    box-sizing: border-box;
  }
  
  /* Masquer les flèches sur mobile */
  .carousel-button {
    display: none !important;
  }
  
  .carousel-track {
    gap: 15px;
    cursor: grab;
    user-select: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    will-change: transform;
  }
  
  .carousel-track:active {
    cursor: grabbing;
  }
  
  /* Empêcher le défilement de la page sur iOS */
  .carousel-track {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Ajuster la largeur des cartes pour éviter le débordement */
  .card {
    margin: 0 5px;
  }
}


.carousel-pagination {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  gap: 10px;
}

.pagination-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #ddd;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pagination-dot.active {
  background-color: var(--vert);
  transform: scale(1.2);
}

.card {
  display: flex;
  flex-direction: column;
  position: relative; /* référence pour le rectangle */
  background: #fff;
  border-radius: 10px;
  overflow: visible; /* IMPORTANT : permet au rectangle de dépasser */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s, box-shadow 0.3s;
}

/* Rectangle décoratif */
.top-rectangle {
  position: absolute;
  top: -20px;      /* plus haut que le haut de la carte */
  right: -20px;    /* plus à droite */
  width: 120px;
  height: 65px;
  background: var(--vert, #085F2B);
  z-index: 0;      /* derrière la carte */
  border-bottom-left-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); /* optionnel : ombre légère */
}

/* Image */
.image-container {
  position: relative;
  z-index: 2; /* image au-dessus du rectangle */
  height: 240px;
  overflow: hidden;
  background-color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid #ddd;
}

/* Style pour le conteneur sans image */
.image-container.no-image {
  background-color: #f0f0f0;
  border: 1px dashed #ccc;
}

.placeholder-image {
  text-align: center;
  color: #888;
  padding: 20px;
}

.placeholder-image i {
  font-size: 48px;
  margin-bottom: 10px;
  display: block;
  color: var(--vert);
}

.placeholder-image span {
  display: block;
  font-size: 14px;
  margin-top: 10px;
}

/* Contenu texte */
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
  position: relative;
  z-index: 3; /* texte au-dessus de tout */
}


.card-body h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #000;
}

.card-body p {
  font-size: 16px;
  color: #333;
  line-height: 1.2;
  margin-bottom: 20px;
  flex-grow: 1;
}

/* Bouton */
.btn-full {
  margin-top: auto;
  display: block;
  width: 100%;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--vert);
  text-decoration: none;
  padding: 14px 0;
  border: 2px solid var(--vert);
  border-radius: 6px;
  transition: all 0.3s;
}

.btn-full:hover {
  background: var(--vert);
  color: #fff;
}

/* Responsive */

/* Grand écran (1200px+) */
@media (min-width: 1200px) {
  .actualites {
    padding: 100px 120px;
  }
  .image-container {
    height: 260px;
  }
}

/* Tablettes */
@media (max-width: 992px) {
  .carousel-slide {
    min-width: calc(50% - 15px);
    flex: 0 0 calc(50% - 15px);
  }
  .image-container {
    height: 200px;
  }
  .card-body p {
    font-size: 14px;
  }
}

/* Mobiles */
@media (max-width: 768px) {
  .actualites {
    padding: 40px 20px;
  }
  .actualites h2 {
    font-size: 26px;
    text-align: center;
    margin-bottom: 30px;
    padding-left: 0;
  }
  .actualites-content {
    grid-template-columns: 1fr;
    gap: 20px;
    display: flex;
    flex-direction: column;
  }
  .carousel-container {
    width: 100%;
    padding: 0 30px; /* Réduire l'espace sur mobile */
  }
  .carousel-slide {
    min-width: 100%;
    flex: 0 0 100%;
  }
  .carousel-button {
    width: 32px;
    height: 32px;
    font-size: 16px;
    margin: 0 -15px; /* Moins de décalage sur mobile */
  }
  .image-container {
    height: 180px;
  }
  .card-body h3 {
    font-size: 20px;
  }
  .card-body p {
    font-size: 13px;
  }
  .btn-full {
    font-size: 14px;
    padding: 12px 0;
  }
}

/* Très petits écrans */
@media (max-width: 480px) {
  .actualites {
    padding: 30px 15px;
  }
  .actualites h2 {
    font-size: 22px;
  }
  .image-container {
    height: 150px;
  }
  .card-body h3 {
    font-size: 16px;
  }
  .card-body p {
    font-size: 12px;
    line-height: 1.4;
  }
  .btn-full {
    font-size: 13px;
    padding: 10px 0;
  }
  .image-container img {
    object-fit: cover;
    object-position: top;
  }
}

