/* Image framing belongs to the layout, not the dimensions of the uploaded file.
   A portrait, landscape or panoramic source can share the same photograph slot. */
:is(.home-service-image,.home-journal-image,.blog-card-image,.service-detail-media,
    .sv-photo,.blog-inline-photo,.care-story-visual,.about-photo,.story-image,
    .story-scene-backdrop,.home-process-backdrop){min-width:0;overflow:hidden}

/* Reserve a stable frame before the image loads. Source width/height attributes
   continue to provide loading hints, but cannot change a card's proportions. */
.home-service-image{aspect-ratio:8/5}
.home-journal-image{aspect-ratio:16/9}
.blog-card-image{aspect-ratio:16/10}
.blog-featured .blog-card-image{aspect-ratio:8/5}
:is(.home-service-image,.home-journal-image,.blog-card-image){position:relative}
:is(.home-service-image,.home-journal-image,.blog-card-image)>img{
  position:absolute;inset:0;display:block;width:100%;height:100%;
  max-width:none;max-height:none;object-fit:cover;object-position:center;
}
.services-page .service-detail:nth-child(n) .service-detail-media{
  aspect-ratio:16/10;height:auto;min-height:0;position:relative;
}
.services-page .service-detail-media>img{
  position:absolute;inset:0;width:100%;height:100%;max-width:none;
  object-fit:cover;object-position:center;
}

/* Captions remain outside the photographic frame on service and blog pages. */
.sv-photo>img{height:auto;aspect-ratio:16/10;max-width:none;object-fit:cover;object-position:center}
.sv-gallery-detail>img{aspect-ratio:5/4}
.sv-style-studio .sv-photo>img{height:auto;aspect-ratio:16/10}
.sv-style-technical .sv-gallery-wide>img{height:auto;aspect-ratio:16/9}
.sv-style-technical .sv-gallery-detail>img{height:auto;aspect-ratio:5/4}
.blog-inline-photo>img{height:auto;aspect-ratio:16/9;max-width:none;object-fit:cover;object-position:center}

/* Full-bleed scenes keep their existing drift and parallax transforms. */
:is(.hero-photo,img.inner-hero-photo,.inner-hero-photo>img,.care-story-visual>img,
    .story-scene-backdrop>img,.home-process-backdrop>img,.about-photo>img,.story-image>img){
  display:block;max-width:none;max-height:none;object-fit:cover;
}
.story-scene-backdrop>img{position:absolute;inset:0;width:100%;height:100%}

/* Framing preferences are applied only to selected photographs. Badges, marks
   and review avatars retain the fitting rules intended for those components. */
img[data-image-framed]{object-fit:var(--photo-fit,cover)!important;object-position:var(--photo-x,50%) var(--photo-y,50%)!important}
img[data-image-framed="contain"]{background:var(--photo-mat,#18201a)}
[data-theme="light"] img[data-image-framed="contain"]{--photo-mat:#ddd8cc}
.brand img,.brand-tile img,.about-photo-badge img{object-fit:contain}

@media(max-width:760px){
  .home-service-image,.blog-card-image,.blog-featured .blog-card-image{aspect-ratio:8/5}
  .home-journal-image{aspect-ratio:16/10}
  .sv-photo>img,.sv-style-studio .sv-photo>img{height:auto;aspect-ratio:8/5}
  .sv-gallery-wide>img,.sv-gallery-detail>img,
  .sv-style-studio .sv-gallery img,.sv-style-technical .sv-gallery-wide>img,
  .sv-style-technical .sv-gallery-detail>img{height:auto;aspect-ratio:16/10}
}

/* Showing the full photograph disables image-only zoom/overscan, while card
   reveals and surrounding futuristic motion continue as before. */
img[data-image-framed="contain"]{transform:none!important;scale:none!important;animation:none!important}
:is(.hero-photo,img.inner-hero-photo,.about-photo>img,.story-image>img,.home-process-backdrop>img)[data-image-framed="contain"]{
  inset:0!important;width:100%;height:100%!important;
}
