.pytorch-container {
  margin: 0 auto;
  padding: 0 rem(30px);
  width: auto;
  position: relative;
  @include full-nav-menu-desktop {
    padding: 0;
  }

  @include sphinx-medium-size {
    margin-left: 25%;
  }

  @include sphinx-full-size {
    margin-left: $desktop_menu_width;
  }

  @include clearfix;
}

.pytorch-content-wrap {
  background-color: #ffffff;
  display: flex;
  position: relative;
  padding-top: 0;
  @include clearfix;

  @include sphinx-medium-size {
    padding-top: 45px;
    float: left;
    width: 100%;
    display: block;
  }

  @include sphinx-full-size {
    width: 100%;
  }
}

.pytorch-content {
  background: #ffffff;
  width: 100%;
  max-width: $sphinx_full_width_content_width;
  position: relative;
}

.pytorch-content-left {
  margin-top: rem(40px);
  width: 100%;

  @include sphinx-medium-size {
    margin-top: 0;
    margin-left: 3%;
    width: $sphinx_article_width;
    float: left;
  }

  @include sphinx-full-size {
    width: 850px;
    margin-left: 30px;
  }

  .main-content {
    padding-top: rem(15px);
    ul.simple {
      padding-bottom: rem(20px);
    }
    .note, .warning {
      &:nth-child(1) {
        margin-top: 0;
      }
    }
  }
}

.pytorch-content-right {
  display: none;
  position: relative;
  overflow-x: hidden;
  overflow-y: hidden;

  @include sphinx-medium-size {
    display: block;
    margin-left: 0;
    width: 19%;
    float: left;
    height: 100%;
  }

  @include sphinx-full-size {
    width: $desktop_menu_width - 70px;
  }
}

.pytorch-side-scroll {
  @include sphinx-medium-size {
    position: relative;
    overflow-x: hidden;
    overflow-y: scroll;
    height: 100%;
  }
}

.pytorch-menu-vertical {
  padding: rem(20px) rem(30px) rem(40px) rem(30px);

  @include sphinx-medium-size {
    display: block;
    padding-top: 0;
    padding-right: $sphinx_left_menu_wrapper_padding_right;
    padding-bottom: rem(90px);
  }

  @include sphinx-full-size {
    padding-left: 0;
    padding-right: rem(25px);
  }
}

.pytorch-left-menu {
  display: none;
  background-color: $light_grey;
  color: $slate;

  @include sphinx-medium-size {
    display: block;
    overflow-x: hidden;
    overflow-y: hidden;
    padding-bottom: 20px + 90px;
    padding: 0 rem(30px) 0 0;
    width: $sphinx_left_menu_width;
    z-index: 200;
    float: left;

    &.make-fixed {
      position: fixed;
      top: 0;
      bottom: 0;
      left: 0;
      float: none;
    }
  }

  @include sphinx-full-size {
    padding: 0 0 0 rem(30px);
    width: $desktop_menu_width;
  }
}

.pytorch-left-menu p.caption {
  color: $not_quite_black;
  display: block;
  display: inline-block;
  font-size: rem(16px);
  line-height: rem(22px);
  margin-bottom: rem(16px);
  padding: 0;
  text-transform: none;
  white-space: nowrap;
}

.pytorch-left-menu-search {
  margin-bottom: rem(40px);

  @include sphinx-medium-size {
    margin: rem(20px) rem(10px) rem(30px) 0;
  }
}

.pytorch-left-menu-search {
  ::-webkit-input-placeholder {
    color: $not_quite_black;
  }

  ::-moz-placeholder {
    color: $not_quite_black;
  }

  :-ms-input-placeholder {
    color: $not_quite_black;
  }

  :-moz-placeholder {
    color: $not_quite_black;
  }

  ::placeholder {
    color: $not_quite_black;
  }
}

.pytorch-left-menu-search input[type=text] {
  border-radius: 0;
  padding: rem(8px) rem(12px);
  border-color: $white;
  color: $not_quite_black;
  border-style: solid;
  font-size: rem(16px);
  width: 100%;
  background-color: $light_grey;
  background-image: url("../images/search-icon.svg");
  background-repeat: no-repeat;
  background-size: 18px 18px;
  background-position: 12px 10px;
  padding-left: 40px;
  background-color: $white;

  &:focus {
    outline: 0;
  }
}

.pytorch-left-menu .pytorch-side-scroll {
  @include sphinx-medium-size {
    width: $sphinx_left_menu_scroll_wrapper_width;
  }

  @include sphinx-full-size {
    width: 340px;
  }
}

.pytorch-right-menu {
  min-height: 100px;
  overflow-x: hidden;
  overflow-y: hidden;
  left: 0;
  z-index: 200;
  padding-top: 0;
  position: relative;

  @include sphinx-medium-size {
    width: 100%;

    &.scrolling-fixed {
      position: fixed;
      top: 45px;
      left: 83.5%;
      width: 14%;
    }

    &.scrolling-absolute {
      position: absolute;
      left: 0;
    }
  }

  @include sphinx-full-size {
    left: 0;
    width: 380px;

    &.scrolling-fixed {
      position: fixed;
      top: 45px;
      left: 1230px;
    }

    &.scrolling-absolute {
      position: absolute;
      left: 0;
    }
  }
}

