/* LXB Voice player. The accent color comes from the theme's link color, set inline by Player.php. */

.LXB_VOICE-listen {
	--lxb-voice-accent: #1a5fb4;
	--lxb-voice-ink: #2b2f36;
	--lxb-voice-muted: #6b7280;
	--lxb-voice-line: #e3e5e8;
	--lxb-voice-track: #dfe2e6;
	margin-top: 20px;
	font-size: 15px;
	line-height: 1.3;
	color: var(--lxb-voice-ink);
}

.LXB_VOICE-listen [hidden] { display: none !important; }

.LXB_VOICE-listen button {
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
	background-image: none !important;
	text-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	float: none !important;
	clear: none !important;
	width: auto;
	max-width: none !important;
	min-height: 0 !important;
}

.LXB_VOICE-listen button:focus-visible,
.LXB_VOICE-listen input:focus-visible,
.LXB_VOICE-listen .LXB_VOICE-listen-ai:focus-visible {
	outline: 2px solid var(--lxb-voice-accent);
	outline-offset: 2px;
}

/* The native player is only for readers without JavaScript. */
.LXB_VOICE-listen.is-enhanced .LXB_VOICE-listen-audio { display: none; }
.LXB_VOICE-listen:not(.is-enhanced) .LXB_VOICE-listen-card { display: none; }
.LXB_VOICE-listen-audio { width: 100%; }

/* ---- The card ---- */

.LXB_VOICE-listen-card {
	display: flex;
	clear: none;
	align-items: center;
	gap: 14px;
	padding: 12px 14px;
	border: 1px solid var(--lxb-voice-line);
	border-radius: 10px;
	background: #fff;
	text-align: left;
}

.LXB_VOICE-listen-toggle {
	position: relative;
	flex: 0 0 auto !important;
	margin: 0 !important;
	padding: 0 !important;
	display: grid !important;
	place-items: center;
	width: 44px !important;
	height: 44px !important;
	border-radius: 50% !important;
	background: var(--lxb-voice-accent) !important;
	color: #fff !important;
	transition: transform .15s ease, filter .15s ease;
}

.LXB_VOICE-listen-toggle:hover { filter: brightness(1.1); }
.LXB_VOICE-listen-toggle:active { transform: scale(.94); }

.LXB_VOICE-listen-toggle svg,
.LXB_VOICE-listen-mini-toggle svg { display: block; }

.LXB_VOICE-listen .LXB_VOICE-listen-icon-pause,
.LXB_VOICE-listen.is-playing .LXB_VOICE-listen-icon-play { display: none; }
.LXB_VOICE-listen.is-playing .LXB_VOICE-listen-icon-pause { display: block; }

.LXB_VOICE-listen-spinner {
	display: none;
	position: absolute;
	inset: -4px;
	border: 2px solid transparent;
	border-top-color: var(--lxb-voice-accent);
	border-radius: 50%;
	animation: lxb-voice-spin .8s linear infinite;
}

.LXB_VOICE-listen.is-loading .LXB_VOICE-listen-spinner { display: block; }

@keyframes lxb-voice-spin { to { transform: rotate(360deg); } }

.LXB_VOICE-listen-body {
	flex: 1 1 auto;
	min-width: 0;
}

.LXB_VOICE-listen-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px;
}

.LXB_VOICE-listen-label { font-weight: 600; }

.LXB_VOICE-listen-dot,
.LXB_VOICE-listen-duration { color: var(--lxb-voice-muted); font-variant-numeric: tabular-nums; }

.LXB_VOICE-listen-disclosure {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 4px;
	font-size: 12px;
	color: var(--lxb-voice-muted);
}

.LXB_VOICE-listen .LXB_VOICE-listen-download {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.LXB_VOICE-listen .LXB_VOICE-listen-download:hover { color: var(--lxb-voice-accent); }

.LXB_VOICE-listen-ai {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	cursor: help;
}

/* Once playing, the meta line gives way to the scrubber. */
.LXB_VOICE-listen.is-started .LXB_VOICE-listen-meta { display: none; }

.LXB_VOICE-listen-scrubber {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	color: var(--lxb-voice-muted);
	font-variant-numeric: tabular-nums;
}

.LXB_VOICE-listen-current,
.LXB_VOICE-listen-remaining { flex: 0 0 auto; min-width: 2.6em; }
.LXB_VOICE-listen-remaining { text-align: right; }

/* ---- Range input ---- */

.LXB_VOICE-listen-seek {
	--lxb-voice-pct: 0%;
	flex: 1 1 auto;
	min-width: 60px;
	height: 20px;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

.LXB_VOICE-listen-seek::-webkit-slider-runnable-track {
	height: 4px;
	border-radius: 2px;
	background: linear-gradient(to right, var(--lxb-voice-accent) var(--lxb-voice-pct), var(--lxb-voice-track) var(--lxb-voice-pct));
}

.LXB_VOICE-listen-seek::-moz-range-track { height: 4px; border-radius: 2px; background: var(--lxb-voice-track); }
.LXB_VOICE-listen-seek::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--lxb-voice-accent); }

