/*
 *= require styleguide/prism
 */

@import 'marketing_assets';

/*================ Module Imports ================*/
// needed since modules likely depend on vars
@import 'marketing_assets/modules/tabbed-carousel-nav';
@import 'marketing_assets/modules/tabbed-carousel';
@import 'marketing_assets/modules/breadcrumbs';
@import 'marketing_assets/modules/content/truncated-text';

/*============================================================================
  Styleguide Nav
==============================================================================*/

.page--has-styleguide-nav {
  .marketing-nav__hamburger {
    display: block;
    position: absolute;
    top: 0;
    left: $gutter;
  }

  .marketing-nav__logo {
    margin-left: 50px;
  }
}

/*============================================================================
  Autocomplete search
==============================================================================*/

.autocomplete-suggestions {
  border: $border-grey;
  border-radius: $border-radius;
  overflow-y: scroll;
  background: $color-white;
}

.styleguide-search {
  padding-top: $gutter;
  margin-bottom: -$gutter * 1.5;
}

.autocomplete-suggestion {
  padding: $input-padding;

  &.autocomplete-selected {
    background: $color-sky--light;
  }
}

/*============================================================================
  Styleguide Content
==============================================================================*/
.styleguide-content {
  > p {
    color: $color-grey-body;
    max-width: 730px;
  }

  .styleguide-link {
    color: darken($color-green, 10%);
    border: 0;

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

  > h1,
  > h2,
  > h3,
  > ul {
    a {
      border: 0;
      color: darken($color-green, 10%);

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

  h2,
  h3,
  h4,
  p,
  li {
    >  code {
      font-size: 1.3em;
      background: $color-grey-border-on--white;
    }
  }

  hr {
    margin: $gutter * 1.5 0;
    background: $color-grey-border-on--white;
    border: 0;
    height: 1px;
  }

  ul {
    list-style: disc;
    list-style-position: inside;
    padding-left: 1em;
  }

  > ol {
    list-style-type: decimal;
    list-style-position: inside;
  }

  .styleguide-table {
    border-collapse: collapse;
    margin-bottom: $gutter;

    th,
    td {
      text-align: left;
      background: $color-grey-border-on--white;
      padding: 10px;
    }
  }

  // Page-specific overrides
  .marketing-nav__items {
    margin-bottom: 0;
    padding-left: 0;
  }

  .page--has-transparent-nav--primary .marketing-nav__secondary {
    display: none;
  }

  .in-page-menu {
    list-style: none;
    padding-left: 0;
  }
}

.styleguide__link-list {
  column-count: 4;
  column-width: em(180);

  p {
    // Prevent link borders from wrapping up the top of the next column
    display: inline-block;
    width: 100%;
  }
}

/*============================================================================
  Code Styles
==============================================================================*/
// scss-lint:disable QualifyingElement
pre[class*='language-'] {
  margin-top: $gutter;
  margin-bottom: $gutter * 2;
  clear: both; // accounts for the fact some modules are floated by default
  font-size: 14px;
  border: solid 1px $color-grey-heading;
}

.token.comment {
  color: $color-red;
}

/*================ KSS Blocks ================*/
.styleguide-kss {
  border-bottom: 1px solid $color-grey-border-on--white;
  padding-bottom: $gutter;
  margin-bottom: $gutter;

  pre.language-css {
    display: inline-block;
    font-size: em(14);
    padding: 0 0.5em;
    margin: 0 0 5px;
  }
}

.styleguide-kss__modifier {
  ul,
  li {
    list-style: none;
  }
}

.styleguide-kss__modifier-description {
  font-size: em(14);
  padding: 0.5em;
  vertical-align: top;
  font-style: italic;
}

/*================ Styleguide Demo Modules ================*/
.styleguide-links {
  @include font-brandon-regular;
  text-align: center;
  margin: $gutter 0;
  padding-bottom: $gutter / 2;
  border-bottom: 1px solid $color-grey-border-on--white;

  a {
    display: inline-block;
    margin-bottom: 10px;
    color: $color-red;
    margin-left: $gutter / 2;
    margin-right: $gutter / 2;
  }
}

.styleguide-demo {
  margin-bottom: $gutter;
}

/*============================================================================
  Modules - overrrides to better showcase styles
==============================================================================*/

/*================ Grid ================*/
.styleguide-page-grid {
  .styleguide-grid-item {
    @include font-brandon-regular;
    height: 100px;
    padding-top: 10px;
    margin-bottom: 30px;
    background: $color-grey-body;
    font-size: 14px;
    text-align: center;
    color: $color-white;

    > .styleguide-grid-item {
      margin-top: -10px;
    }
  }

  .styleguide-padded-grid-box .styleguide-grid-item {
    background: none;
  }
}

/*================ Picture ================*/
.styleguide-page-picture {
  picture {
    > img {
      width: 500px;
    }
  }
}

/*================ Carousel ================*/
.styleguide-carousel {
  .carousel-item {
    display: none;

    &.js-is-active {
      display: block;
    }
  }

  .carousel-nav-item.js-is-active {
    color: $color-green;
  }
}

/*================ Color Page ================*/
.styleguide-color {
  margin-bottom: $gutter;
  text-align: left;
}

.styleguide-color__block {
  border: solid 1px $color-sky;
  width: 90px;
  height: 90px;
  display: inline-block;
  margin: 0;
}

.styleguide-color__text {
  font-size: 80px;
  display: inline-block;
  font-weight: bold;
}

.styleguide-color__label {
  @include font-brandon-regular;
  color: $color-black;

  .language-css {
    font-size: 11.5px;
    padding: 5px 2px;
    margin: 0 0 10px;
  }
}

.styleguide-color__color {
  font-size: 12px;
  font-style: italic;
}

.styleguide-color__usage {
  margin-bottom: 5px;
}

/*================ Segment Page ================*/
// overrides to add spacing between demos
.styleguide-page-segments {
  .styleguide-segment-example {
    margin-bottom: 10px;
  }

  .segment-block {
    padding: 0 8px;

    > h2 {
      color: $color-white;
      margin-bottom: 0;
      line-height: 100px;
    }
  }
}

/*================ Icons ================*/
.styleguide-icon {
  float: left;
  text-align: center;
  width: 150px;
  height: 240px;
  margin: 10px;
  padding: $gutter 10px 0;
  background-color: $color-grey-border-on--white;

  > .icon {
    margin-bottom: 14px;
  }

  .styleguide-icon__heading {
    font-weight: 700;
  }

  > p {
    display: block;
    font-size: em(12);
    margin: 3px 0 0;
  }

  > .styleguide-icon__info {
    margin: 0;
  }

  &.js-hidden {
    display: none;
  }
}

.icon-styleguide-placholder {
  background-image: asset-svg-url(shopify, $color-black);
}

/*================ Typography ================*/
.styleguide-typography__block {
  background: $color-sky;
  padding: 15px;
  margin-bottom: 30px;
}

/*================ Page Header ===============*/
.page-header--some-custom-class {
  @include retina-image('styleguide/about-video-placeholder', cover, 'jpg', $retina-suffix: '-@2x');
}

/*============================================================================
YUI Docs output
==============================================================================*/

// scss-lint:disable MergeableSelector
.styleguide-content .yuidocs__params {
  list-style-position: outside;
}
// scss-lint:enable MergeableSelector

.yuidocs__code-heading {
  font-family: monospace;
}

h5.yuidocs__code-heading {
  text-transform: none;
  letter-spacing: normal;
  margin-bottom: 0;
}

h3.yuidocs__code-heading {
  font-size: em(28);
}

h4.yuidocs__code-heading {
  font-size: em(24);
  background: $color-sky--light;
}

.yuidocs__heading {
  color: $color-green;
}

.yuidocs__args {
  color: $color-grey-heading;
}

.yuidocs__type {
  color: $color-grey-heading;
  font-style: italic;
}

.yuidocs__label,
.yuidocs__type {
  font-size: em(12);
  font-family: $font-body-family;
}

.yuidocs__label {
  padding: em(2) em(6);
  color: $color-white;
  background: $color-grey-text--light;
  border-radius: $border-radius;
}
// scss-lint:enable QualifyingElement

.styleguide-examples {
  max-width: 930px;
  position: relative;
  margin: ($gutter * 1.5) auto 0;
}

.styleguide-examples__tab {
  display: none;

  &.js-is-active {
    display: block;
  }
}

.styleguide-examples__toggle {
  @include font-brandon-medium;
  position: absolute;
  top: 1px;
  right: 1px;
  padding: 8px 10px;
  background: $color-grey-body;
  color: $color-white;
  border-bottom-left-radius: $border-radius;

  &:hover,
  &:focus {
    background: darken($color-grey-body, 10%);
  }
}
