/*! Gallexy Pro — feuille de style front (noyau). */

/* ---------- Base ---------- */
.gxp {
	--gxp-c: var(--gxp-cols, 3);
	/* Valeurs effectives par appareil : espacement, ratio et hauteur du cadre (repli sur l'appareil plus grand). */
	--gxp-g: var(--gxp-gap, 12px);
	--gxp-r: var(--gxp-ratio, auto);
	--gxp-hh: var(--gxp-h, auto);
	position: relative;
	box-sizing: border-box;
	width: 100%;
	color: var(--gxp-text, inherit);
	font-family: var(--gxp-font, inherit);
	line-height: 1.4;
}
.gxp *, .gxp *::before, .gxp *::after { box-sizing: border-box; }
@media (max-width: 1024px) {
	.gxp {
		--gxp-c: var(--gxp-cols-t, var(--gxp-cols, 2));
		--gxp-g: var(--gxp-gap-t, var(--gxp-gap, 12px));
		--gxp-r: var(--gxp-ratio-t, var(--gxp-ratio, auto));
		--gxp-hh: var(--gxp-h-t, var(--gxp-h, auto));
	}
}
@media (max-width: 767px) {
	.gxp {
		--gxp-c: var(--gxp-cols-m, var(--gxp-cols-t, var(--gxp-cols, 1)));
		--gxp-g: var(--gxp-gap-m, var(--gxp-gap-t, var(--gxp-gap, 12px)));
		--gxp-r: var(--gxp-ratio-m, var(--gxp-ratio-t, var(--gxp-ratio, auto)));
		--gxp-hh: var(--gxp-h-m, var(--gxp-h-t, var(--gxp-h, auto)));
	}
}
/* « Adapter le cadre à chaque photo » : aucun ratio ni hauteur imposés, aucune photo coupée. */
.gxp.gxp-fit-auto:not(.gxp-tpl-grid) { --gxp-r: auto; --gxp-hh: auto; }
.gxp-fit-auto:not(.gxp-tpl-grid) .gxp-items { align-items: start; }
/* La grille classique impose un ratio homogène même si le réglage global « auto » est sélectionné. */
.gxp-tpl-grid.gxp-fit-auto { --gxp-r: var(--gxp-ratio, 4 / 3); }

.gxp-notice {
	margin: 8px 0;
	padding: 10px 14px;
	border-left: 4px solid #f59e0b;
	background: #fffbeb;
	color: #78350f;
	font-size: 14px;
	border-radius: 4px;
}
.gxp-empty { padding: 24px; text-align: center; opacity: .7; }

/* ---------- Grille ---------- */
.gxp-items {
	display: grid;
	grid-template-columns: repeat(var(--gxp-c), minmax(0, 1fr));
	gap: var(--gxp-g, 12px);
	margin: 0;
	padding: 0;
}
.gxp-item { position: relative; margin: 0; min-width: 0; }

.gxp-frame {
	position: relative;
	overflow: hidden;
	border-radius: var(--gxp-radius, 8px);
	background: var(--gxp-bg, transparent);
	border: var(--gxp-bw, 0px) solid var(--gxp-bc, transparent);
	box-shadow: var(--gxp-shadow, none);
}

