/* Abyss Gaming Hub v234Z R89 — public homepage mobile safe-area ownership.
   Keeps the public site's sticky header, mobile menu, skip link and anchored
   sections clear of iPhone status bars / notches / Dynamic Island without
   changing the private Hub's established safe-area modules. */

:root {
  --agh-public-safe-top: env(safe-area-inset-top, 0px);
  --agh-public-safe-right: env(safe-area-inset-right, 0px);
  --agh-public-safe-bottom: env(safe-area-inset-bottom, 0px);
  --agh-public-safe-left: env(safe-area-inset-left, 0px);
}

@media (max-width: 780px), (hover: none) and (pointer: coarse) {
  /* The sticky glass continues behind the system status area, while every
     interactive control starts below it. Because the padding belongs to the
     header itself, normal document flow automatically gives the hero the same
     clearance instead of relying on a device-specific hard-coded offset. */
  body.public-home-page .site-nav {
    top: 0;
    padding-top: var(--agh-public-safe-top);
  }

  body.public-home-page .site-nav .nav-inner {
    min-height: 66px;
  }

  /* Keep all public-page shells out of left/right cutouts too, which matters
     most in landscape on notched phones. */
  body.public-home-page .site-shell {
    width: auto;
    max-width: 1180px;
    margin-left: max(14px, calc(var(--agh-public-safe-left) + 14px));
    margin-right: max(14px, calc(var(--agh-public-safe-right) + 14px));
  }

  /* Absolute menu positioning must include the same safe top; otherwise the
     expanded panel can climb back under the status bar even when the header
     controls themselves are safe. */
  body.public-home-page .site-nav.open .nav-links {
    top: calc(var(--agh-public-safe-top) + 62px);
    left: max(14px, calc(var(--agh-public-safe-left) + 14px));
    right: max(14px, calc(var(--agh-public-safe-right) + 14px));
    max-height: calc(100dvh - var(--agh-public-safe-top) - 82px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  body.public-home-page .skip-link {
    top: calc(var(--agh-public-safe-top) + 10px);
    left: max(14px, calc(var(--agh-public-safe-left) + 14px));
  }

  html.public-home-root {
    scroll-padding-top: calc(var(--agh-public-safe-top) + 82px);
  }

  body.public-home-page main [id] {
    scroll-margin-top: calc(var(--agh-public-safe-top) + 82px);
  }

  body.public-home-page .site-footer {
    padding-bottom: max(38px, calc(var(--agh-public-safe-bottom) + 24px));
  }
}

/* Native fullscreen removes browser chrome/cutout interference, so do not
   carry an artificial top gap into fullscreen if the page ever enters it. */
:fullscreen {
  --agh-public-safe-top: 0px;
  --agh-public-safe-right: 0px;
  --agh-public-safe-bottom: 0px;
  --agh-public-safe-left: 0px;
}
:-webkit-full-screen {
  --agh-public-safe-top: 0px;
  --agh-public-safe-right: 0px;
  --agh-public-safe-bottom: 0px;
  --agh-public-safe-left: 0px;
}
