/**
 * MediaPlyr Skin: EPK Sidebar
 * The dark audio card in a press-kit sidebar: transparent controls, tight spacing, muted tracklist.
 * Controls: play, progress, current-time, mute, volume
 */

/* Ported from the hand-rolled Plyr styling that lived in presskit-view.php before
 * the kit moved onto MediaPlyr. Same look, MediaPlyr's class names.
 *
 * The kit's own custom properties (--accent-2, --ink, --line) are defined on :root
 * in presskit-view.php and resolve here because the skin loads on the same page.
 * Fallbacks are given anyway so the skin is not nonsense if it is ever previewed
 * outside a kit — a bare var() with no fallback renders as an invalid value, which
 * on a color means the property is dropped entirely. */

.mp-skin-epk {

/* MediaPlyr 105+ applies a site `default_color` as --mp-default-color through a
 * zero-specificity :where() rule, so a skin that sets --plyr-color-main simply
 * wins by ordinary cascade. Before 105 the default went inline on this wrapper
 * and repainted every skin, which needed !important to beat; that workaround is
 * gone. A colour passed to one player explicitly still outranks this, which is
 * correct — that is a caller asking for it. */
	--plyr-color-main: var(--accent-2, #b2402f);
	--plyr-control-spacing: 8px;
	color: #cfc8bd;
}

/* The card behind it is already dark; Plyr's own control bar background would
 * paint a lighter slab on top of it. */
.mp-skin-epk .plyr--audio .plyr__controls { background: transparent; }

/* Rebalanced for a narrow sidebar: the playhead takes the slack, the volume
 * slider is capped so it cannot push the progress bar to nothing. */
.mp-skin-epk .plyr__progress__container { flex: 1 1 auto; min-width: 0; }
.mp-skin-epk .plyr__time               { font-size: .72rem; padding: 0 4px; }
.mp-skin-epk .plyr__volume             { flex: 0 0 auto; min-width: 0; }
.mp-skin-epk .plyr__volume input[type="range"] { max-width: 52px; }

/* Tracklist ------------------------------------------------------------- */

.mp-skin-epk .mp-tracklist {
	list-style: none;
	margin: 16px 0 0;
	padding: 0;
}
.mp-skin-epk .mp-track {
	display: flex;
	align-items: baseline;
	gap: 12px;
	padding: 9px 4px;
	cursor: pointer;
	border-bottom: 1px solid #2a2a2a;
	transition: color .15s;
}
.mp-skin-epk .mp-track:last-child { border-bottom: none; }
.mp-skin-epk .mp-track:hover,
.mp-skin-epk .mp-track.mp-active  { color: #fff; }

.mp-skin-epk .mp-track-num   { font-size: .74rem; color: #6a645c; min-width: 20px; }
.mp-skin-epk .mp-track-title { flex: 1; font-size: .9rem; color: #cfc8bd; }

.mp-skin-epk .mp-track.mp-active .mp-track-num   { color: var(--accent-2, #b2402f); }
.mp-skin-epk .mp-track.mp-active .mp-track-title { color: #fff; }

/* THE CREDIT GETS ITS OWN LINE, under the title rather than beside it. Side by side,
 * two elastic columns in a sidebar this narrow fight over the same width: a long
 * track name wrapped to five lines so that an ensemble credit could sit next to it.
 * Stacked, the title has the full row and the credit cannot squeeze it.
 *
 * `order` is what does it — the credit is third in the markup, between the title and
 * the duration, so without reordering a full-width credit would push the duration
 * onto a line of its own as well. The indent clears the track-number column (20px
 * min-width plus the 12px row gap), so the credit lines up under the title. */
.mp-skin-epk .mp-track           { flex-wrap: wrap; }
.mp-skin-epk .mp-track-num       { order: 0; }
.mp-skin-epk .mp-track-title     { order: 1; }
.mp-skin-epk .mp-track-duration  { order: 2; }
.mp-skin-epk .mp-track-artist {
	order: 3;
	/* The basis has to allow for the indent: a flat 100% plus a 32px margin is
	 * wider than the row, and the credit runs out past the duration. */
	flex: 1 1 calc(100% - 32px);
	min-width: 0;
	margin-left: 32px;
	color: #8a847b;
	font-size: .82rem;
}
/* The em dash separated two things on one line; on its own line it has nothing to
 * separate, and reads as a stray mark. */
.mp-skin-epk .mp-track-artist .mp-sep { display: none; }

/* NO CREDIT AT ALL ON A SINGLE-COMPOSER KIT, where it is only the kit's own heading
 * repeated on every row — 2,446 of the 2,569 rows on such kits printed the composer's
 * bare name and nothing else. presskit-audio.php sets this class; see the reasoning
 * there for why the column is hidden rather than left unset. */
.epk-player--no-credit .mp-track-artist,
.epk-player--no-credit .mp-mini-artist { display: none; }

/* Duration is new — the hand-rolled list had no slot for it. */
.mp-skin-epk .mp-track-duration { color: #6a645c; font-size: .74rem; font-variant-numeric: tabular-nums; }

/* Left hidden, as it was before: the sidebar card already has a heading, and the
 * active row is marked in the list. */
.mp-skin-epk .mp-now-playing { display: none; }
