/*
 * This file is part of itemplate_moule.
 *
 * Copyright (c) 2026 IPEOS
 *
 * Licensed under the Business Source License 1.1 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is distributed with this software, in the
 * LICENSE file.
 *
 * Change Date:    2029-10-30
 * Change License: GPL-3.0-or-later
 *
 * Non-production use is permitted. Production use requires a
 * commercial license from IPEOS.
 */

/* Fond animé sous les images en loading="lazy" tant qu'elles ne sont pas chargées.
 * Actif seulement quand js/image-loader.js a posé la classe img-loader sur <html> : sans JS, aucune image ne
 * recevrait is-loaded et l'animation tournerait derrière les images transparentes. */

@keyframes img-placeholder {
	from {
		background-position: 100% 0;
	}

	to {
		background-position: -100% 0;
	}
}

:root.img-loader img[loading="lazy"]:not(.is-loaded) {
	color: transparent;
	background: linear-gradient(90deg, #ced4da 0%, #f8f9fa 50%, #ced4da 100%) 0 0 / 200% 100%;
	animation: img-placeholder 1.5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
	:root.img-loader img[loading="lazy"]:not(.is-loaded) {
		animation: none;
	}
}
