html { box-sizing: border-box; }
*, *:after, *:before { box-sizing: inherit; }

html, body { height: 100%; }

body {
  font-family: $fontFamily-body;
  font-size: $fontSize-s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: $color-medium;
  margin: 0;
  background-color: $color-primary;

  @media #{$screen-medium} {
    font-size: $fontSize-body;
  }
}

a {
  text-decoration: none;
  color: $color-medium;
}

img, video {
  max-width: 100%;
  height: auto;
  border: 0;
}

h1, h2, h3, h4, strong {
  font-weight: 600;
  color: $color-dark;
}

code, pre {
  font-family: $fontFamily-code;
  font-size: $fontSize-code;
  background-color: $color-codebg;
  -webkit-font-smoothing: initial;
  -moz-osx-font-smoothing: initial;
}

code {
  // color: $color-orange;
  padding: 3px 5px;
  // margin: 0 2px;
  border-radius: $size-radius;
  // white-space: nowrap;
}

em { color: $color-light; }

hr {
  border: 0;
  background: none;
  border-top: 1px solid $color-gray;
  margin: 3em 0;
}

a.button {
  display: inline-block;
  font-family: $fontFamily-code;
  font-weight: 700;
  color: #fff;
  background-color: lighten($color-primary, 8%);
  border-bottom: 2px solid darken($color-primary, 12%);
  padding: 12px 14px;
  border-radius: 4px;
  transition: all .15s ease;

  &:hover {
    background-color: lighten($color-primary, 15%);
    transform: translate(0, -2px);
  }
}

.highlight {
  // overflow-x: auto;
  position: relative;
  padding: 0;
  background-color: $color-codebg;
  padding: .6em .6em;
  line-height: 1.1;
  border-radius: $size-radius;

  figcaption {
    display: none;
  }

  table, tr, td {
    width: 100%;
    border-collapse: collapse;
    padding: 0;
    margin: 0;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  .gutter { width: 1.5em; }

  .code {
    font-size: 0.85em;
  }

  .code pre {
    padding: 0.4em 0.2em;
    line-height: 1.5em;
    margin: 0;
  }

  &.html, &.js, &.bash, &.css {
    .code:after {
      position: absolute;
      top: 0;
      right: 0;
      color: $color-gray;
      text-align: right;
      font-size: .75em;
      padding: 5px 10px 0;
      line-height: 15px;
      height: 15px;
      font-weight: 600;
    }
  }

  &.html .code:after { content: 'HTML'; }
  &.js .code:after { content: 'JS'; }
  &.bash .code:after { content: 'Shell'; }
  &.css .code:after { content: 'CSS'; }
}

.page {
  background-color: $color-white;
  min-height: 100vh;
}

.page-inner .MainContent {
  position: relative;
  z-index: 1;
  overflow-x: hidden;
  padding: 2em 1.4em 0;

  @media #{$screen-medium} {
    padding: 0 60px 30px;
  }
}


.Social {
  text-align: center;
  list-style-type: none;
  padding: 0;
  margin: 0 auto;
  margin-top: 2em;
  margin-bottom: 2em;
}

.Social li {
  margin: 0.7em 0;

  @media #{$screen-medium} {
    display: inline-block;
    margin: 0 0.7em;
    vertical-align: middle;

    &.last { margin-left: -2px; }
  }
}

  .Sidebar .Social {
    text-align: left;
    padding-left: 0;
    margin-top: 50px;
  }

  .Sidebar .Social li {
    display: block;
    margin: 0.7em 0;
  }

/**
* MainLogo
*/
.MainLogo {
  display: inline-block;
  font-size: 1.5em;
  line-height: $size-headerHeight;
  color: $color-dark;
  font-family: $fontFamily-logo;
  font-weight: 500;

  img {
    vertical-align: middle;
    // margin-right: 6px;
    width: $size-headerHeight;
    height: $size-headerHeight;
  }
}

  .MainLogo-text {
    display: none;
    @media #{$screen-medium} {
      display: inline-block;
      vertical-align: middle;
    }
  }

/**
* MainHeader
*/

.MainHeader {
  position: relative;
}

.page-index .MainHeader {
  padding: 1em 0;
  border-top: 3px solid $color-primary;
}

.page-inner .MainHeader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 40px;
  z-index: 9;
  box-shadow: 0 0 4px rgba(0,0,0,.25);
  background-color: $color-white;
  text-align: center;

  @media #{$screen-medium} {
    position: static;
    height: auto;
    padding: 10px 60px;
    box-shadow: none;
    position: relative;
    z-index: 2;
    border-top: 3px solid $color-primary;
    text-align: left;
  }
}

.MainHeader-menuBtn {
  display: block;

  @media #{$screen-medium} {
    display: none;
  }
}

  .page-index .MainHeader-menuBtn {
    display: none;
  }

  .page-inner .MainHeader-menuBtn {
    background: none;
    border: 0;
    position: absolute;
    width: 24px;
    height: 24px;
    top: 8px;
    left: 12px;
    background: svg-load('burger.svg', fill=#{$color-gray}) center center no-repeat;
    background-size: 22px;
  }

/**
* MainMenu
*/

.MainMenu {
  text-transform: uppercase;
  letter-spacing: 2px;
  list-style-type: none;
  padding: 0;
  font-size: $fontSize-s;

  @media #{$screen-medium} {
    margin: 0;
  }
}

  .MainMenu-searchQuery {
    height: 30px;
    line-height: 30px;
    padding: 0 15px 0 30px;
    border: 1px solid #e3e3e3;
    outline: none;
    border-radius: 15px;
    margin-right: 10px;
    transition: border-color .2s ease;
    background: svg-load('search.svg', fill=#{$color-gray}) 8px 5px no-repeat;
    background-size: 18px;
    margin-bottom: 10px;

    &:focus { border-color: $color-primary; }

    @media #{$screen-medium} {
      width: auto;
      width: 200px;
      margin-bottom: 0;
    }
  }

  .page-inner .MainMenu {
    display: none;
    position: absolute;
    right: 60px;
    top: 15px;
    height: $size-headerHeight;
    line-height: $size-headerHeight;

    li {
      display: inline-block;
      position: relative;
      margin: 0 0.6em;
    }

    @media #{$screen-medium} {
      display: block;
    }
  }

.nav-link {
  color: $color-light;
  padding-bottom: 3px;
  font-size: .85em;
  margin: 0 .5em;
  cursor: pointer;

  &:first-child { margin-left: 0; }
  &:hover, &.current { border-bottom: 3px solid $color-primary; }

  @media #{$screen-medium} {
    margin: 0 1.5em;
    font-size: 1em;
  }
}

/**
* GitHub corner
*/

.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}

/**
* BuildBadge
*/
.page-index .BuildBadge { margin-left: -2px !important; }
.Sidebar .BuildBadge { margin-top: 15px; }