.pytorch-left-menu,
.pytorch-right-menu {
  ul {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: rem(40px);
  }

  > ul {
    margin-bottom: rem(40px);
  }

  a:link,
  a:visited,
  a:hover {
    color: $quick_start_grey;
    font-size: rem(14px);
    line-height: rem(16px);
    padding: 0;
    text-decoration: none;
    &.reference.internal {
      margin-bottom: rem(5px);
      position: relative;
    }
  }

  li {
    &.divide-top {
    }

    &.divide-bottom {
    }

    &.current {
      a {
        &:hover {
        }
      }
    }

    code {
      border: none;
      background: inherit;
      color: inherit;
      padding-left: 0;
      padding-right: 0;
    }

    // Expand links
    span.toctree-expand {
      display: block;
      float: left;
      margin-left: -1.2em;

      font-size: 0.8em;
      line-height: 1.6em;
    }
  }

  // On state for the first level
  li.on a, li.current > a {
    position: relative;
    border: none;

    &:hover {
      span.toctree-expand {
      }
    }

    span.toctree-expand {
      display: block;
      font-size: 0.8em;
      line-height: 1.6em;
    }
  }

  li.toctree-l1.current > a {
    color: $red_orange;
    &:before {
      content: "\2022";
      display: inline-block;
      position: absolute;
      left: -15px;
      top: 1px;
      font-size: rem(22px);
      color: $red_orange;

      @include sphinx-medium-size {
        left: -20px;
      }
    }
  }

  // This is the on state for pages beyond second level
  li.toctree-l2 a, li.toctree-l3 a, li.toctree-l4 a {
  }

  li.toctree-l1.current li.toctree-l2, li.toctree-l2.current li.toctree-l3 {
    > ul {
      display: none;
    }

    &.current > ul {
      display: block;
    }
  }

  li.toctree-l2 {
    &.current {
      > a {
      }

      li.toctree-l3 > a {
        display: block;
      }
    }

    a:hover span.toctree-expand {
    }

    span.toctree-expand {
    }
  }

  li.toctree-l3 {
    font-size: 0.9em;

    &.current {
      > a {
      }

      li.toctree-l4 > a {
        display: block;
      }
    }

    a:hover span.toctree-expand {
    }

    span.toctree-expand {
    }
  }

  li.toctree-l4 {
    font-size: 0.9em;
  }

  li.current ul {
    display: block;
  }

  li ul {
    margin-bottom: 0;
    display: none;
  }

  li ul li a {
    margin-bottom: 0;
  }

  a {
    display: inline-block;
    position: relative;

    &:hover {
      cursor: pointer;

      span.toctree-expand {
      }
    }

    &:active {
      cursor: pointer;
      span.toctree-expand {}
    }
  }
}

.pytorch-left-menu ul {
  padding-left: 0;
}

.pytorch-right-menu {
  a:link,
  a:visited,
  a:hover {
    color: $quick_start_grey;

    span.pre {
      color: $quick_start_grey;
    }
  }

  a.reference.internal {
    &.expanded:before {
      content: "-";
      font-family: monospace;
      position: absolute;
      left: -12px;
    }

    &.not-expanded:before {
      content: "+";
      font-family: monospace;
      position: absolute;
      left: -12px;
    }
  }

  li.active > a {
    color: $red_orange;

    span.pre,
    &:before {
      color: $red_orange;
    }

    &:after {
      content: "\2022";
      color: $orange;
      display: inline-block;
      font-size: rem(22px);
      left: -17px;
      position: absolute;
      top: 1px;
    }
  }

  .pytorch-side-scroll > ul > li > ul > li {
    margin-bottom: 0;
  }

  ul ul {
    padding-left: 0;

    li {
      padding-left: 0px;

      a.reference.internal {
        padding-left: 0;
      }

      ul {
        display: none;
        padding-left: 10px;
      }

      li a.reference.internal {
        padding-left: 0;
      }
    }
  }

  li ul {
    display: block;
  }
}

.pytorch-right-menu .pytorch-side-scroll {
  @include sphinx-medium-size {
    width: $sphinx_right_menu_scroll_wrapper_width;
  }

  @include sphinx-full-size {
    width: 400px;
  }

  padding-top: 20px;

  > ul {
    padding-left: 10%;
    padding-right: 10%;
    margin-bottom: 0;

    @include sphinx-full-size {
      padding-left: 25px;
    }

    > li > a.reference.internal  {
      color: $slate;
      font-weight: 500;
    }
  }

  ul li {
    position: relative;
  }
}

.header-container {
  max-width: none;
  margin-top: 4px;
  @include sphinx-medium-size {
    margin-top: 0;
  }
  @include sphinx-full-size {
    margin-top: 0;
  }
}

.container-fluid.header-holder {
  padding-right: 0;
  padding-left: 0;
}

