/* Phone artwork uses the full reading width, accounting for the site's zoom.
   Scope every rule to internal-page main content; preserve desktop and branding.
   The layer overrides earlier per-artwork !important width caps consistently. */
@layer lyra-mobile-artwork {
 @media (max-width:760px) {
  body.lyra-site:not(.home-page) main {
   --mobile-art-width:calc(100vw / var(--lyra-page-scale,1) - var(--page-gutter) - var(--page-gutter));
   --mobile-art-gap:clamp(2rem,5vw,4rem);
  }

  /* Remove narrow or oversized ancestor columns before centring their art.
     Keep the outer page sections and the contents of each framed picture intact. */
  body.lyra-site:not(.home-page) main :is(div,article,aside,section):has(figure img):not(main > section):not(figure *) {
   display:block!important;position:relative!important;inset:auto!important;
   width:100%!important;max-width:none!important;min-width:0!important;
   height:auto!important;max-height:none!important;
   margin-inline:auto!important;transform:none!important;overflow:visible!important;
   box-sizing:border-box!important;
  }

  body.lyra-site:not(.home-page) main figure:has(img):not(figure figure) {
   display:block!important;position:relative!important;inset:auto!important;left:50%!important;
   width:var(--mobile-art-width)!important;max-width:none!important;min-width:0!important;
   height:auto!important;min-height:0!important;max-height:none!important;aspect-ratio:auto!important;
   margin-inline:0!important;transform:translateX(-50%)!important;
   float:none!important;flex:none!important;box-sizing:border-box!important;
   justify-self:start!important;align-self:auto!important;grid-column:1/-1!important;grid-row:auto!important;
  }

  /* Inner frames follow their enlarged figure, never a second viewport width. */
  body.lyra-site:not(.home-page) main :is(.lyra-six-frame,.lyra-art-display,.human-experience-art-grid,.human-evolution-ape-grid),
  body.lyra-site:not(.home-page) main figure :is(figure,.reference-cover-frame,.presence-art-image) {
   position:relative!important;inset:auto!important;transform:none!important;
   width:100%!important;max-width:100%!important;min-width:0!important;
   margin-inline:auto!important;box-sizing:border-box!important;
  }
  body.lyra-site:not(.home-page) main figure :is(.lyra-six-frame,.lyra-art-display,.reference-cover-frame,.presence-art-image) {
   height:auto!important;max-height:none!important;aspect-ratio:auto!important;
  }

  /* Individual gallery pieces and book covers get the available phone width. */
  body.lyra-site:not(.home-page) main :is(.inner-temple-columns,.inner-temple-currents,.inner-temple-after-yeshua,.human-experience-art-grid,.human-evolution-ape-grid,.live-life-photo-grid,.lyra-butterfly-portrait-pair,.chapter-summary-layout) {
   display:grid!important;grid-template-columns:minmax(0,1fr)!important;
   gap:var(--mobile-art-gap)!important;min-width:0!important;
  }
  body.lyra-site:not(.home-page) main :is(.inner-temple-stack,.inner-temple-row) {
   display:flex!important;flex-direction:column!important;
   gap:var(--mobile-art-gap)!important;min-width:0!important;
  }
  body.lyra-site:not(.home-page) main :is(div,article,aside,section) > figure + figure {
   margin-block-start:var(--mobile-art-gap)!important;
  }
  body.lyra-site:not(.home-page) main .live-life-photo {
   width:100%!important;height:auto!important;aspect-ratio:auto!important;
  }

  /* Preserve intentional crop windows, poster overlays and decorative logos. */
  body.lyra-site:not(.home-page) main figure img:not([alt=""],.lyra-section-logo img,.remember-path-face img,figcaption img,.higher-self-art-window img,.nervous-system-backdrop,.inner-temple-source-fit img,.inner-temple-new-source-fit img,.inner-temple-cosmic-gap img) {
   display:block!important;position:relative!important;inset:auto!important;transform:none!important;
   width:100%!important;max-width:100%!important;height:auto!important;max-height:none!important;
   aspect-ratio:auto!important;object-fit:contain!important;margin-inline:auto!important;
  }

  /* Lead artwork and the two overview pieces do not use figure elements. */
  body.lyra-site:not(.home-page) main :is(.section-art,.family-art,.work-art,.connect-art,.skydive-section > img,.imprints-section > img,.chapter-summary-art) {
   display:block!important;position:relative!important;inset:auto!important;left:50%!important;
   width:var(--mobile-art-width)!important;max-width:none!important;min-width:0!important;
   height:auto!important;min-height:0!important;max-height:none!important;aspect-ratio:auto!important;
   margin-inline:0!important;transform:translateX(-50%)!important;box-sizing:border-box!important;
   object-fit:contain!important;grid-row:auto!important;
  }
  body.lyra-site:not(.home-page) main :is(.section-art,.chapter-summary-art) > img {
   position:relative!important;inset:auto!important;width:100%!important;
   height:auto!important;max-height:none!important;object-fit:contain!important;
  }
  body.lyra-site:not(.home-page) main :is(.practice-grid,.roadmap-grid) {
   grid-template-columns:minmax(0,1fr)!important;
  }
  body.lyra-site:not(.home-page) main :is(.practice-featured,.roadmap-quantum) > img {
   width:100%!important;max-width:100%!important;height:auto!important;object-fit:contain!important;
  }
 }
}
