@import "variables";
@import "mixins";
@import "hljs";

body {
  font-family: "Open Sans";
  font-style: normal;
  font-variant: normal;
  font-weight: 400;
  color: #333;
  line-height: 23px;

  @media (min-width: $breakpoint) {
    padding: 0 0 0 $sidebar_width;
  }
}

img {
  max-width: 800px;
}

#graphql-docs {
  & > div > div {
    max-width: 100%;
  }

  a {
    @extend .coral-link;
  }
}

.toc {
  a {
    border-bottom: none !important;
    @extend .coral-link;
  }
}

h1 {
  font-size: 2rem;
}

h2 {
  margin: 1.6em 0 0.8em;
  font-size: 1.75rem;
  font-weight: 600;
}

h3 {
  margin: 1.6em 0 0.8em;
  font-size: 1.5rem;
  font-weight: 500;
}

h4 {
  margin: 1.6em 0 0.8em;
  font-size: 1.2rem;
  font-weight: 500;
}

.param {
  font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
}

article.configuration {
  h2,
  .toc {
    @extend .param;
  }
}

.suggest-edits {
  padding: 0.2rem 0.5rem;
}

/**
 * Demo
 */

.demo {
  background: $coral_orange;
  overflow: hidden;
  margin: 0 auto;
  padding: 0;
  margin-bottom: 1rem;
  max-width: 650px;

  .btn,
  .alert {
    border: none;
    border-radius: 0;
    margin: 0;
  }

  .alert {
    display: none;
  }

  .mount {
    display: none;
    background: white;
    padding: 10px;
  }
}

.copy-to-clipboard {
  position: absolute;
  top: 0;
  right: 0;
  background: $copy_button_background;
  padding: 3px 10px;
  border: $code_border;
  color: $copy_button_color;

  &:hover {
    background: darken($copy_button_background, 10%);
    cursor: pointer;
  }
}

code {
  color: $hljs_string_color;
}

pre {
  display: block;
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 90%;
  color: #212529;
  position: relative;

  & > code {
    display: block;
    overflow-x: auto;
    padding: 0.5em;
    background: $code_background;
    border: $code_border;
    min-height: 31px;
  }
}

.code-aside {
  margin-top: -1rem;
  margin-bottom: 1rem;
  border-bottom: $code-border;
  border-left: $code-border;
  border-right: $code-border;
  padding: 10px;
  font-size: 80%;
}

#sidebar-toggle {
  display: none;
}

@media (max-width: $breakpoint) {
  .sidebar--toggled .sidebar__backdrop {
    cursor: pointer;
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 2;
  }

  #sidebar-toggle {
    display: inline-block;
  }
}

.header {
  margin-bottom: $header_padding_bottom;

  .search {
    align-items: center;
    display: flex;
  }

  .algolia-autocomplete {
    width: 100%;
    left: 0 !important;

    .algolia-docsearch-suggestion--highlight {
      color: $algolia_suggestion_highlight_color;
      background: $algolia_suggestion_highlight_background;
    }

    .ds-dropdown-menu {
      min-width: 500px;
      max-width: 700px;
      width: 100%;

      // Hide the carrot.
      &:before {
        display: none;
      }

      // Fix for smaller screens.
      @media (max-width: $breakpoint) {
        min-width: 200px;
      }
    }
  }

  &.header--toggled {
    .header__nav {
      display: none;
    }
  }

  .header__nav {
    margin: 0 0 0 10px;
    display: flex;

    & > a {
      display: inline-block;
      text-align: center;
      margin-left: 15px;
      color: $header_nav_link_color;
      white-space: nowrap;

      & > svg {
        height: 20px;
        width: 20px;

        rect {
          fill: $header_nav_icon_color;
        }
      }

      &:hover {
        color: darken($header_nav_icon_color, 10%);
      }
    }
  }
}

.footer {
  font-size: 90%;
  text-align: center;
  color: lighten(gray, 20%);

  a {
    @extend .coral-link;
  }
}

