::selection {
  background: $selection-bg;
  color: $selection-color;
}

html, body {
  height: 100%;
}

body {
  background: $body-bg-color;
  color: $text-color;
  font-family: $font-family-base;
  font-size: $font-size-base;
  line-height: $line-height-base;

  +tablet-mobile() {
    // Remove the padding of body when the sidebar is open.
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

h1, h2, h3, h4, h5, h6 {
  font-family: $font-family-headings;
  font-weight: bold;
  line-height: 1.5;
  margin: 20px 0 15px;
  padding: 0;
}

for headline in (1 .. 6) {
  h{headline} {
    font-size: $font-size-headings-base - $font-size-headings-step * headline;
  }
}

p {
  margin: 0 0 20px 0;
}

a, span.exturl {
  word-wrap();
  border-bottom: 1px solid $link-decoration-color;
  color: $link-color;
  outline: none;
  text-decoration: none;

  &:hover {
    border-bottom-color: $link-decoration-hover-color;
    color: $link-hover-color;
  }

  // For spanned external links.
  cursor: pointer;
}

iframe, img, video {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
}

hr {
  background-color: $gray-lighter;
  background-image: repeating-linear-gradient(
    -45deg,
    white,
    white 4px,
    transparent 4px,
    transparent 8px
  );
  border: 0;
  height: 3px;
  margin: 40px 0;
}

blockquote {
  border-left: 4px solid $gray-lighter;
  color: $grey-dim;
  margin: 0;
  padding: 0 15px;

  cite::before {
    content: '-';
    padding: 0 5px;
  }
}

dt {
  font-weight: $font-weight-bolder;
}

dd {
  margin: 0;
  padding: 0;
}

kbd {
  background-color: #f9f9f9;
  background-image: linear-gradient(top, #eee, white, #eee);
  border: 1px solid $grey-light;
  border-radius: .2em;
  box-shadow: .1em .1em .2em rgba(0, 0, 0, .1);
  font-family: inherit;
  padding: .1em .3em;
  white-space: nowrap;
}
