/* AzuraCast Player -------------------------------------------------------- */

.azp {
	/* Brand */
	--azp-primary: #0d47a1;
	--azp-secondary: #f5a623;
	--azp-secondary-rgb: 245, 166, 35;

	/* Sticky bar surface. White on primary is 8.63:1. */
	--azp-bg: var(--azp-primary);
	--azp-fg: #ffffff;
	--azp-muted: rgba(255, 255, 255, 0.82);   /* 6.35:1 on primary */
	--azp-line: rgba(255, 255, 255, 0.22);
	--azp-track: rgba(0, 0, 0, 0.25);         /* amber fill reads 5.76:1 on this */

	/* Play control */
	--azp-play: var(--azp-secondary);
	--azp-play-glyph: #1a1200;                /* 9.17:1 on amber */
	--azp-play-hover: #ffb733;                /* 10.68:1 for the glyph, 4.96:1 on the card */

	--azp-radius: 12px;
	--azp-bar-h: 68px;
	--azp-hero-art: 72px;
	--azp-thumb: 28px;
	--azp-bar-art: 46px;
	--azp-bar-pad-x: 22px;
	--azp-bar-pad-y: 9px;

	box-sizing: border-box;
	position: relative;
	color: var(--azp-fg);
	background: var(--azp-bg);
	font-size: 16px;
	line-height: 1.45;
	font-variant-numeric: tabular-nums;
	-webkit-font-smoothing: antialiased;
}

.azp *,
.azp *::before,
.azp *::after {
	box-sizing: inherit;
}

/*
 * Resets carry zero specificity via :where(), so component rules below always
 * win. A plain `.azp button` would outrank them and silently strip styling.
 */
:where(.azp) :is(p, h3, ol, li) {
	margin: 0;
	padding: 0;
	list-style: none;
}

