@import '../../../scss/app';
@import url('https://use.typekit.net/qqm8vsn.css');

@mixin alert-color-stack {
  background-color: $alert;
  border-color: mix($alert, $white, 33%);
  color: mix($alert, $white, 33%);
}

// TYPOGRAPHY

// Proxima Nova Headers for docs only
h1,h2,h3,h4 {
  font-family: 'proxima-nova', $global-sans-serif-font;
  font-weight: 500;
}
h1 {
  font-weight: 900;
}

h1 h5,
h6 {
  font-weight: normal;
  letter-spacing: 1px;
  margin: $global-padding-large 0 0;
  text-transform: uppercase;
}
.CodeMirror.CodeMirror {
  height: auto;
}
.CodeMirror-line.CodeMirror-line {
  font-size: $global-font-size-small;
  line-height: $global-vertical-space;
  padding: 0;
}
.CodeMirror-lines.CodeMirror-lines {
  padding: $global-vertical-space / 4 0;
}
.CodeMirror-scroll {
  margin-left: $global-margin;
}
.playground {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: $global-margin-large;
}
.playgroundCode {
  margin-bottom: $global-vertical-space;
  order: 1;
  width: 100%;
}
.playgroundError {
  font-family: monospace;
  overflow-x: scroll;
  white-space: pre-wrap;
  @include panel($padded: true);
  @include alert-color-stack;
}
.playgroundPreview {
  order: 0;
  width: 100%;
}
.playgroundPreview--FakeViewportContainer {
  .playgroundPreview {
    background: url('https://3ulsmb4eg8vz37c0vz2si64j-wpengine.netdna-ssl.com/wp-content/uploads/2016/07/75ff3f3c-4aa5-11e6-9c23-4491699777fe.jpg');
    background-position: center;
    background-size: cover;
    min-height: 320px;
    min-width: 320px;
    transform: scale(1);
    width: 100%;
  }
}
// For grid example pages, colorize columns and mark the edges, and put spacing between rows
.ColumnExamples {
  &.rev-Row,
  .rev-Row {
    margin-bottom: $global-margin;
    .rev-Row {
      margin-bottom: 0;
    }
  }
  .rev-Col {
    // bottom and top padding for demo purposes only
    padding-bottom: $global-padding;
    padding-top: $global-padding;
    text-align: center;
    // All of this is a way to put an outline-esque border on the left and
    // right edge without taking up space (doing it this way, because outline
    // can't be applied to only left and right).
    // If we just put left and right borders, it can cause weird overflows
    // and wrapping with the grid, which is bad for a grid demo page
    &:before {
      // Mark left and right edges
      border-left: 2px dotted $gray;
      border-right: 2px dotted $gray;
      // Position to be the same size and location as the column
      bottom: 0;
      // Needs content to be placed in DOM
      content: ' ';
      left: -1px;
      position: absolute;
      right: -1px;
      top: 0;
    }
  }
  // Throw some grayscale colors on the grid columns to show what space they
  // occupy
  .rev-Col:nth-child(6n + 1) {
    @include color-stack($lightest-gray);
  }
  .rev-Col:nth-child(6n + 2) {
    @include color-stack($lighter-gray);
  }
  .rev-Col:nth-child(6n + 3) {
    @include color-stack($light-gray);
  }
  .rev-Col:nth-child(6n + 4) {
    @include color-stack($gray);
  }
  .rev-Col:nth-child(6n + 5) {
    @include color-stack($dark-gray);
  }
  .rev-Col:nth-child(6n + 6) {
    @include color-stack($darker-gray);
  }
  // For nesting example, show the extents of the nested row
  .rev-Col .rev-Row {
    outline: 1px solid $white;
  }
  // removing the bkgd on Block Grid so that kitty images look better
  &.ColumnExamples--blockGrid {
    .rev-Col {
      background: transparent;
      margin-bottom: $global-padding-small;
    }
  }
}
// Bkgd Colors
.ExampleBkgd--primary {
  background: $primary;
  display: block;
  margin-bottom: $global-padding;
  padding: $global-padding $global-padding 0;
}
// Color Swatches
.ExampleSwatches {
  @include aspect-ratio(1, 1);
  @include color-management;
}
// Buttons
.ExampleButtons {
  .rev-Button {
    margin-right: $global-margin;
  }
}
// Visibility
.ExampleVisibility {
  padding: $global-padding;
}

.ExamplePink {
  background: pink;
}

// Example TopBars
.playground .rev-TopBar {
  margin: 0 0 $global-vertical-space;
}
// Topbar Small Only
@include breakpoint(small-only) {
  .rev-TopBar.Show--smallOnly {
    background: $body-font-color;
    border: 0;
    .rev-Brand {
      @include flex(baseline, row, flex-start, nowrap);
      height: $topbar-height;
      padding: 0;
    }
    h1 {
      color: $white;
      font-size: $global-font-size-large;
      line-height: $topbar-height;
      margin: 0;
      padding: 0 $global-padding-tiny 0 0;
    }
    small {
      color: $white-60;
      font-size: $global-font-size-small;
      font-weight: normal;
    }
  }
}

// Sidebar Nav
.DocsSiteNav {
  &.rev-Drawer.rev-Drawer--open {
    .rev-Drawer-closer {
      color: $white-60;
      transform: rotate(0.125turn);
      &:hover,
      &:active,
      &:focus {
        color: $white;
      }
    }
  }
  @include breakpoint(small-only) {
    top: $topbar-height;
    &.rev-Drawer {
      .rev-Drawer-closer {
        top: $topbar-height;
      }
      .rev-Drawer-expander {
        background: $brand;
        border-radius: 0 $global-radius $global-radius 0;
        color: $white;
        font-size: 18px;
        top: $topbar-height + 10;
        width: $size-default;
      }
    }
  }
  .rev-Drawer-contents {
    background: $brand;
    background: linear-gradient(to bottom, $brand-purple 0%, $brand 100%);
    color: $white;
    padding-bottom: $global-padding-larger;
  }
  .rev-Brand {
    color: $white;
    padding: 0 $global-padding;
    h1 {
      margin-bottom: 0;
    }
    small {
      color: $white-60;
      font-size: $global-font-size;
      font-weight: normal;
    }
  }
  .rev-Menu-item--text {
    color: $white-60;
  }
  .rev-Menu-item a {
    color: $white-80;
    position: relative;
    &:hover,
    &:active,
    &:focus {
      background: $white-06;
      color: $white;
    }
    &:active,
    &:focus {
      background: $white-10;
    }
  }
  .rev-Menu-item--selected a {
    background: $white-10;
    color: $white;
    &:after {
      background: $white;
      border-radius: 0 $global-radius $global-radius 0;
      content: '';
      height: 100%;
      left: 0;
      position: absolute;
      top: 0;
      width: 5px;
    }
  }
}
.FixedDrawerLinks {
  @include flex(stretch, row, center, nowrap);
  @include global-transition;
  background: $primary;
  border-top: 1px solid $divider-color-dark;
  bottom: 0;
  left: -$drawer-width;
  position: fixed;
  width: $drawer-width;
  z-index: $above;
  .rev-Drawer--open & {
    left: 0;
  }
  @include breakpoint(medium) {
    left: 0;
  }
  .rev-Menu-item {
    flex: 1;
    text-align: center;
    &:first-child {
      border-right: 1px solid $divider-color-dark;
    }
  }
}

// DRAWER EXAMPLE STYLES
.ExampleDrawerContainer {
  min-height: 32rem;
  position: relative;
}
