/**
 * OCI Gallery Lightbox — styles
 * Visionneuse sobre et sombre, pensée pour se fondre dans Elementor.
 */

/* Bloque le défilement de la page quand la lightbox est ouverte */
html.oci-glb-locked {
	overflow: hidden;
}

.oci-glb {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(10, 10, 12, 0.94);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.oci-glb.is-open {
	display: flex;
	opacity: 1;
}

/* Scène : conteneur centré de l'image */
.oci-glb__stage {
	position: relative;
	max-width: 90vw;
	max-height: 86vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.oci-glb__img {
	max-width: 90vw;
	max-height: 86vh;
	width: auto;
	height: auto;
	display: block;
	border-radius: 10px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	opacity: 0;
	transform: scale(0.985);
	transition: opacity 0.28s ease, transform 0.28s ease;
}

.oci-glb__img.is-visible {
	opacity: 1;
	transform: scale(1);
}

/* Spinner — un seul anneau qui tourne, masqué dès que l'image est prête */
.oci-glb__spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 46px;
	height: 46px;
	margin: -23px 0 0 -23px;
	border: 3px solid rgba(255, 255, 255, 0.25);
	border-top-color: #fff;
	border-radius: 50%;
	animation: oci-glb-spin 0.8s linear infinite;
}

@keyframes oci-glb-spin {
	to { transform: rotate(360deg); }
}

/* Boutons */
.oci-glb__close,
.oci-glb__nav {
	position: absolute;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	border: none;
	cursor: pointer;
	border-radius: 50%;
	transition: background 0.2s ease, transform 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.oci-glb__close:hover,
.oci-glb__nav:hover {
	background: rgba(255, 255, 255, 0.22);
}

.oci-glb__close {
	top: 22px;
	right: 24px;
	width: 46px;
	height: 46px;
	font-size: 30px;
	line-height: 1;
}

.oci-glb__nav {
	top: 50%;
	transform: translateY(-50%);
	width: 54px;
	height: 54px;
	font-size: 34px;
	line-height: 1;
}

.oci-glb__nav:hover {
	transform: translateY(-50%) scale(1.06);
}

.oci-glb__prev { left: 24px; }
.oci-glb__next { right: 24px; }

/* Légende + compteur */
.oci-glb__caption {
	position: absolute;
	bottom: 26px;
	left: 50%;
	transform: translateX(-50%);
	max-width: 80vw;
	text-align: center;
	color: rgba(255, 255, 255, 0.92);
	font-size: 15px;
	line-height: 1.4;
}

.oci-glb__counter {
	position: absolute;
	top: 28px;
	left: 28px;
	color: rgba(255, 255, 255, 0.7);
	font-size: 14px;
	letter-spacing: 0.5px;
}

/* Mobile */
@media (max-width: 768px) {
	.oci-glb__nav {
		width: 44px;
		height: 44px;
		font-size: 28px;
	}
	.oci-glb__prev { left: 10px; }
	.oci-glb__next { right: 10px; }
	.oci-glb__close { top: 14px; right: 14px; }
	.oci-glb__counter { top: 18px; left: 16px; }
	.oci-glb__stage,
	.oci-glb__img { max-width: 96vw; }
}

/* Accessibilité : on respecte la préférence de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
	.oci-glb,
	.oci-glb__img {
		transition: none;
	}
	.oci-glb__spinner {
		animation-duration: 1.4s;
	}
}
