/* The documentation reader follows the same app-shell rules as the console. */
body.page-node-type-doc {
  padding-top: 64px !important;
}

body.page-node-type-doc .doc-appbar {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  left: 0 !important;
  width: 100% !important;
}

body.page-node-type-doc .doc-sidebar {
  position: sticky !important;
  top: 88px !important;
  max-height: calc(100vh - 112px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scrollbar-width: thin;
}

body.page-node-type-doc .doc-toc {
  position: sticky !important;
  top: 88px !important;
  max-height: calc(100vh - 112px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scrollbar-width: thin;
}

/* If a document has no TOC, let the article use the free column. */
body.page-node-type-doc .doc-layout:not(:has(.doc-toc li)) {
  grid-template-columns: 280px minmax(0, 1fr) !important;
}

@media (max-width: 1180px) {
  body.page-node-type-doc .doc-layout:not(:has(.doc-toc li)) {
    grid-template-columns: 250px minmax(0, 1fr) !important;
  }
}

@media (max-width: 820px) {
  body.page-node-type-doc {
    padding-top: 64px !important;
  }

  body.page-node-type-doc .doc-layout:not(:has(.doc-toc li)) {
    grid-template-columns: 1fr !important;
  }
}

/* Documentation content uses the same public header as every other front page. */
body.page-node-type-doc.evx-front-nav header[role="banner"] {
  display: block !important;
}

body.page-node-type-doc.evx-front-nav header[role="banner"] > .region-header {
  display: flex !important;
}

body.page-node-type-doc .doc-appbar {
  display: none !important;
}

/* Keep the docs reader aligned with the public header at every breakpoint. */
body.page-node-type-doc.evx-front-nav {
  padding-top: calc(var(--front-header-h, 64px) + var(--drupal-displace-offset-top, 0px)) !important;
}

@media (max-width: 1024px) {
  html body.page-node-type-doc.evx-front-nav header[role="banner"] .evx-nav-toggle {
    display: flex !important;
    position: absolute !important;
    top: 50% !important;
    right: 16px !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(-50%) !important;
  }
}

@media (max-width: 1024px) {
  html body.page-node-type-doc.evx-front-nav .evx-nav-toggle {
    position: fixed !important;
    top: 7px !important;
    right: 16px !important;
    left: auto !important;
    z-index: 1001 !important;
    transform: none !important;
  }
}