.coral-link {
  color: $coral_button_color;
  text-decoration: none;

  &:hover {
    color: $coral_button_hover_color;
    text-decoration: none;
  }
}

.coral-link-invert {
  @extend .coral-link;
  color: $coral_button_invert_color;

  &:hover {
    color: $coral_button_invert_hover_color;
  }
}

.toc {
  a {
    @extend .coral-link;
    border-bottom: none !important;
  }
}

.content {
  article {
    p a:not(.plain-link),
    ul:not(.toc__menu) li a,
    ol li a,
    td a,
    dd > a {
      @extend .coral-link;
    }
  }
}

.form-control:focus {
  border-color: $coral_orange;
}

a.brand {
  display: block;
  padding: $sidebar_gutter;
  color: #fff;
  text-decoration: none;
  min-height: 90px;

  h2 {
    margin: 0;
    line-height: 40px;
  }

  &:hover {
    text-decoration: none;
  }

  span {
    display: inline-block;
    margin-left: 10px;
    font-size: 30px;
    vertical-align: middle;
    font-weight: 500;
  }

  img {
    vertical-align: middle;
    width: 100%;
  }
}

.content {
  padding: $content_gutter $content_gutter 60px;
}

.voxmedia {
  // width: 50%;
  margin: 0 0 $sidebar_gutter;

  > img {
    width: 100%;
  }
}

.sidebar {
  background: $sidebar_background;
  color: $sidebar_color;
  height: 100%;
  position: fixed;
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  top: 0;
  left: 0;
  z-index: 2;
  overflow-y: auto;
  width: $sidebar_width;

  @include transition(all, 150ms);

  @media (max-width: $breakpoint) {
    &.sidebar--toggled {
      @include transform(translate3d(0, 0, 0));
      box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
      z-index: 3;
    }
  }

  @media (max-width: $breakpoint) {
    @include transform(translate3d((-$sidebar_width), 0, 0));
  }

  .sidebar__list {
    padding: 0px;
  }

  .sidebar__section {
    list-style: none;
    border-bottom: 1px solid lighten($sidebar_background, 3%);

    &.toggled {
      & > .sidebar__header {
        background: darken($sidebar_background, 10%);
        // color: white;
      }

      .sidebar__subsection {
        display: block;
      }

      .sidebar__links {
        display: block;
      }
    }

    &.active {
      & > .sidebar__header {
        background: darken($sidebar_background, 30%);
      }
    }
  }

  .sidebar__subsection {
    display: none;
  }

  .sidebar__subsection {
    list-style: none;

    &.active {
      & > .sidebar__header {
        color: fade-out($sidebar_color, 0.3);
        background-color: darken($sidebar_background, 2%);
      }
    }
  }

  .sidebar__headers {
    padding: 0;
  }

  a.sidebar__header {
    font-size: 0.9em;
    text-transform: uppercase;
    font-weight: 700;
    display: block;
    padding: 15px $sidebar_gutter;
    color: $sidebar_color;

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

  .sidebar__links {
    margin: 0 0 10px;
    list-style: none;
    padding: 0;
    display: none;
    overflow-y: hidden;

    & > li {
      & > a {
        display: block;
        padding: 6px $sidebar_gutter;
        color: fade-out($sidebar_color, 0.6);

        &:hover {
          color: fade-out($sidebar_color, 0.3);
          text-decoration: none;
        }
      }

      &.active > a {
        color: fade-out($sidebar_color, 0.2);
      }

      &.active {
        background: darken($sidebar_background, 1%);
      }
    }
  }
}

.plugin {
  display: none;
}

.badge-tag {
  font-family: monospace;
}

.badge-tag-default {
  background: #28a745;
  color: #fff;
}

.badge-tag-gdpr {
  background: rgb(0, 102, 176);
  color: #fff;
}

.callout {
  background-color: $callout_background;
  color: $callout_color;
  margin: 20px 0;
  padding: 20px;
  text-align: center;

  a {
    @extend .coral-link;
    color: $callout_link_color;

    &:hover {
      color: $callout_link_hover_color;
    }
  }
}
