/* Styles for the cover collection views. Kept separate from the legacy sheet. */
#cover-collections-section,
#all-songs-view,
#collection-grid,
#collection-detail {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

#collection-grid,
#featured-collections {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 154px), 1fr));
  gap: 16px;
  padding: 4px 0 20px;
}

#featured-collections {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

#featured-collections::-webkit-scrollbar { display: none; }

.collection-card {
  display: flex;
  flex: 0 0 180px;
  width: 100%;
  min-width: 0;
  padding: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  color: var(--white);
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: transform .18s ease;
}

#collection-grid .collection-card { flex-basis: auto; }
.collection-card:hover { transform: translateY(-3px); }
.collection-card:focus-visible { outline: 2px solid var(--white); outline-offset: 4px; border-radius: 12px; }

.collection-artwork-wrap {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(135deg, #263238, #7c42f4);
}

.collection-card-artwork {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  background: linear-gradient(135deg, #263238, #7c42f4);
}

.collection-card-open-icon {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding-left: 2px;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-size: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,.24);
}

.collection-card-title {
  max-width: 100%;
  margin-top: 6px;
  overflow: hidden;
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-card-artist,
.collection-card-count {
  max-width: 100%;
  overflow: hidden;
  color: rgba(255,255,255,.62);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#collection-detail {
  overflow-x: clip;
}

#collection-detail .artist-profile-back-btn {
  position: static;
  margin: 8px 0 20px;
  padding: 0;
}

.collection-detail-hero {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(132px, min(22vw, 210px)) minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 3vw, 28px);
  margin: 0 0 28px;
}

.collection-detail-hero > img {
  display: block;
  width: 100%;
  max-width: 210px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  background: linear-gradient(135deg, #263238, #7c42f4);
}

.collection-detail-meta { min-width: 0; overflow-wrap: anywhere; }
.collection-detail-meta .section-title { margin: 0 0 6px; }
.collection-detail-meta .section-subtitle { margin: 4px 0; }
.collection-credits { margin-top: 10px; }
.collection-credit { margin: 5px 0; color: rgba(255,255,255,.78); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.collection-credit-label { color: rgba(255,255,255,.5); }
.collection-cover-count { margin-top: 10px !important; }
.collection-cover-list { width: 100%; min-width: 0; }
.collection-cover-list .release-row { min-width: 0; }
.collection-cover-list .release-meta { min-width: 0; }
.collection-message, .collection-loading { padding: 20px 0; color: rgba(255,255,255,.62); }

@media (max-width: 600px) {
  #cover-collections-section { padding-right: 16px; padding-left: 16px; }
  #all-songs-view.content-section { padding: 30px 16px 120px; }
  #collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  #featured-collections .collection-card { flex-basis: min(42vw, 170px); }
  .collection-detail-hero {
    grid-template-columns: minmax(112px, min(36vw, 160px)) minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 24px;
  }
  .collection-detail-hero > img { max-width: 160px; border-radius: 12px; }
  .collection-detail-meta .section-title { font-size: clamp(20px, 6vw, 26px); line-height: 1.12; }
  .collection-detail-meta .section-subtitle { font-size: 12px; }
  .collection-credit { font-size: 11px; }
  .collection-cover-list .release-row { gap: 10px; padding: 12px 0; }
  .collection-cover-list .release-menu-btn { display: none; }
}

@media (max-width: 360px) {
  #all-songs-view.content-section { padding-right: 12px; padding-left: 12px; }
  #collection-grid { gap: 10px; }
  .collection-detail-hero { grid-template-columns: minmax(100px, 34vw) minmax(0, 1fr); gap: 11px; }
  .collection-cover-list .release-play-btn { width: 28px; height: 28px; }
}
