@import '_variables';

// ------------------------------------ Navbar ------------------------------------

.navbar {
  position: sticky;
  top: 0;
  height: $navbarHeight;
  width: 100%;
  z-index: 30;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-color);

  .navbar-inner {
    margin: 0 auto;
    padding: 0 1.5rem;

    // less than 992px
    @media (max-width: ($tablet - 0.02px)) {
      & {
        padding: 0 1rem;
      }
    }
  }
}

// ------------------------------------ Sidebar ------------------------------------

.sidebar {
  position: fixed;
  left: 0;
  width: $sidebarWidth;
  max-width: $sidebarWidth;
  height: 100vh;
  z-index: 20;
  background-color: var(--bg-color);
  transform: translateX(0);
  transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  .sidebar-inner {
    padding: 1.5rem;
    padding-right: 0;
  }
}

.with-navbar .sidebar {
  height: calc(100vh - #{$navbarHeight});
}

// 992px and up
@media (min-width: $tablet) {
  .theme-mix.no-sidebar .sidebar {
    display: none;
  }
}

// less than 992px
@media (max-width: ($tablet - 0.02px)) {
  .sidebar {
    transform: translateX(-100%);

    .sidebar-inner {
      padding-left: 1rem;
      padding-top: 0;
    }
  }

  .theme-mix.sidebar-open .sidebar {
    transform: translateX(0);
  }
}

// ------------------------------------ Page ------------------------------------
// 992px and up
@media (min-width: $tablet) {
  .page {
    padding-left: $sidebarWidth;
  }
}

.page {
  width: 100%;
  height: 100%;
  min-width: 0;

  .theme-mix-content-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 2.5rem 0;

    .theme-mix-content {
      padding: 0 1.5rem;
      flex: 1 1 auto;
      max-width: $maxContentWidth;
      min-width: 0;

      // less than 992px
      @media (max-width: ($tablet - 0.02px)) {
        max-width: 100%;
        padding: 0 1rem;
      }
    }
  }

  .toc-wrap {
    color: var(--text-secondary-color);
    background-color: var(--bg-color);
    flex: none;

    // 1200px and up
    @media (min-width: $desktop) {
      & {
        max-width: 14rem;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
      }
    }
  }
}

.no-sidebar .page {
  max-width: $maxPageWidth;
  margin: 0 auto;
  padding-left: 0;
}

// page 404
.not-found {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
