/**
 * Pro Stylez Narration — custom branded "Listen to this article" player.
 *
 * The native <audio> UI is hidden; these styles drive a custom purple
 * play/pause button, progress bar, and mute toggle (wired by the inline
 * script in templates/player.php). Brand: gold #e0b945 frame + Pro Stylez
 * purple #7b2fbe controls on the dark card. Consistent across browsers.
 */

.psn-player {
	--psn-gold: #e0b945;
	--psn-gold-2: #c9a84c;
	--psn-dark: #16111f;
	--psn-dark-2: #1f1830;
	--psn-purple: #7b2fbe;
	--psn-purple-2: #9b4fd8;
	--psn-line: rgba(224, 185, 69, 0.28);
	--psn-text: #f3eefb;
	--psn-muted: #b9aed0;

	box-sizing: border-box;
	display: block;
	width: 100%;
	margin: 0 0 1.75em;
	padding: 18px 20px;
	background: linear-gradient(135deg, var(--psn-dark) 0%, var(--psn-dark-2) 100%);
	border: 1px solid var(--psn-line);
	border-left: 4px solid var(--psn-gold);
	border-radius: 12px;
	color: var(--psn-text);
	box-shadow: 0 6px 22px rgba(11, 8, 20, 0.28);
}

.psn-player *,
.psn-player *::before,
.psn-player *::after {
	box-sizing: border-box;
}

.psn-player__top {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 14px;
}

/* Purple play / pause button (replaces the gold badge). */
.psn-player__play {
	flex: 0 0 auto;
	width: 46px;
	height: 46px;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	padding: 0;
	position: relative;
	background: var(--psn-purple);
	box-shadow: 0 0 0 4px rgba(123, 47, 190, 0.18);
	transition: background 0.15s ease, transform 0.15s ease;
}

.psn-player__play:hover {
	background: var(--psn-purple-2);
	transform: translateY(-1px);
}

.psn-player__play:focus-visible {
	outline: 2px solid var(--psn-gold);
	outline-offset: 2px;
}

/* Play triangle. */
.psn-player__play::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 54%;
	transform: translate(-50%, -50%);
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 8px 0 8px 13px;
	border-color: transparent transparent transparent #fff;
}

/* Pause bars (shown while playing). */
.psn-player__play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 42%;
	transform: translate(-50%, -50%);
	display: none;
	width: 5px;
	height: 15px;
	background: #fff;
	box-shadow: 7px 0 0 #fff;
}

.psn-player.is-playing .psn-player__play::before { display: none; }
.psn-player.is-playing .psn-player__play::after { display: block; }

.psn-player__head { min-width: 0; }

.psn-player__heading {
	font-family: "Playfair Display", Georgia, "Times New Roman", serif;
	font-weight: 700;
	font-size: 1.18rem;
	line-height: 1.2;
	margin: 0;
	color: var(--psn-gold);
}

.psn-player__byline {
	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 0.78rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	margin: 2px 0 0;
	color: var(--psn-muted);
}

/* Control row: time · progress · time · mute. */
.psn-player__ctrls {
	display: flex;
	align-items: center;
	gap: 12px;
}

.psn-time {
	flex: 0 0 auto;
	min-width: 38px;
	font-size: 12px;
	color: var(--psn-muted);
	font-variant-numeric: tabular-nums;
}
.psn-cur { text-align: right; }
.psn-dur { text-align: left; }

.psn-bar {
	flex: 1 1 auto;
	height: 7px;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.16);
	position: relative;
	cursor: pointer;
}
.psn-bar:focus-visible {
	outline: 2px solid var(--psn-gold);
	outline-offset: 3px;
}

.psn-fill {
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	width: 0;
	border-radius: 4px;
	background: linear-gradient(90deg, var(--psn-purple), var(--psn-purple-2));
}
.psn-fill::after {
	content: "";
	position: absolute;
	right: -5px;
	top: 50%;
	transform: translateY(-50%);
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.psn-mute {
	flex: 0 0 auto;
	position: relative;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	padding: 0;
	background: transparent;
	color: var(--psn-purple);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.psn-mute:hover {
	color: var(--psn-purple-2);
	background: rgba(123, 47, 190, 0.12);
}
.psn-mute:focus-visible {
	outline: 2px solid var(--psn-gold);
	outline-offset: 2px;
}

/* Muted state: hide the sound waves and show a slash. */
.psn-player.is-muted .psn-wave { display: none; }
.psn-player.is-muted .psn-mute::after {
	content: "";
	position: absolute;
	width: 24px;
	height: 2px;
	background: currentColor;
	transform: rotate(-45deg);
}

/* The native audio element is the playback engine only — never shown. */
.psn-audio { display: none; }

@media ( max-width: 480px ) {
	.psn-player { padding: 15px 15px; }
	.psn-player__heading { font-size: 1.05rem; }
	.psn-player__play { width: 42px; height: 42px; }
	.psn-time { min-width: 34px; }
}
