/*
 * Position-based reveals using common.js's existing .scrolled-to trigger.
 * Slide without opacity animation or clip-path effects.
 * Position animation requires layout/paint work; keep travel bounded.
 */
html body.tc-theme-frontend :is(
  .h-animate-from-top,
  .h-animate-from-bottom,
  .h-animate-from-left,
  .h-animate-from-right,
  .h-reveal-images-from-bottom
),
html body.tc-theme-frontend :is(.js-reveal-from-top, .js-reveal-from-bottom) > * {
  position: relative;
  opacity: 1 !important;
  transform: none !important;
  translate: none !important;
  scale: none !important;
  rotate: none !important;
  clip-path: none !important;
  will-change: auto !important;
  backface-visibility: visible !important;
  animation: none !important;
  top: 0;
  left: 0;
  transition: top 1100ms cubic-bezier(0.22, 1, 0.36, 1),
    left 1100ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

.tc-theme-frontend .h-reveal-images-from-bottom img {
  transform: none !important;
  transition: none !important;
  will-change: auto !important;
}

/* The theme's separator reveal also used a composited transform. */
.tc-theme-frontend .wp-block-separator.animate-separator {
  transform: none !important;
  translate: none !important;
  will-change: auto !important;
  animation: none !important;
  width: 100% !important;
  transition: width 1100ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

.tc-theme-frontend .wp-block-separator.animate-separator:not(.scrolled-to) {
  width: 0 !important;
}

/* Include saved footer copies that omit the parent's site-footer-container class. */
/* Footer link underlines also kept invisible transform layers alive. */
@media (min-width: 1025px) {
  :is(.site-footer-container, .wmw-site-footer) :is(h1, h2, h3, h4, h5, h6, p, ul:not(.page-numbers), ol)
  a:not(.button):not(.wp-block-button__link)::after {
    transform: none !important;
    will-change: auto !important;
    width: 0 !important;
    transition: width 500ms ease !important;
  }

  :is(.site-footer-container, .wmw-site-footer) :is(h1, h2, h3, h4, h5, h6, p, ul:not(.page-numbers), ol)
  a:not(.button):not(.wp-block-button__link):is(:hover, :focus, .has-focus)::after {
    width: 100% !important;
  }
}

/* Set before first paint; common.js releases this after loading the text fonts. */
html.eveny-404-fonts-pending body.error404 main {
  visibility: hidden !important;
}

html.eveny-404-fonts-pending body.error404 main * {
  visibility: hidden !important;
}

.tc-theme-frontend .h-animate-from-top:not(.scrolled-to),
.tc-theme-frontend .js-reveal-from-top:not(.scrolled-to) > * {
  top: -48px;
  visibility: hidden;
}

.tc-theme-frontend :is(.h-animate-from-bottom, .h-reveal-images-from-bottom):not(.scrolled-to),
.tc-theme-frontend .js-reveal-from-bottom:not(.scrolled-to) > * {
  top: 48px;
  visibility: hidden;
}

.tc-theme-frontend .h-animate-from-left:not(.scrolled-to) {
  left: -48px;
  visibility: hidden;
}

.tc-theme-frontend .h-animate-from-right:not(.scrolled-to) {
  left: 48px;
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce), print {
  :is(.site-footer-container, .wmw-site-footer) :is(h1, h2, h3, h4, h5, h6, p, ul:not(.page-numbers), ol)
  a:not(.button):not(.wp-block-button__link)::after {
    transition: none !important;
  }

  .tc-theme-frontend .wp-block-separator.animate-separator {
    width: 100% !important;
    transition: none !important;
  }

  html body.tc-theme-frontend :is(
    .h-animate-from-top,
    .h-animate-from-bottom,
    .h-animate-from-left,
    .h-animate-from-right,
    .h-reveal-images-from-bottom
  ),
  html body.tc-theme-frontend :is(.js-reveal-from-top, .js-reveal-from-bottom) > * {
    top: 0 !important;
    left: 0 !important;
    visibility: visible !important;
    transition: none !important;
  }
}

/* Paint solid surfaces without the earlier forced-compositing experiments. */
@media screen {
  html body.single-product.tc-theme-frontend > .wp-site-blocks {
    background-color: #010205;
  }

  /* The product template's outer content group has no .has-background class. */
  html body.single-product.tc-theme-frontend > .wp-site-blocks
  > :is(main, .wp-block-group):has(
    .wp-block-woocommerce-product-image-gallery,
    .wp-block-woocommerce-product-gallery,
    .wp-block-woocommerce-product-details
  ) {
    background-color: #010205;
  }

  /* Paint gaps and the area below the last child on the footer's own surface. */
  html body.tc-theme-frontend .site-footer-container {
    background-color: #010205;
  }

  /*
   * Keep ancestors of fixed-position overlays free of transforms and layer
   * hints, including any left in the site's Additional CSS.
   */
  html body.tc-theme-frontend .wp-site-blocks.wp-site-blocks
  :not(svg, svg *):has(:is(
    .wp-block-navigation__responsive-container,
    .wc-block-components-drawer__screen-overlay,
    [role="dialog"],
    [aria-modal="true"],
    [style*="position:fixed" i],
    [style*="position: fixed" i]
  )) {
    -webkit-backface-visibility: visible !important;
    backface-visibility: visible !important;
    transform: none !important;
    translate: none !important;
    will-change: auto !important;
  }

}

/* Navigation overlays need their own viewport-based positioning hierarchy. */
@media screen {
  html body.tc-theme-frontend .wp-site-blocks .wp-block-navigation__responsive-container,
  html body.tc-theme-frontend .wp-site-blocks
  .wp-block-navigation__responsive-container :not(svg, svg *) {
    -webkit-backface-visibility: visible !important;
    backface-visibility: visible !important;
    translate: none !important;
    will-change: auto !important;
  }

  html body.tc-theme-frontend .wp-site-blocks
  .wp-block-navigation__responsive-container :is(
    .wp-block-navigation__responsive-close,
    .wp-block-navigation__responsive-dialog
  ) {
    transform: none !important;
  }

  /* Keep the header's geometry stable while hiding the cart behind the menu. */
  html body.tc-theme-frontend
  .site-header:has(.wp-block-navigation__responsive-container.is-menu-open)
  .wc-block-mini-cart,
  html body.tc-theme-frontend
  .site-header:has(.wp-block-navigation__responsive-container.is-menu-open)
  .wc-block-mini-cart * {
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/*
 * Live SVG duotone filters caused the reported scroll-dependent black shift.
 * Footer sponsor logos now use local SVGs with lime artwork and black cutouts.
 * Keep the product-page fallback for other duotone images in the footer.
 */
@media screen {
  html body.tc-theme-frontend .wp-site-blocks
  :is(footer, .site-footer-container) img.wmw-footer-logo,
  html body.single-product.tc-theme-frontend .wp-site-blocks
  :is(footer, .site-footer-container) .wp-block-image[class*="wp-duotone-"] img {
    -webkit-filter: none !important;
    filter: none !important;
  }
}
