/* ==========================================================================
   GRDF Innovation – Correctifs vignettes challenges (.challenge-thumb)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Code couleur des badges de statut (en haut à gauche des vignettes)
   Les classes .badge-challenge__current / __over / __notstarted ne sont plus
   générées : on s'appuie sur les attributs data-is-* de la vignette.
   -------------------------------------------------------------------------- */

/* En cours : vert */
.challenge-thumb[data-is-current="1"] .badge-challenge {
  border: 1px solid #70b856;
  background-color: #ccf0c0 !important;
}

/* Terminé : gris-bleu */
.challenge-thumb[data-is-finished="1"] .badge-challenge {
  border: 1px solid #66686b;
  background-color: #d8e1eb !important;
}

/* À venir : bleu */
.challenge-thumb[data-is-shortly="1"] .badge-challenge {
  border: 1px solid #009ac4;
  background-color: #b9edfa !important;
}

/* --------------------------------------------------------------------------
   2. Centrage du bouton « Découvrez l'appel à projets » dans les listes
   Le bouton « Voir les initiatives » (.btn-challenge-show-project) est masqué
   dans .challenge-list mais reste dans le DOM : la règle :has(...nth-last-child(2))
   forçait le bouton restant à 50 % de largeur, calé à gauche.
   -------------------------------------------------------------------------- */
:root body .challenge-list .challenge-thumb[data-challenge-thumb] .challenge-thumb__bottom {
  justify-content: center;
}

:root body .challenge-list .challenge-thumb[data-challenge-thumb] .challenge-thumb__bottom.flex:has(> .btn:first-child:nth-last-child(2)) > .btn:not(.btn-circle):not(.btn-square):not(.btn-block) {
  width: auto !important;
  max-width: 100%;
  white-space: nowrap;
  align-self: center;
}
