/* Riff's design tokens: every custom property Riff documents, with its
   default, and the one rule every surface shares: that a control's text is
   not selected. riff.css and every Riff extension list this
   stylesheet, riff-tokens, as a dependency and use these names rather than
   copying values, so a theme or a block style that sets them reaches all of
   them at once. A docblock is what makes a property public; site/developers/css
   is written from them. */

:root {

	/**
	 * The height of the player bar. The page keeps this much room at its end
	 * so the bar never covers the last line.
	 *
	 * @since 4.0.0
	 */
	--riff-bar-h: 64px;
}

@media (min-width: 900px) and (not ((pointer: coarse) and (min-aspect-ratio: 5 / 4) and (max-height: 500px))) {

	:root {
		--riff-bar-h: 72px;
	}
}

#riff {

	/**
	 * The background of Now Playing.
	 *
	 * @since 4.0.0
	 */
	--riff-bg: #030303;

	/**
	 * The bar, the Up next sheet, tooltips, and the Song and Video switch.
	 *
	 * @since 4.0.0
	 */
	--riff-surface: #212121;

	/**
	 * The player's text and icons, and the played part of the seek bar in Now
	 * Playing.
	 *
	 * @since 4.0.0
	 */
	--riff-fg: #fff;

	/**
	 * Secondary text, such as the artist, the times and the format, and
	 * toggles that are off.
	 *
	 * @since 4.0.0
	 */
	--riff-fg-2: rgb(255 255 255 / 0.7);

	/**
	 * The unselected side of the Song and Video switch.
	 *
	 * @since 4.0.0
	 */
	--riff-fg-3: rgb(255 255 255 / 0.5);

	/**
	 * Dividers and the unplayed part of the seek bar.
	 *
	 * @since 4.0.0
	 */
	--riff-line: rgb(255 255 255 / 0.1);

	/**
	 * The wash behind a control under the pointer, and behind chips, the
	 * current Up next item, and artwork while it loads.
	 *
	 * @since 4.0.0
	 */
	--riff-hover: rgb(255 255 255 / 0.1);

	/**
	 * The ring around the player's control that has the keyboard's focus, as
	 * an `outline` value: one ring outside the control's edge, following its
	 * corners, in the cover's accent, `--riff-cover-accent`, where the player
	 * sets one on `#riff`, else the player's text colour. A theme sets a ring
	 * of its own, such as `3px solid #ffbf47`.
	 *
	 * @since 6.5.0
	 */
	--riff-focus-ring: 2px solid var(--riff-cover-accent, var(--riff-fg));

	/**
	 * How far the focus ring sits outside the control's edge.
	 *
	 * @since 6.5.0
	 */
	--riff-focus-ring-offset: 2px;

	/**
	 * The played part of the seek bar in the bar, its knob, the format label,
	 * and the glow behind the cover. A theme sets it in theme.json under
	 * `settings.custom.riff.accent`; a site's or a host's own stylesheet that
	 * sets it on `#riff` wins over that. Unset, it is the player's text
	 * colour.
	 *
	 * @since 4.0.0
	 * @since 6.5.0 The player's text colour by default, and a stylesheet wins
	 *              over theme.json.
	 */
	--riff-accent: var(--riff-theme-accent, var(--riff-fg));

	/**
	 * The accent the playing track's cover gives, which the player sets here
	 * as the track changes: the cover's hue, muted, and light enough to read
	 * at 4.5:1 on the bar and on Now Playing. The played part of the seek bar
	 * in the bar, its knob, the playing bars and the title of the current Up
	 * next item, and a wash behind Now Playing take it. A cover that is grey,
	 * near black or near white gives none, and it is `--riff-accent`. In the
	 * Listen app's own document the player sets it on the body too, for the
	 * app's links, Liked songs and the Browse tiles. The `riff_cover_accent`
	 * filter turns it off.
	 *
	 * @since 6.5.0
	 */
	--riff-cover-accent: var(--riff-accent);
}

