/**
 * Page « Galeries » (archive des reportages) — page Portfolio de la démo Captured.
 * Cotes relevées à 1440 px : titre 92 px centré (800 px de large), intro 26 px,
 * recherche et catégories côte à côte sur les colonnes 2 et 3 (338 × 60 px chacune),
 * puis les albums : cadre de 1015 × 675 px centré, coins arrondis à 20 px, photo qui se
 * dézoome de 1,2 à 1 au défilement, et par-dessus la date (30 px), la catégorie (16 px) et
 * les prénoms (68 px), en blanc, centrés. Tous les albums sont sur une colonne et collants
 * (top 36 px) : le suivant glisse par-dessus le précédent, 10 à la fois puis « Voir plus »
 * (demande d'Olivier du 22/09).
 */

.aml-gals-head {
	position: relative;
	overflow: hidden;
	background: var(--aml-ink);
	color: var(--aml-white);
	padding: clamp(150px, 15vw, 230px) clamp(16px, 2.5vw, 36px) clamp(56px, 6vw, 90px);
	text-align: center;
}

.aml-gals-head__inner {
	width: 100%;
	max-width: 1920px;
	margin: 0 auto;
}

.aml-gals-head__h1 {
	max-width: 800px;
	margin: 0 auto;
	font-size: clamp(40px, 6.4vw, 92px);
	font-weight: 500;
	letter-spacing: -0.07em;
	line-height: 0.96;
}

.aml-gals-head__intro {
	max-width: 800px;
	margin: 28px auto 0;
	font-size: clamp(19px, 1.8vw, 26px);
	font-weight: 500;
	letter-spacing: -0.05em;
	line-height: 1.2;
	color: rgba(255, 255, 255, 0.6);
}

