/* Home gallery lightbox (assets/js/gallery-lightbox.js): a full-screen,
   carousel view of the "Our work" photos. Loaded on the front page only. */

.ci-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000; /* above the sticky header, mobile action bar and Marcel */
	display: flex;
	flex-direction: column;
	background: rgba(28, 25, 23, 0.96); /* ink */
	color: var(--wp--preset--color--porcelain);
	animation: ci-lightbox-fade 0.2s ease-out;
}

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

/* Page behind the dialog shouldn't scroll while it's open. */
.ci-lightbox-open,
.ci-lightbox-open body {
	overflow: hidden;
}

.ci-lightbox__stage {
	position: relative;
	flex: 1;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 64px 88px 8px;
}

.ci-lightbox__image {
	display: block;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 4px;
	transition: opacity 0.2s ease;
	user-select: none;
	-webkit-user-drag: none;
}

.ci-lightbox__image.is-loading {
	opacity: 0.35;
}

.ci-lightbox button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1px solid rgba(248, 243, 238, 0.35);
	border-radius: 50%;
	background: rgba(28, 25, 23, 0.55);
	color: var(--wp--preset--color--porcelain);
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ci-lightbox button:hover {
	background: var(--wp--preset--color--copper);
	border-color: var(--wp--preset--color--copper);
}

.ci-lightbox button:focus-visible {
	outline: 2px solid var(--wp--preset--color--blush);
	outline-offset: 3px;
}

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

.ci-lightbox__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 1;
}

.ci-lightbox__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
}

.ci-lightbox__prev {
	left: 20px;
}

.ci-lightbox__next {
	right: 20px;
}

.ci-lightbox__meta {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 12px 24px 24px;
	text-align: center;
	font-size: 14px;
	line-height: 1.5;
}

.ci-lightbox__counter {
	font-size: 12px;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--blush);
}

.ci-lightbox__caption {
	max-width: 560px;
	color: rgba(248, 243, 238, 0.85);
}

/* Phones: the photo gets the full width and the arrows sit in a row under
   it, beside the counter, instead of overlapping the photo's edges. */
@media (max-width: 599px) {
	.ci-lightbox__stage {
		padding: 68px 12px 8px;
	}
	.ci-lightbox__nav {
		top: auto;
		bottom: -60px;
		transform: none;
	}
	.ci-lightbox__prev {
		left: 16px;
	}
	.ci-lightbox__next {
		right: 16px;
	}
	.ci-lightbox__meta {
		min-height: 72px;
		padding: 12px 80px 20px;
		justify-content: center;
	}
}

@keyframes ci-lightbox-fade {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ci-lightbox,
	.ci-lightbox__image {
		animation: none;
		transition: none;
	}
}
