.navigation-resize,
.navigation-toc-toggle {
  display: none;
}

@media (min-width: 960px) {
  /* The layout spans the whole window so the header lines up with the sidebars. */
  .bd-page-width,
  .bd-main .bd-content .bd-article-container {
    max-width: none;
  }

  .bd-main .bd-content .bd-article-container {
    flex: 1;
    min-width: 0;
  }

  /* Text keeps a readable line length; 58rem still fits a 900 px diagram. */
  .bd-article-container > * {
    margin-inline: auto;
    max-width: 58rem;
    width: 100%;
  }

  .bd-sidebar-primary {
    width: var(--navigation-width, min(25%, 14rem));
  }

  .navigation-resize {
    align-self: flex-start;
    cursor: col-resize;
    display: block;
    flex: 0 0 12px;
    height: calc(100vh - var(--pst-header-height));
    margin-inline: -6px;
    position: sticky;
    top: var(--pst-header-height);
    touch-action: none;
    z-index: 2;
  }

  .navigation-resize:focus-visible,
  .navigation-resize:active {
    box-shadow: inset 2px 0 var(--pst-color-primary);
  }
}

/* PyData switches the right sidebar from a drawer to a column at 1200px. */
@media (min-width: 1200px) {
  /* Fixed, so the button appearing after load does not shift the columns. */
  .navigation-toc-toggle {
    display: grid;
    font-size: 1.5rem;
    height: 2.25rem;
    padding: 0;
    place-items: center;
    position: fixed;
    right: 0.75rem;
    top: calc(var(--pst-header-height) + 1rem);
    width: 2rem;
    z-index: 3;
  }

  /* Set on <html> by navigation-early.js before the first paint. */
  html.navigation-toc-collapsed .bd-sidebar-secondary {
    display: none;
  }
}
