/* Spotify Credits Grid — theme-neutral defaults; override freely in your theme. */
.scg-grid {
	--scg-gap: 12px;
	--scg-overlay: rgba(10, 10, 10, 0.82);
	--scg-text: #fff;
	--scg-muted: rgba(255, 255, 255, 0.72);
	display: grid;
	grid-template-columns: repeat(var(--scg-cols, 4), minmax(0, 1fr));
	gap: var(--scg-gap);
	margin: 0;
	padding: 0;
}
@media (max-width: 900px) { .scg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .scg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.scg-tile {
	position: relative;
	margin: 0;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #111;
	outline: none;
}
.scg-tile img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease, filter 0.35s ease;
}

.scg-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 4px;
	padding: 14px;
	background: var(--scg-overlay);
	color: var(--scg-text);
	font-size: 13px;
	line-height: 1.35;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
	overflow: hidden;
}

/* Reveal: mouse hover, keyboard focus, or tap (is-active set by scg.js). */
.scg-tile:hover .scg-overlay,
.scg-tile:focus-within .scg-overlay,
.scg-tile.is-active .scg-overlay {
	opacity: 1;
	pointer-events: auto;
}
.scg-tile:hover img,
.scg-tile:focus-within img,
.scg-tile.is-active img {
	transform: scale(1.04);
	filter: blur(1px);
}

.scg-overlay a { color: inherit; text-decoration: none; }
.scg-overlay a:hover, .scg-overlay a:focus-visible { text-decoration: underline; }

.scg-main { display: flex; flex-direction: column; }
.scg-title { font-weight: 700; font-size: 15px; }
.scg-artist { color: var(--scg-muted); }
.scg-sub { color: var(--scg-muted); font-size: 12px; }

.scg-tracks {
	list-style: none;
	margin: 2px 0;
	padding: 0;
	font-size: 12px;
}
.scg-tracks li {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.scg-tracks li::before { content: "– "; color: var(--scg-muted); }
.scg-more { color: var(--scg-muted); }

.scg-roles {
	margin-top: 6px;
	padding-top: 6px;
	border-top: 1px solid rgba(255, 255, 255, 0.2);
	font-size: 11px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* ---------- Filter bar ---------- */
.scg-filters {
	--scg-accent: currentColor;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 16px;
}
.scg-filter {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 7px 14px;
	border: 1px solid rgba(127, 127, 127, 0.45);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.scg-filter:hover { border-color: var(--scg-accent); }
.scg-filter:focus-visible { outline: 2px solid var(--scg-accent); outline-offset: 2px; }
.scg-filter[aria-pressed="true"] {
	background: #111;
	border-color: #111;
	color: #fff;
}
.scg-count { opacity: 0.6; font-size: 11px; }

.scg-tile[hidden] { display: none; }
.scg-empty { opacity: 0.7; }

/* Under an active filter, emphasise that role on each tile and fade the others. */
.scg-wrap[data-active-role]:not([data-active-role="all"]) .scg-role { opacity: 0.55; }
.scg-wrap[data-active-role="cowritten"] .scg-role[data-role="cowritten"],
.scg-wrap[data-active-role="produced"] .scg-role[data-role="produced"],
.scg-wrap[data-active-role="mixed"] .scg-role[data-role="mixed"],
.scg-wrap[data-active-role="mastered"] .scg-role[data-role="mastered"] {
	opacity: 1;
	font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
	.scg-tile img, .scg-overlay { transition: none; }
	.scg-tile:hover img, .scg-tile:focus-within img, .scg-tile.is-active img { transform: none; }
}
