/* Pocket Casts' compact show identity and Spotify's archive-first browsing. */
@layer pages {
  .show-page {
    container: show-content / inline-size;
    gap: var(--page-gap);
  }

  .show-page > .show-identity {
    grid-template-columns: minmax(0, min(26vw, 96px)) minmax(0, 1fr);
    align-items: start;
    justify-items: stretch;
    gap: 1rem;
    margin-block-start: 0;
  }

  .show-page > .show-identity > .cover-frame {
    width: 100%;
    margin-block-start: 0;
    border: 0;
  }

  .show-page .detail-copy {
    min-width: 0;
    gap: 0.35rem;
    justify-items: start;
    text-align: start;
  }

  .show-page .detail-copy h1 {
    font-size: var(--fs-title);
    line-height: var(--lh-title);
    overflow-wrap: anywhere;
  }

  .show-publisher {
    color: var(--muted-strong);
    font-size: var(--fs-14);
    overflow-wrap: anywhere;
  }

  .show-studio-credit {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    min-inline-size: 0;
    max-inline-size: 100%;
    color: var(--muted-strong);
    font-size: var(--fs-14);
  }

  .show-studio-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-block-size: 2.75rem;
    max-inline-size: 100%;
    color: var(--text);
    font-size: var(--fs-14);
    overflow-wrap: anywhere;
  }

  .show-studio-link strong {
    min-inline-size: 0;
    text-decoration: underline;
    text-underline-offset: 0.2em;
  }

  .show-studio-link svg {
    flex: 0 0 1em;
    inline-size: 1em;
    block-size: 1em;
  }

  .studio-logo {
    display: grid;
    place-items: center;
    background: var(--surface-raised);
    font-size: var(--fs-20);
    font-weight: 700;
  }

  .studio-logo:has(img:not([hidden])) span {
    visibility: hidden;
  }

  .studio-logo img {
    object-fit: contain;
  }

  .studio-podcasts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(8rem, 100%), 1fr));
    gap: var(--space-5) var(--space-4);
  }

  .studio-podcasts > .podcast-card {
    min-inline-size: 0;
    margin: 0;
  }

  .studio-empty {
    color: var(--muted-strong);
    line-height: var(--lh-reading);
  }

  .show-page .stat-line {
    justify-content: start;
    font-size: var(--fs-12);
    gap: 0.5rem 0.75rem;
  }

  .show-page .show-actions {
    grid-column: 1 / -1;
    min-width: 0;
    justify-content: start;
    gap: 0.75rem;
  }

  .show-actions > button {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
  }

  .show-disclosure {
    min-width: 0;
    border-block: 1px solid var(--border);
  }

  .show-disclosure > summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.25rem;
    padding-block: 0.75rem;
    cursor: pointer;
    list-style: none;
    font-weight: 700;
  }

  .show-disclosure > summary::-webkit-details-marker {
    display: none;
  }

  .show-disclosure > summary > svg {
    width: 1.1rem;
    height: 1.1rem;
    margin-inline-start: auto;
    flex-shrink: 0;
  }

  .show-disclosure[open] > summary > svg {
    transform: rotate(180deg);
  }

  .show-disclosure > summary > span {
    color: var(--muted-strong);
    font-size: var(--fs-12);
    font-weight: 400;
  }

  .show-disclosure__body {
    padding-block: 0.5rem 1.5rem;
  }

  .show-description {
    max-width: 72ch;
    font-size: var(--fs-16);
    line-height: var(--lh-reading);
    color: var(--muted-strong);
    white-space: pre-line;
    overflow-wrap: anywhere;
  }

  .show-disclosure__body > .detail-actions {
    margin-block-start: 1rem;
    justify-content: start;
  }

  .show-archive {
    gap: 1rem;
  }

  .show-archive__heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
  }

  .show-archive__heading .eyebrow {
    padding: 0;
    font-size: var(--fs-12);
    color: var(--muted-strong);
  }

  .show-archive__heading h2 {
    font-size: var(--fs-20);
    margin-block-start: 0.25rem;
  }

  .show-archive__count,
  .show-archive__result {
    color: var(--muted-strong);
    font-size: var(--fs-14);
    overflow-wrap: anywhere;
  }

  .show-search {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
  }

  .show-search > svg {
    flex: 0 0 1.25rem;
    width: 1.25rem;
    height: 1.25rem;
    margin-inline-start: 0.25rem;
    color: var(--muted-strong);
  }

  .show-search > input {
    flex: 1 1 8rem;
    width: 0;
    min-width: 0;
    min-height: 2.75rem;
    padding-inline: 0.25rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
  }

  .show-search > button {
    max-width: 100%;
  }

  .show-archive__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.75rem 1rem;
  }

  .show-sort {
    display: grid;
    flex: 1 1 9rem;
    min-width: 0;
    gap: 0.25rem;
    color: var(--muted-strong);
    font-size: var(--fs-12);
  }

  .show-sort select {
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    color: var(--text);
    font-size: var(--fs-14);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    padding: 0.5rem;
  }

  .show-reviews .section-heading {
    flex-wrap: wrap;
  }

  .show-reviews .review-form,
  .show-reviews .review-card {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

@layer responsive {
  /* Override the shared legacy desktop hero in its existing responsive layer. */
  .show-page > .show-identity {
    grid-template-columns: minmax(0, min(26vw, 96px)) minmax(0, 1fr);
    align-items: start;
    justify-items: stretch;
    gap: 1rem;
  }

  .show-page .detail-copy h1 {
    font-size: var(--fs-title);
  }

  @container show-content (min-width: 36rem) {
    .show-page > .show-identity {
      grid-template-columns: 160px minmax(0, 1fr);
      gap: 0.75rem 1.75rem;
    }

    .show-page > .show-identity > .cover-frame {
      grid-row: 1 / 3;
    }

    .show-page .show-actions {
      grid-column: 2;
    }

    .show-actions > button {
      flex: 0 1 auto;
    }

    .show-archive__filters {
      justify-content: end;
    }

    .show-sort {
      flex: 0 1 12rem;
    }
  }
}

@layer system {
  @media (max-width: 39.99rem), (hover: none) and (pointer: coarse) and (max-height: 32rem) {
    .show-recommendations__shelf {
      grid-auto-columns: min(6.5rem, 100%);
      column-gap: var(--space-3);
      margin-inline: 0;
      padding: var(--space-1);
      scroll-padding-inline: var(--space-1);
    }

    .show-recommendations__shelf > .podcast-card {
      gap: var(--space-2);
      margin: 0;
    }

    .show-recommendations__shelf .podcast-card .cover-frame {
      inline-size: 80px;
      max-inline-size: 100%;
      border-radius: var(--radius-sm);
      box-shadow: none;
    }

    .show-recommendations__shelf .podcast-card__play {
      display: none;
    }

    .show-recommendations__shelf .podcast-card__body {
      overflow-wrap: anywhere;
    }

    .show-recommendations__shelf .podcast-card__body p {
      white-space: normal;
    }

    .show-recommendations__shelf .reason-chip {
      padding-inline: 0.375rem;
      line-height: 1.45;
    }
  }
}