.LXB_VOICE-listen-seek::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	margin-top: -5px;
	border: 0;
	border-radius: 50%;
	background: var(--lxb-voice-accent);
	box-shadow: 0 1px 2px rgba(0,0,0,.3);
}

.LXB_VOICE-listen-seek::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border: 0;
	border-radius: 50%;
	background: var(--lxb-voice-accent);
}

/* ---- Skip and speed ---- */

.LXB_VOICE-listen-tools {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 4px;
}

.LXB_VOICE-listen-skip {
	display: grid !important;
	place-items: center;
	width: 36px !important;
	height: 36px !important;
	border-radius: 50% !important;
	color: var(--lxb-voice-ink) !important;
}

.LXB_VOICE-listen-skip:hover,
.LXB_VOICE-listen-speed:hover,
.LXB_VOICE-listen-mini-close:hover { background: rgba(0,0,0,.06) !important; }

.LXB_VOICE-listen-speed {
	display: inline-block !important;
	width: auto !important;
	margin: 0 !important;
	min-width: 46px;
	height: 30px;
	padding: 0 8px !important;
	border: 1px solid var(--lxb-voice-line) !important;
	border-radius: 15px !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	font-variant-numeric: tabular-nums;
	color: var(--lxb-voice-ink) !important;
	background: #fff !important;
}

/* The wide layout centers the post header, but a player reads best left-aligned in a card. */
.lxb_af-is_wide .lxb_af-post_header .LXB_VOICE-listen {
	max-width: 640px;
	margin-left: auto;
	margin-right: auto;
}

/* ---- Mini player, pinned to the bottom of the screen while you scroll ---- */

.LXB_VOICE-listen-mini {
	position: fixed;
	z-index: 9999;
	left: 50%;
	/* Pages with a player set viewport-fit=cover, so this keeps clear of the home indicator. */
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	width: min(560px, calc(100vw - 24px));
	transform: translateX(-50%);
	animation: lxb-voice-rise .2s ease-out;
}

.LXB_VOICE-listen-mini-pill {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 10px 8px 8px;
	border-radius: 12px;
	background: #1f2328;
	color: #fff;
	box-shadow: 0 8px 28px rgba(0,0,0,.28);
}

@keyframes lxb-voice-rise { from { opacity: 0; transform: translate(-50%, 12px); } }

.LXB_VOICE-listen-mini-toggle {
	flex: 0 0 auto !important;
	margin: 0 !important;
	padding: 0 !important;
	display: grid !important;
	place-items: center;
	width: 40px !important;
	height: 40px !important;
	border-radius: 50% !important;
	background: #fff !important;
	color: #1f2328 !important;
}

.LXB_VOICE-listen-mini-body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.LXB_VOICE-listen-mini-title {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-size: 14px;
	font-weight: 600;
}

.LXB_VOICE-listen-mini-bar {
	display: block;
	height: 3px;
	border-radius: 2px;
	background: rgba(255,255,255,.25);
	overflow: hidden;
}

.LXB_VOICE-listen-mini-bar span {
	display: block;
	width: 0;
	height: 100%;
	background: #fff;
}

.LXB_VOICE-listen-mini-time {
	flex: 0 0 auto;
	font-size: 12px;
	opacity: .8;
	font-variant-numeric: tabular-nums;
}

.LXB_VOICE-listen-mini .LXB_VOICE-listen-speed {
	color: #fff !important;
	border-color: rgba(255,255,255,.35) !important;
	background: transparent !important;
}

.LXB_VOICE-listen-mini .LXB_VOICE-listen-speed:hover,
.LXB_VOICE-listen-mini-close:hover { background: rgba(255,255,255,.12) !important; }

.LXB_VOICE-listen-mini-close {
	flex: 0 0 auto !important;
	margin: 0 !important;
	padding: 0 !important;
	display: grid !important;
	place-items: center;
	width: 32px !important;
	height: 32px !important;
	border-radius: 50% !important;
	color: #fff !important;
	opacity: .8;
}

