/*!
 * POC — Galerie
 * Version: 1.0.0
 * Thème cible : Modins (Gavias).
 *
 * Règles tenues : racine confinée, min-width: 0 sur tous les
 * descendants, aucune unité vw hors visionneuse plein écran, aucune
 * marge négative. La visionneuse vit en fin de <body>.
 */

/* =====================================================================
   1. VARIABLES
   ===================================================================== */
.poc-ga,
.poc-gav {
	--poc-ga-or: #a21a18;
	--poc-ga-or-clair: #f38c8b;
	--poc-ga-encre: #4e4e4c;
	--poc-ga-gris: #76766f;
	--poc-ga-creme: #fbf3f3;
	--poc-ga-filet: #f6e1e1;
	--poc-ga-blanc: #ffffff;

	--poc-ga-cols: 3;
	--poc-ga-gap: 14px;
	--poc-ga-radius: 14px;

	--poc-ga-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* =====================================================================
   2. GARDES — thème Modins
   ===================================================================== */
.poc-ga,
.poc-ga *,
.poc-gav,
.poc-gav * {
	box-sizing: border-box;
	min-width: 0;
}

.poc-ga [hidden],
.poc-gav[hidden],
.poc-gav [hidden] {
	display: none !important;
}

.poc-ga :where(h1, h2, h3, h4, h5, h6, p, figure, figcaption),
.poc-gav :where(h1, h2, h3, h4, h5, h6, p) {
	margin: 0;
	padding: 0;
	letter-spacing: normal;
}

.poc-ga button,
.poc-gav button {
	background: none;
	border: 0;
	margin: 0;
	padding: 0;
	font: inherit;
	color: inherit;
	border-radius: 0;
	position: static;
	z-index: auto;
	box-shadow: none;
	text-transform: none;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

.poc-ga button:hover,
.poc-ga button:focus,
.poc-gav button:hover,
.poc-gav button:focus {
	opacity: 1;
	box-shadow: none;
	background: none;
}

.poc-ga svg,
.poc-gav svg {
	height: auto;
	vertical-align: middle;
}

/* Modins force height:auto sur les images ; nos cadres imposent la leur. */
.poc-ga .poc-ga__img {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 100%;
	max-width: none;
	object-fit: cover;
}

/* =====================================================================
   3. RACINE ET EN-TÊTE
   ===================================================================== */
.poc-ga {
	display: block;
	width: 100%;
	max-width: 100%;
	overflow-x: clip;
	color: var(--poc-ga-encre);
}

.poc-ga .poc-ga__entete {
	margin-bottom: 22px;
}

.poc-ga .poc-ga__surtitre {
	color: var(--poc-ga-or);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	margin-bottom: 8px;
	text-transform: none;
	overflow-wrap: break-word;
}

.poc-ga .poc-ga__titre {
	font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.2rem);
	font-weight: 800;
	line-height: 1.2;
	text-transform: none;
	overflow-wrap: break-word;
}

/* =====================================================================
   4. FILTRES
   ===================================================================== */
.poc-ga .poc-ga__filtres {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 18px;
	min-width: 0;
}

.poc-ga .poc-ga__filtre {
	display: inline-flex;
	align-items: center;
	max-width: 100%;
	padding: 9px 16px;
	border: 1.5px solid var(--poc-ga-filet);
	border-radius: 999px;
	background: var(--poc-ga-blanc);
	font-size: 13.5px;
	font-weight: 700;
	overflow-wrap: break-word;
	transition: background 200ms var(--poc-ga-ease),
		border-color 200ms var(--poc-ga-ease),
		color 200ms var(--poc-ga-ease);
}

.poc-ga .poc-ga__filtre:hover {
	border-color: var(--poc-ga-or);
}

.poc-ga .poc-ga__filtre.is-active {
	background: linear-gradient(135deg, var(--poc-ga-or-clair), var(--poc-ga-or));
	border-color: transparent;
	color: var(--poc-ga-encre);
}

.poc-ga .poc-ga__filtre:focus-visible {
	outline: 2px solid var(--poc-ga-or);
	outline-offset: 3px;
}

.poc-ga .poc-ga__filtre-n {
	flex: 0 0 auto;
	margin-left: 8px !important;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--poc-ga-creme);
	color: var(--poc-ga-gris);
	font-size: 11px;
	font-weight: 800;
}

