/* Song records: the Markdown in songs/, rendered under each song's photos.
   Loaded after gallery.css; colors come from base.css, type from
   typography.css and typography-site.css. Adapted from the teak site. */

/* Text keeps a reading measure; tables may use the full width and scroll
   sideways on phones. */
.prose {
	max-width: var(--wide);
	margin: 0 auto 12vh;
}
.prose > :not(.table-wrap) { max-width: var(--measure); }
.prose-inset { padding-top: 2em; }
.prose h3 {
	margin: 2.4em 0 0.8em;
	padding-top: 1.2em;
	border-top: 1px solid var(--rule);
}
.prose h3:first-of-type { margin-top: 1.2em; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.prose li { margin: 0 0 0.45em; }
/* A link to a photo opens it in the viewer, marked with a north-east arrow. */
.prose a.photo-link::after { content: " \2197"; color: var(--faint); }

.table-wrap { overflow-x: auto; margin: 0 0 1.6em; }
.prose td:first-child { white-space: nowrap; }

code {
	font-family: ui-monospace, "SF Mono", Menlo, monospace;
	font-size: 0.88em;
	overflow-wrap: anywhere;
}

/* A song alone on the site is the page's intro, and jump.js focuses it
   when a section URL is opened; no ring. */
.intro:focus { outline: none; }

/* The local recording player sits between the song's intro and photos. */
.song-player {
	max-width: var(--wide);
	margin: 0 auto 3em;
}
.song-player audio {
	display: block;
	width: 100%;
	max-width: 40em;
}

/* A page of its own with recordings (Tearz Progressions): each track is its
   player with its photo and caption under it, the photo one gallery column
   wide. */
.tracks {
	max-width: var(--wide);
	margin: 0 auto 10vh;
}
.track { margin: 0 0 4.5em; }
.track .song-player { margin: 0 0 1.5em; }
.track .gallery {
	margin: 0;
	grid-template-columns: minmax(0, 24em);
}

/* Controls belong to the page, so browser chrome does not set their look. */
.song-player audio[hidden],
.player-controls[hidden],
.player-range[hidden],
.player-volume-hint[hidden],
.player-status[hidden] { display: none; }

.player-controls {
	max-width: 40em;
	padding: 1em 0;
	border-top: 1px solid var(--rule);
	border-bottom: 1px solid var(--rule);
	font-family: var(--nothing-sans);
	font-size: var(--nothing-small);
}
.player-main, .player-transport, .player-volume {
	display: flex;
	align-items: center;
	gap: 0.5em;
}
.player-main { flex-wrap: wrap; gap: 0.75em; }
.player-time, .player-volume { margin-left: auto; }
.player-time, .player-volume-hint {
	color: var(--muted);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.player-controls button {
	appearance: none;
	min-width: 44px;
	min-height: 44px;
	border: 1px solid var(--rule);
	border-radius: 0.25em;
	background: transparent;
	color: var(--ink);
	font: inherit;
	line-height: 1;
	/* Nothing Sans reserves more space above its letters: add 0.192em below. */
	padding: 0.65em 0.75em calc(0.65em + var(--nothing-optical-bottom));
	cursor: pointer;
}
.player-controls .player-play {
	min-width: 5em;
	border-color: var(--ink);
	background: var(--ink);
	color: var(--bg);
}
.player-controls button:hover:not(:disabled) { border-color: var(--ink); }
.player-controls :focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.player-controls :disabled { opacity: 0.4; cursor: default; }

.player-range {
	--player-progress: 0%;
	appearance: none;
	-webkit-appearance: none;
	display: block;
	min-width: 0;
	height: 28px;
	padding: 0;
	margin: 0;
	background: transparent;
	cursor: pointer;
}
.player-seek { width: 100%; margin-top: 0.75em; }
.player-volume .player-range { width: 5em; }
.player-range::-webkit-slider-runnable-track {
	height: 4px;
	border-radius: 2px;
	background: linear-gradient(to right, var(--ink) var(--player-progress), var(--rule) var(--player-progress));
}
.player-range::-moz-range-track {
	height: 4px;
	border-radius: 2px;
	background: linear-gradient(to right, var(--ink) var(--player-progress), var(--rule) var(--player-progress));
}
.player-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	margin-top: -5px;
	border: 0;
	border-radius: 50%;
	background: var(--ink);
}
.player-range::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border: 0;
	border-radius: 50%;
	background: var(--ink);
}
.player-status {
	margin: 0.75em 0 0;
	font-family: var(--nothing-sans);
	font-size: var(--nothing-small);
	line-height: 1.3333;
	color: var(--reading);
}
@media (max-width: 38em) {
	.player-volume { width: 100%; margin-left: 0; }
}

/* The video's photos are frames of a vertical video, with its captions
   burned in a little below the middle; the grid's 4:3 crop is moved down to
   keep them. */
.gallery figure[data-photo^="sour-taste-potato-"] img { object-position: 50% 68%; }
/* The order screenshot reads from the left; keep the restaurant's name. */
.gallery figure[data-photo$="-02-the-order-by-app"] img { object-position: left center; }

/* Version links under a player, set like the section links: the loaded one
   in the ink color. */
.player-versions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em 1.5em;
	margin-top: 1em;
}
.player-versions a { color: var(--muted); }
.player-versions a[aria-current] { color: var(--ink); }

/* Pinyin with a letter Nothing Sans lacks (see mark_pinyin in build.py), in
   the fallback fonts of --nothing-sans. */
.pinyin { font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; }

/* Players inside a record line up with its text. */
.prose .song-player { margin-inline: 0; padding-inline: 0; }
