/* Public episode and album pages. Mobile-first; all presentation stays external. */
.library-page {
	min-height: 65vh;
	padding-block: 48px 64px;
}
.library-page h1 {
	font-size: clamp(40px, 5vw, 76px);
	overflow-wrap: anywhere;
}
.library-subtitle {
	margin-block: 20px;
	font-size: 20px;
	max-width: 740px;
}
.library-meta {
	color: var(--muted);
	font-size: 13px;
	margin-block: 14px;
}
.library-search {
	margin-block: 30px;
	max-width: 760px;
}
.library-search label {
	display: block;
	margin-bottom: 8px;
	font-weight: bold;
}
.library-search-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}
.library-search input {
	min-width: 0;
	flex: 1 1 220px;
	padding: 12px 15px;
	border: 1px solid #777;
	background: var(--paper);
	color: #111;
	font: inherit;
}
.library-episode-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}
.library-episode-card {
	background: #111;
	border: 1px solid #333;
}
.library-episode-card:is(:hover, :focus-within) {
	background: #35191f;
	border-color: var(--gold);
}

.library-episode-card > a:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 3px;
}

.library-episode-card > a {
	display: flex;
	flex-direction: column;
	height: 100%;
}
.library-episode-card img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
}
.library-card-copy {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	padding: 16px;
}
.library-card-copy > .library-action {
	margin-block-start: auto;
}
.library-card-copy h2 {
	font-size: clamp(23px, 2.5vw, 31px);
	letter-spacing: 0;
}
.library-card-copy .eyebrow {
	font-size: 10px;
}
.library-action {
	color: var(--gold);
	font-size: 11px;
	font-weight: bold;
	letter-spacing: 0.06em;
}
.library-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 20px;
	margin-top: 36px;
}
.library-back {
	display: inline-block;
	color: var(--gold);
	font-weight: bold;
	font-size: 12px;
	padding-block: 10px;
	margin-bottom: 24px;
}
.library-detail {
	display: grid;
	gap: 32px;
}
.library-detail > div {
	min-width: 0;
}
.library-detail-art {
	width: min(100%, 500px);
	aspect-ratio: 1;
	object-fit: cover;
}
.library-player {
	width: 100%;
	height: 190px;
	border: 0;
	margin-block: 24px;
	background: #111;
}
.library-platforms {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}
.library-votes {
	padding: 24px;
	margin-top: 30px;
	border-left: 3px solid var(--red);
	background: #111;
}
.library-votes h2 {
	font-size: 28px;
	margin-bottom: 15px;
}
.library-notes {
	margin-top: 48px;
	max-width: 900px;
}
.library-notes-text {
	white-space: pre-line;
	overflow-wrap: anywhere;
	margin-top: 24px;
}
.library-album-grid {
	margin-top: 35px;
}
.library-track-list {
	margin-top: 24px;
	padding-left: 28px;
}
.library-track-list li {
	padding: 14px 4px;
	border-bottom: 1px solid #444;
}
.library-track-list a {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
}
.library-track-list .library-action {
	flex-shrink: 0;
}
.library-uncovered {
	color: #aaa;
}
@media (min-width: 768px) {
	.library-page {
		padding-top: 64px;
	}
	.library-episode-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 24px;
	}
	.library-detail {
		grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
		gap: 40px;
	}
}
@media (min-width: 1100px) {
	.library-episode-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}
@media (max-width: 360px) {
	.library-episode-grid {
		grid-template-columns: 1fr;
	}
}

/* Episode notes use sanitized RSS HTML and a separately managed website footer. */
.library-notes-text {
	white-space: normal;
	overflow-wrap: anywhere;
}
.library-notes-text p,
.library-notes-footer p {
	margin: 0 0 1.2em;
}
.library-notes-text a,
.library-notes-footer a {
	text-decoration: none;
}
.library-notes-footer {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid #555;
	overflow-wrap: anywhere;
}