.header-holder .container {
  max-width: none;
  padding-right: rem(30px);
  padding-left: rem(30px);

  @include sphinx-medium-size {
    padding-right: rem(30px);
    padding-left: rem(30px);
  }
}

.header-holder .main-menu {
  justify-content: unset;
  position: relative;

  @include sphinx-medium-size {
    ul {
      padding-left: 0;
      margin-left: 26%;
    }
  }

  @include sphinx-full-size {
    ul {
      padding-left: 38px;
      margin-left: 310px;
    }
  }
}

.pytorch-page-level-bar {
  display: none;
  align-items: center;
  background-color: $white;
  border-bottom: 1px solid #e2e2e2;
  width: 100%;
  z-index: 201;

  @include sphinx-medium-size {
    left: 0;
    display: flex;
    height: $desktop_header_height / 2;
    padding-left: 0;
    width: 100%;
    position: absolute;
    z-index: 1;

    &.left-menu-is-fixed {
      position: fixed;
      top: 0;
      left: 25%;
      padding-left: 0;
      right: 0;
      width: 75%;
    }
  }

  @include sphinx-full-size {
    left: 0;
    right: 0;
    width: auto;
    z-index: 1;

    &.left-menu-is-fixed {
      left: $desktop_menu_width;
      right: 0;
      width: auto;
    }
  }

  ul, li {
    margin: 0;
  }
}

.pytorch-shortcuts-wrapper {
  display: none;

  @include sphinx-medium-size {
    font-size: rem(14px);
    float: left;
    margin-left: $sphinx_right_menu_wrap_left_margin;
  }

  @include sphinx-full-size {
    margin-left: rem(30px);
  }
}

.cookie-banner-wrapper {
  display: none;

  .container {
    padding-left: rem(30px);
    padding-right: rem(30px);
    max-width: 1240px;
  }

  &.is-visible {
    display: block;
    position: fixed;
    bottom: 0;
    background-color: $light_grey;
    min-height: 100px;
    width: 100%;
    z-index: 401;
    border-top: 3px solid #ededee;
  }

  .gdpr-notice {
    color: $dark_grey;
    margin-top: rem(25px);
    text-align: left;
    max-width: 1440px;
    @include desktop {
      width: 77%;
    }
    @include small-desktop {
      width: inherit;
    }

    .cookie-policy-link {
      color: #343434;
    }
  }

  .close-button {
    appearance: none;
    background: transparent;
    border: 1px solid $light_grey;
    height: rem(21px);
    position: absolute;
    bottom: 42px;
    right: 0;
    top: 0;
    cursor: pointer;
    outline: none;
    @include desktop {
      right: 20%;
      top: inherit;
    }

    @include small-desktop {
      right: 0;
      top: 0;
    }
  }
}

.main-menu ul li {
  .ecosystem-dropdown, .resources-dropdown a {
    cursor: pointer;
  }

  .dropdown-menu {
    border-radius: 0;
    padding: 0;

    .dropdown-item {
      color: $dark_grey;
      border-bottom: 1px solid #e2e2e2;
      &:last-of-type {
        border-bottom-color: transparent;
      }

      &:hover {
        background-color: $orange;
      }

      p {
        font-size: rem(16px);
        color: #979797;
      }
    }

    a.dropdown-item {
      &:hover {
        color: $white;
        p {
          color: $white;
        }
      }
    }
  }
}

.ecosystem-dropdown-menu, .resources-dropdown-menu {
  left: -75px;
  width: 226px;
  display: none;
  position: absolute;
  top: rem(50px);
  z-index: 1000;
  display: none;
  float: left;
  min-width: 10rem;
  padding: 0.5rem 0;
  margin: 0.125rem 0 0;
  font-size: 1rem;
  color: #212529;
  text-align: left;
  list-style: none;
  background-color: $white;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.25rem;
}

.ecosystem-dropdown-menu.show-menu, .resources-dropdown-menu.show-menu {
  display: block;
}

.main-menu ul li {
  .ecosystem-dropdown-menu, .resources-dropdown-menu {
    border-radius: 0;
    padding: 0;
  }
}

.main-menu ul li {
  .ecosystem-dropdown-menu, .resources-dropdown-menu {
    .dropdown-item {
      color: #6c6c6d;
      border-bottom: 1px solid #e2e2e2;
    }
  }
}

.header-holder .main-menu ul li a.nav-dropdown-item {
  display: block;
  font-size: rem(16px);
  line-height: rem(21px);
  width: 100%;
  padding: 0.25rem 1.5rem;
  clear: both;
  font-weight: 400;
  color: #979797;
  text-align: center;
  background-color: transparent;
  border-bottom: 1px solid #e2e2e2;
  &:last-of-type {
    border-bottom-color: transparent;
  }
  &:hover {
    background-color: $orange;
    color: white;
  }
  .dropdown-title {
    font-size: rem(18px);
    color: $dark_grey;
    letter-spacing: 0;
    line-height: 34px;
  }
}

.header-holder .main-menu ul li a.nav-dropdown-item:hover .dropdown-title {
  background-color: $orange;
  color: white;
}
