@layer pages {
  /* Ownership: Gallery below-the-fold presentation only.
     Shared below-the-fold styles for every Gallery page: the main
     gallery landing (paired with gallery-landing.css for its editorial
     intro and section headers), the artwork-collection pages and the
     artwork-episode pages. Masthead layout, typography and breadcrumbs
     are shared by every pillar/series/season landing page in
     pillar-landing-masthead.css; the collection and episode pages use
     the compact masthead (breadcrumbs only, no hero image), so no
     masthead override is needed here. All card grids (episode/part
     carousels, curated works, part cards) reuse the canonical
     .gnostic-card/.shop-card system from shop.css. */

  .gallery-section {
    display: grid;
    gap: var(--space-lg);
  }

  .gallery-section__header {
    display: grid;
    gap: 0.35rem;
    max-width: none;
  }

  .artwork-gallery-intro {
    display: grid;
    gap: var(--space-sm);
  }

  .artwork-gallery-intro > :first-child {
    margin-top: 0;
  }

  .artwork-gallery-intro > :last-child {
    margin-bottom: 0;
  }

  .gallery-episode-section {
    gap: clamp(2rem, 5vw, 4rem);
  }

  .gallery-episode-group {
    display: grid;
    gap: var(--space-md);
  }

  .gallery-episode-group__title {
    margin: 0;
    color: var(--text-primary);
    font-family: var(--page-title);
    font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  }

  .gallery-part-carousel {
    display: grid;
    gap: var(--space-sm);
  }

  .gallery-part-carousel__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-md);
  }

  .gallery-part-carousel__header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
  }

  .gallery-part-carousel__header a {
    flex: 0 0 auto;
    color: var(--text-accent);
    font-size: 0.78rem;
    font-weight: var(--type-weight-bold, 700);
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  /* Episode hero cover figure (artwork-episode.njk) — reuses the
     collection-card media box shape, not the retired card grid. */
  .gallery-collection-card__media {
    margin: 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-primary);
  }

  .gallery-episode-cover {
    border: 1px solid var(--section-border);
    border-radius: var(--border-radius-base);
    box-shadow: var(--page-shadow-soft);
  }

  .gallery-collection-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}
