/* Artis Apotheosis Gallery — isolated mobile presentation only.
   Original CSS and JS, including physical artwork scaling, are unchanged. */
@media screen and (max-width: 700px) {
  html, body { max-width:100%; }
  main { min-width:0; max-width:100%; }

  /* Home banner: never clip the exhibition title or dates. */
  .hero { min-height:310px; flex-direction:column; align-items:stretch; justify-content:flex-end; gap:12px; padding:20px 16px; }
  .hero-copy { width:100%; max-width:100%; flex:0 1 auto; min-width:0; display:block; }
  .hero-copy h1 { width:100%; max-width:100%; margin:0; font-size:clamp(17px,4.6vw,24px); line-height:1.3; text-align:left; overflow-wrap:anywhere; }
  .hero .visit { margin:0 0 0 auto; align-self:flex-end; flex-shrink:0; padding:10px 20px; }
  /* Arrow is text inside the existing VISIT link: replace visible text, not the link. */
  .hero .visit {font-size:0!important;}
  .hero .visit::after {content:"VISIT";font-size:13px;line-height:1.4;}

  /* Home: five separate full-width tiles with restrained captions. */
  main .tiles, main .smalltiles {display:grid!important;grid-template-columns:minmax(0,1fr)!important;justify-content:stretch!important;gap:18px!important;width:100%!important;max-width:510px!important;margin-left:auto!important;margin-right:auto!important;}
  main .tiles .tile,main .smalltiles .tile {width:100%!important;max-width:none!important;flex:none!important;aspect-ratio:1 / 1!important;min-width:0!important;}
  main .tiles .tile .bar,main .smalltiles .tile .bar {min-height:0!important;flex:0 0 auto!important;padding:10px 12px!important;font-size:clamp(14px,3.8vw,18px)!important;line-height:1.2!important;}
  main .tiles .tile .bar small,main .smalltiles .tile .bar small {font-size:clamp(11px,3vw,13px)!important;line-height:1.25!important;margin-top:4px!important;}
  main .tiles .tile .tile-media,main .smalltiles .tile .tile-media {min-height:0!important;flex:1 1 auto!important;}

  /* Open Call: keep poster and its border together within the viewport. */
  .call-detail-top {grid-template-columns:minmax(0,1fr)!important;}
  .call-detail-poster {width:min(100%,340px)!important;max-width:100%!important;height:auto!important;aspect-ratio:4/5;overflow:hidden;margin-left:auto;margin-right:auto;}
  .call-detail-poster img {max-width:100%!important;max-height:100%!important;}
  .call-detail-cover {max-width:100%!important;height:auto!important;}
  /* Remove large diagonal arrows only in these two mobile action labels. */
  .exhibition-view-more[href*="application"] {font-size:0!important;}
  .exhibition-view-more[href*="application"]::after {content:"Submit Your Application";font-size:14px;}
  .oc-section a[href*="terms-"], .call-detail-terms a[href*="terms-"] {font-size:0!important;}
  .oc-section a[href*="terms-"]::after, .call-detail-terms a[href*="terms-"]::after {content:"Official Terms & Conditions";font-size:14px;}

  /* Group exhibition: display each artwork on its own centered mobile row.
     The established 5.2px/cm remains intact in source JS/Desktop CSS.
     Width is downscaled on phones only and limited by viewport width. */
  #exhibition:not(.individual-exhibition) .artgrid {width:100%!important;min-width:0!important;max-width:100%!important;align-items:center!important;}
  #exhibition:not(.individual-exhibition) .artwork-row {display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;flex-wrap:nowrap!important;gap:26px!important;overflow:visible!important;width:100%!important;max-width:100%!important;min-width:0!important;padding:0!important;}
  #exhibition:not(.individual-exhibition) .artwork-row .exhibition-artwork {box-sizing:border-box!important;flex:0 1 auto!important;width:min(calc(var(--physical-w,260px) * .65), 100%)!important;min-width:0!important;max-width:100%!important;margin:0 auto!important;align-items:center!important;}
  #exhibition:not(.individual-exhibition) .artwork-row .artwork-image-link {box-sizing:border-box!important;width:100%!important;height:auto!important;min-width:0!important;min-height:0!important;max-width:100%!important;max-height:none!important;overflow:hidden!important;}
  #exhibition:not(.individual-exhibition) .artwork-row .artwork-image-link img {box-sizing:border-box!important;display:block!important;width:100%!important;height:auto!important;min-width:0!important;min-height:0!important;max-width:100%!important;max-height:none!important;object-fit:contain!important;}

  /* Individual exhibition: apply mobile fit only to works, not the desktop scale. */
  #exhibition.individual-exhibition .artwork-row {flex-wrap:wrap!important;overflow:visible!important;max-width:100%!important;justify-content:center!important;gap:24px!important;}
  #exhibition.individual-exhibition .artwork-row .exhibition-artwork {max-width:100%!important;min-width:0!important;flex:0 1 auto!important;}
  #exhibition.individual-exhibition .artwork-row .artwork-image-link {max-width:100%!important;min-width:0!important;height:auto!important;}
  #exhibition.individual-exhibition .artwork-row .artwork-image-link img {max-width:100%!important;height:auto!important;object-fit:contain!important;}

  /* Individual artwork dimensions come from the existing desktop script:
     inline width and --individual-artwork-height. Keep BOTH dimensions together;
     never replace the declared height with the photo file's intrinsic ratio.
     Responsive zoom is common to all artworks at a given phone width. */
  #exhibition.individual-exhibition .individual-artworks .individual-artwork > img {
    zoom: .16;
    max-width: 100%!important;
    height: var(--individual-artwork-height, auto)!important;
    object-fit: fill!important;
  }
  @media (min-width: 360px) {
    #exhibition.individual-exhibition .individual-artworks .individual-artwork > img { zoom: .18; }
  }
  @media (min-width: 400px) {
    #exhibition.individual-exhibition .individual-artworks .individual-artwork > img { zoom: .20; }
  }
  @media (min-width: 450px) {
    #exhibition.individual-exhibition .individual-artworks .individual-artwork > img { zoom: .23; }
  }
  @media (min-width: 540px) {
    #exhibition.individual-exhibition .individual-artworks .individual-artwork > img { zoom: .27; }
  }
  @media (min-width: 630px) {
    #exhibition.individual-exhibition .individual-artworks .individual-artwork > img { zoom: .30; }
  }

  /* Work detail / View More: prevent artwork from extending beyond the screen. */
  body.group-artwork-detail .group-detail-image-frame {box-sizing:border-box!important;width:min(var(--detail-width,100%),100%)!important;height:auto!important;max-width:100%!important;}
  body.group-artwork-detail .group-detail-image-frame > img {display:block!important;width:100%!important;height:auto!important;max-width:100%!important;max-height:none!important;object-fit:contain!important;}

  /* Artist and interview portraits retain their original proportions. */
  .artist-profile {max-width:100%;min-width:0;padding:14px!important;}
  .artist-profile-text {max-width:100%!important;}
  .artist-profile-side,.interview-detail-side {max-width:100%;min-width:0;}
  .artist-profile .artist-portrait,.interview-detail-portrait {box-sizing:border-box;max-width:100%!important;}
  .artist-profile .artist-portrait img,.interview-detail-portrait img {max-width:100%!important;width:auto;height:auto;object-fit:contain;}
  .interview-detail-layout {grid-template-columns:minmax(0,1fr)!important;gap:24px!important;}
  /* Open Call poster: natural image height preserves equal 10px frame padding. */
  .call-detail-poster { aspect-ratio:auto!important; height:auto!important; }
  .call-detail-poster img { display:block!important; width:100%!important; height:auto!important; max-height:none!important; object-fit:contain!important; }

  /* Individual exhibition: catalogue and artist cards stay inside the mobile viewport. */
  #exhibition.individual-exhibition .individual-listing-cards {
    display:grid!important; grid-template-columns:minmax(0,1fr)!important;
    width:100%!important; max-width:100%!important; min-width:0!important;
    box-sizing:border-box!important;
  }
  #exhibition.individual-exhibition .individual-listing-cards > .exhibition-card {
    display:grid!important; grid-template-columns:minmax(0,1fr)!important;
    width:100%!important; max-width:100%!important; min-width:0!important;
    height:auto!important; min-height:0!important; aspect-ratio:auto!important;
    box-sizing:border-box!important;
  }
  #exhibition.individual-exhibition .individual-listing-cards .exhibition-card-image {
    width:100%!important; height:auto!important; min-width:0!important;
    box-sizing:border-box!important;
  }
  #exhibition.individual-exhibition .individual-listing-cards .exhibition-card-image img {
    display:block!important; width:100%!important; height:auto!important;
    max-height:300px!important; object-fit:contain!important;
  }
  #exhibition.individual-exhibition .individual-listing-cards .exhibition-card-copy {
    min-width:0!important; width:100%!important; box-sizing:border-box!important;
  }
  #exhibition.individual-exhibition .individual-listing-cards .individual-card-buttons {
    flex-wrap:wrap!important; min-width:0!important;
  }

}
