/*
 * Sections
 *
 *     .styleguide-section
 *       .styleguide-text
 *       .styleguide-example
 *         .figure
 *         .source
 */

.styleguide-section:after {
  content: '';
  display: table;
  clear: both;
  zoom: 1;
}

.styleguide-section > h3 {
  border-bottom: solid 2px rgba(128, 128, 128, 0.2);
  margin-bottom: 16px;
  padding-bottom: 16px;
}

.styleguide-text {
  box-sizing: border-box;
  margin-bottom: 16px;
}

.styleguide-example {
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .styleguide-text {
    clear: both;
    float: right;
    width: 30%;
    padding-left: 16px;
  }

  .styleguide-example {
    float: left;
    width: 70%;
  }
}

/*
 * Text
 */

.styleguide-text > :first-child {
  margin-top: 0;
}

/*
 * Example
 */

.styleguide-example {
  border-radius: 2px;
  border: solid 2px transparent;
  overflow: hidden;
}

/*
 * Figures
 */

.styleguide-example > .figure {
  overflow: hidden;
  padding: 8px;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.2)),
    url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAAAAACoWZBhAAAAF0lEQVQI12P4BAI/QICBFCaYBPNJYQIAkUZftTbC4sIAAAAASUVORK5CYII=");
  position: relative;
}

/*
 * Guides
 */

.styleguide-example.-expand > .figure:before,
.styleguide-example.-expand > .figure:after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 16px;
  opacity: 0;
  background: rgba(0, 0, 0, 0.1);
  transition: opacity 100ms linear;
}

.styleguide-example.-expand > .figure:hover:before,
.styleguide-example.-expand > .figure:hover:after {
  opacity: .3;
}

.styleguide-example.-expand > .figure:before {
  top: 0;
  border-bottom: dashed 1px red;
}

.styleguide-example.-expand > .figure:after {
  bottom: 0;
  border-top: dashed 1px red;
}

@media (min-width: 768px) {
  .styleguide-example > .figure {
    padding: 16px;
  }
}

.styleguide-example.-clear {
  border: 0;
}

.styleguide-example.-clear > .figure {
  background: transparent;
  padding: 0;
}

.styleguide-example.-dark > .figure {
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAAAAACoWZBhAAAAFklEQVQI12NQBQF2EGAghQkmwXxSmADZJQiZ2ZZ46gAAAABJRU5ErkJggg==");
}

/*
 * Sources
 */

.styleguide-example > .source {
  border-top: solid 1px rgba(128, 128, 128, .2);
}

.styleguide-example > .source > pre,
.styleguide-example > .source > pre > code {
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.styleguide-example > .source > pre {
  background: white;
  padding: 16px;
}

/*
 * Collapse/expand
 */

.styleguide-example.-collapse > .source {
  display: none;
}

.styleguide-example.-expand {
  border: solid 2px rgba(128, 128, 128, .2);
}

.styleguide-example.-expand.-clear > .figure {
  padding: 16px;
}

/*
 * Styleguide menus
 *
 *     ul.styleguide-menu
 *       li.styleguide-menu-item.-level-1.-parent
 *         span.title Basics
 *         ul.submenu
 *
 * Links have `> .link`:
 *
 *     li.styleguide-menu-item.-level-1
 *       a.link.title(href='...') Basics
 *
 * Parent menu items have `.-parent` and `> .submenu`:
 *
 *     li.styleguide-menu-item.-level-1.-parent
 *       span.title Basics
 *       ul.submenu
 */

.styleguide-menu,
.styleguide-menu-item,
.styleguide-menu-item > .submenu {
  display: block;
  margin: 0;
  padding: 0;
  list-style-type: none;
}

/* Parents */
.styleguide-menu-item.-parent.-level-1 {
  margin-top: 1em;
  margin-bottom: 1em;
  font-weight: bold;
}

.styleguide-menu-item.-parent.-level-1 > .title {
  font-weight: bold;
}

/* Links */
.styleguide-menu-item > .link {
  display: block;
  font-weight: normal;
}

/* Active links */
.styleguide-menu-item > .link.-active,
.styleguide-menu-item > .link.-active:visited {
  color: inherit;
}

.styleguide-menu-item > .link.-active:hover,
.styleguide-menu-item > .link.-active:focus {
  text-decoration: inherit;
  font-weight: normal;
  cursor: default;
}

/* Third-level links */
.styleguide-menu-item.-level-3 > .title:before {
  content: '-';
  display: inline-block;
  width: .7em;
  margin-right: .2em;
}
