.playlist-page {
  max-width: 80rem;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
  background-color: var(--color-bg);
}

/* margin-top: 0 — the title opens the column, above it only .playlist-page's
   --space-xl and the locked 4.5rem header clearance. See the same note in
   essays.css: its own --space-2xl on top of those read as a canyon.

   Left-aligned (was centred), matching the genre/writer index pages and the
   essays page beside it. */
.page-title {
  font-size: var(--font-size-page-title);
  margin-bottom: var(--space-lg);
  margin-top: 0;
  font-family: var(--font-heading);
  text-align: left;
}

/* See essays.css: the shared .pill-nav centres itself, which reads lopsided
   under a left-aligned title. Scoped here, shared component unchanged. */
.playlist-hero .pill-nav {
  justify-content: flex-start;
}

/* ============================================================
   Section bars (one per group)
   ============================================================ */
.playlist-section {
  margin-top: var(--space-2xl);
}

.playlist-section-bar {
  border-top: 2px solid var(--color-black);
  padding-top: 0.6rem;
  margin-bottom: var(--space-lg);
}

.playlist-section-bar span {
  font-family: var(--font-content);
  font-size: 0.8rem;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps-wide);
  color: var(--color-heading-text);
}

/* ============================================================
   Grid of playlist cards
   ============================================================ */
.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: var(--space-2xl) var(--space-xl);
}

.playlist-card {
  background-color: transparent;
  border: none;
  padding: 0;
}

/* Small-caps category kicker, shared by grid + detail */
.playlist-kicker {
  display: inline-block;
  font-family: var(--font-content);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--color-accent);
  margin-bottom: var(--space-xxs);
  text-decoration: none;
}

a.playlist-kicker:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.playlist-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  line-height: var(--line-height-tight);
  margin: 0 0 var(--space-xs);
}

.playlist-title a {
  text-decoration: none;
  color: var(--color-heading);
}

.playlist-title a:hover {
  text-decoration: underline;
}

.playlist-deck {
  font-style: italic;
  font-size: var(--font-size-md);
  color: var(--color-gray-text);
  line-height: var(--line-height-tight);
  margin: 0 0 var(--space-md);

  /* Reserve exactly 2 lines so every card's embed aligns,
     whether the deck is one line or two. */
  min-height: calc(var(--line-height-tight) * 2em);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Artist cross-link under a playlist (index card + detail). */
.playlist-byline {
  font-family: var(--font-content);
  font-size: var(--font-size-sm);
  color: var(--color-subtle-text);
  margin: 0 0 var(--space-md);
}

.playlist-byline a {
  color: var(--color-accent);
  text-decoration: none;
}

.playlist-byline a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.spotify-embed {
  width: 100%;
  height: 22rem;
  border: none;
  border-radius: var(--radius-lg);
  display: block;
}

.playlist-footer {
  margin-top: var(--space-sm);
}

.playlist-meta {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-subtle-text);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.playlist-meta a:not(.tag-pill) {
  color: var(--color-accent);
  text-decoration: none;
}

.playlist-meta a:not(.tag-pill):hover {
  text-decoration: underline;
}

.playlist-empty {
  text-align: center;
  color: var(--color-subtle-text);
  padding: var(--space-2xl) 0;
}

/* ============================================================
   Single playlist (detail page)
   ============================================================ */
.playlist-detail {
  max-width: 46rem;
}

.playlist-single {
  padding-top: var(--space-2xl);
}

.playlist-single-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  border-bottom: 2px solid var(--color-black);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-lg);
}

.playlist-single-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: var(--line-height-tight);
  margin: 0;
}

.playlist-single-deck {
  font-style: italic;
  font-size: var(--font-size-lg);
  color: var(--color-gray-text);
  line-height: var(--line-height-body);
  margin: 0 0 var(--space-lg);
}

.playlist-detail .spotify-embed {
  height: 25rem;
}

/* ============================================================
   Responsive — phone (--bp-phone, see theme/breakpoints.css)
   ============================================================ */
@media (max-width: 54rem) {
  .playlist-page {
    padding: var(--space-md);
  }

  /* See essays.css: the desktop rule is margin-top: 0 now, so this override
     only re-adds a gap under the phone header. */
  .page-title {
    margin-top: 0;
  }

  .playlist-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .playlist-section {
    margin-top: var(--space-xl);
  }

  .playlist-single-header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Moved out of base_styles/mobile.css so the playlists page owns its
     own responsive tail. */
  .playlist-card {
    padding: 1rem 0.5rem;
    margin-bottom: 0.5rem;
    box-shadow: none;
  }

  .playlist-title {
    font-size: 1.15rem;
    margin-bottom: 0.25rem;
    text-align: center;
  }

  .spotify-embed {
    height: 18rem;
    margin-bottom: 0.5rem;
  }

  .playlist-meta {
    font-size: 0.95rem;
    flex-wrap: wrap;
    gap: 0.25rem;
    text-align: center;
  }
}
