/*
 * SwipeBack visual layer.
 * Uses transform and opacity only during the gesture.
 */

html.swipe-back-lock,
body.swipe-back-active {
  overscroll-behavior-x: none;
}

body.swipe-back-active {
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.swipe-back-page {
  animation: none !important;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  contain: layout paint size;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity, box-shadow;
}

.swipe-back-previous {
  z-index: 9980 !important;
  pointer-events: none !important;
}

.swipe-back-current {
  z-index: 9990 !important;
  pointer-events: none !important;
}

.swipe-back-overlay {
  position: fixed;
  inset: 0;
  z-index: 9985;
  background: #000;
  opacity: 0.16;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  will-change: opacity;
}

@media (prefers-reduced-motion: reduce) {
  .swipe-back-page,
  .swipe-back-overlay {
    transition: none !important;
  }
}