.aml-gals-head__lines {
	position: absolute;
	top: 0;
	bottom: 0;
	left: clamp(16px, 2.5vw, 36px);
	right: clamp(16px, 2.5vw, 36px);
	background-image: linear-gradient(to right, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
	background-size: 25% 100%;
	background-position: -1px 0;
	pointer-events: none;
}

/* --- Recherche et catégories ------------------------------------------------------------ */

.aml-gals-section {
	background: var(--aml-white);
	color: var(--aml-ink);
	padding: clamp(56px, 6vw, 90px) clamp(16px, 2.5vw, 36px) clamp(96px, 11.1vw, 160px);
}

.aml-gals {
	width: 100%;
	max-width: 1920px;
	margin: 0 auto;
}

.aml-gals__filter {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0;
	margin-bottom: clamp(56px, 7vw, 100px);
}

.aml-gals__search { grid-column: 2; }
.aml-gals__select { grid-column: 3; }

.aml-gals__search input,
.aml-gals__select select {
	width: 100%;
	height: 60px;
	border: 0;
	color: var(--aml-ink);
	font: 500 16px/22px var(--aml-font);
	letter-spacing: -0.04em;
}

.aml-gals__search input {
	padding: 15px 15px 15px 40px;
	background: transparent var(--aml-i-loupe) no-repeat left 14px center / 16px 16px;
	border-bottom: 1px solid var(--aml-line);
	transition: border-color 0.3s ease;
	-webkit-appearance: none;
	appearance: none;
}

.aml-gals__search input::placeholder { color: #999; }

.aml-gals__search input:hover,
.aml-gals__search input:focus-visible {
	border-color: var(--aml-ink);
	outline: none;
}

.aml-gals__select select {
	appearance: none;
	padding: 14px 40px 14px 20px;
	background: rgba(187, 187, 187, 0.15) var(--aml-i-arrow-dark) no-repeat right 16px center / 10px 10px;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

.aml-gals__select select:hover,
.aml-gals__select select:focus-visible { background-color: rgba(187, 187, 187, 0.3); }

/* --- Albums ------------------------------------------------------------------------------- */

/* Trois albums par ligne (demande du 14/10) : l'empilement collant n'a plus de sens avec
   plusieurs cartes de front, le dé-zoom au défilement est conservé. */
.aml-gals__stack {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: clamp(28px, 3vw, 48px) clamp(20px, 2.2vw, 32px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.aml-gal-card {
	margin: 0;
}

.aml-gal-card a {
	display: block;
	color: var(--aml-white);
	text-decoration: none;
}

.aml-gal-card__media {
	position: relative;
	display: block;
	width: 100%;
	margin: 0 auto;
	overflow: hidden;
	isolation: isolate;
	aspect-ratio: 1015 / 675;
	border-radius: 20px;
	background: var(--aml-ink);
}

/* La photo arrive agrandie de 20 % et se dézoome au fil du défilement. L'animation est
   confiée au navigateur (animation-timeline) : aucun calcul en JavaScript, et les albums
   révélés par « Voir plus » en profitent sans réglage. Les navigateurs qui ne la
   connaissent pas encore affichent simplement la photo à l'échelle normale. */
.aml-gal-card__zoom {
	position: absolute;
	inset: 0;
	display: block;
	transform-origin: center;
}

@supports (animation-timeline: view()) {
	@media (prefers-reduced-motion: no-preference) {
		.aml-gal-card__zoom {
			animation: aml-dezoom linear both;
			animation-timeline: view();
			animation-range: entry 0% exit 100%;
		}
	}
}

@keyframes aml-dezoom {
	from { transform: scale(1.2); }
	to   { transform: scale(1); }
}

.aml-gal-card__zoom img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Voile discret : la date et les prénoms restent lisibles sur une photo claire */
.aml-gal-card__media::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(to bottom, rgba(17, 17, 18, 0.15), rgba(17, 17, 18, 0.35));
	pointer-events: none;
}

.aml-gal-card .aml-corners { inset: clamp(16px, 2.2vw, 32px); z-index: 2; }

.aml-gal-card__text {
	position: absolute;
	left: 50%;
	top: 50%;
	z-index: 2;
	width: 100%;
	padding: 0 24px;
	transform: translate(-50%, -50%);
	text-align: center;
	box-sizing: border-box;
}

.aml-gal-card__info {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 12px;
	color: rgba(255, 255, 255, 0.7);
}

.aml-gal-card__info time {
	font-size: clamp(16px, 1.25vw, 20px);
	font-weight: 600;
	letter-spacing: -0.06em;
}

.aml-gal-card__type {
	font-size: clamp(12px, 0.85vw, 14px);
	font-weight: 500;
	letter-spacing: -0.04em;
}

.aml-gal-card__title {
	display: block;
	margin-top: 10px;
	font-size: clamp(22px, 2.1vw, 30px);
	font-weight: 500;
	letter-spacing: -0.07em;
	line-height: 1;
	color: var(--aml-white);
}

.aml-gals__more {
	display: flex;
	justify-content: center;
	margin-top: clamp(56px, 7vw, 100px);
}

.aml-gals__vide {
	margin: 40px 0 0;
	text-align: center;
	font-size: 20px;
	font-weight: 500;
	letter-spacing: -0.05em;
	color: rgba(17, 17, 18, 0.6);
}

/* --- Tablette et mobile -------------------------------------------------------------- */

@media (max-width: 1199px) {
	.aml-gals__stack { grid-template-columns: 1fr 1fr; }
	.aml-gals__filter { grid-template-columns: 1fr 1fr; }
	.aml-gals__search { grid-column: 1; }
	.aml-gals__select { grid-column: 2; }
	.aml-gal-card__media { width: 100%; }
	.aml-gals-head__lines { background-size: 50% 100%; }
}

@media (max-width: 809px) {
	.aml-gals__filter { grid-template-columns: 1fr; gap: 14px; }
	.aml-gals__search,
	.aml-gals__select { grid-column: 1; }
	.aml-gals__stack { grid-template-columns: 1fr; }
	.aml-gal-card .aml-corners { inset: 12px; }
	.aml-gal-card__media { border-radius: 14px; }
}
