/* ============================================================
   PAGE FORMATIONS — AMA
   Préfixes de classes :
     formations-*   → conteneurs globaux et éléments hero
     fhs-*          → hero stats
     fsc-*          → section CAP header
     fss-*          → section CS/BMA header
     fsb-*          → section Bachelor header
     ftab-*         → tableau comparatif
     fpo-*          → portes ouvertes
     fc-*           → bloc "L'Académie en ligne"

   Classes FSE custom à ajouter côté éditeur (via "Avancé" →
   "Classes CSS additionnelles") — listées en tête de chaque
   section concernée.

   Chargement conditionnel via inc/enqueue.php (is_page)
   Breakpoints : <768px (mobile), 769–1024px (tablette)
   ============================================================ */


/* ============================================================
   HERO FORMATIONS
   ============================================================ */

.formations-hero-line {
  width: 80px;
  height: 1px;
  background: linear-gradient(to right, transparent, #B8956A, transparent);
  margin: 0 auto;
}


/* ============================================================
   FILTRES
   ============================================================ */

.formations-filtres {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 36px 20px;
}

.formations-filtres.alignfull {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.formations-btn-filtre {
  background-color: transparent;
  color: #36454F;
  border: 1px solid rgba(184,149,106,0.3);
  padding: 12px 26px;
  font-family: 'Lato', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
}

.formations-btn-filtre:hover,
.formations-btn-filtre.active {
  background-color: #6B1C23;
  color: #FBF8F3;
  border-color: #6B1C23;
}


/* ============================================================
   HERO STATS
   ============================================================ */

.formations-hero-stats {
  display: flex;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
}

.fhs-item {
  background-color: #ebe4da !important;
  flex: 1;
  padding: 0.7rem 0.9rem;
  text-align: center;
}

.fhs-sep {
  width: 1px;
  align-self: stretch;
  background-color: #B8956A;
}

.fhs-number {
  font-family: 'Bodoni Moda', Georgia, serif !important;
  font-style: italic !important;
  color: #6B1C23 !important;
  font-size: clamp(1.3rem, 2vw, 1.8rem) !important;
  margin: 0 0 0.3rem 0 !important;
}

.fhs-label {
  font-family: 'Lato', sans-serif !important;
  font-size: 16px !important;
  color: #3A3632 !important;
  opacity: 0.85;
  margin: 0 !important;
}


/* ============================================================
   SECTION CAP
   ============================================================ */

.fsc-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 10px;
}

.fsc-label {
  font-family: 'Lato', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #B8956A;
  white-space: nowrap;
}

.fsc-line {
  flex: 1;
  height: 1px;
  background: rgba(184,149,106,0.3);
}

.fsc-count {
  font-family: 'Lato', sans-serif;
  font-size: 0.82rem;
  color: #7a8a93;
  white-space: nowrap;
}


/* ============================================================
   SECTION CS + BMA
   ============================================================ */

.fss-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 10px;
}

.fss-label {
  font-family: 'Lato', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #B8956A;
  white-space: nowrap;
}

.fss-line {
  flex: 1;
  height: 1px;
  background: rgba(184,149,106,0.3);
}

.fss-count {
  font-family: 'Lato', sans-serif;
  font-size: 0.82rem;
  color: #7a8a93;
  white-space: nowrap;
}


/* ============================================================
   SECTION BACHELOR
   ============================================================ */


/* ============================================================
   LARGEUR UNIFORME DES SECTIONS CAP / CS / BACHELOR
   ============================================================

   Classe custom "formations-section-uniforme" à ajouter dans
   l'éditeur Gutenberg sur les 3 blocs Groupe parents (CAP, CS,
   Bachelor) pour garantir la même largeur en desktop.

   Le double sélecteur .formations-section-uniforme.formations-section-uniforme
   augmente la spécificité pour battre les règles TT25 héritées
   de :root :where(...) sans avoir besoin de !important.
   ============================================================ */

.formations-section-uniforme.formations-section-uniforme {
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 70px;
  padding-right: 70px;
  padding-top: 80px;
  padding-bottom: 80px;
  box-sizing: border-box;
}

.fsb-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 10px;
}

.fsb-label {
  font-family: 'Lato', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #B8956A;
  white-space: nowrap;
}

.fsb-line-sep {
  flex: 1;
  height: 1px;
  background: rgba(184,149,106,0.3);
}

