/* ---------- Tile ---------- */
.pfgt { display: flex; flex-direction: column; gap: 0; width: 100%; }

/* The tile is a div (role=button) so global/theme <button> styles can't touch it */
.pfgt .pfgt-open {
	display: block; width: 100%; margin: 0; padding: 0; border: 0 !important; border-radius: 0;
	background: none !important; box-shadow: none !important; outline: none !important;
	text-align: inherit; font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.pfgt .pfgt-open:hover, .pfgt .pfgt-open:active, .pfgt .pfgt-open:focus {
	background: none !important; border: 0 !important; box-shadow: none !important; outline: none !important; color: inherit;
}
.pfgt .pfgt-open:focus-visible { outline: 3px solid currentColor !important; outline-offset: 4px; }
.pfgt.pfgt--no-focus .pfgt-open:focus-visible { outline: none !important; }

.pfgt-frame { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: #e7e7e7; }
.pfgt-frame img {
	position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none;
	object-fit: cover; opacity: 0;
	transition: opacity var(--pfgt-fade, 1.2s) ease, transform .6s ease;
}
/* Before JS runs, show the first image */
.pfgt-frame:not(.is-ready) img:first-child { opacity: 1; }
.pfgt-frame.is-ready img.is-active { opacity: 1; }

.pfgt .pfgt-title { margin: 0 !important; cursor: pointer; }

/* ---------- Lightbox (edit these to restyle) ---------- */
.pfgt-lb {
	--pfgt-lb-bg: rgba(10, 10, 10, .96);
	--pfgt-lb-fg: #fff;
	--pfgt-lb-btn-bg: rgba(255, 255, 255, .12);
	--pfgt-lb-btn-bg-hover: rgba(255, 255, 255, .28);
	position: fixed; inset: 0; z-index: 999999; display: none;
	background: var(--pfgt-lb-bg); color: var(--pfgt-lb-fg);
}
.pfgt-lb.is-open { display: block; }
.pfgt-lb-viewport { position: absolute; inset: 0; overflow: hidden; }
.pfgt-lb-track { display: flex; height: 100%; transition: transform 450ms cubic-bezier(.4, 0, .2, 1); }
.pfgt-lb-slide {
	flex: 0 0 100%; height: 100%; box-sizing: border-box; padding: 64px 88px 32px;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.pfgt-lb-slide img { display: block; max-width: 100%; max-height: calc(100vh - 190px); width: auto; height: auto; object-fit: contain; border-radius: var(--pfgt-lb-img-radius, 0); }
.pfgt-lb-cap { margin-top: 16px; max-width: 70ch; min-height: 1.4em; text-align: center; font-size: var(--pfgt-lb-cap-size, 16px); line-height: 1.4; color: var(--pfgt-lb-fg); }

.pfgt-lb .pfgt-lb-btn {
	position: absolute; z-index: 2; display: flex; align-items: center; justify-content: center;
	width: 48px; height: 48px; min-width: 0; padding: 0 !important; margin: 0; border: 0 !important; border-radius: 50% !important;
	background: var(--pfgt-lb-btn-bg) !important; color: var(--pfgt-lb-fg) !important; box-shadow: none !important;
	outline: none !important; cursor: pointer; line-height: 1; transition: background .2s;
}
.pfgt-lb .pfgt-lb-btn:hover, .pfgt-lb .pfgt-lb-btn:focus {
	background: var(--pfgt-lb-btn-bg-hover) !important; border: 0 !important; color: var(--pfgt-lb-fg) !important;
	box-shadow: none !important; outline: none !important;
}
.pfgt-lb .pfgt-lb-btn:focus-visible { outline: 3px solid var(--pfgt-lb-fg) !important; outline-offset: 2px; }
.pfgt-lb-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pfgt-lb-prev  { left: 20px;  top: 50%; transform: translateY(-50%); }
.pfgt-lb-next  { right: 20px; top: 50%; transform: translateY(-50%); }
.pfgt-lb-close { top: 18px; right: 20px; }

@media (max-width: 640px) {
	.pfgt-lb-slide { padding: 64px 12px 24px; }
	.pfgt-lb-prev, .pfgt-lb-next { top: auto; bottom: 20px; transform: none; }
	.pfgt-lb-prev { left: 20px; }
	.pfgt-lb-next { right: 20px; }
}
@media (prefers-reduced-motion: reduce) {
	.pfgt-frame img, .pfgt-lb-track { transition: none; }
}
