/* v5.35 — smart sticky rails without nested scrolling.
   Tall rails flow through the viewport and pin by their lower edge; short rails pin below the site header.
   Position: sticky remains bounded by the relevant journal/article layout container. */

body.journal-body .journal-business-grid > .journal-left,
body.journal-body .journal-business-grid > .journal-right,
body.journal-body .journal-main-grid > .journal-left,
body.journal-body .journal-main-grid > .journal-right,
body.journal-body .journal-article-layout > .journal-aside {
  position: static !important;
  inset: auto !important;
  top: auto !important;
  bottom: auto !important;
  align-self: start !important;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  overflow-y: visible !important;
  overscroll-behavior: auto !important;
  scrollbar-width: auto !important;
  z-index: auto;
}

@media (min-width: 901px) and (min-height: 600px) {
  body.journal-body .journal-business-grid > .journal-left.journal-smart-sticky,
  body.journal-body .journal-business-grid > .journal-right.journal-smart-sticky,
  body.journal-body .journal-main-grid > .journal-left.journal-smart-sticky,
  body.journal-body .journal-main-grid > .journal-right.journal-smart-sticky,
  body.journal-body .journal-article-layout > .journal-aside.journal-smart-sticky {
    position: sticky !important;
    top: var(--journal-smart-sticky-top, 106px) !important;
    bottom: auto !important;
    align-self: start !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    overflow-y: visible !important;
    overscroll-behavior: auto !important;
    scrollbar-width: none !important;
    z-index: 5;
  }
}

/* Never keep the rails sticky on portrait/tablet/mobile layouts. */
@media (max-width: 900px), (max-height: 599px) {
  body.journal-body .journal-business-grid > .journal-left,
  body.journal-body .journal-business-grid > .journal-right,
  body.journal-body .journal-main-grid > .journal-left,
  body.journal-body .journal-main-grid > .journal-right,
  body.journal-body .journal-article-layout > .journal-aside {
    position: static !important;
    top: auto !important;
    max-height: none !important;
    overflow: visible !important;
    transform: none !important;
  }
}