.fsb-count {
  font-family: 'Lato', sans-serif;
  font-size: 0.82rem;
  color: #7a8a93;
  white-space: nowrap;
}


/* ============================================================
   TABLEAU COMPARATIF
   ============================================================ */

.formations-tableau {
  width: 100%;
}

.ftab-header,
.ftab-wrap {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 70px;
  padding-right: 70px;
}

.ftab-header {
  text-align: center;
  margin-bottom: 40px;
}

.ftab-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2rem;
  font-weight: 300;
  color: #1C1B1A;
  margin-bottom: 10px;
  line-height: 1;
}

.ftab-title em {
  font-style: italic;
  font-weight: 600;
  color: #6B1C23;
}

.ftab-desc {
  font-family: 'Lato', sans-serif;
  font-size: 0.9rem;
  color: #7a8a93;
}

.ftab-wrap {
  overflow-x: auto;
  border: 1px solid rgba(184,149,106,0.2);
}

.ftab-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Lato', sans-serif;
  font-size: 0.88rem;
}

.ftab-table thead tr {
  background-color: #1C1B1A;
  color: #FBF8F3;
}

.ftab-table th {
  padding: 16px 20px;
  font-weight: 600;
  text-align: left;
  letter-spacing: 0.5px;
}

.ftab-table th:not(:first-child) {
  text-align: center;
}

.ftab-table tbody tr:nth-child(even) {
  background-color: #F5F2ED;
}

.ftab-table tbody tr {
  border-bottom: 1px solid rgba(184,149,106,0.12);
  transition: background-color 0.2s;
}

.ftab-table tbody tr:hover {
  background-color: rgba(184,149,106,0.06);
}

.ftab-table td {
  padding: 14px 20px;
  color: #36454F;
  vertical-align: middle;
}

.ftab-table td:not(:first-child) {
  text-align: center;
}

