.playlist-page {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  background-color: var(--color-white);
}

.page-title {
  font-size: var(--font-size-page-title);
  margin-bottom: 1.5rem;
  margin-top: 3rem;
  font-family: var(--font-heading);
  text-align: center;
}

.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 3rem 2rem;
  margin-top: 2rem;
}

.playlist-card {
  background-color: transparent;
  border: none;
  padding: 0;
  transition: transform 0.2s ease;
}

.playlist-card:hover {
  transform: translateY(-3px);
}

/* === Single Playlist Header & Bookmark Row === */
.playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.playlist-title {
  font-family: var(--font-heading);
  text-align: center;
  font-size: var(--font-size-heading-medium);
  margin-bottom: 0.5rem;
}

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

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

/* When used on the single page, the title is left-aligned inside header */
.playlist-grid.single .playlist-title {
  text-align: left;
  margin-bottom: 0;
}

/* === Existing playlist list styles === */

.playlist-excerpt {
  font-size: var(--font-size-base);
  color: var(--color-text);
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.playlist-tags {
  margin-top: 0.5rem;
}

.playlist-tag {
  display: inline-block;
  font-size: var(--font-size-small);
  padding: 0.25rem 0.5rem;
  margin-right: 0.5rem;
  border-radius: 2rem;
  border: 1px solid var(--color-border);
  color: var(--color-dark-gray);
  text-transform: uppercase;
}

.playlist-subtitle {
  font-size: var(--font-size-base);
  font-style: italic;
  color: var(--color-text);
  border-left: 4px solid var(--color-accent);
  padding-left: 1rem;
  margin-bottom: 1.25rem;
  opacity: 0.95;

  /* clamp to 2–3 lines */
  height: 4.8rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}

.read-more-link {
  margin-top: 0.5rem;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

.read-more-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

.spotify-embed {
  width: 100%;
  height: 25rem;
  border: none;
  margin-bottom: 0.25rem;
}

/* Footer for meta / tags on single page */
.playlist-footer {
  margin-top: 0.5rem;
}

.playlist-meta {
  margin: 0;
  font-size: var(--font-size-medium);
  color: var(--color-subtle-text);
}

.playlist-grid.single {
  display: flex;
  justify-content: center;
}

.playlist-grid.single .playlist-card {
  max-width: 40rem;
  min-width: 35rem;
}

@media (max-width: 54rem) {
  /* Playlists Page */

  .page-title {
    margin-top: 0;
  }

  .playlist-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .playlist-page {
    padding: 1rem 2rem;
  }

  .playlist-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem 0.5rem;
    margin-top: 1rem;
  }

  .playlist-card {
    padding: 1rem 0.5rem;
    margin-bottom: 0.5rem;
    box-shadow: none;
  }

  .playlist-subtitle {
    font-size: var(--font-size-base);
    padding-left: 0.5rem;
    margin-bottom: 0.5rem;
  }

  .playlist-meta {
    font-size: var(--font-size-small);
    flex-wrap: wrap;
    gap: 0.25rem;
    text-align: center;
  }

  .playlist-grid.single .playlist-card {
    max-width: 25rem;
    min-width: 25rem;
  }

  /* On small screens, stack title and bookmark vertically */
  .playlist-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .playlist-grid.single .playlist-title {
    text-align: left;
  }
}