.gxp-link {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: inherit;
	text-decoration: none;
	cursor: pointer;
}
span.gxp-link, .gxp-action-none .gxp-link { cursor: default; }
.gxp-link:focus-visible,
.gxp-ico-link:focus-visible,
.gxp-btn:focus-visible {
	outline: 3px solid var(--gxp-accent, #2563eb);
	outline-offset: 2px;
}

.gxp-media {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: var(--gxp-r, auto);
	height: var(--gxp-hh, auto);
	background: var(--gxp-fitbg, #e5e9ef);
}
.gxp-img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: var(--gxp-fit, cover);
	object-position: var(--gxp-pos, 50% 50%);
	/* Zoom et déplacement de l'image dans son cadre : propriétés individuelles, elles se combinent avec le zoom au survol (transform). */
	scale: var(--gxp-zoom, 1);
	translate: var(--gxp-tx, 0) var(--gxp-ty, 0);
	transition: transform var(--gxp-speed, 450ms) ease;
}
/* Cadrage propre à une photo (réglé dans la fenêtre « Modifier la photo »). */
.gxp-item[data-fit="cover"] .gxp-img { object-fit: cover; }
.gxp-item[data-fit="contain"] .gxp-img { object-fit: contain; }
.gxp-noimg { display: block; width: 100%; min-height: 120px; height: 100%; background: linear-gradient(135deg, #dfe6ee, #c7d1dd); }
.gxp-link:hover .gxp-img { transform: scale(1.05); }
.gxp-action-none .gxp-link:hover .gxp-img { transform: none; }

.gxp-play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.25));
}
.gxp-play .gxp-svg { width: 56px; height: 56px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }

/* ---------- Survol : icônes ---------- */
.gxp-ov {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background: var(--gxp-ov, rgba(15, 23, 42, .38));
	opacity: 0;
	transition: opacity var(--gxp-speed, 250ms) ease;
	pointer-events: none;
}
.gxp-frame:hover .gxp-ov,
.gxp-frame:focus-within .gxp-ov { opacity: 1; }
.gxp-ico {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: #fff;
	color: #0f172a;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
	pointer-events: none;
}
.gxp-ico-link { pointer-events: auto; }

/* ---------- Légendes ---------- */
.gxp-cap { display: flex; flex-direction: column; gap: 2px; padding: 8px 2px 0; font-size: .92em; }
.gxp-title { font-size: var(--gxp-tsize, 1em); font-weight: var(--gxp-fw, 600); }
.gxp-caption { opacity: .75; }
.gxp-desc { opacity: .7; font-size: .92em; }
/* Légende sur la photo (toujours visible) ou au survol : réglage « Position de la légende ». */
.gxp-cs-overlay .gxp-cap,
.gxp-cs-hover .gxp-cap {
	position: absolute;
	z-index: 2;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 28px 14px 12px;
	color: #fff;
	background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .7));
	border-radius: 0 0 var(--gxp-radius, 4px) var(--gxp-radius, 4px);
	pointer-events: none;
}
.gxp-cs-hover .gxp-cap { opacity: 0; transform: translateY(8px); transition: opacity .3s ease, transform .3s ease; }
.gxp-cs-hover .gxp-item:hover .gxp-cap,
.gxp-cs-hover .gxp-item:focus-within .gxp-cap { opacity: 1; transform: none; }

