/* =========================================================================
   Spotiny · detail.css
   ----------------------------------------------------------------------------
   Shared styles for detail pages: Album, Playlist, and (already-existing)
   Artist. Also includes the universal .detail-back button used on all
   detail pages.
   ========================================================================= */

/* ---- Universal back button (used by Artist / Album / Playlist) ---- */
.detail-back {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: var(--sp-2) var(--sp-3);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-13);
  font-weight: 600;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background var(--dur-1), transform var(--dur-1), color var(--dur-1);
}
.detail-back svg {
  width: 16px;
  height: 16px;
  transform: rotate(180deg);   /* chevron-right → points left */
  transition: transform var(--dur-2);
}
.detail-back:hover {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
}
.detail-back:hover svg { transform: rotate(180deg) translateX(2px); }
.detail-back:active { transform: scale(0.96); }
.detail-back:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========================================================================
   Album detail view (v2 — tokens refreshed; layout kept compatible with
   existing album.js markup: .album-hero__backdrop + .album-hero__main)
   ========================================================================= */
.album-hero {
  position: relative;
  padding: var(--sp-7) var(--sp-4) var(--sp-6);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--sp-6);
  min-height: var(--hero-h);
  background: var(--surface);
  display: flex;
  align-items: flex-end;
}
/* If a future template renders a direct <img> inside .album-hero, it fills
   the hero. The legacy .album-hero__cover img (180×180 wrapper) is left
   untouched below so album.js's existing markup still works. */
.album-hero > img {
  width: 100%;
  height: var(--hero-h);
  object-fit: cover;
  object-position: center 30%;
  display: block;
}
.album-hero__gradient {
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, transparent 55%);
  z-index: 1;
}
.album-hero__info {
  position: absolute;
  bottom: var(--sp-4);
  left: var(--sp-4);
  right: var(--sp-4);
  z-index: 2;
}
.album-hero__backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  filter: blur(30px) saturate(140%);
  opacity: 0.55;
  transform: scale(1.1);
  z-index: 0;
}
.album-hero__backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(6, 6, 8, 0.4) 0%,
    rgba(6, 6, 8, 0.7) 60%,
    rgba(6, 6, 8, 0.95) 100%);
}
.album-hero__main {
  position: relative;
  z-index: 1;
  display: flex;
  gap: var(--sp-5);
  align-items: flex-end;
  width: 100%;
  flex-wrap: wrap;
}
.album-hero__cover {
  width: 180px;
  height: 180px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-3);
  box-shadow: var(--shadow-lg);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.album-hero__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.album-hero__cover--placeholder svg { width: 64px; height: 64px; }
.album-hero__meta {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.album-hero__type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-12);
  color: var(--text-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.album-hero__type svg { width: 14px; height: 14px; }
.album-hero__title {
  font-size: var(--fs-32);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  margin: 0;
  line-height: 1.1;
}
.album-hero__sub {
  font-size: var(--fs-14);
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.album-hero__sub > span::before {
  content: '·';
  margin-right: var(--sp-2);
  color: var(--muted);
}
.album-hero__sub > span:first-child::before { content: ''; margin: 0; }
.album-hero__artist-link {
  background: transparent;
  border: 0;
  color: var(--text);
  font: inherit;
  font-size: var(--fs-14);
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color var(--dur-1), text-decoration-color var(--dur-1);
}
.album-hero__artist-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}
.album-hero__artist-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
.album-hero__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  flex-wrap: wrap;
}
.album-hero__play-btn,
.album-hero__shuffle-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--fs-14);
  font-weight: 600;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background var(--dur-1), transform var(--dur-1), color var(--dur-1);
}
.album-hero__play-btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  box-shadow: var(--shadow-accent);
}
.album-hero__play-btn:hover { background: var(--accent-strong); transform: scale(1.04); }
.album-hero__play-btn:active { transform: scale(0.97); }
.album-hero__play-btn svg { width: 16px; height: 16px; }
.album-hero__shuffle-btn {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border);
}
.album-hero__shuffle-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}
.album-hero__shuffle-btn:active { transform: scale(0.97); }
.album-hero__shuffle-btn svg { width: 16px; height: 16px; }
.album-hero__action-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--dur-1), color var(--dur-1), transform var(--dur-1);
}
.album-hero__action-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  transform: scale(1.06);
}
.album-hero__action-btn:active { transform: scale(0.92); }
.album-hero__action-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.album-hero__action-btn svg { width: 18px; height: 18px; }

