/* Document owns vertical scrolling. Do not hide a vertical scrollbar or clip content.
   overflow-x:hidden implicitly makes overflow-y:auto and creates a second body
   scroller when reveal transforms extend the footer beyond its layout box. */
html body {
  display: flow-root;
  height: auto;
  max-height: none;
  overflow-x: clip !important;
  overflow-y: visible !important;
}

/* A long article companion must grow with the document, not trap wheel/touch
   input in a viewport-height sidebar. Keep its content and existing spacing. */
body.page-publication .pub-action-rail,
body.page-publication .pub-context-rail {
  position: static;
}
body.page-publication .pub-action-rail__stack,
body.page-publication .pub-context-rail .article-toc-list {
  max-height: none;
  overflow: visible;
  overscroll-behavior: auto;
}

/* Keep the native disclosure usable on wide screens too. A closed <details>
   cannot reliably be made permanently open using display:block on its child. */
body.page-publication .pub-context-toc > summary {
  pointer-events: auto;
}
body.page-publication .pub-context-toc > summary::after {
  display: block;
}
body.page-publication .pub-context-toc:not([open]) > .article-toc-nav {
  display: none;
}