/* ---------- Badge (+N) et pied de carte ---------- */
.gxp-badge {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(15, 23, 42, .55);
	color: #fff;
	font-size: 1.6em;
	font-weight: 700;
	pointer-events: none;
}
.gxp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 2px 0; font-size: .85em; opacity: .9; }
.gxp-foot-icons { display: inline-flex; gap: 6px; margin-inline-start: auto; }
.gxp-foot-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 1px solid rgba(100, 116, 139, .35);
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
}
.gxp-foot-btn .gxp-svg { width: 16px; height: 16px; }
.gxp-foot-btn:hover { background: rgba(100, 116, 139, .12); }
.gxp-foot-btn:focus-visible { outline: 3px solid var(--gxp-accent, #2563eb); outline-offset: 2px; }

/* ---------- Boutons ---------- */
.gxp-toolbar { display: flex; justify-content: flex-end; margin: 0 0 var(--gxp-g, 12px); }
.gxp-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: .65em 1.15em;
	border: 1px solid var(--gxp-accent, #2563eb);
	border-radius: 999px;
	background: var(--gxp-accent, #2563eb);
	color: #fff;
	font: inherit;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: filter .2s ease;
}
.gxp-btn:hover { filter: brightness(1.08); }
.gxp-btn[disabled] { opacity: .5; cursor: not-allowed; }
.gxp-count { opacity: .85; font-weight: 400; }

/* ---------- Grille carrée / arrondie ---------- */
.gxp-shape-square .gxp-frame { border-radius: 0; }
.gxp-shape-circle .gxp-frame { border-radius: 50%; }
.gxp-shape-circle .gxp-media { aspect-ratio: 1 / 1; }

/* ---------- Albums (cartes) ---------- */
.gxp-album-open { position: relative; }
.gxp-album-set { display: none; }

/* ---------- Photo seule ---------- */
.gxp-photo .gxp-items { grid-template-columns: minmax(0, 1fr); }

/* ---------- Lightbox ---------- */
html.gxp-lb-lock { overflow: hidden; }
.gxp-lb {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	background: rgba(8, 11, 18, .95);
	color: #fff;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s ease, visibility .2s;
}
.gxp-lb.is-open { opacity: 1; visibility: visible; }
.gxp-lb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; }
.gxp-lb-counter { font-size: 14px; opacity: .85; font-variant-numeric: tabular-nums; }
.gxp-lb-tools { display: flex; gap: 6px; margin-inline-start: auto; }
.gxp-lb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .14);
	color: #fff;
	cursor: pointer;
	transition: background .2s ease;
}
.gxp-lb-btn:hover { background: rgba(255, 255, 255, .28); }
.gxp-lb-btn[disabled] { opacity: .35; cursor: default; }
.gxp-lb-btn:focus-visible, .gxp-lb-thumb:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.gxp-lb-stage {
	position: relative;
	flex: 1;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	touch-action: none;
}
.gxp-lb-media { display: flex; align-items: center; justify-content: center; max-width: 100%; max-height: 100%; }
.gxp-lb-img {
	display: block;
	max-width: calc(100vw - 32px);
	max-height: 100%;
	object-fit: contain;
	cursor: zoom-in;
	user-select: none;
	-webkit-user-drag: none;
	transform-origin: center center;
	transition: transform .18s ease;
}
.gxp-lb-img.is-zoomed { cursor: grab; }
.gxp-lb-stage.is-loading::after {
	content: "";
	position: absolute;
	width: 36px;
	height: 36px;
	border: 3px solid rgba(255, 255, 255, .25);
	border-top-color: #fff;
	border-radius: 50%;
	animation: gxp-spin .8s linear infinite;
}
.gxp-lb-stage.is-error::after { content: "!"; position: absolute; font-size: 32px; opacity: .7; }
@keyframes gxp-spin { to { transform: rotate(360deg); } }
.gxp-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.gxp-lb-prev { left: 12px; }
.gxp-lb-next { right: 12px; }
.gxp-lb-video iframe, .gxp-lb-video video {
	display: block;
	width: min(92vw, 1100px);
	max-height: 100%;
	aspect-ratio: 16 / 9;
	border: 0;
	background: #000;
}
.gxp-lb-cap { min-height: 24px; padding: 8px 16px; text-align: center; font-size: 14px; line-height: 1.4; }
.gxp-lb-thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 6px 12px 14px; justify-content: center; }
.gxp-lb-thumb {
	flex: 0 0 auto;
	width: 64px;
	height: 48px;
	padding: 0;
	overflow: hidden;
	border: 2px solid transparent;
	border-radius: 6px;
	background: #1d2433;
	opacity: .55;
	cursor: pointer;
}
.gxp-lb-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gxp-lb-thumb.is-active { opacity: 1; border-color: #fff; }
@media (max-width: 767px) {
	.gxp-lb-nav { width: 38px; height: 38px; }
	.gxp-lb-prev { left: 6px; }
	.gxp-lb-next { right: 6px; }
	.gxp-lb-thumbs { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
	.gxp *, .gxp-lb, .gxp-lb * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* L'attribut hidden doit toujours l'emporter sur les display des composants. */
.gxp [hidden], .gxp-lb [hidden] { display: none !important; }