.poc-ga .poc-ga__filtre.is-active .poc-ga__filtre-n {
	background: rgba(255, 255, 255, 0.45);
	color: var(--poc-ga-encre);
}

/* =====================================================================
   5. LA PISTE
   ===================================================================== */
.poc-ga--grille .poc-ga__piste {
	display: grid;
	grid-template-columns: repeat(var(--poc-ga-cols), minmax(0, 1fr));
	gap: var(--poc-ga-gap);
	min-width: 0;
}

/* Mosaïque : les colonnes coulent, les hauteurs restent naturelles. */
.poc-ga--mosaique .poc-ga__piste {
	column-count: var(--poc-ga-cols);
	column-gap: var(--poc-ga-gap);
	min-width: 0;
}

.poc-ga--mosaique .poc-ga__item {
	break-inside: avoid;
	margin-bottom: var(--poc-ga-gap);
}

/* Carrousel : défilement natif avec accrochage. */
.poc-ga--carrousel .poc-ga__piste {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc(
		(100% - (var(--poc-ga-cols) - 1) * var(--poc-ga-gap)) / var(--poc-ga-cols)
	);
	gap: var(--poc-ga-gap);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	padding-bottom: 4px;
	scrollbar-width: none;
}

.poc-ga--carrousel .poc-ga__piste::-webkit-scrollbar {
	display: none;
}

.poc-ga--carrousel .poc-ga__item {
	scroll-snap-align: start;
}

.poc-ga--carrousel .poc-ga__piste:focus-visible {
	outline: 2px solid var(--poc-ga-or);
	outline-offset: 4px;
	border-radius: var(--poc-ga-radius);
}

@media (prefers-reduced-motion: reduce) {
	.poc-ga--carrousel .poc-ga__piste {
		scroll-behavior: auto;
	}
}

/* =====================================================================
   6. LA PHOTO
   ===================================================================== */
.poc-ga .poc-ga__item {
	min-width: 0;
	max-width: 100%;
}

.poc-ga .poc-ga__cadre {
	position: relative;
	display: block;
	width: 100%;
	min-width: 0;
	overflow: hidden;
	border-radius: var(--poc-ga-radius);
	background: var(--poc-ga-creme);
	transition: box-shadow 260ms var(--poc-ga-ease);
}

button.poc-ga__cadre {
	cursor: zoom-in;
}

button.poc-ga__cadre:focus-visible {
	outline: 2px solid var(--poc-ga-or);
	outline-offset: 3px;
}

/* Format imposé, sauf en mosaïque où la hauteur reste naturelle. */
.poc-ga--r-4-3 .poc-ga__cadre {
	aspect-ratio: 4 / 3;
}

.poc-ga--r-1-1 .poc-ga__cadre {
	aspect-ratio: 1 / 1;
}

.poc-ga--r-3-4 .poc-ga__cadre {
	aspect-ratio: 3 / 4;
}

.poc-ga--r-16-9 .poc-ga__cadre {
	aspect-ratio: 16 / 9;
}

.poc-ga--mosaique .poc-ga__cadre {
	aspect-ratio: auto;
}

.poc-ga--mosaique .poc-ga__img {
	height: auto;
	min-height: 0;
}

.poc-ga .poc-ga__img {
	transition: transform 700ms var(--poc-ga-ease);
}

.poc-ga--zoom .poc-ga__cadre:hover .poc-ga__img,
.poc-ga--zoom .poc-ga__cadre:focus-visible .poc-ga__img {
	transform: scale(1.06);
}

/* --- Légende au survol --- */
.poc-ga .poc-ga__voile {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: flex-end;
	padding: 16px;
	background: linear-gradient(
		to top,
		rgba(45, 45, 42, 0.88) 0%,
		rgba(45, 45, 42, 0.45) 45%,
		rgba(45, 45, 42, 0) 100%
	);
	opacity: 0;
	transition: opacity 260ms var(--poc-ga-ease);
}

.poc-ga .poc-ga__cadre:hover .poc-ga__voile,
.poc-ga .poc-ga__cadre:focus-visible .poc-ga__voile {
	opacity: 1;
}

.poc-ga .poc-ga__voile-corps {
	display: flex;
	flex-direction: column;
	min-width: 0;
	text-align: left;
}

.poc-ga .poc-ga__voile .poc-ga__legende {
	color: #fff;
}

