/* =====================
   CHALLENGES - BASE
===================== */
.challenges {
  padding: 80px 24px;
  background: #faf8f4;
}

.challenges__header {
  margin: 0 auto 48px;-
}
.challenges__group {
  display: flex;
  align-items:center;
  gap: 12px;
}
.challenges__square {
  width: 12px;
  height: 12px;
  background-color: #F5ED63;
  border-radius: 50%;
  display: block;
}
.challenges__label {
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15%;
  color: #1C1C1C;
}

.challenges__title {
  font-size: 52px;
  color: #1C1C1C;
  line-height: 120%;
  margin: 0;
}

/* =====================
   GRID
===================== */
.challenges__grid {
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

/* 3 tuiles : 3 colonnes */
.challenges--count-3 .challenges__grid {
  grid-template-columns: repeat(3, 1fr);
}

/* 4 tuiles : 2x2 */
.challenges--count-4 .challenges__grid {
  grid-template-columns: repeat(2, 1fr);
}

/* 5 tuiles : 3 + 2 centrées */
.challenges--count-5 .challenges__grid {
  grid-template-columns: repeat(6, 1fr);
}

.challenges--count-5 .challenges__tile:nth-child(-n+3) {
  grid-column: span 2;
}

.challenges--count-5 .challenges__tile:nth-child(4) {
  grid-column: 2 / span 2;
}

.challenges--count-5 .challenges__tile:nth-child(5) {
  grid-column: 4 / span 2;
}

/* 6 tuiles : 3x2 */
.challenges--count-6 .challenges__grid {
  grid-template-columns: repeat(3, 1fr);
}

/* =====================
   TILE
===================== */
.challenges__tile {
  background: #ffffff;
  border-radius: 16px;
  padding: 32px;
  position: relative;
  transition: box-shadow 0.2s ease;
}

{% set colors = ['#F5ED63', '#3DA2D6', '#EE4823', '#FCB912'] %}

.challenges__tile-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.challenges__tile-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

.challenges__description {
  font-size: 16px;
  color: #6B6A6A;
  line-height: 1.6;
  margin: 16px 0 0;
}

.challenges__tile-description {
  font-size: 16px;
  color: #6B6A6A;
  line-height: 1.6;
  margin: 0;
}
.challenges__tile-title {
  font-size: 24px;
  color: #1C1C1C;
  margin: 0 0 12px;
  line-height: 1.3;
}

.challenges__tile-description {
  font-size: 16px;
  color: #6B6A6A;
  line-height: 1.6;
  margin: 0;
}

/* =====================
   CTA
===================== */
.challenges__cta {
  margin-top: 48px;
}

.challenges__cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  border-radius: 4px;
  padding: 14px 16px;
  background: #1C1C1C;
  color: #ffffff;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease;
  box-sizing: border-box;
  border: 1px solid #1C1C1C;
}

.challenges__cta-btn:hover {
  background: transparent;
  color: #1C1C1C;
}

/* =====================
   MOBILE
===================== */
@media (max-width: 768px) {
  .challenges {
    padding: 48px 16px;
  }

  .challenges__title {
    font-size: 26px;
  }

  /* Toutes les variantes passent en 1 colonne sur mobile */
  .challenges--count-3 .challenges__grid,
  .challenges--count-4 .challenges__grid,
  .challenges--count-5 .challenges__grid,
  .challenges--count-6 .challenges__grid {
    grid-template-columns: 1fr;
  }

  /* Reset des positions spéciales pour le cas 5 tuiles */
  .challenges--count-5 .challenges__tile:nth-child(n) {
    grid-column: auto;
  }

  .challenges__tile {
    padding: 24px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  /* 3 et 6 tuiles passent en 2 colonnes sur tablette */
  .challenges--count-3 .challenges__grid,
  .challenges--count-6 .challenges__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 5 tuiles : 2 colonnes sur tablette */
  .challenges--count-5 .challenges__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .challenges--count-5 .challenges__tile:nth-child(n) {
    grid-column: auto;
  }
}
