/* The CRT is a frame, not a scrolling container: every project uses one fixed tube. */
.tape-player__screen {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  scrollbar-gutter: auto;
}
.tape-player__screen .card__body {
  display: grid;
  grid-auto-rows: min-content;
  align-content: center;
  justify-items: start;
  gap: .65rem;
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  box-sizing: border-box;
  padding: clamp(1.15rem, 2.7vw, 2rem);
}
.tape-player__screen .badge {
  font-size: .62rem;
  line-height: 1.25;
}
.tape-player__screen h3 {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.tape-player__screen p {
  margin: 0;
  font-size: clamp(.875rem, 1.25vw, .98rem);
  line-height: 1.5;
}
.tape-player__screen .card__links {
  margin: .15rem 0 0;
  align-items: center;
  gap: .55rem 1rem;
  font-size: .86rem;
}
.tape-player__screen .tape-preview,
.tape-player__screen .tape-art-preview {
  margin: .25rem 0 0;
  max-width: 100%;
}
.tape-player__screen .tape-preview img,
.tape-player__screen .tape-art-preview img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 125px;
  object-fit: contain;
}
.tape-player__screen .tape-preview figcaption {
  margin-top: .3rem;
  font-size: .6rem;
}
/* Prints sit alongside the copy on larger screens, so neither competes with the links. */
@media (min-width: 681px) {
  .tape-player__screen .card__body:has(.tape-preview, .tape-art-preview) {
    grid-template-columns: minmax(0, 1fr) minmax(110px, 28%);
    column-gap: 1.2rem;
  }
  .tape-player__screen .card__body:has(.tape-preview, .tape-art-preview) > :not(.tape-preview, .tape-art-preview) { grid-column: 1; }
  .tape-player__screen .card__body > :is(.tape-preview, .tape-art-preview) {
    grid-column: 2;
    grid-row: 1 / span 8;
    align-self: center;
    margin: 0;
  }
  .tape-player__screen .tape-preview img,
  .tape-player__screen .tape-art-preview img { max-height: 165px; }
}
/* A taller tube at phone widths leaves room for actual text, not tiny type or a second scroll. */
@media (max-width: 680px) {
  .tape-player__screen { aspect-ratio: 3 / 5; }
  .tape-player__screen .card__body { padding: 1.1rem; gap: .55rem; }
  .tape-player__screen h3 { font-size: 1.35rem; }
  .tape-player__screen p { font-size: .875rem; line-height: 1.43; }
  .tape-player__screen .card__links { gap: .5rem .8rem; }
  .tape-player__screen .tape-preview img,
  .tape-player__screen .tape-art-preview img { max-height: 110px; }
  /* A thumbnail alongside the heading leaves the full tube width for prose. */
  .tape-player__screen .card__body:has(.tape-preview, .tape-art-preview) {
    grid-template-columns: minmax(0, 1fr) 76px;
    column-gap: .65rem;
  }
  .tape-player__screen .card__body:has(.tape-preview, .tape-art-preview) > :is(.badge, h3) { grid-column: 1; }
  .tape-player__screen .card__body:has(.tape-preview, .tape-art-preview) > :is(p, .card__links) { grid-column: 1 / -1; }
  .tape-player__screen .card__body > :is(.tape-preview, .tape-art-preview) {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    margin: 0;
  }
  .tape-player__screen .tape-preview img,
  .tape-player__screen .tape-art-preview img { max-height: 76px; }
  .tape-player__screen .tape-preview figcaption { font-size: .52rem; line-height: 1.25; }
}
@media (max-width: 480px) {
  /* Long project names need the whole width of the smallest tubes. Keep the
     artwork as a small preview next to the badge, above the heading. */
  .tape-player__screen .card__body:has(.tape-preview, .tape-art-preview) { grid-template-columns: minmax(0, 1fr) 44px; }
  .tape-player__screen .card__body:has(.tape-preview, .tape-art-preview) > h3 { grid-column: 1 / -1; }
  .tape-player__screen .card__body > :is(.tape-preview, .tape-art-preview) { grid-row: 1; }
  .tape-player__screen .tape-preview img,
  .tape-player__screen .tape-art-preview img { max-height: 44px; }
  .tape-player__screen .tape-image-open { min-width: 44px; min-height: 44px; display: grid; place-items: center; }
  .tape-player__screen .tape-image-open__hint { right: 0; bottom: 0; padding: .15rem .25rem; font-size: 0; }
  .tape-player__screen .tape-image-open__hint::after { content: '↗'; font: 600 .75rem/1 var(--font-mono); }
  .tape-player__screen .tape-preview figcaption {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
@media (max-width: 380px) {
  /* Keep the extra reading height inside the tube instead of letting the
     preferred ratio transfer its 600px minimum into a wider screen. */
  .tape-player__screen { width: 100%; max-width: 100%; aspect-ratio: 1 / 1.86; min-height: 600px; }
  .tape-player__tv::after {
    /* Constrain the glass to the same inset width as the tube; its tall
       minimum must not transfer through aspect-ratio into horizontal overflow. */
    width: calc(100% - 2 * var(--crt-rim));
    max-width: calc(100% - 2 * var(--crt-rim));
    min-height: 600px;
  }
}
/* Programme notes give each project a short introduction and a useful second
   paragraph. The longer original introduction remains available in the fallback. */
.tape-player__screen .card__body > p:not(.tape-summary, .tape-detail) { display: none; }
.tape-player__screen .tape-detail {
  padding-top: .65rem;
  border-top: 1px solid #b8d3e533;
  color: #c3d3df;
}
.tape-player__screen .tape-summary[hidden] { display: none; }
