/* Sponsor Gallery: square tiles. Sizes and colors come from CSS variables set on .spgal. */
.spgal { --spgal-cols: 4; --spgal-size: 150px; --spgal-fcols: 3; --spgal-fsize: 200px; --spgal-mcols: 2; --spgal-gap: 8px; --spgal-pad: 8px; --spgal-radius: 4px; --spgal-bg: #fff; --spgal-border: #ddd; }

.spgal .spgal-grid {
	display: grid;
	grid-template-columns: repeat(var(--spgal-cols), minmax(0, var(--spgal-size)));
	gap: var(--spgal-gap);
	list-style: none;
	margin: 0 0 var(--spgal-gap);
	padding: 0;
	justify-content: center;
}
.spgal .spgal-grid:last-child { margin-bottom: 0; }
.spgal .spgal-grid--featured { grid-template-columns: repeat(var(--spgal-fcols), minmax(0, var(--spgal-fsize))); }
.spgal--align-left .spgal-grid { justify-content: start; }

.spgal .spgal-tile { margin: 0; padding: 0; list-style: none; min-width: 0; }
.spgal .spgal-tile::before, .spgal .spgal-tile::marker { content: none; }

.spgal .spgal-box {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	width: 100%;
	box-sizing: border-box;
	padding: var(--spgal-pad);
	background: var(--spgal-bg);
	border: 1px solid var(--spgal-border);
	border-radius: var(--spgal-radius);
	overflow: hidden;
	text-decoration: none;
	box-shadow: none;
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.spgal .spgal-box img,
.spgal .spgal-box .spgal-img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: contain;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.spgal--hover a.spgal-box:hover,
.spgal--hover a.spgal-box:focus-visible { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, .12); }
.spgal a.spgal-box:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.spgal .spgal-caption { display: block; margin-top: 4px; font-size: .8em; line-height: 1.3; text-align: center; overflow-wrap: anywhere; }
.spgal .spgal-heading { margin: 0 0 var(--spgal-gap); font-weight: 600; text-align: center; }
.spgal--align-left .spgal-heading { text-align: left; }

/* Info text + kiosk link */
.spgal .spgal-info { text-align: center; margin: calc(var(--spgal-gap) * 2) 0; }
.spgal .spgal-info:first-child { margin-top: 0; }
.spgal .spgal-info:last-child { margin-bottom: 0; }
.spgal--align-left .spgal-info { text-align: left; }
.spgal .spgal-info-text > :first-child { margin-top: 0; }
.spgal .spgal-info-text > :last-child { margin-bottom: 0; }
.spgal .spgal-kiosk-wrap { margin: .75em 0 0; }
.spgal .spgal-kiosk--button {
	display: inline-block;
	padding: .6em 1.4em;
	border: 1px solid currentColor;
	border-radius: var(--spgal-radius);
	text-decoration: none;
	font-weight: 600;
	line-height: 1.3;
	transition: opacity .15s ease, transform .15s ease;
}
.spgal .spgal-kiosk--button:hover,
.spgal .spgal-kiosk--button:focus-visible { opacity: .88; transform: translateY(-1px); }
.spgal .spgal-kiosk--link { font-weight: 600; }

.spgal-wrap .spgal-title { margin-top: 0; margin-bottom: .75em; }

@media (max-width: 600px) {
	.spgal .spgal-grid,
	.spgal .spgal-grid--featured { grid-template-columns: repeat(var(--spgal-mcols), minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
	.spgal .spgal-box { transition: none; }
	.spgal--hover a.spgal-box:hover { transform: none; }
}
