/* Shared photo treatment. Logos, diagrams and explicit opt-outs remain still.
   CSS timelines need no scroll listeners; unsupported browsers keep hover zoom. */
body img:is([src*=".jpg" i], [src*=".jpeg" i], [src*=".webp" i], [src*=".png" i], [src*=".avif" i]):not([src*="logo" i]):not([data-immersive="off"]) {
  --photo-hover-scale: 1;
  transform: scale(var(--photo-hover-scale));
  transform-origin: center;
  transition: transform 650ms cubic-bezier(.2, .65, .3, 1);
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    body img:is([src*=".jpg" i], [src*=".jpeg" i], [src*=".webp" i], [src*=".png" i], [src*=".avif" i]):not([src*="logo" i]):not([data-immersive="off"]) {
      animation: immersive-photo-entry linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 100%;
    }
  }
  @media (hover: hover) and (pointer: fine) {
    body img:is([src*=".jpg" i], [src*=".jpeg" i], [src*=".webp" i], [src*=".png" i], [src*=".avif" i]):not([src*="logo" i]):not([data-immersive="off"]):hover,
    body :is(a, button):is(:hover, :focus-visible) img:not([src*="logo" i]):not([data-immersive="off"]) {
      --photo-hover-scale: 1.025;
    }
  }
}

@keyframes immersive-photo-entry {
  from { scale: var(--photo-entry-scale, .97); translate: 0 var(--photo-entry-offset, 10px); }
  to { scale: 1; translate: 0 0; }
}

/* Keep edge-to-edge hero photography filled throughout its entrance. */
.store-hero-photo {
  --photo-entry-scale: 1;
  --photo-entry-offset: 0px;
}

@media (max-width: 760px), (pointer: coarse) {
  body {
    --photo-entry-scale: .99;
    --photo-entry-offset: 3px;
  }
}

/* Product inspection stays stable, even inside a scrolling dialog. */
dialog img {
  animation: none !important;
  scale: 1 !important;
  translate: none !important;
}

@media (prefers-reduced-motion: reduce) {
  body img,
  .hero .hero-media,
  .service-grid article,
  .store-card {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    scale: none !important;
    translate: none !important;
  }
}