:where(.azp) button {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	margin: 0;
	padding: 0;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

/*
 * No border-radius here. Setting one made every focused control adopt it, so
 * the round play button turned into a rounded square under keyboard
 * navigation. An outline already follows whatever radius the element has, so
 * each control keeps its own shape.
 */
.azp :focus-visible {
	outline: 3px solid var(--azp-secondary);
	outline-offset: 2px;
}

/* --- small labels --------------------------------------------------------- */

.azp__badge,
.azp__station,
.azp__eyebrow,
.azp__recent-head {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* --- live indicator ------------------------------------------------------- */

.azp__badge {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.azp__live {
	flex: none;
	width: 17px;
	height: 17px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
}

.azp__live .azp__live-dot {
	fill: currentColor;
	stroke: none;
}

.azp__live .azp__live-arc {
	opacity: 0.35;
	transition: opacity 0.3s ease;
}

.azp.is-playing .azp__live .azp__live-arc {
	opacity: 1;
	animation: azp-broadcast 1.8s ease-in-out infinite;
}

.azp.is-playing .azp__live .azp__live-arc--far {
	animation-delay: 0.25s;
}

@keyframes azp-broadcast {
	0%, 100% { opacity: 0.3; }
	50%      { opacity: 1; }
}

/* --- play control --------------------------------------------------------- */

.azp__play {
	--azp-play-pad: 0;
	--azp-play-gap: 0;
	position: relative;
	flex: none;
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: var(--azp-play);
	color: var(--azp-play-glyph);
	transition: background-color 0.15s ease;
}

/*
 * The button's geometry is held in custom properties and applied with
 * !important, so a theme rule cannot change padding, gap or spacing on hover
 * and shift the icon. Transform stays ours too — `.site-main .wp-block-button
 * button:hover { transform: … }` outranks any sane selector we could write.
 */
.azp .azp__play {
	padding: var(--azp-play-pad) !important;
	gap: var(--azp-play-gap) !important;
	border-width: 0 !important;
	letter-spacing: 0.01em !important;
	word-spacing: normal !important;
	text-indent: 0 !important;
	margin: 0 !important;
}

.azp .azp__play:hover,
.azp .azp__play:focus,
.azp .azp__play:focus-visible {
	/*
	 * A colour change, never a filter: `filter` promotes the button to its own
	 * compositing layer and re-rasterises the glyph and label, which shifts
	 * them a sub-pixel sideways. That was the hover jitter.
	 */
	background: var(--azp-play-hover);
	filter: none !important;
	transform: none !important;
	translate: none !important;
	scale: none !important;
	rotate: none !important;
}

.azp .azp__play:active {
	transform: scale(0.95) !important;
	translate: none !important;
}

/* Nothing inside the button moves either. */
.azp .azp__play .azp__icon,
.azp .azp__play .azp__glyphs,
.azp .azp__play .azp__play-text,
.azp .azp__play .azp__label {
	transform: none !important;
	translate: none !important;
}

/* Themes sometimes add arrows to buttons on hover; not in ours. */
.azp .azp__play::before {
	content: none !important;
}

.azp__icon {
	grid-area: 1 / 1;
	width: 19px;
	height: 19px;
	fill: currentColor;
}

.azp__spinner { grid-area: 1 / 1; }
.azp__icon--pause { display: none; }

.azp.is-playing .azp__icon--play,
.azp.is-loading .azp__icon--play { display: none; }
.azp.is-playing .azp__icon--pause { display: block; }
.azp.is-loading .azp__icon--pause { display: none; }

.azp__spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	animation: azp-spin 0.7s linear infinite;
}

.azp.is-loading .azp__spinner { display: block; }

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

/* --- volume (sticky bar only) --------------------------------------------- */

.azp__volume {
	display: flex;
	align-items: center;
	gap: 4px;
	color: var(--azp-muted);
}

/*
 * The mute control had no box of its own: only its icon was sized, so the
 * button wrapped an inline SVG sitting on the text baseline, leaving descender
 * space underneath. The icon looked low and the focus ring hugged that
 * lopsided shape. A fixed square with centred content fixes both.
 */
.azp__mute {
	display: grid;
	place-items: center;
	flex: none;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	color: inherit;
	transition: background-color 0.15s ease;
}

.azp__mute:hover {
	background: rgba(255, 255, 255, 0.14);
	color: var(--azp-fg);
}

.azp__mute svg {
	display: block;
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.azp.is-muted .azp__wave { opacity: 0.3; }

/* Full height and a pill radius, so the focus ring is a neat capsule around
   the slider rather than a rectangle clipped to the track. */
.azp__volume input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	width: 84px;
	height: 32px;
	border-radius: 999px;
	background: none;
	margin: 0;
	cursor: pointer;
}

.azp__volume input[type="range"]::-webkit-slider-runnable-track {
	height: 4px;
	border-radius: 2px;
	background: var(--azp-track);
}

.azp__volume input[type="range"]::-moz-range-track {
	height: 4px;
	border-radius: 2px;
	background: var(--azp-track);
}

.azp__volume input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 12px;
	height: 12px;
	margin-top: -4px;
	border-radius: 50%;
	background: var(--azp-fg);
	border: 0;
}

.azp__volume input[type="range"]::-webkit-slider-runnable-track {
	margin: 14px 0;
}

.azp__volume input[type="range"]::-moz-range-track {
	margin: 14px 0;
}

.azp__volume input[type="range"]::-moz-range-thumb {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--azp-fg);
	border: 0;
}

/* --- progress ------------------------------------------------------------- */

.azp__progress {
	height: 3px;
	background: var(--azp-track);
	overflow: hidden;
}

.azp__progress-fill {
	display: block;
	height: 100%;
	width: 0;
	background: var(--azp-secondary);
	transition: width 0.5s linear;
}

/* --- shared text ---------------------------------------------------------- */

.azp__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.azp__listeners {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.azp__ico {
	width: 15px;
	height: 15px;
	fill: currentColor;
	flex: none;
}

.azp__title {
	font-weight: 700;
	letter-spacing: -0.01em;
}

.azp__artist,
.azp__time,
.azp__station,
.azp__eyebrow,
.azp__recent-head,
.azp__listeners,
.azp__empty {
	color: var(--azp-muted);
}

/* --- recently played ------------------------------------------------------ */

.azp__list li {
	display: grid;
	align-items: center;
}

.azp__track {
	min-width: 0;
}

.azp__empty {
	display: block !important;
	font-size: 0.875rem;
}

/* ==========================================================================
   Front page card — a panel in the brand blue, same surface as the bar
   ========================================================================== */

.azp--card .azp__title,
.azp--card .azp__track,
.azp--card .azp__list li,
.azp--card .azp__badge {
	color: var(--azp-fg);
}

.azp--card .azp__artist,
.azp--card .azp__time,
.azp--card .azp__station,
.azp--card .azp__eyebrow,
.azp--card .azp__recent-head,
.azp--card .azp__listeners,
.azp--card .azp__empty,
.azp--card .azp__track-artist {
	color: var(--azp-muted);
}

.azp--card {
	--azp-card-pad-x: 18px;
	max-width: 34rem;
	padding: 16px var(--azp-card-pad-x) 18px;
	border-radius: 16px;
}

.azp--card .azp__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	min-height: 20px;
	margin-bottom: 12px;
}

