/* Stream Platforms Widget styles — all rules scoped under .sp- prefix
   so nothing here can leak into or clash with the active theme.

   Sizing strategy:
   - Fixed rem/px sizes are used throughout instead of vw-based clamp().
     vw units scale off the full browser viewport, not the widget's own
     column width — that's what was making the card render too large
     on wide screens (even inside a narrow theme content column) and
     too small on some mobile themes that shrink the root font size.
   - Sizes below are set to look right at the widths WordPress content
     columns actually use (roughly 320–640px), with just two small
     breakpoints (container query, with a @media fallback) to tighten
     spacing on very narrow placements like sidebars.
   - This is pure CSS: no extra requests, no JS, no markup changes. */

.sp-widget-wrap {
	width: 100%;
	max-width: 640px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	box-sizing: border-box;
	container-type: inline-size;
	container-name: sp-widget;
}

.sp-widget-wrap * {
	box-sizing: border-box;
}

.sp-widget-heading {
	font-size: 1.05rem;
	font-weight: 800;
	letter-spacing: 1px;
	text-transform: uppercase;
	margin: 0 0 1rem;
	line-height: 1.25;
}

.sp-player-card {
	position: relative;
	background: linear-gradient(160deg, #2b1c14 0%, #120b08 100%);
	border-radius: 16px;
	padding: 16px;
	color: #ffffff;
	overflow: hidden;
}

.sp-player-top {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 18px;
	padding-right: 90px;
}

.sp-cover {
	width: 64px;
	height: 64px;
	border-radius: 10px;
	object-fit: cover;
	flex-shrink: 0;
	display: block;
}

.sp-meta {
	flex: 1;
	min-width: 120px;
}

.sp-title {
	font-size: 1.05rem;
	font-weight: 800;
	line-height: 1.25;
	margin: 0 0 4px;
	word-break: break-word;
}

.sp-artist {
	font-size: 0.85rem;
	font-weight: 600;
	opacity: 0.85;
	margin: 0;
	word-break: break-word;
}

.sp-badge {
	position: absolute;
	top: 16px;
	right: 16px;
	display: flex;
	align-items: center;
	gap: 6px;
	color: #ff9d1f;
	font-weight: 700;
	font-size: 0.75rem;
	white-space: nowrap;
}

.sp-badge svg {
	color: #ff9d1f;
	flex-shrink: 0;
	width: 16px;
	height: 16px;
}

.sp-controls {
	display: flex;
	align-items: center;
	gap: 12px;
}

.sp-play-btn {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 2px solid #ffffff;
	background: transparent;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
	padding: 0;
	transition: background-color 0.2s ease;
}

.sp-play-btn svg {
	width: 18px;
	height: 18px;
}

.sp-play-btn:hover,
.sp-play-btn:focus-visible {
	background: rgba(255, 255, 255, 0.12);
}

.sp-progress-area {
	flex: 1;
	min-width: 0;
}

.sp-times {
	display: flex;
	justify-content: space-between;
	font-weight: 700;
	font-size: 0.78rem;
	margin-bottom: 6px;
}

.sp-waveform {
	position: relative;
	display: flex;
	align-items: flex-end;
	gap: 2px;
	height: 26px;
	cursor: pointer;
}

.sp-bar {
	flex: 1 1 auto;
	background: rgba(255, 255, 255, 0.28);
	height: var(--h, 40%);
	min-width: 2px;
	border-radius: 1px;
}

.sp-progress-fill {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 0%;
	background: rgba(255, 255, 255, 0.18);
	pointer-events: none;
}

.sp-no-audio-msg {
	margin: 12px 0 0;
	font-size: 0.85rem;
	opacity: 0.7;
}

/* Audiomack's own embedded player, used instead of .sp-player-card
   whenever an Audiomack embed link has been filled in. */
.sp-audiomack-embed {
	position: relative;
	width: 100%;
	border-radius: 16px;
	overflow: hidden;
	line-height: 0;
}

.sp-audiomack-embed iframe {
	display: block;
	width: 100%;
	height: 252px;
	border: 0;
}

.sp-links {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 14px;
}

.sp-link {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 12px 16px;
	border-radius: 40px;
	text-decoration: none;
	color: #ffffff;
	font-weight: 700;
	line-height: 1.3;
	transition: filter 0.15s ease, transform 0.1s ease;
}

.sp-link:hover,
.sp-link:focus-visible {
	filter: brightness(1.06);
}

.sp-link:active {
	transform: scale(0.99);
}

.sp-link svg {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
}

.sp-link small {
	display: block;
	font-weight: 500;
	font-size: 0.68rem;
	letter-spacing: .04em;
	text-transform: uppercase;
	opacity: 0.9;
}

.sp-link strong {
	display: block;
	font-size: 0.95rem;
	letter-spacing: 0.5px;
}

.sp-link-text {
	text-align: center;
	min-width: 0;
}

.sp-audiomack {
	background: #ffa723;
	color: #1a1a1a;
}

.sp-audiomack svg {
	color: #1a1a1a;
}

.sp-youtube {
	background: #ff0302;
}

.sp-spotify {
	background: #1db954;
}

.sp-apple {
	background: #fa2851;
}

/* --- Container-query refinements: react to the widget's own width,
       useful when it sits in a narrow sidebar/column even on a wide
       screen, not just on small devices. --- */
@container sp-widget (max-width: 380px) {
	.sp-player-card {
		padding: 14px;
	}

	.sp-player-top {
		padding-right: 0;
	}

	.sp-cover {
		width: 52px;
		height: 52px;
	}

	.sp-title {
		font-size: 0.95rem;
	}

	.sp-badge {
		position: static;
		margin-top: 8px;
	}

	.sp-link {
		flex-direction: column;
		gap: 2px;
	}
}

@container sp-widget (min-width: 381px) and (max-width: 480px) {
	.sp-badge {
		position: static;
		margin-top: 8px;
	}
}

/* --- Viewport-based fallback for browsers without container query
       support (roughly pre-2023). Mirrors the rules above. --- */
@supports not (container-type: inline-size) {
	@media (max-width: 480px) {
		.sp-player-card {
			padding: 14px;
		}

		.sp-player-top {
			padding-right: 0;
		}

		.sp-cover {
			width: 52px;
			height: 52px;
		}

		.sp-title {
			font-size: 0.95rem;
		}

		.sp-badge {
			position: static;
			margin-top: 8px;
		}
	}

	@media (max-width: 360px) {
		.sp-link {
			flex-direction: column;
			gap: 2px;
		}
	}
}
