/**
 * Sitewide Background Music - mini player.
 * Override --sbm-accent, --sbm-bg or --sbm-fg in your theme to restyle it.
 */

.sbm-audio {
	display: none !important;
}

.sbm-player {
	--sbm-bg: rgba( 18, 18, 20, 0.82 );
	--sbm-fg: #f2efe9;
	--sbm-accent: #d8a43c;

	position: fixed;
	z-index: 99990;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 12px 7px 10px;
	border-radius: 999px;
	background: var( --sbm-bg );
	color: var( --sbm-fg );
	box-shadow: 0 4px 22px rgba( 0, 0, 0, 0.28 );
	backdrop-filter: blur( 8px );
	-webkit-backdrop-filter: blur( 8px );
	font-size: 13px;
	line-height: 1;
	transition: opacity 0.25s ease;
}

.sbm-bottom-right { right: 18px; bottom: 18px; }
.sbm-bottom-left  { left: 18px;  bottom: 18px; }
.sbm-top-right    { right: 18px; top: 18px; }
.sbm-top-left     { left: 18px;  top: 18px; }

.sbm-player.is-done {
	display: none;
}

.sbm-player [hidden] {
	display: none !important;
}

.sbm-title,
.sbm-nudge {
	max-width: 170px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 12.5px;
	font-weight: 500;
	letter-spacing: 0.01em;
}

.sbm-title {
	color: var( --sbm-fg );
	opacity: 0.92;
	padding: 0 2px;
}

.sbm-nudge {
	margin: 0;
	padding: 0 2px;
	border: 0;
	background: none;
	color: var( --sbm-accent );
	font-family: inherit;
	line-height: 1;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

.sbm-nudge:hover {
	opacity: 0.8;
}

.sbm-nudge:focus-visible {
	outline: 2px solid var( --sbm-accent );
	outline-offset: 3px;
	border-radius: 3px;
}

.sbm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.sbm-btn:hover {
	background: rgba( 255, 255, 255, 0.12 );
}

.sbm-btn:focus-visible {
	outline: 2px solid var( --sbm-accent );
	outline-offset: 2px;
}

.sbm-btn svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
	stroke: none;
}

.sbm-btn svg path[stroke] {
	fill: none;
	stroke: currentColor;
}

/* Level indicator: moving when sound is on, flat when it is not. */
.sbm-eq {
	display: inline-flex;
	align-items: flex-end;
	gap: 2px;
	width: 14px;
	height: 14px;
	margin-right: 2px;
}

.sbm-eq i {
	display: block;
	width: 3px;
	height: 40%;
	border-radius: 1px;
	background: var( --sbm-accent );
	transform-origin: bottom;
	animation: sbm-bounce 1.1s ease-in-out infinite;
}

.sbm-eq i:nth-child( 2 ) { animation-delay: 0.18s; }
.sbm-eq i:nth-child( 3 ) { animation-delay: 0.36s; }

.sbm-player.is-silent .sbm-eq i {
	animation: none;
	height: 25%;
	opacity: 0.45;
}

@keyframes sbm-bounce {
	0%, 100% { height: 30%; }
	50%      { height: 100%; }
}

.sbm-vol {
	width: 62px;
	height: 3px;
	margin: 0 2px 0 4px;
	padding: 0;
	appearance: none;
	-webkit-appearance: none;
	background: rgba( 255, 255, 255, 0.28 );
	border-radius: 999px;
	cursor: pointer;
}

.sbm-vol::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 11px;
	height: 11px;
	border: 0;
	border-radius: 50%;
	background: var( --sbm-accent );
	cursor: pointer;
}

.sbm-vol::-moz-range-thumb {
	width: 11px;
	height: 11px;
	border: 0;
	border-radius: 50%;
	background: var( --sbm-accent );
	cursor: pointer;
}

.sbm-vol:focus-visible {
	outline: 2px solid var( --sbm-accent );
	outline-offset: 3px;
}

.sbm-loading {
	cursor: progress;
}

@media ( max-width: 600px ) {
	.sbm-vol { width: 46px; }
	.sbm-title,
	.sbm-nudge { max-width: 108px; font-size: 12px; }
	.sbm-bottom-right,
	.sbm-bottom-left { bottom: 12px; }
}

@media ( prefers-reduced-motion: reduce ) {
	.sbm-eq i {
		animation: none;
		height: 60%;
	}
	.sbm-player { transition: none; }
}
