/* Gli ingressi sono in components.css (sezione "Ingressi dei componenti").
   Questo file: compatibilità <picture> e movimento a scroll in CSS puro (animation-timeline), solo transform e scale,
   senza JS e senza layout. Tutto dietro @supports e prefers-reduced-motion: no-preference. */

/* <picture> dentro i frame foto: blocco a piena altezza, così object-fit e scale restano sul frame */
.photo-frame > picture, .card-media .photo-frame > picture { display: block; width: 100%; height: 100%; }
.path:hover .path-media .photo-frame > picture, .card.is-link:hover .card-media .photo-frame > picture { scale: 1.04; }
.hm-photo > picture { display: contents; }

/* Profondità: dentro il frame la foto scorre più piano della pagina; le figure di una composizione a velocità diverse */
@keyframes img-parallax { from { translate: 0 -5%; } to { translate: 0 5%; } }
@keyframes fig-lift { from { translate: 0 var(--lift, 48px); } to { translate: 0 calc(var(--lift, 48px) * -1); } }
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    :is(.mosaic, .with-media, .photo-pair, .cta-photo) .photo-frame img { scale: 1.12; animation: img-parallax linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
    .mosaic .mz-a { --lift: 40px; animation: fig-lift linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
    .mosaic .mz-b { --lift: 24px; animation: fig-lift linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
    .photo-pair > :nth-child(2) { --lift: 40px; animation: fig-lift linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
  }
}
