/* Page Clubs & Associations (/clubs-associations/) : complète css/actualites.css (base) et css/alumni.css (titres de
   section, FAQ, bandeau final, animation al-revele). Ici : en-tête (fond sombre, bandes de clubs qui défilent), étapes
   « Rejoindre un club », clubs (une couleur par club, donnée en style par le programme : --c1, --c2, --c-clair ; clubs
   ITBS tous présentés de la même façon : icône, nom, une ligne ; associations en cartes à visuel), bandeau final. Page voulue dynamique (17/11) : survols
   et apparitions au défilement, tout coupé si « réduire les animations ». Cartes sans ombre (bordure seule). */

.al-titre { text-wrap: balance; }
.al-texte, .cl-intro, .cl-etapes p { text-wrap: pretty; }

/* ---- En-tête : fond sombre (comme la page Mobilité) ; clubs en bandes qui défilent (17/11) ---- */
.cl-ha { position: relative; overflow: hidden; padding: 60px 0 64px; color: #fff; text-align: center;
  background: radial-gradient(circle at 12% 0%, rgba(99, 102, 241, .38), transparent 42%),
              radial-gradient(circle at 92% 100%, rgba(219, 39, 119, .24), transparent 42%), #0F172A; }
.cl-ha .al-etiquette { background: rgba(255, 255, 255, .1); color: #C7D2FE; }
.cl-ha h1 { margin: 16px 0 14px; font-size: clamp(36px, 4.6vw, 58px); font-weight: 800; line-height: 1.06; letter-spacing: -.5px; color: #fff; }
.cl-ha h1 span { color: #818CF8; }
.cl-intro { max-width: 660px; margin: 0 auto; font-size: 17.5px; line-height: 1.6; color: rgba(255, 255, 255, .8); }
.cl-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 26px; }
/* deux bandes de clubs qui défilent en sens opposés (3 copies : boucle sans trou), bords fondus ; arrêt au survol */
.cl-defile { display: grid; gap: 14px; margin-top: 46px; }
.cl-rangee { overflow: hidden; padding: 6px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.cl-piste { display: flex; width: max-content; margin: 0; padding: 0; list-style: none; }
.cl-piste li { flex: none; margin-right: 14px; }
.cl-piste a { display: flex; align-items: center; gap: 14px; min-width: 230px; padding: 12px 22px 12px 12px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 18px;
  background: rgba(255, 255, 255, .06); color: #fff; text-align: left; text-decoration: none; transition: background .25s, border-color .25s, transform .25s; }
.cl-piste a:hover, .cl-piste a:focus-visible { background: rgba(255, 255, 255, .12); border-color: var(--c1); transform: translateY(-3px); outline: none; }
.cl-defile-icone { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(135deg, var(--c1), var(--c2)); font-size: 19px;
  box-shadow: 0 8px 22px -6px var(--c1); transition: transform .4s cubic-bezier(.34, 1.56, .64, 1); }
.cl-piste a:hover .cl-defile-icone { transform: rotate(-8deg) scale(1.1); }
.cl-defile-texte { display: grid; gap: 2px; }
.cl-defile-texte strong { font-size: 15.5px; font-weight: 800; line-height: 1.25; white-space: nowrap; }
.cl-defile-texte small { font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .62); white-space: nowrap; }

/* ---- Rejoindre un club (sous l'en-tête, fond gris) : 3 étapes ; le trait entre elles se remplit au défilement ---- */
.cl-etapes { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; max-width: 1040px; margin: 0 auto; padding: 0; list-style: none; }
.cl-etapes::before, .cl-etapes::after { content: ""; position: absolute; top: 38px; left: 17%; right: 17%; height: 4px; border-radius: 4px; }
.cl-etapes::before { background: #E0E7FF; }
.cl-etapes::after { background: linear-gradient(90deg, #6366F1, #DB2777, #F59E0B); transform-origin: left; }
.cl-etapes li { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; padding: 0 8px; text-align: center; }
.cl-etape-icone { position: relative; display: grid; place-items: center; width: 70px; height: 70px; border: 5px solid var(--fond-alt); border-radius: 24px; background: linear-gradient(135deg, var(--al-indigo-1), #9333EA); color: #fff; font-size: 24px; box-sizing: content-box; }
.cl-etapes li:nth-child(2) .cl-etape-icone { background: linear-gradient(135deg, var(--al-rose-1), var(--al-rose-2)); }
.cl-etapes li:nth-child(3) .cl-etape-icone { background: linear-gradient(135deg, var(--al-jaune-1), var(--al-jaune-2)); }
.cl-etape-num { position: absolute; top: -9px; right: -9px; display: grid; place-items: center; width: 28px; height: 28px; border: 3px solid var(--fond-alt); border-radius: 50%; background: var(--encre); color: #fff; font-size: 13px; font-weight: 800; line-height: 1; }
.cl-etapes h3 { margin: 18px 0 8px; font-size: 19px; font-weight: 800; line-height: 1.3; color: var(--encre); }
.cl-etapes p { max-width: 330px; margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--texte); }

/* ---- Les clubs ---- */
.cl-groupe { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 20px; font-weight: 800; color: var(--encre); }
.cl-groupe > i { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--accent-clair); color: var(--accent); font-size: 16px; }
.cl-groupe span { padding: 2px 10px; border-radius: 999px; background: var(--fond-alt); border: 1px solid var(--bord); font-size: 13px; font-weight: 700; color: var(--discret); }
.cl-clubs + .cl-groupe { margin-top: 44px; }
.cl-club, .cl-asso { --c1: #6366F1; --c2: #4338CA; --c-clair: #EEF2FF; position: relative; overflow: hidden; scroll-margin-top: 120px; }   /* ancre sous la barre fixe, même pendant l'apparition */
/* halo à la couleur du club, qui suit la souris (js/clubs.js donne --mx / --my ; sinon centré) */
.cl-club::after, .cl-asso::after { content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: 0; pointer-events: none; transition: opacity .35s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--c-clair), transparent 70%); }
.cl-club:hover::after, .cl-asso:hover::after { opacity: 1; }
.cl-club > *, .cl-asso > * { position: relative; z-index: 1; }
/* clubs ITBS : tous pareils (icône + nom + une ligne descriptive), 3 par ligne, toutes les cartes de la même hauteur ;
   liseré de couleur à gauche qui s'allonge au survol */
.cl-clubs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 16px; }
.cl-club { display: flex; align-items: center; gap: 16px; min-height: 92px; padding: 18px 22px; background: #fff; border: 1px solid var(--bord); border-radius: 18px; transition: transform .3s, border-color .3s; }
.cl-club::before { content: ""; position: absolute; z-index: 2; top: 24px; bottom: 24px; left: 0; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(180deg, var(--c1), var(--c2)); transition: top .3s, bottom .3s; }
.cl-club:hover, .cl-club:target { transform: translateY(-4px); border-color: var(--c1); }
.cl-club:hover::before, .cl-club:target::before { top: 0; bottom: 0; }
.cl-club-icone { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; font-size: 21px;
  transition: transform .4s cubic-bezier(.34, 1.56, .64, 1); }
.cl-club:hover .cl-club-icone, .cl-club:target .cl-club-icone { transform: rotate(-8deg) scale(1.1); }
.cl-club h4, .cl-asso h4 { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.3; color: var(--encre); }
.cl-club-texte { display: grid; gap: 4px; min-width: 0; }
.cl-club p, .cl-asso-corps p { margin: 0; font-size: 14.5px; line-height: 1.45; color: var(--texte); text-wrap: pretty; }
.cl-asso-corps p { margin-top: -4px; }
/* associations et réseaux internationaux : carte à visuel (zone d'image aux couleurs du réseau, grande icône dans un
   médaillon « verre » ; prévue pour accueillir leur logo), puis nom et étiquette ; contour lumineux qui tourne au survol */
.cl-assos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.cl-asso { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--bord); border-radius: 20px; transition: transform .3s; }
.cl-asso:hover, .cl-asso:target { transform: translateY(-4px); }
.cl-asso-visuel { position: relative; display: grid; place-items: center; height: 150px; overflow: hidden;
  background: radial-gradient(circle at 18% 20%, rgba(255, 255, 255, .28), transparent 38%), radial-gradient(circle at 88% 92%, rgba(255, 255, 255, .2), transparent 34%), linear-gradient(135deg, var(--c1), var(--c2)); }
.cl-asso-visuel::before, .cl-asso-visuel::after { content: ""; position: absolute; border: 2px solid rgba(255, 255, 255, .22); border-radius: 50%; }
.cl-asso-visuel::before { width: 210px; height: 210px; top: -90px; right: -70px; }
.cl-asso-visuel::after { width: 130px; height: 130px; bottom: -60px; left: -40px; }
.cl-asso-icone { position: relative; z-index: 1; display: grid; place-items: center; width: 78px; height: 78px; border: 1px solid rgba(255, 255, 255, .45); border-radius: 50%;
  background: rgba(255, 255, 255, .18); color: #fff; font-size: 32px; backdrop-filter: blur(4px); transition: transform .45s cubic-bezier(.34, 1.56, .64, 1); }
.cl-asso:hover .cl-asso-icone, .cl-asso:target .cl-asso-icone { transform: scale(1.12) rotate(-6deg); }
.cl-asso-corps { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px 20px 20px; }
.cl-asso-etiquette { margin-top: auto; display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; background: var(--c-clair); font-size: 12px; font-weight: 700; color: var(--c2); }
@property --cl-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.cl-asso::before { content: ""; position: absolute; z-index: 2; inset: 0; padding: 2px; border-radius: inherit; opacity: 0; pointer-events: none; transition: opacity .35s;
  background: conic-gradient(from var(--cl-angle), var(--c1), var(--c2), transparent 35%, transparent 65%, var(--c1));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.cl-asso:hover::before, .cl-asso:target::before { opacity: 1; }

/* ---- FAQ : les réponses s'ouvrent en douceur (navigateurs récents ; sinon, ouverture directe) ---- */
@supports (interpolate-size: allow-keywords) {
  .al-faq { interpolate-size: allow-keywords; }
  .al-faq details::details-content { block-size: 0; overflow: hidden; transition: block-size .35s ease, content-visibility .35s allow-discrete; }
  .al-faq details[open]::details-content { block-size: auto; }
}

/* ---- Bandeau final : dégradé qui ondule, icônes des clubs qui flottent en fond ---- */
.cl-cta .al-cta { background-size: 200% 200%; }
.cl-cta-icones { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.cl-cta-icones i { position: absolute; left: var(--x); top: var(--y); font-size: 22px; color: #fff; opacity: .12; }
.cl-cta-icones i:nth-child(3n) { font-size: 30px; opacity: .09; }
.cl-cta-icones i:nth-child(3n+1) { font-size: 17px; }
.cl-cta .al-cta > :not(.cl-cta-icones) { position: relative; z-index: 1; }

@media (max-width: 1024px) {
  .cl-clubs, .cl-assos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .cl-etapes { grid-template-columns: 1fr; gap: 30px; max-width: 460px; }
  .cl-etapes::before, .cl-etapes::after { display: none; }
}
@media (max-width: 540px) {
  .cl-actions .bouton { flex: 1 1 100%; }
  .cl-ha { padding: 44px 0 48px; }
  .cl-intro { font-size: 16.5px; }
  .cl-defile { gap: 10px; margin-top: 34px; }
  .cl-piste a { min-width: 0; gap: 11px; padding: 9px 16px 9px 9px; border-radius: 15px; }
  .cl-defile-icone { width: 38px; height: 38px; border-radius: 12px; font-size: 16px; }
  .cl-defile-texte strong { font-size: 14px; }
  .cl-defile-texte small { font-size: 11.5px; }
  .cl-groupe { font-size: 18px; }
  .cl-clubs { grid-template-columns: 1fr; gap: 10px; }
  .cl-club { min-height: 76px; padding: 14px 18px; }
  .cl-club-icone { width: 46px; height: 46px; border-radius: 13px; font-size: 19px; }
  .cl-club p, .cl-asso-corps p { font-size: 14px; }
  /* associations : une par ligne, visuel coloré à gauche (comme les clubs : icône à gauche, texte à droite) */
  .cl-assos { grid-template-columns: 1fr; grid-auto-rows: 1fr; gap: 10px; }
  .cl-asso { flex-direction: row; border-radius: 18px; }
  .cl-asso-visuel { flex: none; width: 96px; height: auto; }
  .cl-asso-icone { width: 54px; height: 54px; font-size: 22px; }
  .cl-asso-corps { gap: 8px; padding: 14px 16px; }
  .cl-cta-icones i:nth-child(n+8) { display: none; }
}

/* ---- Mouvements (coupés si « réduire les animations ») ---- */
@keyframes cl-arrivee { from { opacity: 0; translate: 0 14px; } }
@keyframes cl-defile { to { transform: translateX(-33.3333%); } }
@keyframes cl-trait-x { from { transform: scaleX(0); } }
@keyframes cl-pop { from { opacity: 0; scale: .5; } 70% { scale: 1.08; } }
@keyframes cl-tourne { to { --cl-angle: 360deg; } }
@keyframes cl-ondule { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes cl-flotte { 0%, 100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -12px; rotate: 8deg; } }
@media (prefers-reduced-motion: no-preference) {
  .cl-defile { animation: cl-arrivee .7s .15s ease-out both; }
  .cl-piste { animation: cl-defile 46s linear infinite; }
  .cl-rangee-inverse .cl-piste { animation-direction: reverse; animation-duration: 52s; }
  .cl-rangee:hover .cl-piste, .cl-rangee:focus-within .cl-piste { animation-play-state: paused; }
  .cl-asso:hover::before, .cl-asso:target::before { animation: cl-tourne 3s linear infinite; }
  .cl-cta .al-cta { animation: cl-ondule 14s ease-in-out infinite; }
  .cl-cta-icones i { animation: cl-flotte 7s ease-in-out infinite; animation-delay: calc(var(--i) * -.6s); }
  @supports (animation-timeline: view()) {
    .cl-club, .cl-asso, .cl-etapes li { animation: al-revele ease-out both; animation-timeline: view(); animation-range: entry 0% entry 75%; }
    .cl-club:nth-child(3n+2), .cl-asso:nth-child(4n+2), .cl-etapes li:nth-child(2) { animation-range: entry 8% entry 83%; }
    .cl-club:nth-child(3n), .cl-asso:nth-child(4n+3), .cl-etapes li:nth-child(3) { animation-range: entry 16% entry 91%; }
    .cl-asso:nth-child(4n) { animation-range: entry 24% entry 99%; }
    /* étapes : le trait se remplit de gauche à droite, les icônes apparaissent en rebond */
    .cl-etapes::after { animation: cl-trait-x linear both; animation-timeline: view(); animation-range: entry 60% cover 55%; }
    .cl-etape-icone { animation: cl-pop ease-out both; animation-timeline: view(); animation-range: entry 20% entry 90%; }
  }
}
@media (prefers-reduced-motion: reduce) {
  /* sans mouvement : les 13 clubs en grille, une seule copie ; sur téléphone, deux rangées à faire glisser du doigt */
  .cl-rangee { -webkit-mask-image: none; mask-image: none; }
  .cl-piste { width: auto; max-width: 1000px; margin-inline: auto; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 0 24px; }
  .cl-piste li { margin: 0; }
  .cl-piste li[aria-hidden="true"] { display: none; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 540px) {
  .cl-rangee { overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; scrollbar-width: none; }
  .cl-rangee::-webkit-scrollbar { display: none; }
  .cl-piste { width: max-content; max-width: none; flex-wrap: nowrap; justify-content: flex-start; padding: 0 16px; }
  .cl-piste li { scroll-snap-align: start; }
}
