/* ==========================================================================
   ALBUMS: EXPANDED CARDS RAIL (5 TALL ALBUM CARDS)
   Stage container-type: inline-size; 1cqw gap; 13% closed, 44% open;
   Width animation: 0.62s cubic-bezier(.22, 1, .36, 1);
   44cqw fixed non-rewrapping captions.
   ========================================================================== */

.expanded-albums-section {
  padding-block: 70px 85px;
  position: relative;
  overflow: clip;
  background: var(--paper, #fff);
}

.expanded-albums-stage {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  container-type: inline-size;
  position: relative;
}

.expanded-albums-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 20px;
}

.expanded-albums-btn {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #4b4754;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.expanded-albums-btn:hover,
.expanded-albums-btn:focus-visible {
  background: #fff;
  border-color: #ff1730;
  color: #ff1730;
  box-shadow: 0 4px 12px rgba(255, 23, 48, 0.12);
  outline: none;
}

/* The Rail: flex row, 1cqw gap, flex: 0 0 auto */
.expanded-albums-rail {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 1cqw;
  width: 100%;
  box-sizing: border-box;
}

/* Album Card */
.expanded-album-card {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 13%;
  height: 520px;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  filter: brightness(0.97);
  border: 1px solid rgba(0, 0, 0, 0.09);
  transition: width 0.62s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.35s ease,
              border-color 0.35s ease,
              box-shadow 0.35s ease;
  user-select: none;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.expanded-albums-rail .expanded-album-card {
  background: #ffffff;
}

.expanded-album-card:focus-visible {
  outline: 2px solid #ff1730;
  outline-offset: 3px;
  border-color: #ff1730;
}

/* Active open card */
.expanded-album-card.is-open {
  width: 44%;
  filter: brightness(1);
  border-color: rgba(229, 9, 20, 0.45);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.08), 0 0 35px rgba(229, 9, 20, 0.12);
}

/* 5 Distinct Light Gradients */
.expanded-albums-rail .expanded-album-card:nth-child(1) {
  background: linear-gradient(145deg, #ffffff 0%, #fff1f2 60%, #ffe4e6 100%);
}
.expanded-albums-rail .expanded-album-card:nth-child(2) {
  background: linear-gradient(145deg, #ffffff 0%, #fffbeb 60%, #fef3c7 100%);
}
.expanded-albums-rail .expanded-album-card:nth-child(3) {
  background: linear-gradient(145deg, #ffffff 0%, #f0f9ff 60%, #e0f2fe 100%);
}
.expanded-albums-rail .expanded-album-card:nth-child(4) {
  background: linear-gradient(145deg, #ffffff 0%, #faf5ff 60%, #f3e8ff 100%);
}
.expanded-albums-rail .expanded-album-card:nth-child(5) {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 60%, #f1f5f9 100%);
}

/* Soft organic blob with radial highlight */
.expanded-album-card::before {
  content: '';
  position: absolute;
  top: -15%;
  right: -15%;
  width: 240px;
  height: 240px;
  border-radius: 46% 54% 58% 42% / 52% 44% 56% 48%;
  background: radial-gradient(circle at 35% 35%, rgba(229, 9, 20, 0.22) 0%, rgba(255, 100, 120, 0.1) 45%, transparent 75%);
  filter: blur(16px);
  opacity: 0.65;
  pointer-events: none;
  transition: transform 0.8s ease, opacity 0.5s ease;
  z-index: 1;
}

.expanded-album-card.is-open::before {
  transform: scale(1.15) rotate(15deg);
  opacity: 0.85;
}

/* Bottom-up light scrim */
.expanded-album-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.55) 45%, rgba(255, 255, 255, 0.97) 100%);
  z-index: 2;
  pointer-events: none;
}

/* Artwork container */
.album-card__artwork {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.album-card__artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
  transition: transform 0.8s ease, opacity 0.5s ease;
}

.expanded-album-card.is-open .album-card__artwork img {
  transform: scale(1.05);
  opacity: 0.62;
}

/* Card content */
.album-card__content {
  position: relative;
  z-index: 3;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px 22px;
}

.album-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.album-card__num {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #e50024;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.album-card__pill {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #4b4754;
  border: 1px solid rgba(0, 0, 0, 0.08);
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.expanded-album-card.is-open .album-card__pill {
  opacity: 1;
}

/* Fixed 44cqw caption that never rewraps during expansion */
.album-card__caption {
  width: 44cqw;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 20px;
}

.album-card__title {
  font-size: clamp(20px, 2.3cqw, 28px);
  font-weight: 800;
  color: #0e0d12;
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-card__artist {
  font-size: 14px;
  color: #e50024;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-card__meta {
  font-size: 13px;
  color: #5c5866;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease 0.12s, transform 0.35s ease 0.12s;
}

.album-card__action {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #0e0d12;
  text-decoration: none;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease 0.16s, transform 0.35s ease 0.16s, color 0.2s ease;
}

.album-card__action:hover {
  color: #e50024;
}

.expanded-album-card.is-open .album-card__meta,
.expanded-album-card.is-open .album-card__action {
  opacity: 1;
  transform: translateY(0);
}

@media(max-width: 860px) {
  .expanded-albums-rail {
    flex-direction: column;
    gap: 14px;
  }
  .expanded-album-card {
    width: 100% !important;
    height: 140px;
    filter: brightness(0.9);
  }
  .expanded-album-card.is-open {
    height: 290px;
    filter: brightness(1.05);
  }
  .album-card__caption {
    width: 100%;
  }
  .expanded-album-card:not(.is-open) .album-card__meta,
  .expanded-album-card:not(.is-open) .album-card__action {
    display: none;
  }
  .expanded-album-card.is-open .album-card__meta,
  .expanded-album-card.is-open .album-card__action {
    opacity: 1 !important;
    transform: none !important;
  }
}

@media(prefers-reduced-motion: reduce) {
  .expanded-album-card {
    transition: none;
  }
  .expanded-albums-btn {
    display: none;
  }
}
