/**
 * UpToDownSoft Screenshots — grid + lightbox.
 */

/* ------------------------------------------------------------------ grid */

.utd-shots {
	--utd-shots-cols: 4;
	--utd-shots-gap: 14px;
	--utd-shots-radius: 8px;
	--utd-shots-ratio: 16 / 10;
	--utd-shots-border: #e3e6ec;
	margin: 2em 0;
}

.utd-shots__title {
	margin: 0 0 .6em;
	font-size: 1.35em;
	line-height: 1.3;
}

.utd-shots__grid {
	display: grid;
	grid-template-columns: repeat(var(--utd-shots-cols), minmax(0, 1fr));
	gap: var(--utd-shots-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.utd-shots__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.utd-shots__figure {
	margin: 0;
}

.utd-shots__link {
	display: block;
	position: relative;
	overflow: hidden;
	border: 1px solid var(--utd-shots-border);
	border-radius: var(--utd-shots-radius);
	background: #0d0f14;
	line-height: 0;
	box-shadow: none;
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.utd-shots__link:hover,
.utd-shots__link:focus-visible {
	transform: translateY(-2px);
	border-color: #b9c2d0;
	box-shadow: 0 6px 18px rgba(15, 20, 30, .18);
}

.utd-shots__link:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
}

.utd-shots__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--utd-shots-ratio);
	object-fit: cover;
}

/* The magnifier badge only appears once the lightbox script is active. */
.utd-shots-ready .utd-shots__link::after {
	content: "";
	position: absolute;
	right: 8px;
	bottom: 8px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(12, 15, 22, .72) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0A4.5 4.5 0 1 1 14 9.5 4.5 4.5 0 0 1 9.5 14M10 7v2H8v1h2v2h1v-2h2V9h-2V7z'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
	opacity: 0;
	transition: opacity .18s ease;
	pointer-events: none;
}

.utd-shots-ready .utd-shots__link:hover::after,
.utd-shots-ready .utd-shots__link:focus-visible::after {
	opacity: 1;
}

.utd-shots__caption {
	margin: .5em 0 0;
	font-size: .85em;
	line-height: 1.4;
	color: #5a6273;
}

@media (max-width: 782px) {
	.utd-shots__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		--utd-shots-gap: 10px;
	}
}

/* -------------------------------------------------------------- lightbox */

html.utd-lb-open,
html.utd-lb-open body {
	overflow: hidden;
}

.utd-lb {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	grid-template-columns: auto 1fr auto;
	grid-template-rows: auto 1fr auto auto;
	grid-template-areas:
		"bar bar bar"
		"prev stage next"
		"caption caption caption"
		"thumbs thumbs thumbs";
	color: #fff;
	font-size: 15px;
	line-height: 1.4;
	-webkit-user-select: none;
	user-select: none;
}

.utd-lb.is-open {
	display: grid;
}

.utd-lb__backdrop {
	position: absolute;
	inset: 0;
	background: #0b0d12;
	background: radial-gradient(circle at 50% 40%, #1a1f2b 0%, #0b0d12 75%);
}

.utd-lb__bar {
	grid-area: bar;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
}

.utd-lb__counter {
	margin: 0;
	font-size: .95em;
	font-variant-numeric: tabular-nums;
	letter-spacing: .02em;
	color: rgba(255, 255, 255, .82);
}

.utd-lb__btn,
.utd-lb__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .08);
	color: #fff;
	cursor: pointer;
	transition: background .16s ease, transform .16s ease;
}

.utd-lb__btn:hover,
.utd-lb__nav:hover {
	background: rgba(255, 255, 255, .18);
}

.utd-lb__btn:focus-visible,
.utd-lb__nav:focus-visible,
.utd-lb__thumb:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.utd-lb__btn svg,
.utd-lb__nav svg {
	width: 24px;
	height: 24px;
	fill: currentColor;
}

.utd-lb__nav {
	position: relative;
	align-self: center;
	margin: 0 10px;
	width: 52px;
	height: 52px;
}

.utd-lb__prev {
	grid-area: prev;
}

.utd-lb__next {
	grid-area: next;
}

.utd-lb__nav[hidden] {
	display: none;
}

.utd-lb__stage {
	grid-area: stage;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	min-height: 0;
	padding: 4px;
}

.utd-lb__figure {
	margin: 0;
	max-width: 100%;
	max-height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.utd-lb__img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	border-radius: 6px;
	background: rgba(255, 255, 255, .04);
	box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
	transform-origin: 50% 50%;
	transition: transform .22s ease;
	touch-action: pan-y;
}

.utd-lb.is-zoomable .utd-lb__img {
	cursor: zoom-in;
}

.utd-lb.is-zoomable .utd-lb__img.is-zoomed {
	cursor: grab;
	touch-action: none;
}

.utd-lb.is-zoomable .utd-lb__img.is-zoomed:active {
	cursor: grabbing;
}

.utd-lb.is-loading .utd-lb__img {
	opacity: .35;
}

.utd-lb__caption {
	grid-area: caption;
	position: relative;
	margin: 0;
	padding: 10px 24px 0;
	text-align: center;
	font-size: .9em;
	color: rgba(255, 255, 255, .78);
}

.utd-lb__caption[hidden] {
	display: none;
}

.utd-lb__thumbs {
	grid-area: thumbs;
	position: relative;
	display: flex;
	gap: 8px;
	justify-content: center;
	overflow-x: auto;
	scrollbar-width: thin;
	padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
}

.utd-lb__thumbs[hidden] {
	display: none;
}

.utd-lb__thumb {
	flex: 0 0 auto;
	width: 88px;
	height: 56px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 6px;
	background: rgba(255, 255, 255, .06);
	overflow: hidden;
	cursor: pointer;
	opacity: .55;
	transition: opacity .16s ease, border-color .16s ease, transform .16s ease;
}

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

.utd-lb__thumb:hover {
	opacity: .85;
}

.utd-lb__thumb.is-active {
	opacity: 1;
	border-color: #fff;
	transform: translateY(-2px);
}

@media (max-width: 640px) {
	.utd-lb__nav {
		width: 44px;
		height: 44px;
		margin: 0 4px;
	}

	.utd-lb__thumb {
		width: 64px;
		height: 42px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.utd-shots__link,
	.utd-lb__img,
	.utd-lb__btn,
	.utd-lb__nav,
	.utd-lb__thumb {
		transition: none;
	}
}

@media (prefers-color-scheme: dark) {
	.utd-shots {
		--utd-shots-border: #303643;
	}

	.utd-shots__caption {
		color: #a7b0c0;
	}
}
