/*
 * Blind Skeleton Record Cabinet
 *
 * To change the colours, override these variables in
 * Appearance → Editor → Styles → Additional CSS, e.g.
 *   .bsrc-cabinet { --bsrc-accent: #2F4A3A; }
 */
.bsrc-cabinet {
	--bsrc-ink: #2B1D14;
	--bsrc-muted: #5A4636;
	--bsrc-paper: #F3EAD7;
	--bsrc-accent: #7A1F1F;   /* oxblood label */
	--bsrc-brass: #B08D57;    /* brass label */
	--bsrc-navy: #1F3350;     /* navy label */
	--bsrc-shellac: #161010;
	--bsrc-groove: #2C2421;
	--bsrc-size: 150px;
	color: var(--bsrc-ink);
}

/* Three across on wide screens (6 or 9 episodes make tidy rows), two on phones */
.bsrc-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 40px 28px;
	max-width: 760px;
	margin: 0 auto;
}

@media (max-width: 600px) {
	.bsrc-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 28px 16px;
	}
}

.bsrc-record {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	text-align: center;
}

/* The record itself */
.bsrc-disc {
	position: relative;
	width: var(--bsrc-size);
	height: var(--bsrc-size);
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: repeating-radial-gradient(circle at center,
		var(--bsrc-shellac) 0px, var(--bsrc-shellac) 2px,
		var(--bsrc-groove) 3px, var(--bsrc-shellac) 4px);
	box-shadow: 0 8px 18px rgba(43, 29, 20, 0.28);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button.bsrc-disc {
	cursor: pointer;
}

button.bsrc-disc:hover {
	box-shadow: 0 12px 24px rgba(43, 29, 20, 0.38);
	transform: translateY(-2px);
}

button.bsrc-disc:focus-visible {
	outline: 3px solid var(--bsrc-accent);
	outline-offset: 4px;
}

/* The paper label in the middle */
.bsrc-label {
	width: 40%;
	aspect-ratio: 1;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1;
}

.bsrc-label--1 { background: var(--bsrc-accent); color: var(--bsrc-paper); }
.bsrc-label--2 { background: var(--bsrc-brass); color: var(--bsrc-ink); }
.bsrc-label--3 { background: var(--bsrc-navy); color: var(--bsrc-paper); }

/* Episode artwork on the label: a little larger, with a coloured rim */
.bsrc-label.bsrc-has-art {
	width: 50%;
	padding: 3px;
	box-sizing: border-box;
	overflow: hidden;
}

.bsrc-art {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

/* Dim the artwork on hover/play so the play symbol and spindle stand out */
.bsrc-has-art::before {
	content: "";
	position: absolute;
	inset: 3px;
	border-radius: 50%;
	background: rgba(22, 16, 16, 0.5);
	opacity: 0;
	transition: opacity 0.15s ease;
}

button.bsrc-disc:hover .bsrc-has-art::before,
button.bsrc-disc:focus-visible .bsrc-has-art::before {
	opacity: 1;
}

/* Spindle hole, shown on hover / while playing */
.bsrc-label::after {
	content: "";
	position: absolute;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--bsrc-shellac);
	bottom: 18%;
	opacity: 0;
	z-index: 1;
}

.bsrc-has-art::after {
	width: 8px;
	height: 8px;
	bottom: auto;
	background: var(--bsrc-paper);
	box-shadow: 0 0 0 2px var(--bsrc-shellac);
}

/* On hover the date fades and a play triangle appears */
button.bsrc-disc:hover .bsrc-label-text,
button.bsrc-disc:focus-visible .bsrc-label-text {
	opacity: 0;
}

button.bsrc-disc .bsrc-label-text {
	transition: opacity 0.15s ease;
}

button.bsrc-disc::after {
	content: "";
	position: absolute;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 9px 0 9px 15px;
	border-color: transparent transparent transparent currentColor;
	color: var(--bsrc-paper);
	opacity: 0;
	margin-left: 4px;
	transition: opacity 0.15s ease;
	pointer-events: none;
}

button.bsrc-disc:has(.bsrc-label--2)::after {
	color: var(--bsrc-ink);
}

button.bsrc-disc:has(.bsrc-has-art)::after {
	color: var(--bsrc-paper);
}

button.bsrc-disc:hover::after,
button.bsrc-disc:focus-visible::after {
	opacity: 1;
}

/* Playing: spin at a true 78rpm and show a pause symbol */
@keyframes bsrc-spin {
	to { transform: rotate(360deg); }
}

.bsrc-disc.is-playing {
	animation: bsrc-spin 0.77s linear infinite;
}

.bsrc-disc.is-playing:hover {
	transform: none;
}

.bsrc-disc.is-playing .bsrc-label-text {
	opacity: 0;
}

.bsrc-disc.is-playing .bsrc-label::after {
	opacity: 1;
}

.bsrc-disc.is-playing::after {
	opacity: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
	.bsrc-disc.is-playing { animation: none; }
	.bsrc-disc.is-playing::after {
		opacity: 1 !important;
		border-width: 0 5px;
		width: 6px;
		height: 18px;
		border-style: solid;
		border-color: transparent currentColor;
		margin-left: 0;
	}
}

/* Title and date under each record */
.bsrc-record figcaption {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.bsrc-title {
	font-family: inherit;
	font-weight: 700;
	font-size: 1.1em;
	line-height: 1.25;
	color: var(--bsrc-ink);
	text-decoration: none;
}

a.bsrc-title:hover,
a.bsrc-title:focus-visible {
	color: var(--bsrc-accent);
	text-decoration: underline;
}

.bsrc-meta {
	font-size: 0.85em;
	color: var(--bsrc-muted);
}

/* The shared player bar */
.bsrc-player {
	max-width: 760px;
	margin: 40px auto 0;
	box-sizing: border-box;
	padding: 14px 18px;
	border-top: 3px double var(--bsrc-ink);
	border-bottom: 3px double var(--bsrc-ink);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 18px;
}

.bsrc-player[hidden] {
	display: none;
}

.bsrc-now {
	flex: 1 1 220px;
	min-width: 0;
}

.bsrc-now-label {
	font-size: 0.8em;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--bsrc-accent);
	margin-right: 6px;
}

.bsrc-now-title {
	font-weight: 700;
}

.bsrc-audio {
	flex: 2 1 300px;
	min-width: 0;
	width: 100%;
}

.bsrc-error {
	padding: 12px 16px;
	border: 1px solid var(--bsrc-accent);
	color: var(--bsrc-accent);
}

.bsrc-dur {
	white-space: nowrap;
}

@media (max-width: 420px) {
	.bsrc-cabinet { --bsrc-size: 130px; }
}
