/**
 * cto-lightbox.css — styling for the dependency-free gallery lightbox
 * (assets/js/cto-lightbox.js). Dark full-viewport overlay, image shown at its
 * real proportion (object-fit: contain — never cropped, per the fidelity
 * contract), filename caption, side prev/next arrows, top-right close.
 */

/* Clickable affordance on gallery photos (delegation targets these). */
.cto-gallery img,
.cto-group-grid .group-photo img {
	cursor: zoom-in;
}

.cto-lightbox[hidden] {
	display: none;
}

.cto-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4vmin;
	background: rgba( 0, 0, 0, 0.9 );
	/* Above the sticky header. */
}

/* Freeze background scroll while the lightbox is open. */
html.cto-lightbox-open {
	overflow: hidden;
}

.cto-lightbox__figure {
	margin: 0;
	max-width: 92vw;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
}

.cto-lightbox__img {
	display: block;
	max-width: 92vw;
	max-height: 82vh;
	width: auto;
	height: auto;
	object-fit: contain; /* real proportion, never cropped */
	box-shadow: 0 6px 40px rgba( 0, 0, 0, 0.5 );
}

.cto-lightbox__caption {
	color: #fff;
	font-size: 14px;
	line-height: 1.4;
	text-align: center;
	opacity: 0.85;
	word-break: break-word;
}

.cto-lightbox__nav,
.cto-lightbox__close {
	position: absolute;
	background: transparent;
	border: 0;
	color: #fff;
	cursor: pointer;
	line-height: 1;
	padding: 0;
	opacity: 0.75;
	transition: opacity 0.15s ease;
}

.cto-lightbox__nav:hover,
.cto-lightbox__close:hover,
.cto-lightbox__nav:focus-visible,
.cto-lightbox__close:focus-visible {
	opacity: 1;
	outline: none;
}

.cto-lightbox__nav:focus-visible,
.cto-lightbox__close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 4px;
}

.cto-lightbox__nav {
	top: 50%;
	transform: translateY( -50% );
	width: 64px;
	height: 64px;
	font-size: 48px;
}

.cto-lightbox__nav--prev {
	left: 2vmin;
}

.cto-lightbox__nav--next {
	right: 2vmin;
}

.cto-lightbox__nav[hidden] {
	display: none;
}

.cto-lightbox__close {
	top: 2vmin;
	right: 2vmin;
	width: 48px;
	height: 48px;
	font-size: 36px;
}

@media ( max-width: 600px ) {
	.cto-lightbox__nav {
		width: 44px;
		height: 44px;
		font-size: 34px;
	}
	.cto-lightbox__nav--prev {
		left: 0;
	}
	.cto-lightbox__nav--next {
		right: 0;
	}
}
