/**
 * Visor de la galería de trabajos.
 *
 * Capa a pantalla completa con la foto ampliada, flechas, pie de foto y
 * contador. Se carga solo en las páginas que usan [aranda_gallery].
 */

.aranda-gallery__item a.aranda-gallery__link {
	display: block;
	cursor: zoom-in;
}

.aranda-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: clamp(8px, 2vw, 24px);
	padding: clamp(56px, 7vh, 76px) clamp(12px, 3vw, 40px) clamp(44px, 6vh, 60px);
	background: #061432;
	color: #fff;
	overscroll-behavior: contain;
	animation: aranda-lightbox-fade 0.18s ease-out;
}

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

@keyframes aranda-lightbox-fade {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

.aranda-lightbox__figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	min-width: 0;
	max-width: min(1200px, 100%);
	max-height: 100%;
	margin: 0;
}

.aranda-lightbox__img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: calc(100vh - 200px);
	max-height: calc(100dvh - 200px);
	border-radius: 4px;
	background: #fff;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.aranda-lightbox__caption {
	max-width: 60ch;
	margin: 0;
	color: #dfe6f2;
	font-size: clamp(0.85rem, 0.4vw + 0.75rem, 1rem);
	line-height: 1.5;
	text-align: center;
	text-wrap: balance;
}

.aranda-lightbox__counter {
	position: absolute;
	left: 50%;
	bottom: clamp(12px, 2vh, 20px);
	margin: 0;
	color: #c3cee2;
	font-size: 0.8125rem;
	letter-spacing: 0.08em;
	transform: translateX(-50%);
}

.aranda-lightbox button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.aranda-lightbox button:hover {
	border-color: rgba(255, 255, 255, 0.6);
	background: rgba(255, 255, 255, 0.22);
}

.aranda-lightbox button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.aranda-lightbox__close {
	position: absolute;
	top: clamp(10px, 2vh, 20px);
	right: clamp(10px, 2vw, 24px);
	width: 44px;
	height: 44px;
	font-size: 1.5rem;
}

.aranda-lightbox__nav {
	flex: 0 0 auto;
}

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

@media (max-width: 640px) {
	.aranda-lightbox {
		flex-wrap: wrap;
		align-content: center;
		gap: 16px;
		padding: 64px 14px 56px;
	}

	.aranda-lightbox__figure {
		flex: 1 0 100%;
	}

	.aranda-lightbox__img {
		max-height: calc(100vh - 230px);
		max-height: calc(100dvh - 230px);
	}

	.aranda-lightbox .aranda-lightbox__nav {
		order: 3;
		width: 46px;
		height: 46px;
		font-size: 1.5rem;
	}

	.aranda-lightbox__nav--prev {
		margin-left: auto;
	}

	.aranda-lightbox__nav--next {
		margin-right: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.aranda-lightbox {
		animation: none;
	}

	.aranda-lightbox button {
		transition: none;
	}
}
