/* =============================================================================
   StillEmo Spotify Carousel — Frontend Styles
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Section wrapper
   ----------------------------------------------------------------------------- */
.spotify-carousel-section {
	padding: var(--space-10) 0 var(--space-12);
	background: var(--color-bg);
}

.spotify-section-title {
	display: flex;
	align-items: center;
	gap: var(--space-2);
}

.spotify-wordmark-icon {
	color: #1db954; /* Spotify green */
	flex-shrink: 0;
}

/* -----------------------------------------------------------------------------
   Prev / Next controls (sit in .section-header alongside the title)
   ----------------------------------------------------------------------------- */
.spotify-carousel-controls {
	display: flex;
	gap: var(--space-2);
	align-items: center;
}

.spotify-nav-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid var(--color-border);
	background: var(--color-surface);
	color: var(--color-text-secondary);
	cursor: pointer;
	transition:
		background var(--transition-fast),
		border-color var(--transition-fast),
		color var(--transition-fast);
	flex-shrink: 0;
}

.spotify-nav-btn:hover:not(:disabled) {
	background: #1db954;
	border-color: #1db954;
	color: #fff;
}

.spotify-nav-btn:disabled {
	opacity: 0.3;
	cursor: default;
	pointer-events: none;
}

/* -----------------------------------------------------------------------------
   Carousel outer — wraps the scrollable track.
   A right-edge gradient signals that more content exists.
   ----------------------------------------------------------------------------- */
.spotify-carousel-outer {
	position: relative;
	margin-top: var(--space-5);
}

/* Right-fade indicator: fades out to background colour */
.spotify-carousel-outer::after {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 96px;
	background: linear-gradient(to right, transparent, var(--color-bg) 90%);
	pointer-events: none;
	z-index: 2;
	transition: opacity 0.25s;
}

/* Hide the fade when the track is fully scrolled to the end */
.spotify-carousel-outer.is-at-end::after {
	opacity: 0;
}

/* -----------------------------------------------------------------------------
   Track — the horizontally scrollable flex row
   ----------------------------------------------------------------------------- */
.spotify-track {
	--card-gap: 16px;
	--peek: 56px;   /* how much of the next card peeks into view */

	display: flex;
	gap: var(--card-gap);
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;   /* Firefox */
	padding-bottom: 4px;     /* keep border-radius / box-shadow visible */
}

.spotify-track::-webkit-scrollbar {
	display: none;   /* Chrome / Safari */
}

/* -----------------------------------------------------------------------------
   Cards
   Mobile: show 1 full card + peek of the next
   Desktop (≥ 768 px): show 3 full cards + peek of the 4th
   ----------------------------------------------------------------------------- */
.spotify-card {
	flex: 0 0 calc(100% - var(--peek) - var(--card-gap));
	scroll-snap-align: start;
	min-width: 0;
}

@media (min-width: 768px) {
	.spotify-card {
		/* (container - peek - 2 gaps) / 3  →  exactly 3 cards + one peeking gap */
		flex: 0 0 calc((100% - var(--peek) - 2 * var(--card-gap)) / 3);
	}
}

/* Make every iframe fill its card and respect Spotify's border-radius */
.spotify-card iframe {
	display: block;
	width: 100%;
	border-radius: 12px;
}

/* -----------------------------------------------------------------------------
   Sponsored badge
   ----------------------------------------------------------------------------- */
.spotify-card.is-sponsored {
	position: relative;
}

.spotify-sponsored-badge {
	display: inline-block;
	margin-top: 6px;
	padding: 2px 7px;
	border-radius: 3px;
	background: transparent;
	border: 1px solid var(--color-border, #333);
	color: var(--color-text-muted, #888);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1.4;
}