.ftab-formation {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ftab-niveau {
  width: 4px;
  height: 32px;
  flex-shrink: 0;
}

.ftab-niveau.cap      { background-color: #36454F; }
.ftab-niveau.spe      { background-color: #6B1C23; }
.ftab-niveau.bachelor { background-color: #B8956A; }

.ftab-nom {
  font-weight: 600;
  color: #1C1B1A;
  margin-bottom: 2px;
}

.ftab-cat {
  font-size: 0.75rem;
  color: #B8956A;
}

.ftab-taux {
  background-color: rgba(107,28,35,0.08);
  color: #6B1C23;
  padding: 4px 12px;
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
}


/* ============================================================
   PORTES OUVERTES
   ============================================================ */

.fpo-block {
  background-color: rgba(251,248,243,0.06);
  border: 1px solid rgba(184,149,106,0.25);
  padding: 20px;
}

.fpo-title {
  font-family: 'Lato', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #B8956A;
  margin-bottom: 24px;
}

.fpo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(184,149,106,0.15);
}

.fpo-item:last-child {
  border-bottom: none;
}

.fpo-date {
  font-family: 'Lato', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #FBF8F3;
  margin-bottom: 3px;
}

.fpo-lieu {
  font-family: 'Lato', sans-serif;
  font-size: 0.82rem;
  color: #B8B8B8;
}

.fpo-btn {
  background-color: transparent;
  color: #B8956A;
  border: 1px solid #B8956A;
  padding: 7px 14px;
  font-family: 'Lato', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.3s;
}

.fpo-btn:hover {
  background-color: #B8956A;
  color: #1C1B1A;
}


/* ============================================================
   BOUTON "PRENDRE RDV" (FSE)
   Classe à ajouter sur le bouton dans l'éditeur :
   formations-btn-rdv
   ============================================================ */

.formations-btn-rdv {
  transition: background-color 0.3s, color 0.3s !important;
}

.formations-btn-rdv:hover {
  background-color: #FBF8F3 !important;
  color: #6B1C23 !important;
}


/* ============================================================
   FAQ
   ============================================================ */

.formations-faq-item {
  border-left: 3px solid transparent;
  transition: border-color 0.3s;
}

.formations-faq-item:hover {
  border-left-color: #6B1C23;
}


/* ============================================================
   SECTION "L'ACADÉMIE EN LIGNE"
   ============================================================ */

.fc-section {
  max-width: var(--wp--preset--spacing--wide, 1440px);
  margin: 0 auto;
  position: relative;
}

.fc-card {
  background: linear-gradient(160deg, #3A1A1D 0%, #6B1C23 100%);
  border-radius: 20px;
  padding: clamp(48px, 6vw, 80px) clamp(32px, 6vw, 80px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.fc-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 1px solid rgba(235, 228, 218, 0.12);
  pointer-events: none;
}

.fc-card::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 1px solid rgba(235, 228, 218, 0.18);
  pointer-events: none;
}

.fc-content {
  position: relative;
  z-index: 1;
}

.fc-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--wp--preset--font-family--lato);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #B8956A;
  margin-bottom: 20px;
}

.fc-eyebrow::before {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: #B8956A;
}

.fc-titre {
  font-family: var(--wp--preset--font-family--bodoni-moda);
  font-weight: 400;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.1px;
  color: #FBF8F3;
  margin-bottom: 8px;
}

.fc-titre em {
  font-style: italic;
  color: #DEBF92;
}

.fc-sous-titre {
  font-family: var(--wp--preset--font-family--lato);
  font-size: 14px;
  font-weight: 400;
  color: #EBE4DA;
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}

.fc-texte {
  font-family: var(--wp--preset--font-family--lato);
  font-size: 16px;
  line-height: 1.7;
  color: rgba(251, 248, 243, 0.82);
  margin-bottom: 36px;
}

.fc-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #B8956A;
  color: #FBF8F3;
  font-family: var(--wp--preset--font-family--lato);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 32px;
  border-radius: 999px;
  transition: background 0.25s ease, transform 0.2s ease;
}

.fc-cta:hover {
  background: #DEBF92;
  color: #3A1A1D;
  transform: translateY(-2px);
}

.fc-cta svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.fc-cta:hover svg {
  transform: translateX(3px);
}

.fc-piliers {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fc-pilier {
  background: rgba(251, 248, 243, 0.07);
  border: 1px solid rgba(235, 228, 218, 0.16);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: background 0.2s ease;
}

.fc-pilier:hover {
  background: rgba(251, 248, 243, 0.12);
}

.fc-pilier-icone {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: rgba(184, 149, 106, 0.18);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #B8956A;
}

.fc-pilier-titre {
  font-family: var(--wp--preset--font-family--bodoni-moda);
  font-size: 17px;
  font-weight: 400;
  color: #FBF8F3;
  line-height: 1.25;
  margin-bottom: 4px;
}

.fc-pilier-desc {
  font-family: var(--wp--preset--font-family--lato);
  font-size: 13px;
  color: rgba(251, 248, 243, 0.65);
  line-height: 1.55;
}

.fc-cpf {
  background: rgba(222, 191, 146, 0.12);
  border: 1px solid rgba(222, 191, 146, 0.30);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.fc-cpf-badge {
  flex-shrink: 0;
  background: #DEBF92;
  color: #3A1A1D;
  font-family: var(--wp--preset--font-family--lato);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 6px;
}

.fc-cpf-texte {
  font-family: var(--wp--preset--font-family--lato);
  font-size: 13px;
  color: #EBE4DA;
  line-height: 1.5;
}

.fc-cpf-texte strong {
  color: #DEBF92;
  font-weight: 700;
}


/* ============================================================
   ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════
   ============================================================ */


/* ============================================================
   TABLETTE — 769px à 1024px
   ============================================================ */

@media (max-width: 1024px) {

  /* Sections */
  .formations-section-cap,
  .formations-section-cs {
    padding: 60px 40px;
  }

  .formations-section-bachelor {
    padding: 0 40px;
  }

  /* Tableau comparatif */
  .ftab-header,
  .ftab-wrap {
    padding-left: 30px;
    padding-right: 30px;
  }

  /* L'Académie en ligne — passage en colonne unique */
  .fc-card {
    grid-template-columns: 1fr;
    gap: 40px;
  }

}


/* ============================================================
   MOBILE — moins de 768px
   ============================================================ */

@media (max-width: 768px) {

  /* ─── HERO ──────────────────────────────────────────────── */
  /* alignfull forcé : le hero occupe toute la largeur viewport
     en neutralisant le has-global-padding du parent .entry-content */
  .hero-formations {
    padding: 40px 20px !important;
    text-align: center !important;
    box-sizing: border-box !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
  }

  .hero-formations > *,
  .hero-formations h1,
  .hero-formations .wp-block-heading,
  .hero-formations p {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 100% !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  .hero-formations h1,
  .hero-formations .wp-block-heading {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    font-size: clamp(1.5rem, 5.5vw, 2rem) !important;
    line-height: 1.25 !important;
  }

  .formations-hero-line {
    margin: 12px auto !important;
  }

  /* Hero stats — empilées et centrées */
  .formations-hero-stats {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 280px !important;
    margin: 24px auto !important;
    gap: 0 !important;
    align-items: stretch !important;
  }

  .fhs-item {
    flex: 1 1 auto !important;
    width: 100% !important;
    padding: 20px !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  .fhs-sep {
    display: none !important;
  }


  /* ─── FILTRES — empilés verticalement ───────────────────── */
  .formations-filtres {
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 24px 20px !important;
  }

  .formations-btn-filtre {
    width: 100% !important;
    max-width: 280px !important;
    padding: 12px 20px !important;
    font-size: 0.8rem !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }


  /* ─── SECTIONS CAP / CS ─────────────────────────────────── */
  .formations-section-cap,
  .formations-section-cs {
    padding: 20px 10px;
  }


  /* ─── SECTIONS FSE (Groupes Gutenberg CAP, CS, BMA) ──────
     Classe custom "fse-section-card" à ajouter dans l'éditeur
     sur le bloc Groupe parent de chaque section.
     Aligne leur largeur visuelle sur la card Bachelor. */
  .fse-section-card {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }


  /* ─── SECTION BACHELOR (bloc FSE) ────────────────────────
     Cible uniquement les blocs avec les classes custom
     ajoutées dans l'éditeur : fsb-columns, fsb-column, fsb-card.
     Ne touche à aucun autre bloc Colonnes du site.
     ───────────────────────────────────────────────────────── */
  .formations-section-bachelor {
    padding: 20px 10px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .fsb-columns {
    flex-direction: column !important;
    gap: 16px !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .fsb-column {
    flex-basis: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  .fsb-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }


  /* ─── EN-TÊTES DE SECTION ───────────────────────────────── */
  .fsc-header,
  .fss-header,
  .fsb-header {
    gap: 12px;
  }


  /* ─── TABLEAU COMPARATIF ────────────────────────────────── */
  /* Le bloc Gutenberg wrapper du tableau a un style inline :
     padding-top: var(--wp--preset--spacing--xl) = 48px
     On le cible via la classe "formations-tableau-wrap"
     à ajouter dans l'éditeur (panneau Avancé) OU via sa
     classe de couleur Cloud Dancer + présence de .formations-tableau */
  .formations-tableau-wrap,
  .wp-block-group.has-cloud-dancer-background-color:has(> .formations-tableau) {
    padding-top: 0 !important;
    padding-bottom: 20px !important;
  }

  .formations-section-bachelor {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  .ftab-header,
  .ftab-wrap {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .ftab-header {
    margin-bottom: 20px !important;
  }

  .ftab-title {
    font-size: 1.4rem;
  }

  .ftab-table th,
  .ftab-table td {
    padding: 10px 12px;
    font-size: 0.8rem;
  }


  /* ─── PORTES OUVERTES ───────────────────────────────────── */
  .fpo-block {
    padding: 16px;
  }

  .fpo-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }


  /* ─── L'ACADÉMIE EN LIGNE — légèrement élargie ──────────── */
  .fc-section {
    width: calc(100% + 20px) !important;
    max-width: calc(100% + 20px) !important;
    margin-left: -10px !important;
    margin-right: -10px !important;
    padding: 0 !important;
    margin-top: 0;
    box-sizing: border-box;
  }

  .fc-card {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 32px 20px;
    border-radius: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .fc-titre {
    font-size: clamp(28px, 7vw, 34px);
  }

  /* Piliers — icônes masquées sur mobile */
  .fc-pilier {
    padding: 14px 16px;
    gap: 0;
  }

  .fc-pilier-icone {
    display: none;
  }

  /* Bandeau CPF — on garde le badge visible */
  .fc-cpf {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
  }

}


/* ============================================================
   TRÈS PETIT MOBILE — moins de 400px
   ============================================================ */

@media (max-width: 400px) {

  .hero-formations h1,
  .hero-formations .wp-block-heading {
    font-size: 1.5rem !important;
  }

  .fc-card {
    padding: 24px 16px;
  }

}