/*
 * Photo viewer.
 *
 * Dark olive rather than black: the photographs are warm, and pure black makes
 * them look like evidence.
 */
.gaya-lb-open { overflow: hidden; }

/* `display: flex` below outranks the browser's own `[hidden] { display: none }`,
   so without this the viewer never actually closes. */
.gaya-lb[hidden] { display: none; }

.gaya-lb {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: clamp(12px, 4vw, 48px);
	background: rgba(28, 28, 26, 0.94);
	animation: gaya-lb-in 0.18s ease-out;
}

@keyframes gaya-lb-in { from { opacity: 0; } to { opacity: 1; } }

.gaya-lb__stage {
	margin: 0;
	max-width: min(100%, 1400px);
	max-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	min-width: 0;
}

.gaya-lb__stage img {
	max-width: 100%;
	/* Room for the caption below and the padding above. */
	max-height: calc(100vh - 150px);
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 6px;
	display: block;
	transition: opacity 0.15s ease;
}

.gaya-lb.is-loading .gaya-lb__stage img { opacity: 0.35; }

.gaya-lb__caption {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 16px;
	flex-wrap: wrap;
	color: rgba(255, 255, 255, 0.86);
	font-size: 14px;
	line-height: 1.4;
	text-align: center;
	max-width: 60ch;
}

.gaya-lb__count { color: rgba(255, 255, 255, 0.6); font-variant-numeric: tabular-nums; white-space: nowrap; }

.gaya-lb__nav,
.gaya-lb__close {
	flex-shrink: 0;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 0;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.15s ease;
}

.gaya-lb__nav:hover,
.gaya-lb__close:hover { background: rgba(255, 255, 255, 0.24); }

.gaya-lb__nav:focus-visible,
.gaya-lb__close:focus-visible { outline: 2px solid #e8b030; outline-offset: 3px; }

.gaya-lb__close { position: absolute; top: clamp(12px, 3vw, 28px); right: clamp(12px, 3vw, 28px); }

/* On a phone the arrows sit over the image rather than beside it — there is no
   room for a 52px column on either side of a 390px screen. */
@media (max-width: 700px) {
	.gaya-lb { padding: 12px; }
	.gaya-lb__nav { position: absolute; bottom: 20px; }
	.gaya-lb__nav--prev { left: 20px; }
	.gaya-lb__nav--next { right: 20px; }
	.gaya-lb__stage img { max-height: calc(100vh - 190px); }
	.gaya-lb__caption { padding-inline: 84px; }
}

@media (prefers-reduced-motion: reduce) {
	.gaya-lb { animation: none; }
	.gaya-lb__stage img { transition: none; }
}