/* --- now playing row --- */

.azp--card .azp__hero {
	/*
	 * Grid, not flex-wrap: minmax(0, 1fr) lets the middle column shrink below
	 * its content, so a long title can never push the button onto a new line.
	 */
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 14px;
	margin-bottom: 14px;
}

.azp__art--hero {
	flex: none;
	width: var(--azp-hero-art);
	height: var(--azp-hero-art);
	overflow: hidden;
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.2);
}

.azp__art--hero img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.azp--card .azp__now {
	flex: 1 1 auto;
	min-width: 0;
}

.azp--card .azp__eyebrow {
	margin-bottom: 1px;
}

.azp--card .azp__title {
	font-size: 1.25rem;
	line-height: 1.15;
	overflow: hidden;
	white-space: nowrap;
}

/*
 * Long lines are clipped, then scrolled so the whole thing can still be read.
 * The distance and duration are measured in JS and passed in as custom
 * properties; the keyframes hold at each end so it is readable, not a treadmill.
 */
.azp__ticker {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

[data-azp-scroll].is-scrolling .azp__ticker {
	display: inline-block;
	overflow: visible;
	text-overflow: clip;
	animation: azp-ticker var(--azp-ticker-time, 14s) linear infinite;
}

@keyframes azp-ticker {
	0%, 12%  { transform: translateX(0); }
	48%, 62% { transform: translateX(var(--azp-ticker-x, 0)); }
	98%, 100% { transform: translateX(0); }
}

.azp--card .azp__artist {
	font-size: 0.9375rem;
	overflow: hidden;
	white-space: nowrap;
}

/* --- the play button, and the only thing that pulses --- */

/*
 * The card's control is a labelled pill rather than a bare icon: the word is
 * visible to everyone, not just screen readers, and it is a far bigger target.
 */
.azp__play--lg {
	--azp-play-pad: 0 22px 0 49px;
	--azp-play-gap: 0;
	display: inline-flex;
	align-items: center;
	justify-content: flex-start;
	width: auto;
	height: 48px;
	border-radius: 999px;
}

/*
 * Positioned against the button's own left edge, so nothing in the flex row —
 * a theme-injected pseudo-element, a changed gap, a wider label — can push it.
 */
.azp__play--lg .azp__glyphs {
	position: absolute;
	left: 17px;
	top: 50%;
	margin-top: -11px;
}

.azp__glyphs {
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
}

.azp__play--lg .azp__icon {
	width: 22px;
	height: 22px;
}

.azp__play--lg .azp__spinner {
	width: 18px;
	height: 18px;
}

/*
 * Only the active label is in the layout, so the button hugs whichever word is
 * showing — narrower for "Ustavi" than for "Predvajaj". The width therefore
 * changes when playback starts or stops. That is a deliberate state change and
 * reads fine; it is hover jitter that must never happen.
 */
.azp__play-text {
	font-size: 0.9375rem;
	font-weight: 700;
	white-space: nowrap;
}

.azp__label--stop {
	display: none;
}

.azp.is-playing .azp__label--play,
.azp.is-loading .azp__label--play {
	display: none;
}

.azp.is-playing .azp__label--stop,
.azp.is-loading .azp__label--stop {
	display: inline;
}

/*
 * Scaling a ring worked on a circle but stretched into an ellipse once the
 * button became a pill. An expanding box-shadow follows any shape, and uses no
 * transform, so it cannot collide with the pinning above.
 */
.azp__play--lg::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	animation: azp-pulse 2.2s ease-out infinite;
}

.azp.is-playing .azp__play--lg::after,
.azp.is-loading .azp__play--lg::after {
	animation: none;
	box-shadow: none;
}

