/* KOVCHEG Blog 3.5.10 — public material page scrolling
 * Author and copyright: Ланцет Семён Борисович
 * License: proprietary / all rights reserved
 */

/*
 * Archives may use the desktop application-style inner scroller. A complete
 * publication, page or portfolio item is a document and must use the browser's
 * normal vertical scroll. These rules are loaded last so legacy fixed-shell
 * overflow locks cannot trap the reader inside a non-scrolling viewport.
 */
html:has(body.blog-theme-document) {
  height: auto !important;
  min-height: 100%;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scroll-behavior: smooth;
}

body.blog-theme-document {
  height: auto !important;
  min-height: 100vh;
  display: block !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: auto;
  touch-action: pan-y;
}

body.blog-theme-document .portal-matrix-header {
  position: sticky;
  top: 0;
}

body.blog-theme-document .portal-matrix-viewport {
  height: auto !important;
  min-height: 0;
  display: block;
  overflow: visible !important;
}

body.blog-theme-document .portal-matrix-columns {
  height: auto !important;
  min-height: 0;
  align-items: start;
}

body.blog-theme-document .portal-matrix-content,
body.blog-theme-document .portal-matrix-sidebar {
  height: auto !important;
  min-height: 0;
  overflow: visible !important;
}

body.blog-theme-document .portal-matrix-content {
  padding-bottom: 32px;
  overscroll-behavior: auto;
  touch-action: pan-y;
}

body.blog-theme-document .portal-matrix-content-grid,
body.blog-theme-document .portal-matrix-page-content {
  min-height: 0;
}

body.blog-theme-document .portal-matrix-sidebar-grid {
  height: auto !important;
  grid-template-rows: none;
  grid-auto-rows: max-content;
  overflow: visible !important;
}

body.blog-theme-document .portal-matrix-footer {
  max-height: none;
  overflow: visible;
}

@media (max-width: 900px) {
  body.blog-theme-document .portal-matrix-header {
    position: sticky;
    top: 0;
  }
}
