/* Photographs opened large over the page (TD-166): loaded only where a
   gallery is shown. */
[data-at-lb] {
	cursor: zoom-in;
}

.at-lb-open {
	overflow: hidden;
}

.at-lb {
	position: fixed;
	inset: 0;
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr) 64px;
	grid-template-rows: auto minmax(0, 1fr);
	width: 100vw;
	max-width: none;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(0, 28, 25, 0.94);
	color: #fff;
}

.at-lb:not([open]) {
	display: none;
}

.at-lb::backdrop {
	background: rgba(0, 28, 25, 0.94);
}

.at-lb__bar {
	grid-column: 1 / -1;
	display: flex;
	gap: 8px;
	align-items: center;
	justify-content: flex-end;
	padding: 12px 16px 0;
}

.at-lb__count {
	margin: 0 auto 0 4px;
	color: rgba(255, 255, 255, 0.85);
	font-size: var(--at-text-sm, 0.875rem);
}

.at-lb__stage {
	grid-column: 2;
	grid-row: 2;
	display: flex;
	flex-direction: column;
	gap: 12px;
	align-items: center;
	justify-content: center;
	min-height: 0;
	margin: 0;
	padding: 12px 0 20px;
}

.at-lb__image {
	display: block;
	max-width: 100%;
	max-height: calc(100dvh - 150px);
	width: auto;
	height: auto;
	border-radius: 8px;
	object-fit: contain;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
	transition: opacity 0.25s ease;
	user-select: none;
	-webkit-user-drag: none;
	touch-action: pan-y;
}

.at-lb.is-loading .at-lb__image {
	opacity: 0.35;
}

.at-lb__caption {
	max-width: 70ch;
	color: rgba(255, 255, 255, 0.9);
	font-size: var(--at-text-sm, 0.875rem);
	text-align: center;
}

.at-lb__button {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	cursor: pointer;
}

.at-lb__button:hover {
	border-color: var(--at-gold, #c9a227);
	background: var(--at-gold, #c9a227);
	color: var(--at-green-deep, #003832);
}

.at-lb__button:focus-visible {
	outline: 3px solid var(--at-gold, #c9a227);
	outline-offset: 2px;
}

.at-lb__button[hidden] {
	display: none;
}

.at-lb__previous,
.at-lb__next {
	grid-row: 2;
	align-self: center;
	justify-self: center;
	z-index: 1;
}

.at-lb__previous {
	grid-column: 1;
}

.at-lb__next {
	grid-column: 3;
}

/* Phones: the photograph takes the width; the arrows sit over its edges. */
@media (max-width: 599.98px) {
	.at-lb {
		grid-template-columns: minmax(0, 1fr);
	}

	.at-lb__stage {
		grid-column: 1;
		padding-inline: 8px;
	}

	.at-lb__previous,
	.at-lb__next {
		position: absolute;
		top: 50%;
		transform: translateY(-50%);
		background: rgba(0, 28, 25, 0.6);
	}

	.at-lb__previous {
		left: 10px;
	}

	.at-lb__next {
		right: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.at-lb__image {
		transition: none;
	}
}
