/* =========================================================
   Galerie : texte d'introduction de catégorie + aperçu « Toutes les catégories »
   avec miniatures qui défilent en continu.
   À lier après style.css dans templates/header.php :
   <link rel="stylesheet" href="/assets/css/galerie-apercu-ajout.css">
   (ou à coller à la fin de assets/css/style.css)
   ========================================================= */

/* Texte de présentation affiché en haut d'une catégorie */
.galerie-intro {
  max-width: 760px;
  margin-bottom: 28px;
}
.galerie-intro p { font-size: 1.05rem; }

/* Aperçu : un bloc par catégorie */
.galerie-apercu { margin-bottom: 44px; }
.galerie-apercu h2 a { color: inherit; }
.galerie-apercu h2 a:hover { color: var(--color-clay); text-decoration: none; }
.galerie-apercu > p { max-width: 760px; }

.galerie-apercu__strip {
  display: block;
  overflow-x: auto;           /* repli sans JavaScript : défilement manuel */
  border-radius: var(--radius-md);
}
.galerie-apercu__strip.is-marquee { overflow: hidden; }

.galerie-apercu__track {
  display: flex;
  width: max-content;
}
/* Chaque miniature est dans un <span> (permet d'y poser la pastille ▶ des vidéos) */
.galerie-apercu__item {
  position: relative;
  flex: none;
  width: 150px;
  height: 100px;
  margin-right: 10px;         /* margin plutôt que gap : la boucle tombe pile */
}
.galerie-apercu__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}
.galerie-apercu__item .play-badge { width: 34px; height: 34px; }
.galerie-apercu__item .play-badge::after { border-width: 7px 0 7px 11px; }

.is-marquee .galerie-apercu__track {
  animation: galerie-defile var(--marquee-duration, 30s) linear infinite;
}
.is-marquee:hover .galerie-apercu__track,
.is-marquee:focus-visible .galerie-apercu__track {
  animation-play-state: paused;
}

@keyframes galerie-defile {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(var(--marquee-shift, 0px) * -1)); }
}

@media (min-width: 700px) {
  .galerie-apercu__item { width: 200px; height: 130px; }
}

/* Mouvement réduit : pas d'animation, défilement manuel */
@media (prefers-reduced-motion: reduce) {
  .is-marquee .galerie-apercu__track { animation: none; }
  .galerie-apercu__strip.is-marquee { overflow-x: auto; }
}