/**
 * MediaPlyr Skin: EPK Work Reference
 * The light inline player inside a work reference, sitting in kit prose on warm paper.
 * Controls: play, progress, current-time, duration, mute, volume
 */

/* The sidebar skin's sibling. Same module, opposite surface: `epk` is a dark card
 * in the sidebar, this is a light block in the body prose, so almost nothing about
 * the colours carries over and they are deliberately two skins rather than one
 * skin with a modifier.
 *
 * Kit custom properties resolve because the skin loads on the kit page; fallbacks
 * are present so a preview outside a kit still renders. */

.mp-skin-epk-work {

/* 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, #8b1a1a);
	--plyr-control-spacing: 8px;
	background: var(--paper-warm, #f7f5f1);
	border: 1px solid var(--line, #e7e4df);
	border-radius: var(--radius, 10px);
	padding: 12px 14px;
	margin: .7em 0 0;
	color: var(--ink, #1a1a1a);
}

.mp-skin-epk-work .plyr--audio .plyr__controls { background: transparent; padding: 0; }
.mp-skin-epk-work .plyr__progress__container { flex: 1 1 auto; min-width: 0; }
.mp-skin-epk-work .plyr__time { font-size: .72rem; padding: 0 4px; }
.mp-skin-epk-work .plyr__volume { flex: 0 0 auto; min-width: 0; }
.mp-skin-epk-work .plyr__volume input[type="range"] { max-width: 52px; }

/* Shown here, unlike the sidebar skin: an inline player has no heading above it,
 * so without this the reader cannot tell which track is loaded until they look
 * down at the list. */
.mp-skin-epk-work .mp-now-playing {
	display: block;
	font-size: .82rem;
	font-weight: 600;
	color: var(--ink, #1a1a1a);
	margin-bottom: 6px;
}


/* Single mode's caption — the now-playing line's opposite number. Playlist mode
 * writes the current track into .mp-now-playing above a list; single mode prints
 * its one track into .mp-track-desc and has no list at all. A one-track work
 * reference renders in single mode (WorksProxy 114), so this skin meets both.
 *
 * PLACED ON THE PROGRESS BAR'S LINE, SM2-STYLE — but not overlaid on it. The SM2
 * Bar UI skin can absolutely-position its title inside the bar because it fixes
 * the bar height itself (--mp-sm2-h) and sizes the play button to match, so it is
 * insetting by a number it owns. This skin uses Plyr's natural control sizing, so
 * the same trick would mean pinning the button size too and redesigning the bar.
 * Instead the caption sits directly above, indented to start where the progress
 * bar starts — the SM2 arrangement without the fixed geometry.
 *
 * The indent is Plyr's own formula, not a measured constant, so it tracks if the
 * control spacing changes: play button = 2 × (spacing × 0.7) padding + 18px icon,
 * then one inter-item gap of spacing ÷ 2. That is 1.9 × spacing + 18px. */
.mp-skin-epk-work .mp-track-desc {
	display: flex;
	align-items: baseline;
	gap: .4em;
	min-width: 0;
	margin: 0 0 4px;
	padding-left: calc(var(--plyr-control-spacing, 10px) * 1.9 + 18px);
	font-size: .82rem;
	line-height: 1.3;
	color: var(--ink, #1a1a1a);
}

/* One line, always. A work title long enough to wrap would push the controls down
 * and leave the player looking like two unrelated things stacked up; the full text
 * is in the entry's own heading directly above, so an ellipsis loses nothing. */
.mp-skin-epk-work .mp-track-desc .mp-track-title {
	flex: 0 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 600;
	color: var(--ink, #1a1a1a);
}
.mp-skin-epk-work .mp-track-desc .mp-track-artist,
.mp-skin-epk-work .mp-track-desc .mp-track-duration { flex: 0 0 auto; }
/* Duration is hidden here, as SM2 hides it in the bar: the player prints it in its
 * own controls two pixels below, and twice over on one line is clutter. */
.mp-skin-epk-work .mp-track-desc .mp-track-duration { display: none; }


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

.mp-skin-epk-work .mp-tracklist {
	list-style: none;
	margin: 10px 0 0;
	padding: 0;
}
.mp-skin-epk-work .mp-track {
	display: flex;
	align-items: baseline;
	gap: 10px;
	padding: 6px 2px;
	cursor: pointer;
	border-bottom: 1px solid var(--line, #e7e4df);
	transition: color .15s;
	font-size: .85rem;
}
.mp-skin-epk-work .mp-track:last-child { border-bottom: none; }
.mp-skin-epk-work .mp-track:hover { color: var(--accent, #8b1a1a); }

/* MediaPlyr's own row number is hidden, because the imported labels already carry
 * one: "1. Introduction", "2. La Science". Shown together they read "11. Introduction".
 *
 * Hiding MediaPlyr's rather than stripping the label's is the truthful way round.
 * MediaPlyr numbers by POSITION in the list it was handed, so when a chip is capped
 * (audio="3") or a work's tracks are a subset of an album, its 1,2,3 would contradict
 * the real movement numbers the labels carry. The label is the better source. A work
 * whose labels have no number simply shows an unnumbered list, which is correct for
 * a single recording. */
.mp-skin-epk-work .mp-track-num { display: none; }
.mp-skin-epk-work .mp-track-title { flex: 1; color: var(--ink-soft, #4a4a4a); }
/* Artist is shown: for kit audio it is usually the composer, which reads well
 * beside the track name. ID3 supplies it, but a scan of 121 playable tracks found
 * it empty or "Unknown Artist" on 40 of them — the render path substitutes the
 * composer in those cases, because MediaPlyr's field map can override a tag but
 * never clear one. Muted so a long credit cannot compete with the title. */
.mp-skin-epk-work .mp-track-artist { color: var(--ink-mute, #8a8a8a); font-size: .8rem; }
.mp-skin-epk-work .mp-track-duration { color: var(--ink-mute, #8a8a8a); font-size: .72rem; font-variant-numeric: tabular-nums; }

.mp-skin-epk-work .mp-track.mp-active .mp-track-title {
	color: var(--accent, #8b1a1a);
	font-weight: 600;
}