.album-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-7);
}
.album-section__title {
  font-size: var(--fs-18);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-4);
}
.album-tracks {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

/* Track-number badge (injected into .row-item for album tracks) */
.row-item__track-num {
  display: inline-block;
  min-width: 28px;
  font-size: var(--fs-13);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 500;
  margin-right: var(--sp-2);
  text-align: right;
}
.row-item.is-playing .row-item__track-num { color: var(--accent); }

/* =========================================================================
   Playlist detail view (v2 — tokens refreshed; layout kept compatible with
   existing playlist.js markup: .playlist-hero__backdrop + .playlist-hero__main)
   ========================================================================= */
.playlist-hero {
  position: relative;
  padding: var(--sp-7) var(--sp-4) var(--sp-6);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--sp-6);
  min-height: var(--hero-h);
  background: var(--surface);
  display: flex;
  align-items: flex-end;
}
.playlist-hero > img {
  width: 100%;
  height: var(--hero-h);
  object-fit: cover;
  object-position: center 30%;
  display: block;
}
.playlist-hero__gradient {
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, transparent 55%);
  z-index: 1;
}
.playlist-hero__info {
  position: absolute;
  bottom: var(--sp-4);
  left: var(--sp-4);
  right: var(--sp-4);
  z-index: 2;
}
.playlist-hero__backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  filter: blur(30px) saturate(140%);
  opacity: 0.55;
  transform: scale(1.1);
  z-index: 0;
}
.playlist-hero__backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(6, 6, 8, 0.4) 0%,
    rgba(6, 6, 8, 0.7) 60%,
    rgba(6, 6, 8, 0.95) 100%);
}
.playlist-hero__main {
  position: relative;
  z-index: 1;
  display: flex;
  gap: var(--sp-5);
  align-items: flex-end;
  width: 100%;
  flex-wrap: wrap;
}
.playlist-hero__cover {
  width: 180px;
  height: 180px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-3);
  box-shadow: var(--shadow-lg);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.playlist-hero__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.playlist-hero__cover--placeholder svg { width: 64px; height: 64px; }
.playlist-hero__meta {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.playlist-hero__type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-12);
  color: var(--text-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.playlist-hero__type svg { width: 14px; height: 14px; }
.playlist-hero__title {
  font-size: var(--fs-32);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  margin: 0;
  line-height: 1.1;
}
.playlist-hero__sub {
  font-size: var(--fs-14);
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.playlist-hero__sub > span::before {
  content: '·';
  margin-right: var(--sp-2);
  color: var(--muted);
}
.playlist-hero__sub > span:first-child::before { content: ''; margin: 0; }
.playlist-hero__desc {
  font-size: var(--fs-13);
  color: var(--muted);
  line-height: 1.5;
  margin-top: var(--sp-2);
  max-width: 60ch;
}
.playlist-hero__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  flex-wrap: wrap;
}
.playlist-hero__play-btn,
.playlist-hero__shuffle-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--fs-14);
  font-weight: 600;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background var(--dur-1), transform var(--dur-1), color var(--dur-1);
}
.playlist-hero__play-btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  box-shadow: var(--shadow-accent);
}
.playlist-hero__play-btn:hover { background: var(--accent-strong); transform: scale(1.04); }
.playlist-hero__play-btn:active { transform: scale(0.97); }
.playlist-hero__play-btn svg { width: 16px; height: 16px; }
.playlist-hero__shuffle-btn {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border);
}
.playlist-hero__shuffle-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}
.playlist-hero__shuffle-btn:active { transform: scale(0.97); }
.playlist-hero__shuffle-btn svg { width: 16px; height: 16px; }
.playlist-hero__action-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--dur-1), color var(--dur-1), transform var(--dur-1);
}
.playlist-hero__action-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  transform: scale(1.06);
}
.playlist-hero__action-btn:active { transform: scale(0.92); }
.playlist-hero__action-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.playlist-hero__action-btn svg { width: 18px; height: 18px; }

.playlist-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-7);
}
.playlist-section__title {
  font-size: var(--fs-18);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--sp-4);
}
.playlist-tracks {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

/* =========================================================================
   Artist-page extras (shuffle-all button + description)
   ========================================================================= */
.artist-hero__shuffle-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background var(--dur-1), transform var(--dur-1);
}
.artist-hero__shuffle-btn:hover {
  background: var(--surface-hover);
  transform: scale(1.06);
}
.artist-hero__shuffle-btn:active { transform: scale(0.95); }
.artist-hero__shuffle-btn svg { width: 22px; height: 22px; }

.artist-hero__desc {
  font-size: var(--fs-13);
  color: var(--muted);
  line-height: 1.5;
  margin-top: var(--sp-2);
  max-width: 60ch;
  text-align: center;
}

/* ---- Mobile: stack album/playlist hero vertically ---- */
@media (max-width: 599px) {
  .album-hero__main,
  .playlist-hero__main {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .album-hero__cover,
  .playlist-hero__cover {
    width: 140px;
    height: 140px;
  }
  .album-hero__meta,
  .playlist-hero__meta {
    align-items: center;
    width: 100%;
  }
  .album-hero__title,
  .playlist-hero__title {
    font-size: var(--fs-24);
  }
  .album-hero__desc,
  .playlist-hero__desc {
    text-align: center;
  }
  .album-hero__actions,
  .playlist-hero__actions {
    justify-content: center;
  }
}
