/* ── Album Reveal ─────────────────────────────────────────────────
 * Theme-overridable via CSS variables. Set any of these on .album-reveal
 * (or a wrapping element) to customise.
 */
.album-reveal {
  --ar-radius: 0;
  --ar-bg: #111;
  --ar-fg: #fff;
  --ar-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  --ar-meta-bg: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.78) 0%,
    rgba(0, 0, 0, 0) 70%
  );
  --ar-player-bg: #000;
  --ar-close-bg: rgba(0, 0, 0, 0.6);
  --ar-close-fg: #fff;
  --ar-hover: #880808;
  --ar-transition: 180ms ease-out;

  position: relative;
  display: block;
  width: 100%;
  border-radius: var(--ar-radius);
  overflow: hidden;
  background: var(--ar-bg);
  color: var(--ar-fg);
  box-shadow: var(--ar-shadow);
  aspect-ratio: 1 / 1; /* square like an album cover; swap for 'auto' if you prefer */
}

/* ── Cover button ─────────────────────────────────────────────── */
.album-reveal__cover {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.album-reveal__cover:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -4px;
}

.album-reveal__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1);
  transition:
    transform var(--ar-transition),
    filter var(--ar-transition);
}

.album-reveal__cover:hover .album-reveal__image,
.album-reveal__cover:focus-visible .album-reveal__image {
  transform: scale(1.03);
  filter: grayscale(0);
}

/* ── Meta overlay ─────────────────────────────────────────────── */
.album-reveal__meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1rem 1rem 0.9rem;
  background: var(--ar-meta-bg);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  pointer-events: none;
}

.album-reveal__title,
.album-reveal__artist {
  display: block;
}

.album-reveal__title {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.25;
}

.album-reveal__artist {
  font-size: 0.85rem;
  opacity: 0.85;
}

/* ── Play indicator (always visible) ──────────────────────────── */
.album-reveal__play {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  transition:
    transform var(--ar-transition),
    background var(--ar-transition);
  pointer-events: none; /* clicks pass through to the cover button */
}

.album-reveal__cover:hover .album-reveal__play,
.album-reveal__cover:focus-visible .album-reveal__play {
  background: var(--ar-hover);
  color: #fff;
  transform: scale(1.08);
}

.album-reveal.is-open .album-reveal__play {
  display: none;
}

/* ── Player panel ─────────────────────────────────────────────── */
.album-reveal__player {
  position: absolute;
  inset: 0;
  background: var(--ar-player-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden; /* hides from pointer events & AT */
  pointer-events: none; /* belt-and-braces: no clicks through it when hidden */
  transition:
    opacity var(--ar-transition),
    visibility 0s linear var(--ar-transition);
  z-index: 2;
}

.album-reveal.is-open .album-reveal__player {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity var(--ar-transition),
    visibility 0s;
}

.album-reveal.is-open .album-reveal__cover {
  pointer-events: none; /* cover sits behind the player when open */
}

.album-reveal__frame {
  padding: 20px;
  width: 100%;
  height: 86%; /* matches the compact Spotify embed */
  max-width: 100%;
}

.album-reveal__frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: calc(var(--ar-radius) - 2px);
}

/* ── Close button ─────────────────────────────────────────────── */
.album-reveal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ar-close-bg);
  color: var(--ar-close-fg);
  cursor: pointer;
  z-index: 3;
  transition:
    background var(--ar-transition),
    transform var(--ar-transition);
}

.album-reveal__close:hover,
.album-reveal__close:focus-visible {
  background: #000;
  transform: scale(1.08);
  outline: none;
}

/* ── Editor tweaks ────────────────────────────────────────────── */
.album-reveal--editor .album-reveal__editor-actions {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  gap: 8px;
  z-index: 4;
}

/* ── Reduced motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .album-reveal,
  .album-reveal *,
  .album-reveal *::before,
  .album-reveal *::after {
    transition: none !important;
  }
}
