/* Blue Note's author-selected, self-hosted cover player (DESIGN §6.4). */
.post-page .markdown-body .post-music {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  margin: 0 0 2rem;
  padding: 0.5rem 0;
  color: var(--prose);
  font-family: var(--font-prose);
  line-height: 1.65;
}
.post-page .markdown-body .post-music__cover {
  display: block;
  flex: none;
  width: 6.25rem;
  height: 6.25rem;
  margin: 0;
  border-radius: 2px;
  object-fit: contain;
  background: transparent;
  box-shadow: none;
}
.post-music__body { flex: 1; min-width: 0; }
.post-music__title { color: var(--heading); font-size: 1rem; letter-spacing: 0.02em; overflow-wrap: anywhere; }
.post-music__metadata { margin-top: 2px; color: var(--muted); font-size: 0.8125rem; }
.post-music__controls { display: flex; align-items: center; gap: 0.625rem; min-width: 0; }
.post-music__controls :disabled { opacity: 1; }
.post-music__play, .post-music__mute {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.post-music__play { position: relative; margin-left: -0.625rem; }
/* Long waits are reported inside the fixed button, never in the metadata. */
.post-music[data-buffering="true"] .post-music__play::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: post-music-buffering 1s linear infinite;
  pointer-events: none;
}
@keyframes post-music-buffering { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .post-music[data-buffering="true"] .post-music__play::after { animation: none; }
}
.post-music__play:hover, .post-music__mute:hover { color: var(--link-hover); }
.post-music__play svg, .post-music__mute svg { display: block; width: 18px; height: 18px; fill: currentColor; }
.post-music__play .post-music__pause-icon, .post-music__mute .post-music__muted-icon { display: none; }
.post-music[data-playing="true"] .post-music__play-icon,
.post-music[data-muted="true"] .post-music__sound-icon { display: none; }
.post-music[data-playing="true"] .post-music__pause-icon,
.post-music[data-muted="true"] .post-music__muted-icon { display: block; }
.post-music__seek, .post-music__volume {
  appearance: none;
  -webkit-appearance: none;
  height: 44px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.post-music__seek { flex: 1; width: 100%; --progress: 0%; }
.post-music__seek::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(to right, var(--link-hover) var(--progress), var(--line) var(--progress));
}
.post-music__volume::-webkit-slider-runnable-track { height: 2px; background: var(--line); }
.post-music__seek::-moz-range-track, .post-music__volume::-moz-range-track { height: 2px; background: var(--line); }
.post-music__seek::-moz-range-progress { height: 2px; background: var(--link-hover); }
.post-music__seek::-webkit-slider-thumb, .post-music__volume::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 8px;
  height: 8px;
  margin-top: -3px;
  border: 0;
  border-radius: 50%;
  background: var(--link-hover);
}
.post-music__seek::-moz-range-thumb, .post-music__volume::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: var(--link-hover);
}
.post-music__time { color: var(--muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.post-music__volume-controls { display: flex; align-items: center; gap: 2px; }
.post-music__volume { width: 56px; flex: none; }
.post-music__audio { display: none; width: 100%; margin-top: 0.5rem; }
.post-music__status { margin-top: 0.5rem; font-size: 0.8125rem; }
.post-music button:focus-visible, .post-music input:focus-visible, .post-music a:focus-visible {
  outline: 2px solid var(--link-hover);
  outline-offset: 3px;
}
@media (max-width: 767px) {
  .post-page .markdown-body .post-music { gap: 0.875rem; }
  .post-page .markdown-body .post-music__cover { width: 4.75rem; height: 4.75rem; }
  .post-music__title { font-size: 0.9375rem; }
  .post-music__controls { gap: 0.375rem; }
  .post-music__volume-controls { display: none; }
}

/* A failed script restores native controls; no-JS uses the same rules in the head. */
.post-music-fallback .post-music__audio { display: block; }
.post-music-fallback .post-music__controls { display: none; }