/* Match episode-note links to the site's gold and red palette. */
.library-notes-text a,
.library-notes-footer a {
	color: #dbb34f;
}
.library-notes-text a:hover,
.library-notes-text a:focus-visible,
.library-notes-footer a:hover,
.library-notes-footer a:focus-visible {
	color: #e90035;
}

/* Detail-page navigation and keyboard-accessible destination tooltips. */
.episode-navigation {
	position: relative;
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 10px;
	margin-bottom: 32px;
}
.episode-navigation-arrow,
.episode-navigation-all {
	background: #dbb34f;
	color: #090909;
	border: 1px solid #dbb34f;
	text-decoration: none;
}
.episode-navigation-arrow {
	position: static;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	flex: 0 0 48px;
	font-size: 26px;
	font-weight: bold;
}
.episode-navigation-all {
	min-height: 48px;
	padding: 12px 20px;
}
.episode-navigation a:hover,
.episode-navigation a:focus-visible {
	background: #e90035;
	border-color: #e90035;
	color: #fff;
}
.episode-navigation-arrow[aria-disabled] {
	opacity: .35;
}
.episode-navigation-tooltip {
	position: absolute;
	top: calc(100% + 12px);
	right: 0;
	width: max-content;
	max-width: min(300px, 65vw);
	padding: 12px 16px;
	background: #171717;
	border: 1px solid #dbb34f;
	box-shadow: 0 6px 22px #0009;
	color: #dbb34f;
	font-size: 14px;
	font-weight: normal;
	line-height: 1.45;
	overflow-wrap: anywhere;
	z-index: 10;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity .18s, transform .18s, visibility .18s;
	pointer-events: none;
}
.episode-navigation-arrow:hover .episode-navigation-tooltip,
.episode-navigation-arrow:focus-visible .episode-navigation-tooltip {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
@media (max-width: 420px) {
	.episode-navigation { gap: 8px; }
	.episode-navigation-all { padding-inline: 12px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
	.episode-navigation-tooltip { transition: none; }
}

/* Red actions and gold ancillary controls; navigation sized to 75%. */
.episode-navigation {
	gap: 7.5px;
}
.episode-navigation-arrow {
	width: 36px;
	height: 36px;
	flex-basis: 36px;
	font-size: 19.5px;
}
.episode-navigation-all {
	min-height: 36px;
	height: 36px;
	padding: 9px 15px;
	font-size: 9px;
	background: #e90035;
	border-color: #e90035;
	color: #fff;
}
.episode-navigation-all:hover,
.episode-navigation-all:focus-visible {
	background: #b8002a;
	border-color: #b8002a;
}

/* Host votes sit left; listener labels and percentages form aligned columns. */
.library-votes {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	flex-wrap: wrap;
	gap: 24px;
}
.library-listener-poll {
	margin-left: auto;
	text-align: right;
}
.library-listener-poll h3 {
	margin: 0 0 15px;
	font-family: Roboto, Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: bold;
	line-height: 1.5;
	letter-spacing: .12em;
	color: #dbb34f;
}
.library-listener-poll dl {
	display: grid;
	grid-template-columns: max-content max-content;
	gap: 15px 12px;
	margin: 0;
}
.library-listener-poll dt,
.library-listener-poll dd {
	margin: 0;
	text-align: right;
}
.library-listener-poll dt {
	font-weight: bold;
}
.library-listener-poll dd {
	font-variant-numeric: tabular-nums;
}

/* Highlight only the majority outcome; equal polls remain neutral. */
.library-listener-poll .library-poll-champion {
	color: #85c995;
}
.library-listener-poll .library-poll-dust {
	color: #ff526b;
}

/* Archive filters use gold ancillary controls and compact removable chips. */
.library-search { max-width: 100%; }
.library-filter-toggle { background: #dbb34f; color: #090909; padding: 12px 16px; }
.library-filter-toggle[hidden], .library-filter-panel[hidden], .library-album-filter-group[hidden] { display: none; }
.library-filter-panel { margin-top: 20px; padding: 20px; background: #141414; border: 1px solid #555; display: grid; gap: 24px; }
.library-filter-panel fieldset { border: 0; padding: 0; min-width: 0; }
.library-filter-panel legend { color: #dbb34f; font-weight: bold; margin-bottom: 12px; }
.library-filter-panel label.library-filter-choice { display: inline-flex; align-items: center; gap: 8px; margin: 0 18px 10px 0; font-weight: normal; }
.library-filter-panel input[type="checkbox"] { flex: none; width: 18px; height: 18px; min-width: 18px; padding: 0; accent-color: #dbb34f; }
.library-vote-filters { display: flex; flex-wrap: wrap; gap: 20px; align-items: end; }
.library-filter-panel select { display: block; background: #090909; color: white; padding: 10px; border: 1px solid #777; margin-top: 6px; }
.library-filter-group-title { font-size: 13px; color: #c8c5c0; margin-bottom: 12px; }
.library-album-filter-group + .library-album-filter-group { border-top: 1px solid #555; padding-top: 16px; margin-top: 8px; }
.library-filter-panel > button { justify-self: start; }
.library-filter-bubbles { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; align-items: center; }
.library-filter-bubble { display: inline-flex; gap: 12px; align-items: center; padding: 6px 12px; border: 1px solid #dbb34f; border-radius: 20px; color: #dbb34f; font-size: 13px; }
.library-filter-bubble span { font-size: 20px; line-height: 1; }
.library-filter-bubble:hover, .library-filter-bubble:focus-visible, .library-filter-clear:hover { color: #ff526b; border-color: #ff526b; }
.library-filter-clear { color: #dbb34f; font-size: 12px; font-weight: bold; }
@media (max-width: 480px) {
	.library-search-controls { gap: 8px; }
	.library-search-controls input { flex-basis: 100%; }
	.library-filter-panel { padding: 15px; }
}

/* Full-screen archive filter darkbox, above the sticky site navigation. */
body.episode-filters-open { overflow: hidden; }
dialog.library-filter-panel {
	position: fixed;
	inset: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	border: 0;
	padding: clamp(20px, 4vw, 60px);
	background: #0b0b0b;
	color: #fff;
	overflow-y: auto;
	overscroll-behavior: contain;
	grid-template-columns: minmax(0, 1fr);
	align-content: start;
	gap: 30px;
}
dialog.library-filter-panel:not([open]) { display: none; }
dialog.library-filter-panel::backdrop { background: #000d; }
.library-filter-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.library-filter-heading .eyebrow { margin-bottom: 12px; }
.library-filter-close { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 52px; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 4px; background: #e90035; color: #fff; font-size: 38px; font-weight: bold; line-height: 1; }
.library-filter-close:hover { background: #b8002a; }
.library-filter-panel input[type="checkbox"] { appearance: none; position: relative; width: 26px; height: 26px; min-width: 26px; border: 2px solid #777; border-radius: 3px; background: #090909; cursor: pointer; }
.library-filter-panel input[type="checkbox"]:checked { background: #e90035; border-color: #e90035; }
.library-filter-panel input[type="checkbox"]:checked::after { content: ''; display: block; position: absolute; left: 7px; top: 2px; width: 8px; height: 15px; border: solid white; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.library-filter-panel input:focus-visible, .library-filter-close:focus-visible { outline: 2px solid #dbb34f; outline-offset: 4px; }
.library-album-filter-group { display: flex; flex-wrap: wrap; gap: 16px; }
.library-filter-group-title { flex-basis: 100%; margin-bottom: 0; }
.library-filter-panel label.library-album-choice { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100px; margin: 0; text-align: center; cursor: pointer; font-weight: normal; }
.library-filter-panel .library-album-choice input { position: absolute; width: 1px; height: 1px; min-width: 0; opacity: 0; }
.library-album-choice img { width: 50px; height: 50px; object-fit: cover; box-sizing: content-box; border: 3px solid transparent; border-radius: 3px; }
.library-album-choice input:checked + img { border-color: #dbb34f; box-shadow: 0 0 0 1px #dbb34f; }
.library-album-choice input:focus-visible + img { outline: 2px solid white; outline-offset: 4px; }
.library-album-choice:hover img { border-color: #dbb34f; }
.library-album-choice span { font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.library-album-choice:has(input:checked) span { color: #dbb34f; }
.library-filter-actions { position: sticky; bottom: -1px; padding: 16px 0; background: #0b0b0bf5; }

/* Album vote totals follow the tracks on mobile and sit below desktop artwork. */
.library-album-detail { align-items: start; }
.library-album-votes { min-width: 0; padding: 22px; background: #111; border-top: 2px solid #dbb34f; }
.library-album-votes h2 { font-size: 30px; margin-bottom: 18px; }
.library-album-votes table { width: 100%; border-collapse: collapse; font-size: 14px; }
.library-album-votes th, .library-album-votes td { padding: 10px 6px; text-align: right; border-bottom: 1px solid #333; }
.library-album-votes th:first-child { text-align: left; }
.library-album-votes thead th { color: #dbb34f; font-size: 11px; text-transform: uppercase; }
.library-album-champion { color: #85c995; font-weight: bold; }
.library-album-dust { color: #ff526b; font-weight: bold; }
.library-album-votes td.library-album-vote-note { text-align: left; color: #aaa; font-size: 12px; padding-top: 0; }
@media (min-width: 768px) {
	.library-album-art { grid-column: 1; grid-row: 1; }
	.library-album-tracks { grid-column: 2; grid-row: 1 / span 2; }
	.library-album-votes { grid-column: 1; grid-row: 2; }
	.library-album-detail { row-gap: 24px; }
}

/* Album title and year share the top row with the compact navigation. */
.library-album-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 24px;
	margin-bottom: 32px;
}
.library-album-heading-title {
	flex: 1 1 320px;
	min-width: 0;
}
.library-album-heading-title .eyebrow {
	margin-top: 0;
}
.library-album-heading-title h1 {
	margin-bottom: 0;
	overflow-wrap: anywhere;
}
.library-album-heading .episode-navigation {
	flex: 0 0 auto;
	margin-bottom: 0;
	margin-left: auto;
}

/* Album and inline bulleted songwriter credits wrap naturally on small screens. */
.library-song-credits {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	column-gap: 16px;
	row-gap: 6px;
	margin-block: 18px 28px;
}
.library-song-album {
	text-transform: uppercase;
}
.library-songwriters {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.library-songwriters li::before {
	content: "•";
	color: #dbb34f;
	margin-right: 10px;
}

/* Give the episode archive page count the same visual weight as its controls. */
.library-page-picker summary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 8px 16px;
	border: 1px solid var(--gold);
	background: #18140e;
	color: var(--gold);
	font: 400 20px/1.15 var(--display);
	letter-spacing: .08em;
	text-transform: uppercase;
}

.library-page-picker {
	position: relative;
}

.library-page-picker summary {
	gap: 10px;
	cursor: pointer;
	list-style: none;
}

.library-page-picker summary::-webkit-details-marker {
	display: none;
}

.library-page-picker[open] summary,
.library-page-picker summary:hover {
	background: #292014;
}

.library-page-picker[open] summary span {
	transform: rotate(180deg);
}

.library-page-options {
	position: absolute;
	z-index: 6;
	inset: auto auto calc(100% + 6px) 50%;
	transform: translateX(-50%);
	width: max-content;
	max-width: min(270px, calc(100vw - 48px));
	max-height: min(20rem, 40vh);
	overflow-y: auto;
	margin: 0;
	padding: 4px;
	list-style: none;
	background: #18140e;
	border: 1px solid var(--gold);
	box-shadow: 0 6px 20px #0009;
}

.library-page-options a {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 8px 12px;
	color: #fff;
}

.library-page-options a:hover,
.library-page-options a:focus-visible,
.library-page-options a[aria-current="page"] {
	color: var(--gold);
	background: #30261a;
}

@media (max-width: 480px) {
	.library-pagination .library-page-picker {
		order: -1;
		flex-basis: 100%;
		text-align: center;
	}
}
