/* Bandeau « Nos écoles partenaires » (templates/nv/_ecoles_bandeau.html). Variables : static/css/nerdy.css.
   Hauteur fixe partout : la section ne bouge pas quand les logos arrivent (loading="lazy"). */

.ecoles-section{overflow:hidden}

.ecoles-tete{display:flex; flex-direction:column; align-items:center; gap:var(--s-2); text-align:center; margin-bottom:var(--s-6)}
.ecoles-titre{margin:0; font-family:var(--font-serif); font-size:var(--t-h3-serif); line-height:var(--lh-h3-serif); font-weight:500; letter-spacing:var(--ls-tight); color:var(--text)}
.ecoles-intro{margin:0; max-width:60ch; font-size:var(--t-small); line-height:var(--lh-small); color:var(--muted)}
.ecoles-apercu{margin:var(--s-2) 0 0; padding:var(--s-2) var(--s-4); border-radius:var(--r-s); background:var(--gold-soft); color:var(--text); font-size:var(--t-small); line-height:var(--lh-small)}

/* ---- la piste ---- */
.ecoles-bandeau{--ecoles-h:88px; --ecoles-gap:var(--s-5); position:relative; height:var(--ecoles-h)}
.ecoles-piste{display:flex; align-items:center; justify-content:center; gap:var(--ecoles-gap); height:100%; margin:0; padding:0 var(--gutter); list-style:none}

.ecoles-item{flex:0 0 auto; display:flex; align-items:center; justify-content:center; height:var(--ecoles-h); min-width:132px; max-width:220px; padding:var(--s-3) var(--s-4); box-sizing:border-box; border-radius:var(--r-m); background:#fff; border:1px solid var(--line)}

/* Logos EN COULEUR (Jordi, 18/11/2026 : plus de niveaux de gris), très légère transparence au repos, pleine opacité au survol.
   La tuile reste blanche en thème sombre (les logos sont faits pour un fond clair). */
.ecoles-logo{display:block; width:auto; height:auto; max-width:100%; max-height:calc(var(--ecoles-h) - 2 * var(--s-3) - 2px); object-fit:contain; opacity:.94; transition:opacity var(--d-base) var(--ease)}
.ecoles-item:hover .ecoles-logo{opacity:1}

.ecoles-nom{display:flex; flex-direction:column; align-items:center; gap:2px; font-family:var(--font-sans); font-size:var(--t-small); line-height:1.25; font-weight:600; text-align:center; color:#1B2A38; white-space:normal}
.ecoles-nom small{font-family:var(--font-mono); font-size:.6875rem; font-weight:400; letter-spacing:.04em; text-transform:uppercase; color:#51677A}

/* ---- défilement (5 écoles et plus) : la piste contient la liste deux fois, on la décale d'une moitié ---- */
.ecoles-bandeau--defile{overflow:hidden; -webkit-mask-image:linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image:linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent)}
.ecoles-bandeau--defile .ecoles-piste{width:max-content; justify-content:flex-start; gap:0; padding:0; animation:ecoles-defile calc(var(--ecoles-n, 8) * 4.5s) linear infinite; will-change:transform}
.ecoles-bandeau--defile .ecoles-item{margin-right:var(--ecoles-gap)}   /* marge et non gap : les deux moitiés ont exactement la même largeur */
.ecoles-bandeau--defile:hover .ecoles-piste,
.ecoles-bandeau--defile:focus-within .ecoles-piste{animation-play-state:paused}

@keyframes ecoles-defile{
  from{transform:translate3d(0,0,0)}
  to{transform:translate3d(-50%,0,0)}
}

/* ---- mobile ---- */
@media (max-width:640px){
  .ecoles-bandeau{--ecoles-h:72px; --ecoles-gap:var(--s-3)}
  .ecoles-item{min-width:112px; max-width:168px; padding:var(--s-2) var(--s-3)}
  .ecoles-logo{max-height:calc(var(--ecoles-h) - 2 * var(--s-2) - 2px)}
  /* rangée fixe (moins de 5 écoles) : elle passe à la ligne au lieu de déborder */
  .ecoles-bandeau:not(.ecoles-bandeau--defile){height:auto}
  .ecoles-bandeau:not(.ecoles-bandeau--defile) .ecoles-piste{flex-wrap:wrap; height:auto}
}

/* ---- mouvement réduit : pas de défilement, une grille ; la seconde copie disparaît ---- */
@media (prefers-reduced-motion:reduce){
  .ecoles-bandeau--defile{height:auto; overflow:visible; -webkit-mask-image:none; mask-image:none}
  .ecoles-bandeau--defile .ecoles-piste{width:auto; max-width:var(--container); height:auto; margin:0 auto; padding:0 var(--gutter); box-sizing:border-box; display:grid; grid-template-columns:repeat(auto-fit, minmax(132px, 1fr)); gap:var(--s-4); animation:none; transform:none}
  .ecoles-bandeau--defile .ecoles-item{margin-right:0; max-width:none}
  .ecoles-bandeau--defile .ecoles-item[aria-hidden="true"]{display:none}
  .ecoles-logo{transition:none}
}

/* ---- Compactage (18/11/2026, retour de Jordi : trop d'espacement) : le bandeau des écoles remplace une bande de 50 px,
   il ne prend donc pas le padding d'une section entière. ---- */
.n-section.ecoles-section{padding-block:var(--s-7) var(--s-6)}
.ecoles-tete{margin-bottom:var(--s-5)}
@media (max-width:640px){ .n-section.ecoles-section{padding-block:var(--s-6) var(--s-5)} .ecoles-tete{margin-bottom:var(--s-4)} }
