/*
 * Artcore LastFM Covers: neutral base styles. Colours follow the surrounding
 * text (currentColor), so the box works on light and dark themes; themes can
 * restyle the alfm-* classes. Accent: --alfm-accent (default: --accent, amber).
 */

.alfm {
	--alfm-accent: var(--accent, #e7b46a);
	--alfm-cover: 40px;
	font-size: 13px;
	line-height: 1.35;
}

.alfm__list {
	display: grid;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
	transition: opacity 0.4s;
}

.alfm__list.is-entering {
	opacity: 0;
}

.alfm__track {
	margin: 0;
}

.alfm__item {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}

a.alfm__item:hover .alfm__name {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.alfm__cover {
	flex: none;
	width: var(--alfm-cover);
	height: var(--alfm-cover);
	border-radius: 6px;
	object-fit: cover;
	background: rgba(127, 127, 127, 0.18);
}

/* No cover on Last.fm: a small vinyl record. */
.alfm__cover--none {
	background:
		radial-gradient(circle, var(--alfm-accent) 0 13%, #111 14% 17%, transparent 18%),
		repeating-radial-gradient(circle, #222 0 1.5px, #161616 1.5px 3px);
}

.alfm__info {
	display: grid;
	flex: 1;
	min-width: 0;
}

.alfm__info > span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.alfm__name {
	font-weight: 500;
}

.alfm__artist,
.alfm__album,
.alfm__time {
	font-size: 0.92em;
	opacity: 0.72;
}

.alfm__time {
	font-size: 0.85em;
	opacity: 0.55;
}

.is-now .alfm__time {
	color: var(--alfm-accent);
	opacity: 1;
}

/* The track playing now: a little larger, with an equaliser. */
.alfm__track.is-first {
	--alfm-cover: 52px;
}

.alfm__eq {
	display: flex;
	flex: none;
	gap: 2px;
	align-items: flex-end;
	height: 14px;
}

.alfm__eq i {
	width: 3px;
	height: 100%;
	border-radius: 1px;
	background: var(--alfm-accent);
	transform-origin: bottom;
	animation: alfm-eq 1s ease-in-out infinite alternate;
}

.alfm__eq i:nth-child(2) {
	animation-delay: -0.4s;
}

.alfm__eq i:nth-child(3) {
	animation-delay: -0.7s;
}

@keyframes alfm-eq {
	from {
		transform: scaleY(0.25);
	}

	to {
		transform: scaleY(1);
	}
}

.alfm__profile {
	display: inline-block;
	margin-top: 12px;
	font-size: 0.85em;
	opacity: 0.6;
	color: inherit;
}

.alfm__profile:hover {
	opacity: 1;
}

.alfm__empty {
	margin: 0;
	opacity: 0.6;
}

@media (prefers-reduced-motion: reduce) {
	.alfm__eq i {
		animation: none;
	}

	.alfm__list {
		transition: none;
	}
}
