/* ---------- Ticker rows ---------- */
.pgt-gallery {
	--pgt-height: 160px;
	--pgt-gap: 8px;
	--pgt-row-height: var(--pgt-height);
	display: flex;
	flex-direction: column;
	gap: var(--pgt-gap);
	width: 100%;
	overflow: hidden;
}

.pgt-row {
	overflow: hidden;
	width: 100%;
}

.pgt-track {
	display: flex;
	width: max-content;
	will-change: transform;
}

.pgt-gallery.is-ready .pgt-row--right .pgt-track {
	animation: pgt-scroll-right var(--pgt-duration, 60s) linear infinite;
}

.pgt-gallery.is-ready .pgt-row--left .pgt-track {
	animation: pgt-scroll-left var(--pgt-duration, 60s) linear infinite;
}

/* Stop the row being hovered (or keyboard-focused), and everything while the lightbox is open. */
.pgt-row:hover .pgt-track,
.pgt-row:has(.pgt-item:focus-visible) .pgt-track,
.pgt-gallery.is-paused .pgt-track {
	animation-play-state: paused;
}

@keyframes pgt-scroll-left {
	from { transform: translateX(0); }
	to   { transform: translateX(calc(-1 * var(--pgt-shift, 50%))); }
}

@keyframes pgt-scroll-right {
	from { transform: translateX(calc(-1 * var(--pgt-shift, 50%))); }
	to   { transform: translateX(0); }
}

.pgt-item {
	flex: 0 0 auto;
	display: block;
	height: var(--pgt-row-height);
	margin-right: var(--pgt-gap); /* margin (not flex gap) so the loop width is exact */
	overflow: hidden;
	cursor: zoom-in;
	background: #eee;
}

.pgt-item img {
	display: block;
	height: 100%;
	width: auto;
	max-width: none;
	transition: transform 0.35s ease, filter 0.35s ease;
}

.pgt-item:hover img,
.pgt-item:focus-visible img {
	transform: scale(1.05);
	filter: brightness(1.05);
}

.pgt-item:focus-visible {
	outline: 3px solid #2271b1;
	outline-offset: -3px;
}

@media (max-width: 600px) {
	.pgt-gallery {
		--pgt-row-height: calc(var(--pgt-height) * 0.7);
	}
}

/* Respect reduced-motion: no auto-scroll, let people swipe/scroll instead. */
@media (prefers-reduced-motion: reduce) {
	.pgt-gallery.is-ready .pgt-track {
		animation: none;
	}
	.pgt-row {
		overflow-x: auto;
	}
}

/* ---------- Lightbox ---------- */
.pgt-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 48px 64px;
	background: rgba(0, 0, 0, 0.9);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.pgt-lightbox__figure {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 100%;
	max-height: 100%;
}

.pgt-lightbox__img {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 140px);
	width: auto;
	height: auto;
	object-fit: contain;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
	transform: scale(0.96);
	transition: transform 0.25s ease;
}

.pgt-lightbox.is-open .pgt-lightbox__img {
	transform: scale(1);
}

.pgt-lightbox__caption {
	margin-top: 12px;
	color: #ddd;
	font-size: 15px;
	text-align: center;
}

.pgt-lightbox__caption:empty {
	display: none;
}

.pgt-lightbox button {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
}

.pgt-lightbox button:hover,
.pgt-lightbox button:focus-visible {
	background: rgba(255, 255, 255, 0.28);
	outline: none;
}

.pgt-lightbox__close { top: 16px; right: 16px; }
.pgt-lightbox__prev  { left: 12px; top: 50%; transform: translateY(-50%); }
.pgt-lightbox__next  { right: 12px; top: 50%; transform: translateY(-50%); }

@media (max-width: 600px) {
	.pgt-lightbox { padding: 64px 12px; }
	.pgt-lightbox__prev,
	.pgt-lightbox__next { top: auto; bottom: 12px; transform: none; }
}

body.pgt-lightbox-open {
	overflow: hidden;
}
