/* Sober audio player (media.js) and native videos. Zero specificity (:where): printed in the footer, after the site styles, yet a site overrides any rule; colours through the --ip-media-* variables. */
:where(.ip-audio) {
	--_accent: var(--ip-media-accent, currentColor);
	--_line: var(--ip-media-line, color-mix(in srgb, currentColor 20%, transparent));
	display: flex;
	align-items: center;
	gap: 0.875rem;
	inline-size: 100%;
	max-inline-size: 40rem;
}

:where(.ip-audio audio) {
	display: none;
}

:where(.ip-audio__toggle) {
	flex: none;
	display: grid;
	place-items: center;
	inline-size: 2.5rem;
	block-size: 2.5rem;
	padding: 0;
	border: 1px solid var(--_accent);
	border-radius: 50%;
	background: transparent;
	color: var(--_accent);
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s;
}

:where(.ip-audio__toggle svg) {
	inline-size: 1rem;
	block-size: 1rem;
}

:where(.ip-audio__toggle:hover),
:where(.ip-audio.is-playing .ip-audio__toggle) {
	background: var(--_accent);
	color: var(--ip-media-on-accent, #fff);
}

:where(.ip-audio__toggle:focus-visible),
:where(.ip-audio__seek:focus-visible) {
	outline: 2px solid var(--_accent);
	outline-offset: 3px;
}

:where(.ip-audio.is-error .ip-audio__toggle) {
	opacity: 0.4;
	cursor: not-allowed;
}

:where(.ip-audio__body) {
	flex: 1;
	min-inline-size: 0;
	display: grid;
	gap: 0.125rem;
}

:where(.ip-audio__title) {
	overflow-wrap: anywhere;
}

:where(.ip-audio__line) {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

:where(.ip-audio__time) {
	flex: none;
	font-size: 0.85em;
	font-variant-numeric: tabular-nums;
	opacity: 0.75;
}

:where(.ip-audio__seek) {
	flex: 1;
	min-inline-size: 0;
	block-size: 1.25rem;
	margin: 0;
	background: transparent;
	appearance: none;
	cursor: pointer;
}

:where(.ip-audio__seek:disabled) {
	cursor: default;
}

:where(.ip-audio__seek)::-webkit-slider-runnable-track {
	block-size: 1px;
	background: var(--_line);
}

:where(.ip-audio__seek)::-moz-range-track {
	block-size: 1px;
	background: var(--_line);
}

:where(.ip-audio__seek)::-moz-range-progress {
	block-size: 1px;
	background: var(--_accent);
}

:where(.ip-audio__seek)::-webkit-slider-thumb {
	appearance: none;
	inline-size: 0.625rem;
	block-size: 0.625rem;
	margin-block-start: -0.28rem;
	border: 0;
	border-radius: 50%;
	background: var(--_accent);
}

:where(.ip-audio__seek)::-moz-range-thumb {
	inline-size: 0.625rem;
	block-size: 0.625rem;
	border: 0;
	border-radius: 50%;
	background: var(--_accent);
}

:where(.ip-audio__seek:disabled)::-webkit-slider-thumb {
	visibility: hidden;
}

:where(.ip-audio__seek:disabled)::-moz-range-thumb {
	visibility: hidden;
}

:where(video.ip-media-video) {
	display: block;
	inline-size: 100%;
	block-size: auto;
	background: #000;
}
