/*
 * CCC /music compact card sizing — geometry only, 2026-11-21.
 * Load after ccc-clean-layout.css and the existing music-page styles.
 * Scoped exclusively to the public editorial music discovery module.
 * No markup, media sources, paint, typography, playback or filter changes.
 * Original iframe heights and native audio controls remain authoritative.
 */

/* Three desktop columns; each row sizes independently, not to the tallest
 * provider anywhere in the grid. Short cards keep their natural height.
 */
body.ccc-cinematic > main.editorial-page [data-music-discovery] .release-grid.editorial-releases {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: auto;
  align-items: start;
  gap: 20px;
}

body.ccc-cinematic > main.editorial-page [data-music-discovery] .music-release-card {
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  height: auto;
  align-self: start;
  gap: 0;
  padding: 14px;
}

/* Full-width, shallow artwork frame; contain shows the entire original art.
 * Grid centering also accommodates the existing CCC mark when no image exists.
 * The display override excludes [hidden], leaving visibility to the module.
 */
body.ccc-cinematic > main.editorial-page [data-music-discovery] .music-release-card .release-art:not([hidden]) {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  height: 160px;
  min-height: 0;
  aspect-ratio: auto;
  flex-shrink: 0;
}

body.ccc-cinematic > main.editorial-page [data-music-discovery] .release-art img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
}

/* Title immediately follows artwork; no reserved two-line title height and
 * no spacer track. All provider, artist and genre text remains unrestricted.
 */
body.ccc-cinematic > main.editorial-page [data-music-discovery] .music-release-copy {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  gap: 6px;
  padding: 8px 0 12px;
}

body.ccc-cinematic > main.editorial-page [data-music-discovery] .music-release-copy h2 {
  min-height: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

body.ccc-cinematic > main.editorial-page [data-music-discovery] .music-release-copy p a:not([hidden]) {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  min-width: 44px;
  min-height: 44px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Do not assign iframe heights or compact provider internals. Prevent flex
 * shrinking so the original height attributes remain intact (200px/352px
 * in the captured public page); keep native audio at least touch-sized.
 */
body.ccc-cinematic > main.editorial-page [data-music-discovery] .music-release-card :is(.music-release-embed, .music-release-audio) {
  flex-shrink: 0;
}

body.ccc-cinematic > main.editorial-page [data-music-discovery] .music-release-card .music-release-audio {
  min-height: 44px;
  margin: 0 0 12px;
}

/* Natural flow rather than pushing a short card's footer to a tall player. */
body.ccc-cinematic > main.editorial-page [data-music-discovery] .music-card-footer {
  gap: 6px 12px;
  margin-top: 0;
  padding: 10px 0 0;
}

body.ccc-cinematic > main.editorial-page [data-music-discovery] .music-card-footer a {
  min-width: 44px;
  min-height: 44px;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* At 1021px the existing 48px page inset, 40px grid gaps and 28px card
 * padding still leave at least 280px per player with existing 1px borders.
 */
@media (max-width: 1020px) {
  body.ccc-cinematic > main.editorial-page [data-music-discovery] .release-grid.editorial-releases {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  body.ccc-cinematic > main.editorial-page [data-music-discovery] .release-grid.editorial-releases {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 480px;
    margin-inline: auto;
    gap: 16px;
  }
}

/* A 320px viewport has only 284px inside the existing page shell. Let the
 * unchanged player use the card's inset at this narrow size, rather than
 * squeezing its controls below 280px. Art and copy retain their normal inset.
 */
@media (max-width: 340px) {
  body.ccc-cinematic > main.editorial-page [data-music-discovery] .music-release-card :is(.music-release-embed, .music-release-audio) {
    width: calc(100% + 26px);
    max-width: calc(100% + 26px);
    margin-inline: -13px;
  }
}
