/*
  GLOBAL LAYOUT
 */

:root {
  --docpage-nav-sidebar-width: 260px;
  --docpage-toc-sidebar-width: 160px;
  @include m(l) {
    --docpage-nav-sidebar-width: 260px;
    --docpage-toc-sidebar-width: 160px;
  }
}

.sticky-sidebar {

  position: -webkit-sticky;
  position: sticky;
  top: calc(var(--top-navbar-height));

  max-height: calc(100vh - (var(--top-navbar-height)));
  overflow-y: auto;

  flex: 0 0 auto;
  align-self: flex-start;
  display: flex;
  flex-direction: column;

  // &::-webkit-scrollbar {
  //   width: 7px;
  // }

  // &::-webkit-scrollbar-track {
  //   background: #f1f1f1;
  //   border-radius: 10px;
  // }

  // &::-webkit-scrollbar-thumb {
  //   background: #888;
  //   border-radius: 10px;

  //   &:hover {
  //     background: #555;
  //   }
  // }
}

/*

     _
    | |
  __| | ___   ___ _ __   __ _  __ _  ___
 / _` |/ _ \ / __| '_ \ / _` |/ _` |/ _ \
| (_| | (_) | (__| |_) | (_| | (_| |  __/
 \__,_|\___/ \___| .__/ \__,_|\__, |\___|
                 | |           __/ |
                 |_|          |___/

*/

.docpage {
  display: flex;
  position: relative;
}

.docpage-sidebar-bg {
  display: none;
  @include m(null, l) {
    display: block;
    background-color: rgba(0,0,0,0.1);
    position: fixed;
    z-index: 1;
    top: var(--top-navbar-height);
    right: 0;
    bottom: 0;
    left: 0;
    visibility: hidden;
    opacity: 0;
    transition: opacity 200ms 0ms, visibility 200ms 200ms;
    &.open {
      transition: opacity 200ms 200ms, visibility 200ms 0ms;
      visibility: visible;
      opacity: 1;
    }
  }
}
.docpage-sidebar {
  width: var(--docpage-nav-sidebar-width);
  padding-right: var(--inner-x-xs);
  @include m(null, l) {
    --local-width: calc(var(--outer-left) + var(--docpage-nav-sidebar-width));
    width: var(--local-width);
    height: 100%;
    padding-left: var(--outer-left);
    padding-right: var(--outer-right);
    background-color: white;
    position: fixed;
    z-index: 1;
    left: 0;
    top: var(--top-navbar-height);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
    transform: translate3d(calc(var(--local-width) * -1), 0, 0);
    transition: transform 200ms ease-in-out;
    &[aria-expanded=true] {
    transform: translate3d(0, 0, 0);
    }
  }
}

.docpage-sidebar-banner {
  border-top: 1px solid var(--global-border-color);
}

.product-avatar {
  display: flex;
  > .avatar {
    > img { border: none; }
    flex: 0 0 auto;
    width: 50px;
  }
  > .heading {
    flex: 1 1 auto;
    margin-left: 1em;
  }
}

.docpage-content {
  --docpage-content-max-width: 100%;
  flex: 1 1 auto;
  display: flex;
  border: none;
  max-width: var(--docpage-content-max-width);
  @include m(l) {
    --docpage-content-max-width: calc(100% - var(--docpage-nav-sidebar-width));
    border-left: 1px solid var(--global-border-color);
  }
}

.docpage-abstract {
  color: #555;
}

.docpage-content-main {
  flex: 1 1 0;
  width: 0%;
  > header::after {
    content: '';
    display: block;
    width: 20%;
    padding-top: var(--inner-y-l);
    border-bottom: 1px solid var(--global-border-color);
  }

  /* set maximum width of doc-content sub-containers */
  --mdx-content-measure: calc(36 * var(--font-size-sans-s));
  > header,
  > footer,
  > .prose-mdx {
    max-width: var(--mdx-content-measure);
  }

  /* class to allow content to span full docpage-content width */
  .mdx-box-max {
    margin-right: -100%;
    max-width: calc(
      100vw
      - var(--outer-right)
      - var(--outer-left)
    );
    @include m(l) {
      max-width: calc(
        100vw
        - var(--outer-right)
        - var(--outer-left)
        - var(--docpage-nav-sidebar-width)
        - var(--inner-x-m)
      );
    }
    @include m(xl) {
      max-width: calc(
        var(--outer-width-xl)
        - var(--outer-right)
        - var(--outer-left)
        - var(--docpage-nav-sidebar-width)
        - var(--inner-x-m)
      );
    }
  }
}

.docpage-content-side {
  width: var(--docpage-toc-sidebar-width);
}

@media only screen and (max-width: 996px) {
  .tableOfContents {
    display: none;
  }
}


/* OLD STUFF BELOW HERER */

.docTitle {
  font-size: 3rem;
  margin-bottom: calc(var(--ifm-leading-desktop) * var(--ifm-leading));
}

.docItemContainer {
  margin: 0 auto;
  padding: 0 0.5rem;
}

@media only screen and (min-width: 997px) {
  .docItemCol {
    max-width: 75% !important;
  }
}

@media (min-width: 997px) and (max-width: 1320px) {
  .docItemWrapper {
    max-width: calc( var(--ifm-container-width) - 300px - var(--ifm-spacing-horizontal) * 2 );
  }
}

.docLastUpdatedAt {
  font-weight: bold;
}

/* TOC */

:root {
  --ifm-toc-link-color:var(--ifm-color-content-secondary);
  --ifm-toc-padding-left:0.5rem;
  --ifm-toc-padding-vertical:0.5rem;
  /* CUSTOM */

}

.table-of-contents {
  font-size: 0.8rem;
  margin: 0;
  list-style-type: none;
  padding-left: var(--ifm-toc-padding-left);

  border-left-color: var(--global-border-color);
  border-left-style: solid;
  border-left-width: 1px;

  ul {
    list-style-type: none;
    padding-left: var(--ifm-toc-padding-left);
  }

  li {
    // margin: var(--ifm-toc-padding-vertical);
  }
}

.table-of-contents__link {
  color: var(--ifm-toc-link-color);

  &:hover {
    color: var(--ifm-color-primary);
    text-decoration: none;

    code {
      color: var(--ifm-color-primary);
      text-decoration: none;
    }
  }
}

.table-of-contents__link--active {
  color: var(--ifm-color-primary);
  text-decoration: none;

  code {
    color: var(--ifm-color-primary);
    text-decoration: none;
  }
}