/* ---- Compact pill, for the home page and archives ---- */

.LXB_VOICE-listen.is-compact { margin: 14px 0 16px; }

.LXB_VOICE-listen.is-compact .LXB_VOICE-listen-card {
	display: inline-flex !important;
	gap: 8px;
	width: auto !important;
	max-width: 100%;
	padding: 4px 14px 4px 4px;
	border-radius: 999px;
	cursor: pointer;
	vertical-align: middle;
}

.LXB_VOICE-listen.is-compact .LXB_VOICE-listen-card:hover { border-color: var(--lxb-voice-accent); }

.LXB_VOICE-listen.is-compact .LXB_VOICE-listen-toggle {
	width: 30px !important;
	height: 30px !important;
}

.LXB_VOICE-listen.is-compact .LXB_VOICE-listen-toggle svg { width: 16px; height: 16px; }
.LXB_VOICE-listen.is-compact .LXB_VOICE-listen-spinner { inset: -3px; }

.LXB_VOICE-listen.is-compact .LXB_VOICE-listen-meta { display: flex !important; flex-wrap: nowrap; white-space: nowrap; font-size: 14px; }
.LXB_VOICE-listen.is-compact .LXB_VOICE-listen-disclosure,
.LXB_VOICE-listen.is-compact .LXB_VOICE-listen-scrubber,
.LXB_VOICE-listen.is-compact .LXB_VOICE-listen-tools { display: none !important; }

/* ---- Small screens ---- */

@media (max-width: 520px) {
	.LXB_VOICE-listen-card { flex-wrap: wrap; gap: 10px 12px; }
	.LXB_VOICE-listen-body { flex: 1 1 0; }
	.LXB_VOICE-listen-tools { order: 3; flex-basis: 100%; justify-content: center; gap: 20px; }
	.LXB_VOICE-listen-mini-time { display: none; }

	/*
	 * On phones, the mini player is a slim pill on a white band docked to the bottom edge.
	 * iOS Safari draws its own frosted effect behind anything pinned near the bottom, and
	 * colors its toolbar from what touches the edge. A floating player left that effect
	 * ending in a line above the address bar. A band that reaches the edge gives Safari
	 * white to work with, and the pill keeps the player light.
	 */
	.LXB_VOICE-listen-mini {
		left: 0;
		bottom: 0;
		width: 100%;
		transform: none;
		padding: 4px 12px calc(12px + env(safe-area-inset-bottom, 0px));
		/*
		 * A solid color, not a gradient: Safari tints its toolbar from the background-color
		 * of whatever is fixed to the bottom edge, and ignores gradients, which are images.
		 */
		background-color: #fff;
		animation-name: lxb-voice-rise-docked;
	}

	/* The fade from the article into the band sits above it, as its own layer. */
	.LXB_VOICE-listen-mini::before {
		content: '';
		position: absolute;
		left: 0;
		right: 0;
		bottom: 100%;
		height: 18px;
		background: linear-gradient(to bottom, rgba(255,255,255,0), #fff);
		pointer-events: none;
	}

	.LXB_VOICE-listen-mini-pill {
		gap: 10px;
		padding: 5px 6px 5px 5px;
		border-radius: 999px;
		box-shadow: 0 2px 10px rgba(0,0,0,.18);
	}

	.LXB_VOICE-listen-mini-toggle {
		width: 36px !important;
		height: 36px !important;
	}

	.LXB_VOICE-listen-mini-toggle svg { width: 20px; height: 20px; }

	.LXB_VOICE-listen-mini-body { gap: 5px; }
	.LXB_VOICE-listen-mini-title { font-size: 13px; }

	.LXB_VOICE-listen-mini .LXB_VOICE-listen-speed { height: 28px; min-width: 40px; font-size: 12px !important; }
}

/* Room to scroll the end of the page clear of the docked mini player. */
@media (max-width: 520px) {
	body.lxb-voice-mini-open { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important; }
}

@keyframes lxb-voice-rise-docked { from { opacity: 0; transform: translateY(12px); } }

@media (prefers-reduced-motion: reduce) {
	.LXB_VOICE-listen *,
	.LXB_VOICE-listen-mini { animation: none !important; transition: none !important; }
	.LXB_VOICE-listen.is-loading .LXB_VOICE-listen-spinner { border-color: var(--lxb-voice-accent); opacity: .4; }
}

@media print {
	.LXB_VOICE-listen { display: none; }
}
