/* ============================================================
   STORMY TITANS™ — LAKE REVEAL TOUCH + SCROLL FIX — 002-R23-FIX

   Confirmed issue in R23:
   body.st-lake-open used touch-action:none. On iOS, touch-action is
   resolved through the ancestor chain, so that blocked pan gestures
   even when .lake-you-links itself declared touch-action:pan-y.

   This correction:
   - keeps page-behind scroll locked with overflow:hidden;
   - DOES NOT disable touch gestures on the body;
   - gives the mobile Lake Reveal a definite height, not merely max-height;
   - makes the You links / Options scroll wrapper the actual scrollport.
   ============================================================ */

.lake-reveal.open{
  pointer-events:auto !important;
}

/* Keep menu controls hit-testable. */
.lake-reveal.open .lake-titlebar,
.lake-reveal.open .lake-scroll,
.lake-reveal.open .you-card,
.lake-reveal.open .lake-you-links,
.lake-reveal.open .lake-admin-links,
.lake-reveal.open a,
.lake-reveal.open button{
  pointer-events:auto !important;
}

/* Page behind the menu is locked, but touch-action is intentionally NOT
   disabled because that would also prevent descendant touch scrolling. */
body.st-lake-open{
  overflow:hidden !important;
  overscroll-behavior:none !important;
}

/* ---------------- You Lake Reveal ---------------- */
.lake-you.open{
  display:flex !important;
  flex-direction:column !important;
  min-height:0 !important;
}

.lake-you.open > .lake-titlebar,
.lake-you.open > .you-card,
.lake-you.open > .lake-admin-links{
  flex:0 0 auto !important;
}

.lake-you.open > .lake-you-links{
  flex:1 1 0 !important;
  min-height:0 !important;
  max-height:none !important;
  overflow-y:scroll !important;
  overflow-x:hidden !important;
  -webkit-overflow-scrolling:touch !important;
  overscroll-behavior-y:contain !important;
  touch-action:pan-y !important;
}

/* ---------------- Options Lake Reveal ---------------- */
.lake-options.open{
  display:flex !important;
  flex-direction:column !important;
  min-height:0 !important;
}

.lake-options.open > .lake-titlebar{
  flex:0 0 auto !important;
}

.lake-options.open > .lake-scroll{
  flex:1 1 0 !important;
  min-height:0 !important;
  max-height:none !important;
  overflow-y:scroll !important;
  overflow-x:hidden !important;
  -webkit-overflow-scrolling:touch !important;
  overscroll-behavior-y:contain !important;
  touch-action:pan-y !important;
}

/* iPhone/mobile: max-height alone is insufficient to create a reliable
   flex scrollport when the content determines the parent's auto height.
   Give the open Lake Reveal an actual bounded height. */
@media(max-width:700px){
  .lake-you.open,
  .lake-options.open{
    height:calc(
      var(--st-vvh,100dvh)
      - 80px
      - 118px
      - env(safe-area-inset-bottom)
    ) !important;

    max-height:calc(
      var(--st-vvh,100dvh)
      - 80px
      - 118px
      - env(safe-area-inset-bottom)
    ) !important;

    min-height:0 !important;
  }
}