@keyframes azp-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(var(--azp-secondary-rgb), 0.7); }
	70%  { box-shadow: 0 0 0 14px rgba(var(--azp-secondary-rgb), 0); }
	100% { box-shadow: 0 0 0 0 rgba(var(--azp-secondary-rgb), 0); }
}

/*
 * Progress hides itself whenever the API reports no duration, which is normal
 * for a live broadcast — so it cannot double as the separator. It stays inset
 * under the hero, tied to the track it describes.
 */
.azp--card .azp__progress {
	height: 2px;
	margin: 0 0 14px;
}

/* The separator: always there, edge to edge, cancelling the card padding. */
.azp--card .azp__rule {
	height: 1px;
	margin: 0 calc(var(--azp-card-pad-x) * -1) 14px;
	padding: 0;
	border: 0;
	background: var(--azp-line);
}

/* --- log --- */

.azp--card .azp__recent-head {
	margin-bottom: 4px;
}

/*
 * Five rows on desktop, three on a phone; the rest are behind the toggle, so
 * the card stays short without the log being cut down permanently.
 */
.azp--card .azp__list li {
	/* `auto` sizes the clock column to its content, so the gap before the
	   artwork is the same on every row instead of a fixed guess. */
	grid-template-columns: auto var(--azp-thumb) minmax(0, 1fr);
	column-gap: 9px;
	padding: 5px 0;
}

.azp--card .azp__list li + li {
	border-top: 1px solid var(--azp-line);
}

.azp--card .azp__thumb {
	width: var(--azp-thumb);
	height: var(--azp-thumb);
	border-radius: 4px;
	object-fit: cover;
	background: rgba(0, 0, 0, 0.2);
}

.azp--card .azp__time {
	font-size: 0.75rem;
}

.azp--card .azp__track {
	display: flex;
	flex-direction: column;
	font-size: 0.875rem;
	line-height: 1.25;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Artist first and light, title second and bold — the same order and weight
   as the now-playing block above. */
.azp--card .azp__track-artist {
	display: block;
	order: -1;
	font-weight: 400;
	font-size: 0.75rem;
	color: var(--azp-muted);
}

.azp--card .azp__track-title {
	display: block;
	font-weight: 600;
	font-size: 0.875rem;
}

@media (max-width: 520px) {
	.azp { --azp-hero-art: 60px; }
	.azp--card { padding: 14px 14px 16px; }
	.azp--card .azp__hero {
		grid-template-columns: auto minmax(0, 1fr);
		grid-template-areas:
			"art now"
			"btn btn";
		gap: 12px 12px;
	}
	.azp--card .azp__art--hero { grid-area: art; }
	.azp--card .azp__now { grid-area: now; }
	.azp--card .azp__play--lg { grid-area: btn; }
	.azp--card .azp__title { font-size: 1.0625rem; }
	.azp__play--lg {
		width: 100%;
		height: 46px;
	}
}

.azp__more {
	display: block;
	width: 100%;
	margin-top: 8px;
	padding: 7px 10px;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.12);
	color: var(--azp-fg);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-align: center;
	transition: background-color 0.15s ease;
}

.azp__more:hover {
	background: rgba(255, 255, 255, 0.2);
}

.azp__more[hidden] {
	display: none;
}

/*
 * `.azp__list li { display: grid }` outranks the browser's own
 * `[hidden] { display: none }`, so rows marked hidden kept rendering and the
 * whole log always showed. Anything this stylesheet gives a display value
 * needs its own [hidden] rule at higher specificity.
 */
.azp .azp__artist[hidden],
.azp .azp__track-artist[hidden],
.azp .azp__list li[hidden],
.azp .azp__empty[hidden],
.azp .azp__listeners[hidden],
.azp .azp__more[hidden] {
	display: none !important;
}

/* ==========================================================================
   Sticky bar
   ========================================================================== */

.azp--bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99990;
	display: flex;
	flex-direction: column;
	max-width: none;
	box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.28);
	transform: translateY(110%);
	visibility: hidden;
	transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.3, 1), visibility 0.3s;
}

.azp--bar.is-visible {
	transform: none;
	visibility: visible;
}

.azp--bar .azp__main {
	display: grid;
	grid-template-columns: var(--azp-bar-art) minmax(0, 1fr) auto;
	align-items: center;
	min-height: var(--azp-bar-h);
	padding: var(--azp-bar-pad-y) var(--azp-bar-pad-x);
	gap: 16px;
}