.riff-app {

	/**
	 * The Listen block's background.
	 *
	 * @since 4.0.0
	 */
	--riff-app-bg: #f6f6f6;

	/**
	 * The album's track list and the now-playing card in the Listen block.
	 *
	 * @since 4.0.0
	 */
	--riff-app-surface: #fff;

	/**
	 * The Listen block's text.
	 *
	 * @since 4.0.0
	 */
	--riff-app-ink: #1e1e1e;

	/**
	 * Secondary text in the Listen block.
	 *
	 * @since 4.0.0
	 */
	--riff-app-ink-2: #656a71;

	/**
	 * Borders in the Listen block, and the space artwork fills while it loads.
	 *
	 * @since 4.0.0
	 */
	--riff-app-line: #d9d9d9;

	/**
	 * Links, play buttons, and the title of the card under the pointer in the
	 * Listen block. Its focus rings are `--riff-app-focus-ring`.
	 *
	 * @since 4.0.0
	 */
	--riff-app-accent: #2c2a26;

	/**
	 * The accent under the pointer or in focus.
	 *
	 * @since 4.0.0
	 */
	--riff-app-accent-deep: #11100e;

	/**
	 * The background of the row playing.
	 *
	 * @since 4.0.0
	 */
	--riff-app-accent-tint: color-mix(in srgb, var(--riff-app-accent) 10%, var(--riff-app-bg));

	/**
	 * Text and icons on a filled button: the accent, or the text colour under
	 * the pointer.
	 *
	 * @since 4.14.0
	 */
	--riff-app-on-accent: #fff;

	/**
	 * The ring around the Listen app's control that has the keyboard's
	 * focus, as an `outline` value: Home, search, the tabs, the sidebar and
	 * the rest, each ringed outside its own edge and corners, in the cover's
	 * accent where the app sets one on `.riff-app`, else the text's colour. The
	 * player's own is `--riff-focus-ring`.
	 *
	 * @since 6.5.0
	 */
	--riff-app-focus-ring: 2px solid var(--riff-cover-accent, var(--riff-app-ink));

	/**
	 * How far the Listen app's focus ring sits outside the control's edge.
	 *
	 * @since 6.5.0
	 */
	--riff-app-focus-ring-offset: 2px;

	/**
	 * The Listen block's text font.
	 *
	 * @since 4.14.0
	 */
	--riff-app-font: "Riff Inter", inter, "Riff Inter Fallback", -apple-system, blinkmacsystemfont, sans-serif;

	/**
	 * The Listen block's headings: the library's title and each album's.
	 *
	 * @since 4.14.0
	 */
	--riff-app-heading-font: "Riff Garamond", "EB Garamond", "Riff Garamond Fallback", garamond, georgia, serif;
}

/* The Listen app's own document, at the Listen page's app/ address or the
   site's: the page around the Listen block, behind the status bar and under
   the tabs. Its block takes its background and text from these too. */
.riff-standalone {

	/**
	 * The Listen app's background: the page, the strip behind the status bar,
	 * and the Listen block inside it.
	 *
	 * @since 6.4.0
	 */
	--riff-standalone-bg: #030303;

	/**
	 * The Listen app's text and icons.
	 *
	 * @since 6.4.0
	 */
	--riff-standalone-ink: #fff;

	/**
	 * Behind the Home, Search and Library tabs along the bottom on a phone.
	 *
	 * @since 6.4.0
	 */
	--riff-standalone-tabs: var(--riff-surface, #212121);

	/**
	 * The icon on an album's round Play button, which is in the accent.
	 *
	 * @since 6.4.0
	 */
	--riff-standalone-on-accent: #000;

	/**
	 * The Listen app's accent in its own document: its Play buttons and
	 * links, until a cover gives one, and what a grey cover falls back to. A
	 * host's stylesheet sets it, on `.riff-standalone`, and it wins over
	 * Riff's own default, the app's text colour.
	 *
	 * @since 6.5.0
	 */
	--riff-standalone-accent: var(--riff-standalone-ink);
}

/* A control is pressed, not read: a tap, a long-press or a double-click on a
   button in the player, a view, a panel, the Listen block, a post's rows or
   an extension's own never paints its label blue. So too the parts that act
   as buttons or are dragged: the bar, which is swiped; Now Playing's head and
   stage, which are dragged down to close and hold the cover, the record and
   the turntable's arm; the sliders and their times; the chips, pills, tabs
   and switches. Important, as each button is first reset with `all: unset`,
   which would otherwise undo it. What is there to be read and copied keeps
   its text: a row's track, in a post or in Up next, is left to the page
   around it (auto), so it selects wherever the page does. An extension whose
   buttons hold text to read does the same in its own stylesheet, as Riff
   Lyrics does for its lines and Riff Chords for its chart's. */
:where(#riff, .riff-app, .riff-tracks, .riff-track, .riff-signin) :is(button, [role="button"], [role="slider"], [role="radio"], input[type="range"]),
:where(#riff, .riff-app) :is(.riff-bar, .riff-np-head, .riff-stage, .riff-bar-seek, .riff-np-seek, .riff-np-times, .riff-volume, .riff-pitch, .riff-chips, .riff-chip, .riff-chip-link, .riff-pill, .riff-modes, .riff-speeds, .riff-app-tab, .riff-sort-link) {
	-webkit-user-select: none !important;
	user-select: none !important;
}

:where(#riff, .riff-app, .riff-tracks, .riff-track) :is(.riff-row, .riff-queue-list li > button:first-child) {
	-webkit-user-select: auto !important;
	user-select: auto !important;
}
