/* Genre/album/artist-network components shared across pages.
   All values come from the design tokens in css/theme/. */

/* --- GENRE GRID --- */
.genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.genre-card {
  background-color: var(--color-bg-card);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-fast);
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.genre-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.genre-card h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.genre-card ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  flex-grow: 1;
}

.genre-card li {
  margin-bottom: 0.25rem;
  font-size: var(--font-size-base);
}

.scrollable-list {
  max-height: 200px;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
  scroll-behavior: smooth;
  margin-bottom: 0.5rem;
}

.scrollable-list::-webkit-scrollbar {
  width: 6px;
}

.scrollable-list::-webkit-scrollbar-thumb {
  background-color: var(--color-border);
  border-radius: var(--radius-lg);
}

.view-all-link {
  text-align: right;
  font-size: 0.95rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-accent);
  text-decoration: none;
  margin-top: 1rem;
  margin-bottom: -0.5rem; /* optional spacing tweak */
  align-self: flex-end;
  transition: color var(--transition-smooth);
}

.view-all-link:hover {
  color: var(--color-accent-hover);
}

.genre-detail-list {
  list-style: none;
  padding-left: 0;
  font-size: 1.125rem;
  max-width: 600px;
  margin: 2rem auto;
}

.genre-detail-list li {
  margin-bottom: 0.5rem;
}

.album-header {
  font-size: var(--font-size-2xl);
  margin-bottom: 1.5rem;
  text-align: center;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.album-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden; /* 🔒 hide overflowed song list */
  position: relative;
  transition: max-height var(--transition-smooth);
}

.album-card.expanded {
  overflow: visible;
}

.album-card .song-list.limited {
  max-height: 300px; /* Only limits songs, not entire card */
  overflow-y: hidden;
}

.album-card.expanded .song-list.limited {
  max-height: none;
}

.album-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.album-cover {
  width: 160px;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}

.album-details {
  flex: 1;
  min-width: 220px;
}

.album-title {
  font-size: var(--font-size-lg);
  margin-bottom: 1rem;
  font-weight: var(--font-weight-bold);
}

.song-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  text-align: left; /* 👈 Align all text to the left */
}

.song-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--color-divider);
  font-size: var(--font-size-base);
  text-align: left; /* 👈 Ensures left alignment */
}

.song-title {
  flex-grow: 1;
  margin-right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.song-duration {
  opacity: 0.6;
  margin-left: 0.5rem;
}

.spotify-icon {
  display: inline-flex;
  align-items: center;
}

.spotify-logo {
  width: 22px;
  height: 22px;
  opacity: 0.85;
  transition: transform var(--transition-fast);
}

.spotify-logo:hover {
  transform: scale(1.1);
  opacity: 1;
}

.expand-songs {
  margin-top: 1rem;
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--color-accent);
  font-size: 0.9rem;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  padding: 0.5rem 0;
  transition: color var(--transition-fast);
}

.expand-songs:hover {
  color: var(--color-accent-hover);
}

.no-songs {
  text-align: center;
  font-style: italic;
  color: var(--color-subtle-text);
}

.disc-heading {
  font-weight: var(--font-weight-semibold);
  font-size: 1.05rem;
  margin-top: 1.5rem;
  margin-bottom: 0.25rem;
  color: var(--color-gray-text);
  border-top: 1px solid var(--color-light-gray);
  padding-top: 0.75rem;
}

.artist-network {
  margin-top: 2rem;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-divider);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  list-style-type: none;
}
.artist-network h3 {
  font-size: var(--font-size-xl);
  margin-bottom: 1rem;
}

.artist-network ul {
  list-style: none;
  padding-left: 0;
  margin: 0.5rem 0;
}

.artist-network li {
  margin-bottom: 0.25rem;
  list-style: none;
}

.network-title {
  font-size: var(--font-size-xl);
  margin-top: 3rem;
  margin-bottom: 1rem;
  text-align: center;
}

#artist-network-graph {
  height: 420px;
  background: var(--color-bg);
  border: 1px solid var(--color-light-gray);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-faint);
  margin: 0 auto 1.5rem auto;
  max-width: 100%;
}

.artist-network {
  margin-top: 2rem;
}

.network-legend {
  text-align: center;
  margin: 0.75rem 0;
}

.legend-list {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 0;
  margin: 0;
}

.legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-round);
  margin-right: 0.4rem;
  vertical-align: middle;
}

.influence-dot {
  background-color: var(--color-viz-influence);
}

.listens-dot {
  background-color: var(--color-viz-listens);
}
