/* Lightbox / carrusel de imágenes — posts y páginas */

.entry-content img.iap-lightbox-trigger {
	cursor: zoom-in;
}

html.iap-lightbox-open,
body.iap-lightbox-open {
	overflow: hidden;
}

.iap-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.iap-lightbox[hidden] {
	display: none !important;
}

.iap-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(5, 8, 16, 0.92);
	cursor: zoom-out;
}

.iap-lightbox__panel {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: min(100vw, 100%);
	height: min(100vh, 100%);
	padding: 3.5rem 3.25rem 3rem;
	box-sizing: border-box;
	pointer-events: none;
}

.iap-lightbox__panel > * {
	pointer-events: auto;
}

.iap-lightbox__stage {
	margin: 0;
	max-width: 100%;
	max-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
}

.iap-lightbox__img {
	display: block;
	max-width: min(92vw, 1200px);
	max-height: min(78vh, 900px);
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
	background: transparent;
	user-select: none;
	-webkit-user-drag: none;
}

.iap-lightbox__caption {
	max-width: min(90vw, 720px);
	margin: 0;
	padding: 0 0.5rem;
	color: rgba(255, 255, 255, 0.82);
	font-size: 0.9rem;
	line-height: 1.45;
	text-align: center;
	font-family: Georgia, "Times New Roman", serif;
}

.iap-lightbox__caption[hidden] {
	display: none !important;
}

.iap-lightbox__close,
.iap-lightbox__nav {
	appearance: none;
	border: 0;
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.iap-lightbox__close:hover,
.iap-lightbox__nav:hover,
.iap-lightbox__close:focus-visible,
.iap-lightbox__nav:focus-visible {
	background: rgba(100, 255, 218, 0.18);
	color: #64ffda;
	outline: none;
}

.iap-lightbox__close {
	position: absolute;
	top: 0.85rem;
	right: 0.85rem;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 999px;
	font-size: 1.75rem;
	line-height: 1;
	z-index: 2;
}

.iap-lightbox__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 999px;
	font-size: 1.35rem;
	z-index: 2;
}

.iap-lightbox__nav--prev {
	left: 0.65rem;
}

.iap-lightbox__nav--next {
	right: 0.65rem;
}

.iap-lightbox__nav[hidden] {
	display: none !important;
}

.iap-lightbox__counter {
	position: absolute;
	left: 50%;
	bottom: 1rem;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.7);
	font-size: 0.8rem;
	letter-spacing: 0.04em;
	font-family: system-ui, -apple-system, Segoe UI, sans-serif;
	pointer-events: none;
}

@media (max-width: 640px) {
	.iap-lightbox__panel {
		padding: 3.25rem 0.5rem 2.75rem;
	}

	.iap-lightbox__img {
		max-width: 96vw;
		max-height: 72vh;
	}

	.iap-lightbox__nav {
		width: 2.4rem;
		height: 2.4rem;
		font-size: 1.15rem;
	}

	.iap-lightbox__nav--prev {
		left: 0.25rem;
	}

	.iap-lightbox__nav--next {
		right: 0.25rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.iap-lightbox__close,
	.iap-lightbox__nav {
		transition: none;
	}
}