.azp--bar .azp__art {
	width: var(--azp-bar-art);
	height: var(--azp-bar-art);
	overflow: hidden;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.2);
}

.azp--bar .azp__art img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.azp--bar .azp__now {
	min-width: 0;
}

/*
 * Kept to roughly the height of the artwork so the bar stays shallow: the
 * three lines together come to about 46px, matching --azp-bar-art.
 */
.azp--bar .azp__badge {
	font-size: 0.6875rem;
	line-height: 1.2;
	margin-bottom: 0;
}

.azp--bar .azp__now > * {
	line-height: 1.2;
}

.azp--bar .azp__title,
.azp--bar .azp__artist {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.azp--bar .azp__title { font-size: 0.9375rem; line-height: 1.25; }
.azp--bar .azp__artist { font-size: 0.8125rem; line-height: 1.2; }

.azp--bar .azp__controls {
	display: flex;
	align-items: center;
	gap: 12px;
}

.azp--bar .azp__progress { order: -1; }

.azp--bar .azp__recent {
	order: -2;
	max-height: 42vh;
	overflow-y: auto;
	border-bottom: 1px solid var(--azp-line);
	padding: 14px var(--azp-bar-pad-x) 16px;
	background: rgba(0, 0, 0, 0.18);
}

.azp--bar .azp__recent-head {
	margin-bottom: 8px;
}

.azp--bar .azp__list li {
	grid-template-columns: auto 28px minmax(0, 1fr);
	column-gap: 9px;
	padding: 5px 0;
	font-size: 0.875rem;
}

.azp--bar .azp__list li + li {
	border-top: 1px solid var(--azp-line);
}

.azp--bar .azp__thumb {
	width: 28px;
	height: 28px;
	border-radius: 3px;
	object-fit: cover;
	background: rgba(0, 0, 0, 0.2);
}

.azp--bar .azp__track-title::before { content: " — "; }

/*
 * Themes routinely style `li` and list text globally, which was landing dark
 * text on the blue bar. Nothing here relies on inheritance reaching this far.
 */
.azp--bar .azp__recent,
.azp--bar .azp__recent-head,
.azp--bar .azp__list,
.azp--bar .azp__list li,
.azp--bar .azp__track,
.azp--bar .azp__title,
.azp--bar .azp__badge,
.azp--bar .azp__station {
	color: var(--azp-fg);
}

.azp--bar .azp__time,
.azp--bar .azp__track-artist,
.azp--bar .azp__artist,
.azp--bar .azp__listeners,
.azp--bar .azp__recent-head,
.azp--bar .azp__empty {
	color: var(--azp-muted);
}

.azp__expand {
	flex: none;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 6px;
	color: var(--azp-muted);
}

.azp__expand svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform 0.2s ease;
}

.azp__expand:hover { color: var(--azp-fg); }
.azp.is-expanded .azp__expand svg { transform: rotate(180deg); }

html.azp-bar-on body {
	padding-bottom: 68px;
}

@media (max-width: 700px) {
	.azp--bar {
		--azp-bar-h: 60px;
		--azp-bar-art: 40px;
		--azp-bar-pad-x: 14px;
		--azp-bar-pad-y: 8px;
	}
	.azp--bar .azp__volume { display: none; }
	.azp--bar .azp__artist { display: none; }
	.azp--bar .azp__main { gap: 12px; }
	html.azp-bar-on body { padding-bottom: 60px; }
	.azp--bar .azp__list li { grid-template-columns: auto minmax(0, 1fr); }
	.azp--bar .azp__thumb { display: none; }
}

/* --- states --------------------------------------------------------------- */

.azp.is-blocked .azp__badge {
	color: var(--azp-secondary);
	opacity: 1;
}

/*
 * Offline is shown in the status line, never by disabling the button. A
 * control that does nothing when pressed, with no explanation, is worse than
 * one that tries and reports a failure.
 */
.azp.is-offline .azp__play {
	opacity: 0.55;
}

@media (prefers-reduced-motion: reduce) {
	.azp *,
	.azp *::before,
	.azp *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}
	.azp--bar { transition: none; }
	.azp__play--lg::after { display: none; }
}

.azp.is-failed .azp__badge {
	color: var(--azp-secondary);
	opacity: 1;
}
