/*
 * Rustdoc owns its internal sidebar, search, source view, and responsive
 * behavior. This sheet only places the site-wide documentation sidebar beside
 * that generated application.
 */
:root {
  --konjure-docs-sidebar-width: 13.125rem;
}

/* Rustdoc fixes its own sidebar during a drag. Compensate inside the reference
 * viewer so its temporary positioning never moves the project navigation. */
html.sidebar-resizing > body.rustdoc { padding-left: 0; }
html.sidebar-resizing body.rustdoc > .rustdoc-site-shell { padding-left: var(--resizing-sidebar-width); }
html.sidebar-resizing body.rustdoc > .rustdoc-site-shell > .sidebar { left: var(--konjure-docs-sidebar-width); }

@font-face {
  font-family: Ubuntu;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../sdk/rust/static.files/ubuntu-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: Ubuntu;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../sdk/rust/static.files/ubuntu-latin-700-normal.woff2") format("woff2");
}

body.rustdoc {
  align-items: stretch;
}

body.rustdoc > .docs-sidebar {
  --alk-sans: Ubuntu, "Fira Sans", system-ui, sans-serif;
  --alk-ink: var(--main-color);
  --alk-muted: var(--main-color);
  --alk-rule: var(--sidebar-border-color);
  --alk-field: var(--sidebar-background-color-hover);
  --kj-cyan: var(--link-color);
  box-sizing: border-box;
  flex: 0 0 var(--konjure-docs-sidebar-width);
  height: 100vh;
  overflow-y: auto;
  padding: 1.5rem 1.2rem;
  position: sticky;
  top: 0;
}

body.rustdoc > .docs-sidebar .docs-search::placeholder {
  color: var(--alk-muted);
  opacity: .75;
}

body.rustdoc > .rustdoc-site-shell {
  display: flex;
  flex: 1 1 auto;
  font-family: Ubuntu, "Fira Sans", system-ui, sans-serif;
  min-width: 0;
}

body.rustdoc > .rustdoc-site-shell :is(h1, h2, h3, h4, h5, h6):not(.code-header) {
  font-family: Ubuntu, "Fira Sans", system-ui, sans-serif;
}

body.rustdoc.src > .rustdoc-site-shell > main {
  min-width: 0;
  overflow-x: auto;
}

body.rustdoc > .rustdoc-site-shell > .sidebar-resizer {
  left: calc(var(--konjure-docs-sidebar-width) + var(--desktop-sidebar-width));
}

body.rustdoc > .rustdoc-site-shell > .sidebar-resizer:hover,
body.rustdoc > .rustdoc-site-shell > .sidebar-resizer:active,
body.rustdoc > .rustdoc-site-shell > .sidebar-resizer:focus,
body.rustdoc > .rustdoc-site-shell > .sidebar-resizer.active {
  left: calc(var(--konjure-docs-sidebar-width) + var(--desktop-sidebar-width) - 1px);
}

body.rustdoc.src > .rustdoc-site-shell > .sidebar-resizer {
  left: calc(var(--konjure-docs-sidebar-width) + 49px);
}

html.src-sidebar-expanded body.rustdoc.src > .rustdoc-site-shell > .sidebar-resizer {
  left: calc(var(--konjure-docs-sidebar-width) + var(--src-sidebar-width));
}

html.src-sidebar-expanded body.rustdoc.src > .rustdoc-site-shell > .sidebar-resizer:hover,
html.src-sidebar-expanded body.rustdoc.src > .rustdoc-site-shell > .sidebar-resizer:active,
html.src-sidebar-expanded body.rustdoc.src > .rustdoc-site-shell > .sidebar-resizer:focus,
html.src-sidebar-expanded body.rustdoc.src > .rustdoc-site-shell > .sidebar-resizer.active {
  left: calc(var(--konjure-docs-sidebar-width) + var(--src-sidebar-width) - 1px);
}

html.hide-sidebar body.rustdoc > .rustdoc-site-shell > .sidebar-resizer {
  left: var(--konjure-docs-sidebar-width);
}

html.hide-sidebar body.rustdoc > .rustdoc-site-shell #sidebar-button {
  left: calc(var(--konjure-docs-sidebar-width) + 6px);
}

@media (max-width: 1000px) {
  body.rustdoc {
    display: block;
    overflow-x: clip;
  }

  body.rustdoc > .docs-sidebar {
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 1rem;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--alk-rule);
    margin-bottom: 1rem;
  }

  body.rustdoc > .rustdoc-site-shell {
    overflow-x: clip;
  }

  body.rustdoc > .rustdoc-site-shell > .sidebar-resizer {
    display: none;
  }

  body.rustdoc.src > .rustdoc-site-shell #sidebar-button {
    position: static;
  }
}

@media (max-width: 700px) {
  body.rustdoc > .docs-sidebar {
    flex-basis: auto;
    margin-bottom: 2rem;
  }

  body.rustdoc > .rustdoc-site-shell {
    display: block;
  }

  html.src-sidebar-expanded body.rustdoc.src > .rustdoc-site-shell > .sidebar {
    box-sizing: border-box;
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    max-width: none;
    height: min(40dvh, 22rem);
    max-height: none;
    overflow: auto;
  }
}

@media (min-width: 1001px) {
  body.rustdoc > .docs-sidebar nav {
    display: block;
    padding-block: 0;
  }

  body.rustdoc.src > .rustdoc-site-shell #sidebar-button {
    left: calc(var(--konjure-docs-sidebar-width) + 8px);
  }
}
