/* ==========================================================
   Triaxe — Galerie « Quelques réalisations » (remplace Essential Grid)
   ========================================================== */

.triaxe-galerie {
	--triaxe-gap: 15px;
	display: grid;
	grid-template-columns: repeat(var(--triaxe-cols, 4), minmax(0, 1fr));
	gap: var(--triaxe-gap);
	max-width: 1170px;
	margin: 0 auto 40px;
}

.triaxe-galerie__item {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #2b2b2b;
	cursor: zoom-in;
}

.triaxe-galerie__item--video { cursor: pointer; }

.triaxe-galerie__item img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	object-fit: cover;
	transition: transform .6s ease, filter .4s ease;
}

.triaxe-galerie__item::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(43, 43, 43, .55);
	opacity: 0;
	transition: opacity .35s ease;
}

.triaxe-galerie__icon {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 1;
	width: 56px;
	height: 56px;
	margin: -28px 0 0 -28px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(30, 183, 205, .9);
	color: #fff;
	opacity: 0;
	transform: scale(.7);
	transition: opacity .35s ease, transform .35s ease;
}

/* Les vidéos montrent toujours leur bouton lecture */
.triaxe-galerie__item--video .triaxe-galerie__icon {
	opacity: 1;
	transform: none;
}

.triaxe-galerie__item:hover img,
.triaxe-galerie__item:focus-visible img { transform: scale(1.08); }

.triaxe-galerie__item:hover::after,
.triaxe-galerie__item:focus-visible::after { opacity: 1; }

.triaxe-galerie__item:hover .triaxe-galerie__icon,
.triaxe-galerie__item:focus-visible .triaxe-galerie__icon {
	opacity: 1;
	transform: scale(1);
}

.triaxe-galerie__item:focus-visible {
	outline: 3px solid rgb(30, 183, 205);
	outline-offset: 2px;
}

@media (max-width: 1023px) {
	.triaxe-galerie { --triaxe-cols: 3 !important; }
}

@media (max-width: 479px) {
	.triaxe-galerie { --triaxe-cols: 1 !important; }
}

/* ---------- Lightbox ---------- */
.triaxe-lb {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(15, 15, 15, .94);
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s ease, visibility 0s linear .3s;
}

.triaxe-lb.is-open {
	opacity: 1;
	visibility: visible;
	transition: opacity .3s ease, visibility 0s;
}

.triaxe-lb__stage {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: calc(100vw - 140px);
	max-height: calc(100vh - 100px);
}

.triaxe-lb__stage img {
	display: block;
	max-width: calc(100vw - 140px);
	max-height: calc(100vh - 120px);
	width: auto;
	height: auto;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}

.triaxe-lb__video {
	width: min(1100px, calc(100vw - 140px), calc((100vh - 120px) * 16 / 9));
	aspect-ratio: 16 / 9;
	background: #000;
}

.triaxe-lb__video iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.triaxe-lb__caption {
	margin-top: 12px;
	color: #ddd;
	font-size: 14px;
	text-align: center;
}

.triaxe-lb__counter {
	position: absolute;
	top: 22px;
	left: 24px;
	color: #bbb;
	font-size: 14px;
	letter-spacing: 1px;
}

.triaxe-lb button {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: rgba(255, 255, 255, .08);
	color: #fff;
	cursor: pointer;
	transition: background-color .25s ease;
}

.triaxe-lb button:hover,
.triaxe-lb button:focus-visible {
	background: rgb(30, 183, 205);
	outline: none;
}

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

.triaxe-lb.is-single .triaxe-lb__prev,
.triaxe-lb.is-single .triaxe-lb__next,
.triaxe-lb.is-single .triaxe-lb__counter { display: none; }

@media (max-width: 767px) {
	.triaxe-lb__stage,
	.triaxe-lb__stage img { max-width: 100vw; }
	.triaxe-lb__video { width: 100vw; }
	.triaxe-lb__prev,
	.triaxe-lb__next { top: auto; bottom: 16px; margin-top: 0; }
	.triaxe-lb__prev { left: calc(50% - 56px); }
	.triaxe-lb__next { right: calc(50% - 56px); }
}

html.triaxe-lb-open { overflow: hidden; }
