/* R-GDB-G1. Content photographs retain the complete source image.
   Videos, posters, branding, icons, maps and embeds keep their existing rules. */
body #main img:not(:where(
  [src*=".svg"], [src*="logo"], [src*="icon"], [src*="badge"], [src*="seal"],
  [src*="homestars"], [src*="bbb"], [src*="houzz"], [src*="google-review"],
  [src*="poster"], [src*="video-thumb"], [src*="/map."], [src*="-map-"],
  [data-hero-video] img, [data-home-video] img, .gdb-hero-video img,
  .video-wrap img, .video-wrapper img, .hero-video-shell img,
  .home-credentials img, .credentials-strip img, .brand img, .logo img
)) {
  height: auto !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
}

/* Let image containers follow the actual photo rather than a crop template. */
body #main :is(
  .hero-photo:not(.gdb-hero-video), .area-hero-photo:not(.gdb-hero-video), .service-story-photo,
  .service-planning-photo, .service-card-photo, .guide-thumbnail, .local-photo,
  .contact-photo, .contact-family-photo, .area-story-photos > figure,
  .showroom-photo, .showroom-grid > figure, .areas__fig,
  .ocard__ph, .scard__ph, .blog__ph, .wk__photo
) {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  align-self: start;
  background: transparent !important;
}
body #main :is(.hero-photo:not(.gdb-hero-video), .area-hero-photo:not(.gdb-hero-video),
  .service-story-photo, .service-planning-photo, .service-card-photo,
  .guide-thumbnail, .local-photo, .contact-photo, .contact-family-photo,
  .area-story-photos, .showroom-grid, .photo-slide, .areas__fig,
  .ocard__ph, .scard__ph, .blog__ph, .wk__photo, .area-service-card) picture {
  display: block;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  background: transparent !important;
}

/* A fixed slideshow row contains each whole photo on its section surface. */
body #main .photo-slide:not(:has(video)) {
  background: transparent !important;
}
body #main .photo-slide:not(:has(video)) img:not([src*="poster"]) {
  max-height: min(65svh, 560px) !important;
}
body #main .photo-slide:not(:has(video)) :is(figure, picture) {
  height: auto !important;
  aspect-ratio: auto !important;
  background: transparent !important;
}

/* The showroom overlay shares the photo's own coordinate system. */
body #main #process.showroom-experience .showroom-photo > img {
  position: relative !important;
  inset: auto !important;
}

/* Keep portrait hero photographs inside a comfortable desktop height. */
@media (min-width: 901px) {
  body #main .hero-photo:not(.gdb-hero-video) img:not([src*="poster"]) {
    max-height: min(75svh, 680px) !important;
  }
}
@media (max-width: 700px) {
  body.homepage #main .home-guides-editorial .guide {
    grid-template-columns: 112px minmax(0, 1fr);
  }
}
