:root {
  --primary-color: #272154;
  --secondary-color: #009bc6;
  --highlight-color: rgba(85, 169, 149, 0.47);
  --highlight-color-2: rgb(64, 110, 193, 0.47);
  --text-color: #272154;
  --font-sans: "Satoshi", Sans-serif;
  --font-serif: "Calibri", Sans-serif;
}

.campagne-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.campagne-container {
  width: 100%;
  max-width: 1245px;
  margin: auto;
  display: flex;
}

.campagne-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

/* S'assurer que les boutons prennent bien toute la largeur définie */
.campagne-buttons a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

/* Cas avec 3 items : 3 par ligne */
.campagne-buttons:has(:nth-child(3)) a {
  flex: 1 1 calc(33.333% - 10px);
  max-width: calc(33.333% - 10px);
}

/* Cas avec 4 items : 2 par ligne */
.campagne-buttons:has(:nth-child(4)) a {
  flex: 1 1 calc(50% - 7.5px);
  /*  max-width: calc(50% - 7.5px);*/
  max-width: calc(34.333% - 10px);
}

/* Cas avec 5 items : 3 sur la première ligne, 2 sur la seconde */
.campagne-buttons:has(:nth-child(5)) a {
  flex: 1 1 calc(33.333% - 10px);
  max-width: calc(33.333% - 10px);
}

/* Ajustement pour forcer les 2 derniers éléments à prendre 50% de largeur */
.campagne-buttons:has(:nth-child(5)) a:nth-child(4),
.campagne-buttons:has(:nth-child(5)) a:nth-child(5) {
  flex: 1 1 calc(50% - 7.5px);
  /* max-width: calc(50% - 7.5px); */
}

.campagne-section {
  padding: 0;
}

.campagne-img-wrapper {
  flex: 1;
}

.campagne-titre-wrapper {
  flex: 2;
}

.campagne-container img {
  padding-right: 15px;
  /* min-width: 354px; */
}

/* h2.campagne-titre {
  color: var(--text-color);
  font-family: var(--font-sans);
  font-size: 35px;
  font-weight: 800;
  margin: 0 0 40px;
  line-height: 1;
  position: relative;
  display: inline-block;
}

h2.campagne-titre::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 20px;
  background-color: var(--highlight-color);
  z-index: -1;
} */

h2.campagne-titre {
  color: var(--text-color);
  font-family: var(--font-sans);
  font-size: 35px;
  font-weight: 800;
  margin: 0 0 40px;
  line-height: 1.2; /* Légèrement ajusté pour les multi-lignes */
  position: relative;
  display: inline;
  box-shadow: inset 0 -15px 0 var(--highlight-color-2);
}

/* h2.campagne-titre {
  font-family: var(--font-sans);
  color: var(--primary-color);
} */

h3.campagne-chapo {
  color: var(--primary-color);
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 600;
  /* text-transform: uppercase; */
  margin-top: 40px;
}

p.campagne-texte {
  font-family: var(--font-serif);
  color: var(--secondary-color);
}

.campagne-container.campagne-texte {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

@media (max-width: 767px) {
  .campagne-container {
    display: flex;
    flex-direction: column;
  }
  h2.campagne-titre::after {
    display: none;
  }
  .campagne-container img {
    min-width: unset;
    padding: 0;
  }
  h2.campagne-titre {
    font-size: 26px;
  }
  h3.campagne-chapo {
    font-size: 20px;
  }
}

.campagne-container.campagne-texte p {
  margin-block-end: 0;
  font-size: 16px;
  color: #272154;
  font-family: "Calibri", Sans-serif;
  font-weight: 400;
}

/* ------ */

.campagne-buttons {
  display: flex;
  flex-wrap: wrap; /* Permet aux boutons de passer à la ligne si besoin */
  gap: 10px; /* Espacement entre les boutons */
  justify-content: center; /* Centre l'ensemble */
}

/* Taille uniforme des boutons */
.offre-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background-color: #0073e6;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: bold;
  width: 360px !important; /* Largeur fixe */
  height: 50px; /* Hauteur fixe */
}

/* Icône et texte en ligne */
.offre-button svg {
  width: 22px;
  height: 22px;
}

/* 3 boutons -> Tous sur la même ligne */
.campagne-buttons:has(.offre-button:nth-child(3):nth-last-child(1)) {
  justify-content: center;
}

/* 4 boutons -> 2 par ligne */
.campagne-buttons:has(.offre-button:nth-child(4):nth-last-child(1)) {
  justify-content: center;
}

.campagne-buttons:has(.offre-button:nth-child(4):nth-last-child(1))
  .offre-button {
  flex: 1 1 360px; /* Largeur égale, flexibilité */
  max-width: 360px;
}

/* ✅ Cas de 5 boutons : 3 en haut, 2 centrés en bas */
.campagne-buttons:has(.offre-button:nth-child(5):nth-last-child(1)) {
  justify-content: center;
}

.campagne-buttons:has(.offre-button:nth-child(5):nth-last-child(1))
  .offre-button {
  flex: 1 1 360px;
  max-width: 360px;
}

/* 6 boutons -> 3 par ligne */
.campagne-buttons:has(.offre-button:nth-child(6):nth-last-child(1)) {
  justify-content: center;
}

.campagne-buttons:has(.offre-button:nth-child(6):nth-last-child(1))
  .offre-button {
  flex: 1 1 360px;
  max-width: 360px;
}
