//
// Typography
// --------------------------------------------------

// Body text
// -------------------------

p {
  margin: 0 0 $line-height-base / 2;
}
.lead {
  margin-bottom: $line-height-base;
  font-size: $font-size-base * 1.5;
  font-weight: 200;
  line-height: $line-height-base * 1.5;
}

// Emphasis & misc

// -------------------------

// Ex: 14px base font * 85% = about 12px
small {
  font-size: $font-size-sm;
}

strong {
  font-weight: $font-weight-semi-bold;
}

em {
  font-style: italic;
  color: $headings-color;
}

cite {
  font-style: normal;
}

// Utility classes
.muted {
  color: $text-muted;
}
a.muted:hover,
a.muted:focus {
  color: darken($text-muted, 10%);
}

.text-warning {
  color: $warning-text-color;
}
a.text-warning:hover,
a.text-warning:focus {
  color: darken($warning-text-color, 10%);
}

.text-error {
  color: $error-text-color;
}
a.text-error:hover,
a.text-error:focus {
  color: darken($error-text-color, 10%);
}

.text-success {
  color: $success-text-color;
}
a.text-success:hover,
a.text-success:focus {
  color: darken($success-text-color, 10%);
}
a {
  cursor: pointer;
}

.text-link {
  text-decoration: underline;
}

a:focus {
  outline: 0 none !important;
}

a[disabled] {
  cursor: default;
  pointer-events: none !important;
}

.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}
.text-center {
  text-align: center;
}

//
// Headings
//

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  margin-bottom: $space-sm;
  font-weight: $font-weight-regular;
  line-height: $headings-line-height;
  color: $headings-color;
}

h1,
.h1 {
  font-size: $font-size-h1;
}
h2,
.h2 {
  font-size: $font-size-h2;
}
h3,
.h3 {
  font-size: $font-size-h3;
}
h4,
.h4 {
  font-size: $font-size-h4;
}
h5,
.h5 {
  font-size: $font-size-h5;
}
h6,
.h6 {
  font-size: $font-size-h6;
}

//
// Horizontal rules
//

hr {
  margin-top: $spacer-y;
  margin-bottom: $spacer-y;
  border: 0;
  border-top: $border-width solid $hr-border-color;
}

//
// Emphasis
//

small,
.small {
  font-size: $font-size-sm;
  font-weight: normal;
}

.small-xs {
  font-size: $font-size-xs;
}

mark,
.mark {
  background: $alert-warning-bg;
}

// Lists
// --------------------------------------------------

// Unordered and Ordered lists
ul,
ol {
  padding: 0;
}
ul ul,
ul ol,
ol ol,
ol ul {
  margin-bottom: 0;
}
li {
  line-height: $line-height-base;
}

// Remove default list styles
ul.unstyled,
ol.unstyled {
  margin-left: 0;
  list-style: none;
}

// Single-line list items
ul.inline,
ol.inline {
  margin-left: 0;
  list-style: none;
  > li {
    display: inline-block;
    padding-left: 5px;
    padding-right: 5px;
  }
}

// Description Lists
dl {
  margin-bottom: $line-height-base;
}
dt,
dd {
  line-height: $line-height-base;
}
dt {
  font-weight: $font-weight-semi-bold;
}
dd {
  margin-left: $line-height-base / 2;
}
// Horizontal layout (like forms)
.dl-horizontal {
  @include clearfix();
  dt {
    float: left;
    width: $horizontalComponentOffset - 20;
    clear: left;
    text-align: right;
    @include text-overflow();
  }
  dd {
    margin-left: $horizontalComponentOffset;
  }
}

// MISC
// ----

// Abbreviations and acronyms
abbr[title] {
  cursor: help;
  border-bottom: 1px dotted $abbr-border-color;
}

abbr.initialism {
  font-size: 90%;
  text-transform: uppercase;
}

// Blockquotes
blockquote {
  padding: 0 0 0 15px;
  margin: 0 0 $line-height-base;
  border-left: 5px solid $gray-3;
  p {
    margin-bottom: 0;
    font-size: $font-size-base * 1.25;
    font-weight: 300;
    line-height: 1.25;
  }
  small {
    display: block;
    line-height: $line-height-base;
    color: $gray-2;
    &:before {
      content: '\2014 \00A0';
    }
  }

  // Float right with text-align: right
  &.pull-right {
    float: right;
    padding-right: 15px;
    padding-left: 0;
    border-right: 5px solid $gray-3;
    border-left: 0;
    p,
    small {
      text-align: right;
    }
    small {
      &:before {
        content: '';
      }
      &:after {
        content: '\00A0 \2014';
      }
    }
  }
}

// Quotes
q:before,
q:after,
blockquote:before,
blockquote:after {
  content: '';
}

// Addresses
address {
  display: block;
  margin-bottom: $line-height-base;
  font-style: normal;
  line-height: $line-height-base;
}

a.external-link {
  color: $external-link-color;
  text-decoration: normal;

  &:hover {
    color: $external-link-color;
    text-decoration: underline;
  }
}

.link {
  color: $link-color;
  cursor: pointer;
}

.link:hover {
  color: $link-hover-color;
}

.pointer {
  cursor: pointer;
}

.markdown-html {
  img {
    max-width: 100%;
  }

  ul,
  ol {
    padding-left: $spacer * 1.5;
    margin-bottom: $spacer;
  }

  table {
    td,
    th {
      padding: $spacer * 0.5 $spacer;
    }
    th {
      font-weight: $font-weight-semi-bold;
      background: $table-bg-accent;
    }
  }

  table,
  th,
  td {
    border: 1px solid $table-border;
    border-collapse: collapse;
  }

  a {
    color: $external-link-color;
    text-decoration: none;

    &:hover {
      color: $external-link-color;
      text-decoration: underline;
    }
  }

  p:last-child {
    margin-bottom: 0;
  }

  ul:last-child,
  ol:last-child {
    margin-bottom: 0;
  }
}

.no-wrap {
  white-space: nowrap;
}

.highlight-search-match {
  background: transparent;
  color: $yellow;
  padding: 0;
}

th {
  font-weight: $font-weight-semi-bold;
}

canvas {
  display: block;
}
