/**
 * hamon-defilante.css
 * Styles du widget "Galerie défilante Hamon".
 *
 * La hauteur des rangées et l'espace ENTRE LES RANGÉES sont pilotés par les
 * variables CSS --hamon-row-height et --hamon-row-gap, posées en inline
 * sur .hamon-defilante-stack par le template PHP (valeurs réglables depuis
 * le panneau Elementor). La vitesse de chaque rangée est sa propre variable
 * --hamon-row-speed, posée sur chaque .hamon-defilante-row individuellement.
 *
 * L'espace ENTRE LES PHOTOS À L'INTÉRIEUR d'une même rangée (gap: 14px sur
 * .hamon-defilante-track ci-dessous) n'a, lui, pas de contrôle Elementor
 * dédié — c'est une valeur fixe assumée, pas un oubli.
 */

.hamon-defilante-stack {
	display: flex;
	flex-direction: column;
	gap: var(--hamon-row-gap, 14px);
	width: 100%;
}

.hamon-defilante-row {
	position: relative;
	overflow: hidden;
	height: var(--hamon-row-height, 160px);
	/* Fondu sur les bords gauche/droite, pour que les photos n'apparaissent/
	   disparaissent jamais brutalement au bord du cadre. */
	-webkit-mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
	mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
}

.hamon-defilante-track {
	display: flex;
	align-items: stretch;
	gap: 14px;
	width: max-content;
	height: 100%;
	animation-name: hamon-scroll-left;
	animation-duration: var(--hamon-row-speed, 40s);
	animation-timing-function: linear;
	animation-iteration-count: infinite;
}

/* Sens inversé : on inverse simplement l'animation utilisée, le reste du
   comportement (durée, fondu, pause au survol) ne change pas. */
.hamon-defilante-row.hamon-row-reverse .hamon-defilante-track {
	animation-name: hamon-scroll-right;
}

/* Pause au survol, seulement si la stack porte la classe correspondante
   (réglage "Pause au survol" du widget). */
.hamon-defilante-stack.hamon-pause-on-hover .hamon-defilante-row:hover .hamon-defilante-track {
	animation-play-state: paused;
}

@keyframes hamon-scroll-left {
	from { transform: translateX(0); }
	to   { transform: translateX(-50%); }
}

@keyframes hamon-scroll-right {
	from { transform: translateX(-50%); }
	to   { transform: translateX(0); }
}

.hamon-defilante-item {
	flex-shrink: 0;
	height: 100%;
	width: auto;
	border-radius: 4px;
	overflow: hidden;
	border: 1px solid #D9D6D0;
	background: #FFFFFF;
}

/* La hauteur du cadre est fixe (héritée de --hamon-row-height) ; la largeur
   n'est plus imposée par un aspect-ratio figé : l'image impose elle-même sa
   largeur en gardant SON propre ratio naturel (height:100%, width:auto sur
   l'image elle-même, pas sur le cadre). Aucun recadrage, quel que soit le
   format de la photo (panoramique, carrée, portrait) — un sabre allongé
   donne un cadre large, une photo verticale donne un cadre étroit. */
.hamon-defilante-item img {
	height: 100% !important;
	width: auto !important;
	max-width: none !important;
	max-height: none !important;
	display: block;
}

/* Respecte la préférence système "réduire les animations" : les photos
   restent visibles, simplement figées plutôt qu'en mouvement continu. */
@media (prefers-reduced-motion: reduce) {
	.hamon-defilante-track {
		animation: none;
	}
}
