@import "variables";
@import "markdown";
@import "admonition";
@import "utils";

html {
  font-size: $font-size-base;
  letter-spacing: 0.33px;
  scroll-behavior: smooth;
}

html,
body {
  min-width: $body-min-width;
  overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
    margin: auto;
  color: $body-font-color;
  background: $body-background;

  font-family: "Oxygen", sans-serif;
  font-weight: $body-font-weight;

  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  box-sizing: border-box;
  * {
    box-sizing: inherit;
  }
}

main {
    display: flex;
    flex-wrap: wrap;
    box-sizing: border-box;
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5 {
  font-weight: 400;
}

a {
  text-decoration: none;
  color: $color-link;

  &:visited {
    color: $color-visited-link;
  }
}

img {
  vertical-align: middle;
}

aside nav ul {
  padding: 0;
  margin: 0;
  list-style: none;

  li {
    margin: 1em 0;
  }

  a {
    display: block;
  }

  a:hover {
    opacity: .5;
  }

  ul {
    padding-left: $padding-16;
  }
}

ul.pagination {
  display: flex;
  justify-content: center;

  .page-item a {
    padding: $padding-16;
  }
}

.container {
  min-width: $container-min-width;
  justify-content: space-between;
}

.book-brand {
  // margin-top: 0;
}

.book-menu {
    flex: 0 0 $menu-width;
    font-size: $font-size-14;
    width: $menu-width;
    min-height: 100vh;
    nav {
        max-height: 100vh;
        @include fixed;
        overflow-y: auto;
    }

    @include dark-links;
}

.book-page {
  min-width: $body-min-width;
  max-width: $body-max-width;
  padding: $padding-16;
}

.book-header {
  margin-bottom: $padding-16;
  display: none;
}

.header-container {
    box-sizing: border-box;
    border-bottom: 1px solid #F2F2F2;
}

header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.header-title {
    text-align: center;
    font-size: larger;
    font-weight: bolder;
}

.pagination {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}


li a:hover {
    color: #B6B6B6;
}

.active {
    text-decoration: underline;
    font-weight: bold;
}

.book-toc {
  flex: 0 0 $toc-width;
  font-size: $font-size-12;
  max-height: 100vh;
  top: 0;
  bottom: 0;
  nav {
    width: $toc-width;
    padding: $padding-16 $padding-16;

    @include fixed;
  }

  nav > ul > li {
    margin: 0;
  }
}

.book-git-footer {
  display: flex;
  margin-top: $padding-16;
  font-size: $font-size-14;
  align-items: baseline;

  img {
    width: $font-size-14;
    vertical-align: bottom;
  }
}

.book-posts {
  min-width: $body-min-width;
  max-width: $sm-breakpoint;
  padding: $padding-16;

  article {
    padding-bottom: $padding-16;
  }
}

.title {
    font-size: larger;
    font-weight: bolder;
}

// Responsive styles
aside nav,
.book-page,
.markdown {
  transition: 0.2s ease-in-out;
  transition-property: transform, margin-left, opacity;
  will-change: transform, margin-left;
}

@media screen and (max-width: $md-breakpoint) {
  .book-toc {
    display: none;
  }
  .container {
      justify-content: left;
  }
}

@media screen and (max-width: $sm-breakpoint) {
    .container {
    }
    .book-toc {
        display: none;
    }
    .book-menu {
        min-height: 0px;
        margin-left: -$menu-width;
    }

    .book-header {
        display: flex;
    }

    #menu-control:checked ~ main {
        .book-menu {
            display: flex;
            transform: translateX($menu-width);
        }
        .book-header label {
            transform: rotate(90deg);
        }

        .markdown {
            opacity: 0.25;
        }

        .book-page {
            transform: translateX($menu-width);
            opacity: 0.25;
        }

    }
}

// Extra space for big screens
@media screen and (min-width: $container-max-width) {
  .book-page,
  .book-toc nav {
      // padding: $padding-16 * 2 $padding-16 * 3;
  }
}
