/**
 * Page d'un reportage — page projet de la démo Captured.
 * Couverture plein écran avec les informations en bas, photos en deux colonnes façon
 * mosaïque (hauteurs naturelles), puis deux autres reportages.
 * La visionneuse plein écran est dans bp-lightbox.js.
 */

/* --- Couverture -------------------------------------------------------------------------- */

/* Le bandeau reste collé en haut pendant que le titre et les informations remontent,
   puis il s'efface quand les photos arrivent par-dessus (mécanique de la démo). */
.aml-album-hero {
	position: sticky;
	top: 0;
	z-index: 0;
	/* Bricks met ses sections en colonne : c'est justify-content qui descend le contenu */
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	align-items: stretch;
	min-height: min(88vh, 900px);
	padding: clamp(120px, 14vw, 200px) clamp(16px, 2.5vw, 36px) clamp(36px, 4vw, 56px);
	background: var(--aml-ink);
	color: var(--aml-white);
	overflow: hidden;
	isolation: isolate;
}

.aml-album-hero__media,
.aml-album-hero__media img {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Voile sombre : les informations restent lisibles sur n'importe quelle photo */
.aml-album-hero::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(to top, rgba(17, 17, 18, 0.75) 0%, rgba(17, 17, 18, 0.25) 45%, rgba(17, 17, 18, 0.15) 100%);
}

.aml-album-hero__inner {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 1920px;
	margin: 0 auto;
}

.aml-album-hero__info {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	margin: 0 0 14px;
	font-size: 16px;
	font-weight: 500;
	letter-spacing: -0.04em;
}

.aml-album-hero__info time { font-weight: 600; }

.aml-album-hero__info span { color: rgba(255, 255, 255, 0.7); }

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

.aml-album-hero__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-top: clamp(28px, 3.5vw, 50px);
}

.aml-album-hero__auteur {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	font-size: 16px;
	font-weight: 500;
	letter-spacing: -0.04em;
}

.aml-album-hero__face {
	width: 43px;
	height: 43px;
	border-radius: 8px;
	object-fit: cover;
	object-position: center 18%;
}

.aml-album-hero__nom,
.aml-album-hero__role { display: block; }

.aml-album-hero__role {
	font-size: 14px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.6);
}

@supports (animation-timeline: view()) {
	@media (prefers-reduced-motion: no-preference) {
		.aml-album-hero {
			animation: aml-hero-efface linear both;
			animation-timeline: view();
			animation-range: exit 0% exit 100%;
		}
	}
}

@keyframes aml-hero-efface {
	from { opacity: 1; }
	to   { opacity: 0; }
}

/* Grain de film : la texture déborde du cadre et se déplace par à-coups, ce qui donne
   l'impression d'une image argentique vivante. Valeurs de la démo : bruit à 6 %. */
.aml-album-hero__grain {
	position: absolute;
	inset: -150%;
	z-index: 0;
	width: 400%;
	height: 400%;
	background-image: url('../img/grain.png');
	opacity: 0.07;
	pointer-events: none;
	will-change: transform;
}

@media (prefers-reduced-motion: no-preference) {
	.aml-album-hero__grain { animation: aml-grain 0.8s steps(1, end) infinite; }
}

@keyframes aml-grain {
	0%   { transform: translate(0, 0); }
	10%  { transform: translate(-3%, -2%); }
	20%  { transform: translate(2%, 3%); }
	30%  { transform: translate(-1%, 2%); }
	40%  { transform: translate(3%, -3%); }
	50%  { transform: translate(-2%, 1%); }
	60%  { transform: translate(1%, -1%); }
	70%  { transform: translate(-3%, 3%); }
	80%  { transform: translate(2%, -2%); }
	90%  { transform: translate(-1%, -3%); }
	100% { transform: translate(0, 0); }
}

/* --- Les photos ---------------------------------------------------------------------------- */

/* Les photos passent au-dessus du bandeau resté collé */
.aml-album,
.aml-album-suite {
	position: relative;
	z-index: 1;
}

.aml-album {
	background: var(--aml-white);
	color: var(--aml-ink);
	padding: clamp(40px, 5vw, 70px) clamp(16px, 2.5vw, 36px) clamp(80px, 9vw, 130px);
}

