/* Interior artwork only. Section landing pages and navigation cards stay unchanged.
   Keep existing widths, heights, aspect ratios, crops and gallery breakpoints. */
body[data-artwork-detail] main img:not(.card img):not(.logo-tile img) {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}
body[data-artwork-detail] main :is(
  .ill-art, .art, .case-art, .space-art, .hero-art, .hero-logo,
  .asset-stage, .project-media, .logo-stage, .image-card, .image-card-media, .piece, .albo-cover,
  .case-card, .case-media, .piece-media, .system-card:has(img), .system-card-media,
  .ps-hero-art, .ps-media, .ps-two figure,
  .noa-hero-art, .noa-card-stage, .noa-stage, .noa-logo-card,
  .trinity-hero-art, .trinity-panel, .trinity-event-art, .trinity-wide,
  .sos-hero-art, .sos-stage, .sos-final-card, .sos-aim-card,
  .process-card, .cover-art, .art-grid figure, .space-process figure,
  .project-grid figure, .gameover-gallery figure, .atl-gallery button,
  .opening-flyer-card, .work-card, .gallery figure
) {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}
/* Captions sit below the artwork with a consistent, readable gap. */
body[data-artwork-detail] main :is(figcaption, .ps-image-caption, .opening-flyer-caption,
  .ps-caption-outside, .ps-media + .ps-caption, .project-caption, .caption, .trinity-caption) {
  position: static !important;
  transform: none !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 12px 0 0 !important;
  line-height: 1.5 !important;
  background: transparent !important;
}
/* Keep deliberately placed above-image captions above their artwork. */
body[data-artwork-detail] main .ps-caption-top {
  margin: 0 0 12px !important;
}
body[data-artwork-detail] main :is(.process-card, .cover-art, .art-grid figure,
  .hero-art, .space-process figure, .project-grid figure, .gameover-gallery figure,
  .image-card, .case-card, .system-card:has(img)) {
  background: transparent !important;
}
body[data-artwork-detail] main :is(.image-card-media, .case-media, .system-card-media, .piece-media) + h3 {
  margin-top: 12px !important;
  line-height: 1.35;
}

/* Responsive interior gallery alignment — October 8, 2026.
   Preserve the complete artwork and do not modify landing-page portfolio cards. */
body[data-artwork-detail] main :is(
  .space-process, .art-grid, .process-grid, .project-grid,
  .tmnt-art-gallery, .image-grid, .gameover-gallery,
  .opening-social-grid, .gallery, .grid
) > * { min-width:0; }

body[data-artwork-detail] main :is(
  .space-process, .art-grid, .process-grid, .project-grid,
  .tmnt-art-gallery, .image-grid, .gameover-gallery,
  .opening-social-grid
) img {
  display:block;
  width:100%;
  max-width:100%;
  height:auto;
  object-fit:contain;
}

/* Artwork must not be forced into square crops or letterboxed stages. */
body[data-artwork-detail] main :is(.process-grid, .art-grid) figure img,
body[data-artwork-detail] main :is(.process-grid, .art-grid) .process-card img {
  aspect-ratio:auto;
}

/* Keep captions directly under their own artwork, never stretched to fill a row. */
body[data-artwork-detail] main :is(
  .space-process figure, .art-grid figure, .process-card,
  .tmnt-art-gallery figure, .project-grid figure, .gameover-gallery figure
) figcaption {
  flex:0 0 auto;
  margin:12px 0 0 !important;
  padding:0 !important;
  background:transparent !important;
}

/* On tablet and smaller screens, varied formats get a centered full-width stack.
   No cropping, stretching, artificial height matching or horizontal overflow. */
@media (max-width:1100px) {
  body[data-artwork-detail] main :is(
    .space-process, .art-grid, .process-grid, .project-grid,
    .tmnt-art-gallery, .image-grid, .opening-social-grid
  ) {
    grid-template-columns:minmax(0,1fr) !important;
    align-items:start;
    gap:32px;
  }
  body[data-artwork-detail] main :is(
    .space-process, .art-grid, .process-grid,
    .tmnt-art-gallery, .image-grid, .opening-social-grid
  ) > * {
    width:100%;
    max-width:900px;
    margin-left:auto;
    margin-right:auto;
    grid-column:auto !important;
  }
  body[data-artwork-detail].gameover-page main .gameover-gallery {
    grid-template-columns:minmax(0,1fr) !important;
  }
}
/* Space Brothers features two differently proportioned images:
   always give each the same full-width presentation, even on desktop. */
body[data-artwork-detail].space-case main .space-process {
  grid-template-columns:minmax(0,1fr) !important;
  width:min(900px,100%);
  margin-left:auto;
  margin-right:auto;
  gap:36px;
}
body[data-artwork-detail].space-case main .space-process figure {
  min-width:0;
  width:100%;
  background:transparent !important;
}
body[data-artwork-detail].space-case main .space-process img {
  width:100%;
  height:auto;
  aspect-ratio:auto;
}
