/**
 * Isola Edipo — Lightbox
 * Accento SOLO viola. Controlli a pillola, molto nero pieno attorno all'immagine.
 */
.ie-lightbox {
	--ie-lb-accent: #003a72;
	--ie-lb-ink:    #141b2e;
	--ie-lb-paper:  #F8F7F0;

	position: fixed;
	inset: 0;
	z-index: 9999;
	display: none;
	align-items: center;
	justify-content: center;
}

.ie-lightbox.is-open {
	display: flex;
}

html.ie-lightbox-lock {
	overflow: hidden;
}

/* ---- Backdrop ---- */
.ie-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(34, 34, 34, 0.94);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	animation: ie-lb-fade 0.2s ease;
}

/* ---- Stage & immagine ---- */
.ie-lightbox__stage {
	position: relative;
	z-index: 1;
	margin: auto;
	max-width: min(92vw, 1200px);
	max-height: 88vh;
}

.ie-lightbox__figure {
	margin: 0;
}

.ie-lightbox__img {
	display: block;
	width: auto;
	height: auto;
	max-width: 92vw;
	max-height: 78vh;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.05);
	opacity: 0;
	transform: scale(0.98);
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.ie-lightbox__img.is-loaded {
	opacity: 1;
	transform: none;
}

.ie-lightbox__caption {
	margin-top: 14px;
	text-align: center;
	color: var(--ie-lb-paper);
	font-family: 'Manrope', system-ui, sans-serif;
	font-size: 0.9rem;
	line-height: 1.4;
	opacity: 0.8;
}

.ie-lightbox__caption[hidden] {
	display: none;
}

/* ---- Controlli a pillola ---- */
.ie-lightbox__btn {
	position: absolute;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	cursor: pointer;
	color: #fff;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 999px;
	line-height: 1;
	transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.ie-lightbox__btn:hover,
.ie-lightbox__btn:focus-visible {
	background: var(--ie-lb-accent);
	outline: none;
}

.ie-lightbox__btn:focus-visible {
	box-shadow: 0 0 0 3px rgba(127, 68, 255, 0.5);
}

.ie-lightbox__btn[hidden] {
	display: none;
}

.ie-lightbox__close {
	top: max(18px, env(safe-area-inset-top));
	right: 18px;
	width: 46px;
	height: 46px;
	font-size: 26px;
}

.ie-lightbox__prev,
.ie-lightbox__next {
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	font-size: 30px;
}

.ie-lightbox__prev {
	left: 18px;
}

.ie-lightbox__next {
	right: 18px;
}

.ie-lightbox__prev:hover,
.ie-lightbox__prev:focus-visible,
.ie-lightbox__next:hover,
.ie-lightbox__next:focus-visible {
	transform: translateY(-50%) scale(1.06);
}

/* ---- Contatore ---- */
.ie-lightbox__counter {
	position: absolute;
	bottom: 22px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2;
	padding: 6px 14px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.12);
	color: var(--ie-lb-paper);
	font-family: 'Manrope', system-ui, sans-serif;
	font-size: 0.78rem;
	letter-spacing: 0.04em;
}

@keyframes ie-lb-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@media (max-width: 600px) {
	.ie-lightbox__prev,
	.ie-lightbox__next {
		width: 44px;
		height: 44px;
		font-size: 26px;
	}
	.ie-lightbox__prev { left: 8px; }
	.ie-lightbox__next { right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
	.ie-lightbox__img,
	.ie-lightbox__btn,
	.ie-lightbox__backdrop {
		transition: none;
		animation: none;
	}
}

/* ---- Trigger nella galleria ---- */
.gallery .lightbox-trigger {
	display: block;
	width: 100%;
	height: 100%;
	cursor: zoom-in;
	text-decoration: none;
	color: inherit;
}
