/* =========================================
   BANNER — FORMATIONS
========================================= */

.formations-banner {
  position: relative;
  width: 100%;
  min-height: 350px;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  background: url(../images/formation-banner.png) center / 100% auto
    no-repeat;
}

/* =========================================
   OVERLAY
========================================= */

.formations-banner-overlay {
  position: absolute;
  inset: 0;

  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.9),
    rgba(15, 23, 42, 0.55)
  );

  z-index: 1;
}

/* =========================================
   TITRE
========================================= */

.formations-banner-content {
  position: relative;
  z-index: 2;

  text-align: center;
  color: #fff;
}

.formations-banner h1 {
  margin: 0;

  font-size: clamp(2.3rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
}

.header {
  padding: 40px;
  text-align: start;
}

.header .container {
  text-align: center;
}

.header h1 {
  margin: 0 0 1rem;

  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.15;
  font-weight: 700;

  color: #0f172a;
}

.header h1 span {
  background: linear-gradient(135deg, #00a8a8, #ff8a00);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header p {
  margin: 0 auto;

  max-width: 700px;

  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  line-height: 1.7;

  color: #64748b;
}

/* Scrollable Filters */
.filter-container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none; /* Firefox */
}

.filter-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.filter-chip {
  white-space: nowrap;
  padding: 10px 20px;
  border-radius: 0.5rem;
  border: 1px solid var(--outline-variant);
  background: var(--surface-container-low);
  color: var(--secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.filter-chip.active {
  background: var(--brand-teal);
  color: white;
  border-color: var(--secondary);
}

/* Training Grid */
/* ===== TRAINING GRID RESPONSIVE ===== */
.grid {
  display: grid;
  grid-template-columns: 1fr; /* MOBILE: 1 colonne */
  gap: 24px;
}

.card {
  background: var(--surface-container-lowest);
  border: 1px solid var(--gray-200);
  border-radius: 1rem;
  padding: 32px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: var(--white);
}

.icon-web {
  background: var(--brand-teal);
}

.icon-mobile {
  background: var(--brand-orange);
}

.icon-data {
  background: #67058d;
}

.icon-design {
  background: #ff9012;
}

.icon-security {
  background: #1bbfd8;
}

.icon-entrepreneurship {
  background: #20c997;
}

.card h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 8px;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 1rem;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 16px;
  width: fit-content;
}

.badge-dev {
  background: rgba(0, 168, 168, 0.3);
  color: var(--brand-teal);
}

.badge-mobile {
  background: rgba(255, 138, 0, 0.3);
  color: var(--brand-orange);
}

.badge-design {
  background: rgb(255, 144, 18, 0.3);
  color: #ff9012;
}

.badge-data {
  background: rgb(103, 5, 141, 0.3);
  color: #67058d;
}

.badge-security {
  background: rgb(27, 191, 216, 0.3);
  color: #1bbfd8;
}

.badge-entrepreneurship {
  background: rgba(32, 201, 151, 0.3);
  color: #20c997;
}

.card-text {
  color: var(--tertiary);
  font-size: 14px;
  margin-bottom: 14px;
}

.card-meta {
  padding-top: 24px;
  border-top: 1px solid var(--surface-container);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--on-surface-variant);
}

.card-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #238a79;
  font-weight: 700;
  text-decoration: none;
}

.card-link .icon {
  width: 18px;
  height: 18px;
}

/* CTA Banner */

.cta {
  padding: 4rem 0;
}

.cta-content {
  display: block;
}

/* Material Symbol adjustments */
.material-symbols-outlined {
  vertical-align: middle;
  font-size: 24px;
}

.ms-18 {
  font-size: 18px;
}

.ms-28 {
  font-size: 28px;
}

/* =========================================================
   RESPONSIVE — REGROUPEMENT DES BREAKPOINTS
   ========================================================= */

/* TABLETTE: 2 colonnes */

@media (min-width: 640px) and (max-width: 1023px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Bordure gauche sur toutes les cases sauf 1ère colonne: 1,3,5... */
  .card:not(:nth-child(2n + 1)) {
    border-left: 2px solid var(--gray-200);
  }

  /* Enlève la bordure top de la meta car on veut 0 bordure en bas */
  .card-meta {
    border-top: none;
    padding-top: 0;
  }
}

/* DESKTOP: 3 colonnes */

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Bordure gauche sur toutes les cases sauf 1ère colonne: 1,4,7... */
  .card:not(:nth-child(3n + 1)) {
    border-left: 2px solid var(--gray-200);
  }

  .card-meta {
    border-top: none;
    padding-top: 0;
  }
}

/* ===== FIX FILTER SCROLL MOBILE ===== */

@media (max-width: 768px) {
  .formations-banner {
    min-height: 250px;
    background: url(../images/formation-banner.png) center 42% / 155% auto no-repeat;
  }

  .header h1 {
    font-size: 2.2rem;
  }

  .header p {
    font-size: 0.95rem;
  }

  .header p br {
    display: none;
  }
}

@media (min-width: 640px) {
  .filter-container {
    overflow-x: visible;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.9rem;
  }

  .header p {
    font-size: 0.9rem;
    line-height: 1.6;
  }
}
