/* Composant : « Le match du week-end » (accueil). Utilise les variables de style.css. Rendu par affiches-match.js.
   Seules les affiches, posées sur le fond clair de la page. Écran large : côte à côte (grille). Mobile (< 700 px) : piste horizontale
   à accrochage (scroll-snap), commandes précédent / points / suivant, aucun défilement automatique. */

.affiches { max-width: calc(var(--affiches-n, 2) * 440px + (var(--affiches-n, 2) - 1) * 40px); margin-inline: auto; }

.affiches__piste { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--affiches-n, 2), minmax(0, 1fr)); gap: 40px; }

/* ===== Mobile : piste à accrochage ===== */
@media (max-width: 699px) {
  .affiches { max-width: none; }
  .affiches__piste {
    position: relative; display: flex; gap: 16px; padding: 4px 14px 14px 4px; margin-inline: -4px;   /* place pour l'écho (10 px) dans la piste */
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
  }
  .affiches__piste::-webkit-scrollbar { display: none; }
  .affiches__piste > .affiche { flex: 0 0 82%; min-width: 0; scroll-snap-align: start; }
  .affiches__piste > .affiche:only-child { flex-basis: 100%; }
}

/* Effet d'écho : une seule ombre pleine et nette, décalée de 10 px, dans la couleur de l'affiche.
   --echo est posé par affiches-match.js sur chaque <li> (champ « couleur » du JSON, sinon couleur lue dans l'image, sinon jaune du site) ;
   tant qu'elle n'est pas connue, l'écho est transparent puis apparaît en fondu. Purement décoratif. */
.affiche { min-width: 0; }
.affiche__cadre { aspect-ratio: 4 / 5; box-shadow: 10px 10px 0 var(--echo, transparent); transition: box-shadow .45s var(--ease); }
.affiche__cadre img { display: block; width: 100%; height: 100%; max-width: none; object-fit: contain; }   /* ratio 4:5 respecté, aucun rognage */

/* ===== Commandes (mobile seulement) ===== */
.affiches__cmd { display: none; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; }
.affiches__cmd[hidden] { display: none; }
@media (max-width: 699px) { .affiches__cmd:not([hidden]) { display: flex; } }
.affiches__btn { display: grid; place-items: center; width: 48px; height: 48px; margin: 0; padding: 0; border: 2px solid var(--navy); border-radius: 0; background: transparent; color: var(--navy); font-size: 1.1rem; line-height: 1; cursor: pointer; -webkit-appearance: none; appearance: none; touch-action: manipulation; }
.affiches__btn[aria-disabled="true"] { opacity: .4; cursor: default; }
.affiches__btn:focus-visible, .affiches__point:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
@media (hover: hover) { .affiches__btn:not([aria-disabled="true"]):hover { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); } }
.affiches__btn:not([aria-disabled="true"]):active { transform: scale(.94); }
.affiches__points { display: flex; align-items: center; }
.affiches__point { display: grid; place-items: center; width: 40px; height: 48px; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; -webkit-appearance: none; appearance: none; touch-action: manipulation; }
.affiches__point span { display: block; width: 12px; height: 22px; background: color-mix(in srgb, var(--navy) 26%, transparent); transform: skewX(-17deg); transition: background-color .2s var(--ease), width .2s var(--ease); }
.affiches__point[aria-current="true"] span { width: 20px; background: var(--yellow); box-shadow: inset 0 0 0 2px var(--navy); }
@media (prefers-reduced-motion: reduce) { .affiches__point span, .affiche__cadre { transition: none; } }