.poc-ga .poc-ga__voile .poc-ga__lieu {
	color: var(--poc-ga-or-clair);
}

/* --- Légende sous la photo --- */
.poc-ga .poc-ga__sous {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 10px 2px 0;
	text-align: left;
}

.poc-ga .poc-ga__legende {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.35;
	overflow-wrap: break-word;
}

.poc-ga .poc-ga__lieu {
	margin-top: 2px;
	color: var(--poc-ga-gris);
	font-size: 12.5px;
	overflow-wrap: break-word;
}

/* --- Loupe --- */
.poc-ga .poc-ga__loupe {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: var(--poc-ga-encre);
	opacity: 0;
	transform: translateY(-6px);
	transition: opacity 240ms var(--poc-ga-ease), transform 240ms var(--poc-ga-ease);
}

.poc-ga .poc-ga__loupe svg {
	width: 17px;
	height: 17px;
}

.poc-ga .poc-ga__cadre:hover .poc-ga__loupe,
.poc-ga .poc-ga__cadre:focus-visible .poc-ga__loupe {
	opacity: 1;
	transform: none;
}

/* Sur écran tactile, il n'y a pas de survol : la loupe reste visible. */
@media (hover: none) {
	.poc-ga .poc-ga__loupe {
		opacity: 1;
		transform: none;
	}

	.poc-ga .poc-ga__voile {
		opacity: 1;
	}
}

/* =====================================================================
   7. PILOTAGE DU CARROUSEL
   ===================================================================== */
.poc-ga__pilotage {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 16px;
	min-width: 0;
}

.poc-ga__puces {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	min-width: 0;
}

.poc-ga .poc-ga__puce {
	display: block;
	width: 9px;
	height: 9px;
	flex: 0 0 auto;
	border-radius: 99px;
	background: var(--poc-ga-filet);
	transition: width 260ms var(--poc-ga-ease), background 260ms var(--poc-ga-ease);
}

.poc-ga .poc-ga__puce.is-active {
	width: 26px;
	background: linear-gradient(90deg, var(--poc-ga-or-clair), var(--poc-ga-or));
}

.poc-ga__fleches {
	display: flex;
	gap: 8px;
	margin-left: auto !important;
}

.poc-ga .poc-ga__fleche {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	flex: 0 0 auto;
	border: 1.5px solid var(--poc-ga-filet);
	border-radius: 50%;
	transition: background 220ms var(--poc-ga-ease), border-color 220ms var(--poc-ga-ease);
}

.poc-ga .poc-ga__fleche svg {
	width: 18px;
	height: 18px;
}

.poc-ga .poc-ga__fleche:hover,
.poc-ga .poc-ga__fleche:focus-visible {
	background: linear-gradient(135deg, var(--poc-ga-or-clair), var(--poc-ga-or));
	border-color: transparent;
}

.poc-ga .poc-ga__fleche[disabled] {
	opacity: 0.35;
	cursor: default;
}

/* =====================================================================
   8. LA VISIONNEUSE (hors du bloc, en fin de body)
   ===================================================================== */
.poc-gav {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: inherit;
}

.poc-gav__voile {
	position: absolute;
	inset: 0;
	background: rgba(10, 12, 15, 0.94);
	animation: poc-gav-voile 260ms var(--poc-ga-ease);
}

