/**
 * Cartes « Formations » – charte ARCOLIB.
 * Les couleurs sont des variables : à ajuster ici si la charte évolue.
 * Tailles en px : le thème m4e_basetheme fixe html { font-size: 10px },
 * des rem rendraient tout à 62,5 %.
 */
.af {
  --af-marine: #13325b;
  --af-marine-fonce: #0b2140;
  --af-turquoise-clair: #e1f2f5;
  --af-jaune: #f4b740;
  --af-jaune-clair: #fdefcf;
  --af-jaune-texte: #5c3f00;
  --af-texte: #3d4b5c;
  --af-gris: #5a6878;
  --af-gris-clair: #e6edf3;
  --af-bord: #c9d6e2;
  --af-alerte: #a1440f;
  color: var(--af-marine);
  display: flex;
  flex-direction: column;
  gap: 24px;
  /* Même largeur et centrage que les paragraphes « double colonne ». */
  max-width: 1300px;
  margin-left: auto;
  margin-right: auto;
}

.af [hidden] {
  display: none !important;
}

/* Filtres */
.af-filtres {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.af-filtre {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--af-bord);
  border-radius: 999px;
  background: #fff;
  color: var(--af-marine);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.af-filtre:hover {
  border-color: var(--af-marine);
}
.af-filtre[aria-pressed="true"] {
  background: var(--af-marine);
  border-color: var(--af-marine);
  color: #fff;
}
.af-filtre:focus-visible,
.af-bouton:focus-visible,
.af-lien:focus-visible {
  outline: 3px solid var(--af-jaune);
  outline-offset: 2px;
}

/* Groupes par semestre */
.af-groupe {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.af-groupe__titre {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--af-gris);
}
/* 440px minimum : 2 cartes par ligne sur ordinateur, 1 sous ~910px. */
.af-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr));
  gap: 32px;
}
.af-grille__item {
  display: flex;
}

/* Carte */
.af-carte {
  --af-pad: 32px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: var(--af-pad);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(19, 50, 91, 0.08);
}
/* Image pleine largeur en haut de carte, malgré le padding. */
.af-carte__visuel {
  margin: calc(-1 * var(--af-pad)) calc(-1 * var(--af-pad)) 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  background: var(--af-gris-clair);
}
.af .af-carte__image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
.af-carte--complet .af-carte__image {
  filter: grayscale(1);
}
.af-carte--brouillon {
  outline: 2px dashed var(--af-jaune);
}
.af-carte__haut {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.af-carte__titre {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--af-marine);
}
/* .af en préfixe : le thème impose une marge à .page__content p. */
.af .af-carte__description {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--af-texte);
}

/* Pavé date */
.af-date {
  flex-shrink: 0;
  width: 64px;
  height: 68px;
  border-radius: 12px;
  background: var(--af-marine);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}
.af-carte--complet .af-date {
  background: var(--af-gris);
}
.af-date__jsem,
.af-date__mois {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.af-date__jsem {
  color: var(--af-jaune);
}
.af-date__jour {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

/* Pastille thème : la variante suit l'ordre des termes */
.af-theme {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: right;
}
.af-theme--1 {
  background: var(--af-turquoise-clair);
  color: var(--af-marine);
}
.af-theme--2 {
  background: var(--af-jaune-clair);
  color: var(--af-jaune-texte);
}
.af-theme--3 {
  background: var(--af-gris-clair);
  color: var(--af-marine);
}

/* Infos : préfixe .af pour passer devant .page__content ul / li du thème. */
.af .af-infos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: 14px;
  color: var(--af-texte);
}
.af .af-infos__item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  position: static;
}
/* Le thème ajoute une puce turquoise à tous les li. */
.af .af-infos__item::before {
  content: none;
  display: none;
}
.af-infos__item svg {
  color: var(--af-marine);
  flex-shrink: 0;
}

/* Bas de carte, calé en bas pour aligner les cartes d'une même ligne. */
.af-carte__bas {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--af-gris-clair);
}
.af-tarif {
  display: flex;
  flex-direction: column;
}
.af-tarif__prix {
  font-size: 22px;
  font-weight: 800;
}
.af-tarif__ht {
  font-size: 13px;
  font-weight: 600;
  color: var(--af-gris);
}
.af-tarif__places {
  font-size: 12px;
  font-weight: 600;
  color: var(--af-gris);
}
.af-tarif__places--alerte {
  color: var(--af-alerte);
}
.af-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.af-lien {
  font-size: 13px;
  font-weight: 600;
  color: var(--af-marine);
}
.af-lien:hover {
  color: var(--af-marine-fonce);
}
.af-bouton {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  background: var(--af-jaune);
  color: var(--af-marine);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.af-bouton:hover {
  background: #e9a823;
  color: var(--af-marine-fonce);
}
.af-bouton--off,
.af-bouton--off:hover {
  background: var(--af-gris-clair);
  color: var(--af-gris);
  cursor: default;
}

.af .af-vide {
  margin: 0;
  color: var(--af-texte);
}

@media (max-width: 480px) {
  .af-carte {
    --af-pad: 20px;
  }
  .af-carte__titre {
    font-size: 19px;
  }
  .af-carte__haut {
    justify-content: flex-start;
  }
  .af-theme {
    text-align: left;
  }
}
