/* JT Sold Works Gallery — grid + lightbox */

.jt-sold-gallery {
	--jt-min: 220px;
	--jt-gap: 14px;
	--jt-row: 4px;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(var(--jt-min), 1fr));
	gap: var(--jt-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Masonry mode is switched on by JS once it can measure real image heights.
   Without JS the grid still renders as plain rows — just less tightly packed. */
.jt-sold-gallery.is-masonry {
	grid-auto-rows: var(--jt-row);
	align-items: start;
}

.jt-sold-gallery.is-masonry .jt-sold-item {
	grid-row-end: span var(--jt-span, 20);
}

.jt-sold-item {
	margin: 0;
	padding: 0;
	overflow: hidden;
	border-radius: 2px;
	background: #f2f0ed;
}

.jt-sold-trigger {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
	line-height: 0;
	border-radius: inherit;
}

.jt-sold-trigger:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.jt-sold-img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform 0.4s ease, opacity 0.3s ease;
}

@media (hover: hover) {
	.jt-sold-trigger:hover .jt-sold-img {
		transform: scale(1.03);
		opacity: 0.92;
	}
}

@media (prefers-reduced-motion: reduce) {
	.jt-sold-img {
		transition: none;
	}
	.jt-sold-trigger:hover .jt-sold-img {
		transform: none;
	}
}

/* The block sets --jt-min inline, and an inline custom property beats any
   stylesheet rule — so override grid-template-columns directly here instead. */
@media (max-width: 600px) {
	.jt-sold-gallery {
		--jt-gap: 8px;
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	}
}

/* ------------------------------------------------------------------ pager */

.jt-sold-pager {
	margin: 40px 0 10px;
	text-align: center;
}

.jt-sold-pager__count {
	margin: 0 0 14px;
	font-size: 13px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #8a8a8a;
}

.jt-sold-pager__links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
}

.jt-sold-pager__links .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border: 1px solid #ddd;
	border-radius: 2px;
	color: #333;
	text-decoration: none;
	font-size: 15px;
	line-height: 1;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.jt-sold-pager__links a.page-numbers:hover,
.jt-sold-pager__links a.page-numbers:focus-visible {
	background: #f2f0ed;
	border-color: #bbb;
}

.jt-sold-pager__links .page-numbers.current {
	background: #333;
	border-color: #333;
	color: #fff;
}

.jt-sold-pager__links .page-numbers.dots {
	border-color: transparent;
	min-width: 24px;
}

.jt-sold-gallery-empty {
	opacity: 0.7;
	font-style: italic;
}

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

.jt-sold-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(14, 14, 14, 0.96);
	opacity: 0;
	visibility: hidden;
	/* visibility must flip instantly on open (delayed only on close) — animating
	   it means the dialog is un-focusable until the transition finishes, and a
	   throttled animation timeline can leave it invisible altogether. */
	transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.jt-sold-lightbox.is-open {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.25s ease, visibility 0s linear 0s;
}

@media (prefers-reduced-motion: reduce) {
	.jt-sold-lightbox {
		transition: none;
	}
}

.jt-sold-lightbox__figure {
	margin: 0;
	max-width: 92vw;
	max-height: 88vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.jt-sold-lightbox__img {
	max-width: 92vw;
	max-height: 88vh;
	width: auto;
	height: auto;
	object-fit: contain;
	box-shadow: 0 10px 60px rgba(0, 0, 0, 0.5);
	user-select: none;
	-webkit-user-drag: none;
}

.jt-sold-lightbox__btn {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
}

.jt-sold-lightbox__btn:hover,
.jt-sold-lightbox__btn:focus-visible {
	background: rgba(255, 255, 255, 0.24);
	outline: none;
}

.jt-sold-lightbox__prev {
	left: 16px;
}

.jt-sold-lightbox__next {
	right: 16px;
}

.jt-sold-lightbox__close {
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	font-size: 22px;
}

.jt-sold-lightbox__counter {
	position: absolute;
	bottom: 18px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.75);
	font-size: 13px;
	letter-spacing: 0.08em;
	font-variant-numeric: tabular-nums;
}

.jt-sold-lightbox.is-loading .jt-sold-lightbox__img {
	opacity: 0.35;
}

body.jt-sold-lightbox-open {
	overflow: hidden;
}

@media (max-width: 700px) {
	.jt-sold-lightbox__btn {
		width: 42px;
		height: 42px;
		font-size: 22px;
	}
	.jt-sold-lightbox__prev {
		left: 6px;
	}
	.jt-sold-lightbox__next {
		right: 6px;
	}
	.jt-sold-lightbox__img,
	.jt-sold-lightbox__figure {
		max-width: 96vw;
		max-height: 80vh;
	}
}