@keyframes poc-gav-voile {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.poc-gav__panneau {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	padding: 14px;
	animation: poc-gav-entree 320ms var(--poc-ga-ease);
}

@keyframes poc-gav-entree {
	from {
		opacity: 0;
		transform: scale(0.97);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.poc-gav__barre {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex: 0 0 auto;
	gap: 12px;
	min-width: 0;
	color: rgba(255, 255, 255, 0.75);
}

.poc-gav__compteur {
	font-size: 14px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.poc-gav__sur {
	opacity: 0.5;
	margin: 0 3px;
}

.poc-gav .poc-gav__fermer {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	flex: 0 0 auto;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	transition: background 200ms var(--poc-ga-ease);
}

.poc-gav .poc-gav__fermer svg {
	width: 19px;
	height: 19px;
}

.poc-gav .poc-gav__fermer:hover,
.poc-gav .poc-gav__fermer:focus-visible {
	background: rgba(255, 255, 255, 0.22);
}

/* --- La scène --- */
.poc-gav__scene {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 auto;
	min-height: 0;
	min-width: 0;
	gap: 10px;
	padding: 10px 0;
}

.poc-gav__cadre {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
	height: 100%;
}

/*
 * Glisser une image déclenche le glisser-déposer natif du navigateur,
 * qui avale les événements de pointeur : le balayage au doigt ne
 * fonctionnait alors que si le geste commençait à côté de la photo.
 */
.poc-gav .poc-gav__img {
	-webkit-user-drag: none;
	user-select: none;
	-webkit-user-select: none;
	touch-action: pan-y;
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 8px;
	box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.9);
}

.poc-gav__attente {
	position: absolute;
	width: 34px;
	height: 34px;
	border: 3px solid rgba(255, 255, 255, 0.25);
	border-top-color: var(--poc-ga-or-clair);
	border-radius: 50%;
	animation: poc-gav-tourne 700ms linear infinite;
}

@keyframes poc-gav-tourne {
	to {
		transform: rotate(360deg);
	}
}

.poc-gav .poc-gav__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	flex: 0 0 auto;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	transition: background 200ms var(--poc-ga-ease);
}

.poc-gav .poc-gav__nav svg {
	width: 22px;
	height: 22px;
}

.poc-gav .poc-gav__nav:hover,
.poc-gav .poc-gav__nav:focus-visible {
	background: linear-gradient(135deg, var(--poc-ga-or-clair), var(--poc-ga-or));
	color: var(--poc-ga-encre);
}

/* --- Pied : légende --- */
.poc-gav__pied {
	flex: 0 0 auto;
	padding: 10px 4px;
	text-align: center;
	min-width: 0;
}

.poc-gav .poc-gav__legende {
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	overflow-wrap: break-word;
}

.poc-gav .poc-gav__lieu {
	margin-top: 2px;
	color: var(--poc-ga-or-clair);
	font-size: 13px;
	overflow-wrap: break-word;
}

/* --- LA BANDE DE VIGNETTES --- */
.poc-gav__vignettes {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	gap: 8px;
	padding: 10px 2px 4px;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.poc-gav__vignettes::-webkit-scrollbar {
	height: 6px;
}

.poc-gav__vignettes::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.28);
	border-radius: 99px;
}

.poc-gav .poc-gav__vignette {
	position: relative;
	display: block;
	width: 92px;
	height: 62px;
	flex: 0 0 auto;
	overflow: hidden;
	border-radius: 8px;
	opacity: 0.45;
	outline: 2px solid transparent;
	outline-offset: 0;
	transition: opacity 220ms var(--poc-ga-ease), outline-color 220ms var(--poc-ga-ease);
}

.poc-gav .poc-gav__vignette img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.poc-gav .poc-gav__vignette:hover,
.poc-gav .poc-gav__vignette:focus-visible {
	opacity: 0.8;
}

.poc-gav .poc-gav__vignette.is-active {
	opacity: 1;
	outline-color: var(--poc-ga-or);
}

/* =====================================================================
   9. RESPONSIVE
   ===================================================================== */
@media (max-width: 1024px) {
	.poc-ga {
		--poc-ga-cols: 2;
	}
}

@media (max-width: 767px) {
	.poc-ga {
		--poc-ga-cols: 1;
	}

	.poc-ga--carrousel .poc-ga__piste {
		grid-auto-columns: 100%;
	}

	.poc-ga__pilotage {
		justify-content: center;
	}

	.poc-ga__fleches {
		margin-left: 0 !important;
	}

	.poc-gav__panneau {
		padding: 10px;
	}

	/* Les flèches passent sur la photo : la place manque à côté. */
	.poc-gav .poc-gav__nav {
		position: absolute;
		top: 50%;
		z-index: 3;
		width: 42px;
		height: 42px;
		margin-top: -21px;
		background: rgba(10, 12, 15, 0.55);
	}

	.poc-gav .poc-gav__nav--prec {
		left: 2px;
	}

	.poc-gav .poc-gav__nav--suiv {
		right: 2px;
	}

	.poc-gav .poc-gav__vignette {
		width: 68px;
		height: 48px;
	}
}

/* =====================================================================
   10. ACCESSIBILITÉ
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
	.poc-ga *,
	.poc-ga *::before,
	.poc-ga *::after,
	.poc-gav *,
	.poc-gav *::before,
	.poc-gav *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}

	.poc-ga .poc-ga__img {
		transform: none !important;
	}
}
