/* =========================================================
   LA PAIX SCROLL STABILITY LOCK — v0.2.176
   ---------------------------------------------------------
   Goal: the browser alone owns vertical scroll position.
   No scroll snapping, no scroll anchoring correction and no
   root rubber-band chaining may push the viewport against the
   user's slow wheel/touch movement.
   v176 also migrates legacy mobile-reactive vh geometry to svh in the
   theme stylesheets so iOS browser-toolbar expansion cannot resize sections.

   This file is intentionally loaded last. It does not change
   copy, spacing, image ratios, prices or page composition.
========================================================= */

/* Programmatic anchors must never animate the viewport. */
html {
  scroll-behavior: auto !important;
  scroll-snap-type: none !important;
}

/* Chromium/WebKit scroll anchoring can counter-move the viewport when
   late image/font/layout geometry settles. The symptom is most visible
   during very slow scrolling: the page advances, then appears to pull a
   few pixels back. La paix reserves its important media geometry in CSS,
   so viewport anchoring is less useful than stable direct input here. */
html,
body,
.site-main {
  overflow-anchor: none !important;
}

@media (max-width: 900px) {
  /* Keep the document on the native vertical scroll path used by v174.
     Do not create a root overflow scroller. We only stop boundary chaining
     / rubber-band feedback from being handed back to the viewport. */
  html,
  body {
    overscroll-behavior-y: none;
    overscroll-behavior-x: none;
  }

  /* Explicitly neutralize any inherited/legacy viewport snap behavior while
     preserving intentional horizontal snapping inside photo galleries. */
  html,
  body,
  .site-main {
    scroll-snap-type: none !important;
  }
}


/* Mobile return-to-top control. It is deliberately a tiny flat fixed layer.
   Visibility is controlled by the small scroll-distance hysteresis in main.js;
   FAQ and footer visibility never suppress a needed return path. */
.page-top-anchor {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.mobile-back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 58;
  display: grid;
  width: 82px;
  min-height: 30px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(15,14,12,.9);
  color: rgba(255,255,255,.86);
  font: 10px/1 var(--font-latin-ui, Arial, sans-serif);
  letter-spacing: .12em;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease;
}
.mobile-back-to-top.is-visible { opacity: 1; visibility: visible; pointer-events: auto; }

@media (max-width: 900px) {
  .mobile-back-to-top {
    position: fixed;
    right: 14px;
    bottom: max(14px, calc(env(safe-area-inset-bottom) + 10px));
    z-index: 58;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(30,29,27,.18);
    border-radius: 50%;
    background: rgba(255,253,248,.97);
    color: #1e1d1b;
    font-family: "Times New Roman", serif;
    font-size: 17px;
    line-height: 1;
    letter-spacing: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: none !important;
    transition: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    filter: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  body.has-open-menu .mobile-back-to-top,
  body.has-lightbox .mobile-back-to-top {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}
