/*
Theme Name: Sheshi iOS Document Edge Guard
Version: 0.28.8
Description: Prevents root-level horizontal panning in iOS Safari and keeps the footer as the final painted page edge.
*/

/* `overflow-x: clip` is useful on the body because it does not create a
   vertical scroll container and therefore preserves sticky profile content.
   WebKit still needs `hidden` on the root element itself to prevent the
   layout viewport from being panned sideways. */
html {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: clip !important;
  background: #000 !important;
}

body.sheshi-home,
body.sheshi-shell {
  width: 100% !important;
  max-width: 100% !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
  margin-left: 0 !important;
  padding-right: 0 !important;
  padding-bottom: 0 !important;
  padding-left: 0 !important;
  overflow-x: clip !important;
}

/* The horizontal discovery rail owns its overflow. Its intrinsic grid width
   must never enlarge the page canvas in WebKit. */
@media (max-width: 1023px) {
  html {
    overflow-x: hidden !important;
  }

  body.sheshi-home .sheshi-discovery > .sheshi-wrap,
  body.sheshi-home .sheshi-discovery-grid {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body.sheshi-home .sheshi-discovery {
    box-sizing: border-box !important;
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
    min-width: 0 !important;
  }

  body.sheshi-home .sheshi-discovery,
  body.sheshi-home .sheshi-discovery > .sheshi-wrap {
    overflow-x: hidden !important;
  }

  body.sheshi-home .sheshi-discovery-grid {
    contain: layout paint !important;
  }
}

/* There is no document reserve after the footer. On profile pages the
   callbar clearance remains inside the black footer, never below it. */
.sheshi-site-footer {
  position: relative;
  width: 100% !important;
  max-width: 100% !important;
  margin-bottom: 0 !important;
  background: #000 !important;
}

.sheshi-site-footer:last-child {
  margin-bottom: 0 !important;
}

@supports not (overflow: clip) {
  html,
  body.sheshi-home,
  body.sheshi-shell {
    overflow-x: hidden !important;
  }
}
