/*
 * The Hip Hop Lab: new releases (Home #releases, artist pages). Revision 0.4, section 9.
 * The hero's lead record leads here too, large; every other release follows newest first.
 * A record is artwork, artist, title and platform buttons (ruling 12).
 * Colours, sizes and timings come from tokens.css only. .btn, .btn--quiet and .section-head
 * belong to system.css (stage lane); this file only positions them.
 */

.releases {
  padding-block: var(--section-pad);
  padding-inline: var(--gutter);
  color: var(--text);
}

.releases__inner {
  max-width: 100%;
  margin-inline: auto;
}

.releases__title--artist {
  font-size: calc(var(--fs-title) * 0.72);
}

/* --------------------------------------------------------------- one release */

.record {
  min-width: 0;
}

.record__cover {
  position: relative;
  margin: 0;
}

.record__art {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  background: var(--ink-2);
  box-shadow: 0 0 0 1px var(--line);
}

.record__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.record__artist {
  color: var(--text-2);
  font-size: var(--fs-small);
  font-weight: 600;
  text-decoration: none;
}

a.record__artist:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

a.record__artist:focus-visible {
  outline: none;
  border-radius: 2px;
  box-shadow: var(--focus-on-dark);
}

/* Ruling 10: the artist name is a short line of text; its hit area is at least 44 x 44 px. */
a.record__artist {
  position: relative;
}

a.record__artist::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100%, var(--target, 44px));
  height: max(100%, var(--target, 44px));
  transform: translate(-50%, -50%);
}

.record__title {
  margin: 0.125rem 0 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

/* Only for a release not yet out: "Out 30 Nov" (ruling 12). */
.record__out {
  margin: 0.25rem 0 0;
  color: var(--text);
  font-size: var(--fs-small);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.record__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem 0.75rem;   /* clears style b's offset shadow */
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

/* --------------------------------------------------------------- the lead record */

.record--lead {
  display: grid;
  gap: clamp(1.25rem, 3vw, 3rem);
  align-items: end;
  margin-bottom: clamp(3rem, 6vw, 5rem);
}

@media (min-width: 48em) {
  .record--lead {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }
}

.record--lead .record__artist {
  font-size: var(--fs-lead);
}

.record--lead .record__title {
  margin-top: 0.25rem;
  font-family: var(--font-display);
  font-stretch: var(--display-stretch);
  font-weight: var(--display-weight);
  font-size: var(--fs-name);
  letter-spacing: var(--display-tracking);
  line-height: 0.95;
  text-transform: uppercase;
}

.record--lead .record__links {
  margin-top: 1.5rem;
}

/* --------------------------------------------------------------- the grid */

.releases__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Phone: a row per release, artwork at the left. */
@media (max-width: 33.99em) {
  /* Artwork and words side by side; the platform controls run the full width under them. */
  .releases__grid .record {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    grid-auto-rows: auto;
    column-gap: 1rem;
    align-items: start;
  }

  .releases__grid .record__body {
    display: contents;
  }

  .releases__grid .record__cover {
    grid-column: 1;
    grid-row: 1 / span 4;
  }

  .releases__grid .record__artist,
  .releases__grid .record__title,
  .releases__grid .record__out {
    grid-column: 2;
    justify-self: start;
  }

  .releases__grid .record__links {
    grid-column: 1 / -1;
    grid-row: 5;
  }
}

@media (min-width: 34em) {
  .releases__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(2.5rem, 4vw, 3.5rem) clamp(1rem, 2vw, 1.75rem);
  }

  .releases__grid .record__body {
    padding-top: 1rem;
  }
}

@media (min-width: 64em) {
  .releases__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