.aml-album__intro {
	max-width: 780px;
	margin: 0 auto clamp(40px, 5vw, 70px);
	font-size: clamp(19px, 1.8vw, 26px);
	font-weight: 500;
	letter-spacing: -0.05em;
	line-height: 1.3;
	text-align: center;
	color: rgba(17, 17, 18, 0.7);
}

/* Mosaïque : les photos gardent leurs proportions et remplissent deux colonnes */
.aml-album__grille {
	display: flex;
	flex-direction: column;
	gap: 20px;
	max-width: 1920px;
	margin: 0 auto;
}

/* Blocs de deux colonnes posés par bp-album-grille.js (à partir de 810 px) */
.aml-album__grille.is-blocs {
	gap: 20px;
}

.aml-album__bloc {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	align-items: start;
}

.aml-album__col {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* Le mouvement de la démo : la colonne de droite se fige pendant que celle de gauche,
   plus haute, continue de défiler ; à la fin du bloc, les deux repartent ensemble. */
.aml-album__col--droite {
	position: sticky;
	top: 24px;
}

@media (prefers-reduced-motion: reduce) {
	.aml-album__col--droite { position: static; }
}

.aml-album__photo {
	display: block;
	overflow: hidden;
	cursor: zoom-in;
	background: var(--aml-mist);
}

.aml-album__photo img {
	display: block;
	width: 100%;
	height: auto;
}

.aml-album__photo {
	transition: opacity 0.4s ease;
}

.aml-album__photo:hover,
.aml-album__photo:focus-visible { opacity: 0.88; }

/* --- Suite ---------------------------------------------------------------------------------- */

.aml-album-suite {
	background: var(--aml-white);
	color: var(--aml-ink);
	padding: 0 clamp(16px, 2.5vw, 36px) clamp(96px, 11.1vw, 160px);
}

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

.aml-album-suite__head {
	margin-bottom: clamp(48px, 6vw, 80px);
	text-align: center;
}

.aml-album-suite__h2 {
	margin: 18px 0 0;
	font-size: clamp(38px, 5.7vw, 82px);
	font-weight: 500;
	letter-spacing: -0.07em;
	line-height: 0.96;
}

/* --- Visionneuse plein écran (bp-lightbox.js) ---------------------------------------- */

/* Mêmes valeurs que la visionneuse de la démo : voile noir à 80 %, photo à 20 px des
   bords, proportions conservées. */
.aml-lb {
	position: fixed;
	inset: 0;
	z-index: 1200;
	display: grid;
	/* minmax(0, 1fr) : sans ça, la case grandit avec la photo et celle-ci déborde de l'écran */
	grid-template: minmax(0, 1fr) / minmax(0, 1fr);
	place-items: center;
	padding: 20px;
	background: rgba(0, 0, 0, 0.8);
	opacity: 0;
	transition: opacity 0.35s ease;
}

.aml-lb[hidden] { display: none; }

.aml-lb.is-open { opacity: 1; }

.aml-lb__img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.aml-lb__img.is-shown { opacity: 1; }

.aml-lb__btn {
	position: absolute;
	/* Centrage par flex : avec la seule hauteur de ligne, le remplissage par défaut du
	   bouton décalait le symbole hors de son cercle. */
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	color: var(--aml-white);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.3s ease, transform 0.3s ease;
}

/* Les chevrons sont plus grands et légèrement remontés par leur dessin */
.aml-lb__prev,
.aml-lb__next { font-size: 26px; }

.aml-lb__btn:hover,
.aml-lb__btn:focus-visible { background: rgba(255, 255, 255, 0.28); }

.aml-lb__close { top: 20px; right: 20px; }
.aml-lb__prev { left: 20px; top: 50%; margin-top: -24px; }
.aml-lb__next { right: 20px; top: 50%; margin-top: -24px; }

.aml-lb__compteur {
	position: absolute;
	left: 50%;
	bottom: 20px;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.7);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: -0.04em;
}

@media (prefers-reduced-motion: reduce) {
	.aml-lb,
	.aml-lb__img { transition: none; }
}

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

@media (max-width: 809px) {
	.aml-album-hero { min-height: 74vh; }
	.aml-lb__btn { width: 42px; height: 42px; }
	.aml-lb__prev { left: 10px; }
	.aml-lb__next { right: 10px; }
}
