html {
  font-family: $font-family-sans-serif;
  font-size: 16px;
}

.font-family-body,
.font-family-body .badge {
  text-transform: unset;
  font-family: $font-family-sans-serif !important;
}


// Headings
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1rem;

  *:not(markdown) > &:first-child,
  .card-body markdown:first-of-type > &:first-child {
    margin-top: 0 !important;
  }

  // icon in header
  .ico {
    font-size: 1.3em;
    position: relative;
    line-height: inherit;
    top: .175em;
    margin-right: .2rem;
  }
}

[role="main"] {
  h1, h2, h3, h4, h5, h6 {
    margin-top: 3em;
  }
}


h1 {
  @include brand-font-h1();

  + h2, + h3, + h4, + h5, + h6 {
    margin-top: 0 !important;
  }
}

h2 {
  @include brand-font-h2();

  + h3, + h4, + h5, + h6 {
    margin-top: 0 !important;
  }
}

h3 {
  @include brand-font-h3();

  + h4, + h5, + h6 {
    margin-top: 0 !important;
  }

  small {
    font-size: 70%;
  }

  .subtitle {
    @extend .pt-1;
    @include brand-font-h3();

    font-size: .9em;
    color: $gray-600;
  }
}

h4 {
  @include brand-font-h4();

  + h5, + h6 {
    margin-top: 0 !important;
  }
}

* + h4, markdown > h4 {
  margin-top: 2rem;
}

.form-summary h4 {
  padding-top: 1.25rem;
}

h5 {
  @include brand-font-h5();

  + h6 {
    margin-top: 0 !important;
  }
}

h6 { @include brand-font-h6(); }

.subtitle {
  @include brand-font-h1();
  font-size: 1.4rem;
  color: $gray-500;
  -webkit-font-smoothing: antialiased;
}

.strike {
  text-decoration: line-through;
}

// Basic Content Elements
p {
  font-size: 1rem;
  line-height: 1.875em;

  small {
    line-height: 1.5;
  }
}

hr {
  margin: 1rem 0;
}

ol + hr {
  margin: 3rem 0 1rem;
}

dt, dd {
  padding-left: 1rem;
}

dd {
  font-size: 90%;
  margin-bottom: 2rem;

  &:first-child {
    margin-top: 1rem;
  }
}

label {
  @include brand-font-label;
  color: $gray-600;
  text-transform: initial;
  margin-bottom: 0;
  font-size: 0.875em;
}

// Global Style Modifiers

// TODO check for usage and replace with built in BS version
.highlight-dark {
  background: $gray-800;
  color: $white;

  * {
    color: $white;
  }
}

.pad-top {
  padding-bottom: 1rem;
}

.pad-bottom {
  padding-bottom: 1rem;
}

.large {
  font-size: 120%;
}

.small {
  font-size: 90%;
}

// Figures
figure {
  display: block;
  padding: 1.5rem;

  & > code {
    padding: 0;
    margin: 0;

    & > pre {
      padding: 0;
      margin: 0;
      color: $cyan-700;
    }
  }

  p {
    margin-bottom: 0;
  }
}

// Code Blocks
pre, code, pre > code, code > pre {
  background-color: transparent;
  color: $cyan-700;
  margin-bottom: 0;
}

.dimmed {
  opacity: 0.5;
}

section {
  margin-bottom: 5rem;
}

caption {
  width: 100%;
  display: inline-block;
  padding-bottom: 2rem;
}

.readable-width {
  max-width: 50rem;
}

.readable-width--wide {
  max-width: 65rem;
}

.centered-block {
  margin-left: auto;
  margin-right: auto;
}

.text-hint {
  color: $gray-500;
  font-style: italic;
  margin-bottom: 1rem;
}

.text-gray {
  color: $gunmetal;
}

.text-alert-green {
  color: $alert-green;
}

// elasticsearch returns HTML results with matching terms wrapped in this tag:
em.highlight {
  font-style: normal;
  background-color: $yellow-200;
}

.truncate {
  @extend .text-truncate;
  display: inline-block;
}

.truncate-xs {
  @extend .truncate;
  max-width: 9rem;
}

.truncate-sm {
  @extend .truncate;
  max-width: 15rem;
}

.truncate-md {
  @extend .truncate;
  max-width: 25rem;
}


.text-soft-delete {
  @extend .text-muted;
  text-decoration: line-through;
}

.label-lg {
  font-size: 1.25rem;
}

.leading-tight {
  line-height: 1.5;
}

label.p, .form-group label.p {
  @extend p;
  @extend .m-0;
  text-transform: none;
  font-family: $font-family-sans-serif;
  color: $gray-dark;
}

img.img-stretch {
  width: 100%;
}

label.font-family-body {
  font-size: 1rem;
}
