/**
 * Generic lightbox chrome, adapted from sliceofcactus-astro/public/css/style.css.
 *
 * Shared as-is (no per-template overrides) by single-photo, single-creation,
 * the front page's filmstrip and Projet 52 — the reference implementation is
 * the single-photo contact sheet (template-parts/single/photo-contact-sheet.php),
 * driven by the shared assets/scripts/components/lightbox.js controller.
 */

.lightbox {
	position: fixed;
	z-index: 10005;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	gap: 1rem;
	background: rgb(20 18 16 / 94%);
	opacity: 0;
	transition: opacity .4s;
	visibility: hidden;
}

.lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.lightbox__fig {
	max-width: min(90vw, 1560px);
	text-align: center;
}

.lightbox__fig img {
	width: auto;
	height: 78vh;
	max-width: 100%;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 30px 60px -20px #000;
}

.lightbox__fig figcaption {
	margin-top: 1rem;
	color: var(--flash);
	font-family: var(--font-display);
	letter-spacing: .1em;
}

.lightbox__close {
	position: absolute;
	top: 1.4rem;
	right: 1.6rem;
	padding: 0;
	border: 0;
	background: none;
	color: var(--paper);
	font-size: 2rem;
	cursor: pointer;
}

.lightbox__nav {
	flex-shrink: 0;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 2px solid var(--paper);
	border-radius: 50%;
	background: none;
	color: var(--paper);
	font-size: 1.6rem;
	cursor: pointer;
	transition:
		background .3s,
		border-color .3s,
		color .3s;
}

.lightbox__nav:hover,
.lightbox__nav:focus-visible {
	border-color: var(--flash);
	background: var(--flash);
	color: var(--ink);
}

.lightbox--filmstrip {
	padding-bottom: 7.5rem;
}

.lightbox--filmstrip .lightbox__fig img {
	height: 80vh;
}

.lightbox__strip-wrap {
	position: absolute;
	inset: auto 0 0;
	display: flex;
	align-items: center;
	gap: .5rem;
	padding: 1rem 1rem 1.25rem;
	background: linear-gradient(to top, rgb(0 0 0 / 70%), transparent);
}

.lightbox__strip {
	display: flex;
	flex: 1;
	justify-content: safe center;
	gap: .5rem;
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.lightbox__strip::-webkit-scrollbar {
	display: none;
}

.lightbox__strip-nav {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 2px solid var(--paper);
	border-radius: 50%;
	background: none;
	color: var(--paper);
	font-size: 1.1rem;
	cursor: pointer;
	transition:
		background .3s,
		border-color .3s,
		color .3s;
}

.lightbox__strip-nav:hover,
.lightbox__strip-nav:focus-visible {
	border-color: var(--flash);
	background: var(--flash);
	color: var(--ink);
}

.lightbox__strip__item {
	flex-shrink: 0;
	width: 64px;
	height: 64px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 3px;
	overflow: hidden;
	background: none;
	cursor: pointer;
	opacity: .5;
	transition: opacity .25s, border-color .25s;
}

.lightbox__strip__item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.lightbox__strip__item.is-active,
.lightbox__strip__item:hover,
.lightbox__strip__item:focus-visible {
	border-color: var(--flash);
	opacity: 1;
}

@media (max-width: 560px) {
	.lightbox {
		padding: 4rem .75rem 2rem;
		gap: .35rem;
	}

	.lightbox__nav {
		width: 42px;
		height: 42px;
	}

	.lightbox--filmstrip {
		padding-bottom: 6rem;
	}

	.lightbox--filmstrip .lightbox__fig img {
		height: 52vh;
	}

	.lightbox__strip__item {
		width: 48px;
		height: 48px;
	}

	.lightbox__strip-nav {
		width: 28px;
		height: 28px;
		font-size: .9rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lightbox,
	.lightbox__nav,
	.lightbox__strip__item,
	.lightbox__strip-nav {
		transition-duration: .01ms;
	}
}