@require './font.styl';
@require './config.styl';
@require './code.styl';
@require './custom-blocks.styl';
@require './arrow.styl';
@require './wrapper.styl';
@require './toc.styl';
@require './sw-popup.styl';

html, body {
  padding: 0;
  margin: 0;
  overflow-x: hidden;
  font-size: 16px;
  min-height 100vh;
}

body {
  font-family: 'Open Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: $textColor;
  background-color: #fdfdfe;
}

.global-layout {
  min-height 100vh;
}
.el-card {
  border-radius: 20px;
}

.el-card.is-always-shadow, .el-card.is-hover-shadow:focus, .el-card.is-hover-shadow:hover {
  box-shadow: 0 0px 20px 0 rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.05);
}

.sidebar-mask {
  position: fixed;
  z-index: 9;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
}

.sidebar {
  font-size: 16px;
  background-color: #fff;
  width: $sidebarWidth;
  position: fixed;
  z-index: 10;
  margin: 0;
  top: $navbarHeight;
  left: 0;
  bottom: 0;
  box-sizing: border-box;
  border-right: 1px solid $borderColor;
  overflow-y: auto;
}

{$contentClass}:not(.custom) {
  @extend $wrapper;

  a:hover {
    text-decoration: underline;
  }

  p.demo {
    padding: 1rem 1.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
  }

  img {
    max-width: 100%;
  }
}

{$contentClass}.custom {
  padding: 0;
  margin: 0;

  img {
    max-width: 100%;
  }
}

a {
  font-weight: 500;
  color: $accentColor;
  text-decoration: none;

  &:hover {
    color: darken($accentColor, 20%);
  }
}

p a code {
  font-weight: 400;
  color: $accentColor;
}

h1 {
  font-size: 1.8rem;
}

h2 {
  font-size: 1.6rem;
}

h3 {
  font-size: 1.4rem;
}

h4 {
  font-size: 1.2rem;
}

h5 {
  font-size: 1rem;
}

h6 {
  font-size: 0.8rem;
}

kbd {
  background: #eee;
  border: solid 0.15rem #ddd;
  border-bottom: solid 0.25rem #ddd;
  border-radius: 0.15rem;
  padding: 0 0.15em;
}

blockquote {
  font-size: 0.9rem;
  color: darken($accentColor, 50%);
  border-left: 3px solid $accentColor;
  margin: 0.5rem 0;
  padding: 0.25rem 0 0.25rem 1rem;

  & > p {
    margin: 0;
  }
}

ul, ol {
  padding-left: 1.2em;
}

strong {
  font-weight: 600;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;

  {$contentClass}:not(.custom) > & {
    margin-top: 0.5rem - $navbarHeight;
    padding-top: ($navbarHeight + 1rem);
    margin-bottom: 0;

    &:first-child {
      margin-bottom: 1rem;

      + p, + pre, + .custom-block {
        margin-top: 2rem;
      }
    }
  }

  &:hover .header-anchor {
    opacity: 1;
  }
}

a.header-anchor {
  font-size: 0.85em;
  float: left;
  margin-left: -0.87em;
  padding-right: 0.23em;
  margin-top: 0.125em;
  opacity: 0;

  &:hover {
    text-decoration: none;
  }
}

code, kbd, .line-number {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
}

p, ul, ol {
  line-height: 1.7;
}

hr {
  border: 0;
  border-top: 1px solid $borderColor;
}

table {
  border-collapse: collapse;
  margin: 1rem 0;
  display: block;
  overflow-x: auto;
}

tr {
  border-top: 1px solid #dfe2e5;

  &:nth-child(2n) {
    background-color: #f6f8fa;
  }
}

th, td {
  border: 1px solid #dfe2e5;
  padding: 0.6em 1em;
}

.theme-container {
  &.sidebar-open {
    .sidebar-mask {
      display: block;
    }
  }

  &.no-navbar {
    {$contentClass}:not(.custom) > h1, h2, h3, h4, h5, h6 {
      margin-top: 1.5rem;
      padding-top: 0;
    }

    .sidebar {
      top: 0;
    }
  }
}

@media (min-width: ($MQMobile + 1px)) {
  .theme-container.no-sidebar {
    .sidebar {
      display: none;
    }

    .page {
      padding-left: 0;
    }
  }
}

@require 'mobile.styl';

.font-dancing {
  font-family: 'Great Vibes', cursive;
  letter-spacing: 0.1em;
}

.el-button--primary {
  background-color: $accentColor;
  border-color: $accentColor;

  &:hover {
    background-color: lighten($accentColor, 10%);
    border-color: $accentColor;
  }
}

.rounded {
  border-radius: 1rem !important;
}

.text-primary {
  color: $accentColor !important;
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }

  30% {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.zoomIn {
  animation-name: zoomIn;
  animation-duration: 0.5s;
}

.shadow {
  box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.08) !important;
}

.text--primary {
  color: $accentColor;
}

.vuepress-blog-theme-content {
  min-height: 80vh;
}