/* ==========================================================================
   Page transitions (site-wide, front end only). 2026-09-23.
   Cross-document View Transitions: on same-site link clicks the header and
   footer stay in place and only the page content crossfades (220ms).
   Browsers without support load pages normally. Reduced motion: off.
   Paired with js/atimi-page-transitions.js and moderate link prefetch
   (wp_speculation_rules_configuration filter in functions.php).
   ========================================================================== */
@view-transition { navigation: auto; }

/* Content: short crossfade so it does not stack with each page's own entrance motion. */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 220ms; animation-timing-function: cubic-bezier(.2,.8,.2,1); }

/* Global shell: captured separately and swapped instantly, so it never fades or flashes.
   (The Elementor sticky spacer is a clone with the same id, so it is excluded.) */
/* 2026-09-29 iOS Safari fix, option B: the header is no longer captured as its own view-transition layer (suspected of
   leaving it parked mid-page on About in iOS 26 Safari). It now crossfades with the page on navigation.
   To restore: #atimiHeader:not(.elementor-sticky__spacer) { view-transition-name: atimi-header; } */
.elementor-location-footer { view-transition-name: atimi-footer; }
#wpadminbar { view-transition-name: atimi-adminbar; }
#hubspot-messages-iframe-container { view-transition-name: atimi-hs-chat; }

::view-transition-group(atimi-header),
::view-transition-group(atimi-footer),
::view-transition-group(atimi-adminbar),
::view-transition-group(atimi-hs-chat) { animation: none; }
::view-transition-old(atimi-header),
::view-transition-old(atimi-footer),
::view-transition-old(atimi-adminbar),
::view-transition-old(atimi-hs-chat) { display: none; }
::view-transition-new(atimi-header),
::view-transition-new(atimi-footer),
::view-transition-new(atimi-adminbar),
::view-transition-new(atimi-hs-chat) { animation: none; }

/* Keep the header above the fading content during the transition. */
::view-transition-group(atimi-header), ::view-transition-group(atimi-adminbar) { z-index: 3; }

/* Leaving the page with the mobile menu open: drop the overlay before the snapshot. */
html.atimi-vt-leaving #atimiHeader .elementor-nav-menu--dropdown { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}