// stylelint-disable declaration-no-important, selector-list-comma-newline-after

//
// Headings
//

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  @if variable-exists(fontheadings) {
    font-family: $fontheadings;
  }

  font-weight: $headings-font-weight;
  color: $headings-color;

  .theme-dark & {
    color: $dm-headings-color;
  }
}

h5,
h6,
.h5,
.h6 {
  color: $body-color-light;

  .theme-dark & {
    color: $dm-body-color-light;
  }

  .yui3-widget-modal & {
    color: $headings-color;

    .theme-dark & {
      color: $dm-headings-color;
    }
  }
}

h1,
.h1 {
  @include font-size($h1-font-size);
  margin-bottom: 1.5rem;

  .page-content--maintenance & {
    font-size: 1rem;
    font-family: $font-family-base;
    color: $body-color-secondary;
  }
}

h2,
.h2 {
  @include font-size($h2-font-size);
  line-height: $headings-line-height;
}

h3,
.h3 {
  @include font-size($h3-font-size);
  line-height: $headings-line-height;
}

h4,
.h4 {
  @include font-size($h4-font-size);
}

h5,
.h5 {
  @include font-size($h5-font-size);
}

h6,
.h6 {
  @include font-size($h6-font-size);
}

h2 {
  .btn {
    margin-left: 0.35rem
  }

  .btn {
    .icon {
      @extend .btn-special-icon;
    }

    &:hover {
      text-decoration: none;

      .icon {
        @extend .btn-special-icon--hover;
      }
    }
  }

}

h2+h3 {
  margin-top: 1.5rem;

  #page-admin-tool-lp-editplan & {
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
}

h2+.nav-tabs {
  margin-top: 2rem !important;
}

h3+fieldset {
  margin-top: $page-padding-global;
}


.lead-1,
.lead-2,
.lead-3,
.lead-4 {
  font-weight: $font-weight-medium;
  color: $body-color;
  line-height: 1.3;

  .theme-dark & {
    color: $dm-body-color;
  }
}

.lead-1 {
  font-size: 3rem;

  @include media-breakpoint-between(xs, sm) {
    font-size: 2rem;
  }
}

.lead-2 {
  font-size: 2.5rem;

  @include media-breakpoint-between(xs, sm) {
    font-size: 1.5rem;
  }
}

.lead-3 {
  font-size: 2rem;

  @include media-breakpoint-between(xs, sm) {
    font-size: 1rem;
  }
}

.lead-4 {
  font-size: 1.5rem;

  @include media-breakpoint-between(xs, sm) {
    font-size: .85rem;
  }
}

// Type display classes
.display-1,
.display-2,
.display-3,
.display-4 {
  color: $body-color;
  line-height: 1.3;

  .theme-dark & {
    color: $dm-body-color;
  }
}

.display-1 {
  @include font-size($display1-size);
  font-weight: $display1-weight;
  line-height: $display-line-height;

  @include media-breakpoint-between(xs, sm) {
    font-size: 3rem;
  }
}

.display-2 {
  @include font-size($display2-size);
  font-weight: $display2-weight;
  line-height: $display-line-height;

  @include media-breakpoint-between(xs, sm) {
    font-size: 2rem;
  }
}

.display-3 {
  @include font-size($display3-size);
  font-weight: $display3-weight;
  line-height: $display-line-height;

  @include media-breakpoint-between(xs, sm) {
    font-size: 1.5rem;
  }
}

.display-4 {
  @include font-size($display4-size);
  font-weight: $display4-weight;
  line-height: $display-line-height;

  @include media-breakpoint-between(xs, sm) {
    font-size: 1rem;
  }
}


//
// Horizontal rules
//

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

  .theme-dark & {
    border-top: $hr-border-width solid $dm-hr-border-color;
  }
}


//
// Emphasis
//
small,
.small,
.text-small {
  @include font-size($small-font-size);
  font-weight: $font-weight-normal;
}

.modified {
  margin: 10px auto 0;

  font-size: $font-size-xs;
  color: $body-color-light;
  text-align: right;
}

mark,
.mark {
  padding: $mark-padding;
  background-color: $mark-bg;

  .theme-dark & {
    background-color: $dm-mark-bg;
  }
}


//
// Lists
//

.list-unstyled {
  @include list-unstyled();
}

// Inline turns list items into inline-block
.list-inline {
  @include list-unstyled();
}

.list-inline-item {
  display: inline-block;

  &:not(:last-child) {
    margin-right: $list-inline-padding;
  }
}

.list-styled {
  margin: 1rem 0 1rem 2rem;
  padding: 0;

  li {
    list-style: none;

    padding: .25rem 2rem;
    margin-bottom: .25rem;

    position: relative;

    color: $body-color-secondary;

    .theme-dark & {
      color: $dm-body-color-secondary;
    }

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

    &:before {
      content: '';
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='#{url-friendly-colour($body-color)}' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M5.75 12.8665L8.33995 16.4138C9.15171 17.5256 10.8179 17.504 11.6006 16.3715L18.25 6.75'%3E%3C/path%3E%3C/svg%3E%0A");
      background-repeat: no-repeat;
      background-size: 24px;

      position: absolute;
      top: calc(50% - 12px);
      left: 0;
      width: 24px;
      height: 24px;

      .theme-dark & {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='#{url-friendly-colour($dm-body-color)}' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M5.75 12.8665L8.33995 16.4138C9.15171 17.5256 10.8179 17.504 11.6006 16.3715L18.25 6.75'%3E%3C/path%3E%3C/svg%3E%0A");
      }
    }

    &.list-icon-x {
      &:before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='#{url-friendly-colour($gray-700)}' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M17.25 6.75L6.75 17.25'%3E%3C/path%3E%3Cpath stroke='#{url-friendly-colour($gray-700)}' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6.75 6.75L17.25 17.25'%3E%3C/path%3E%3C/svg%3E%0A");

        .theme-dark & {
          background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='#{url-friendly-colour($dm-gray-700)}' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M17.25 6.75L6.75 17.25'%3E%3C/path%3E%3Cpath stroke='#{url-friendly-colour($dm-gray-700)}' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6.75 6.75L17.25 17.25'%3E%3C/path%3E%3C/svg%3E%0A");
        }

      }
    }

  }
}

.user-evidence-documents {
  margin: 1rem 1.25rem;
  padding-left: 0;

  li {
    list-style: none;

    padding-top: .5rem;
    padding-bottom: .5rem;

    margin-bottom: .25rem;


    .rui-icon-container {
      margin-right: .35rem;
    }

    a {
      font-size: $font-size-md;
      font-weight: $font-weight-medium;
      color: $body-color-secondary;

      .theme-dark & {
        color: $dm-body-color-secondary;
      }
    }
  }
}

//
// Misc
//

// Builds on `abbr`
.initialism {
  @include font-size(90%);
  text-transform: uppercase;
}

// Blockquotes
.blockquote {
  margin-bottom: $spacer;
  @include font-size($blockquote-font-size);
}

.blockquote-footer {
  display: block;
  @include font-size($blockquote-small-font-size);
  color: $blockquote-small-color;

  .theme-dark & {
    color: $dm-blockquote-small-color;
  }

  &::before {
    content: "\2014\00A0"; // em dash, nbsp
  }
}

.rui-typo-quote {
  margin-bottom: 10px;

  font-size: 1.875rem;
  line-height: 1.3;
  font-weight: $font-weight-normal;
  color: $body-color;

  .theme-dark & {
    color: $dm-body-color;
  }

}

.rui-typo-quote-author,
.rui-typo-quote-author-light {
  display: block;
  font-size: $font-size-base;
}

.rui-typo-quote-author {
  font-weight: $font-weight-bold;
  color: $body-color;

  .theme-dark & {
    color: $dm-body-color;
  }
}

.rui-typo-quote-author-light {
  color: $body-color-light;

  .theme-dark & {
    color: $dm-body-color-light;
  }
}

.rui-pre {
  max-width: 100%;
  width: 100%;
  white-space: pre-wrap;
  overflow: auto;
  position: relative;

  button {
    position: absolute;
    top: 5px;
    right: 5px;
  }
}

.rui-pre-code {
  max-width: 100%;
  width: 100%;
  white-space: pre-wrap;
  overflow: auto;
  position: relative;
  
  padding: 2rem;
  border-radius: $btn-border-radius;

  font-size: $font-size-xs;
  font-family: $font-family-monospace;

  background-color: #000;
  color: #fff;

  button {
    position: absolute;
    top: 5px;
    right: 5px;
  }
}

.font-weight-medium {
  font-weight: $font-weight-medium;
}

.list-unstyled--special {
  list-style: none;
  padding: 0;
  margin: 0;

  font-size: $font-size-md;

  li {
    margin-left: 12px;
    padding: 2px 20px;
    background-image: url("data:image/svg+xml,%3Csvg height='40' viewBox='0 0 16 40' width='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m16 0v40h-15c-.27614237 0-.52614237-.2487307-.70710678-.6508738-.18096441-.4021432-.29289322-.9576987-.29289322-1.5713484v-37.7777778z' fill='none' stroke='#{url-friendly-colour($body-color-light)}' stroke-opacity='.4' stroke-width='2' transform='translate(1 -1)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position-x: 0px;
    background-position-y: -18px;
    background-size: 14px;

    a {
      &:hover {
        color: $link-hover-color;
      }
    }

  }

  .list-unstyled--special-blank {
    background-image: none;
  }

}

.text-light {
  color: $body-color-light;

  .theme-dark & {
    color: $dm-body-color-light!important;
  }
}

.text-size-xl {
  font-size: $font-size-xl;
  line-height: 1.3;

  @include media-breakpoint-between(xs, sm) {
    font-size: $font-size-lg;
  }
}

.text-size-lg {
  font-size: $font-size-lg;
  line-height: 1.4;

  @include media-breakpoint-between(xs, sm) {
    font-size: $font-size-base;
  }
}

.text-size-base {
  font-size: $font-size-base;

  @include media-breakpoint-between(xs, sm) {
    font-size: $font-size-md;
  }
}

.text-size-md {
  font-size: $font-size-md;

  @include media-breakpoint-between(xs, sm) {
    font-size: $font-size-sm;
  }
}

.text-size-sm {
  font-size: $font-size-sm;

  @include media-breakpoint-between(xs, sm) {
    font-size: $font-size-xs;
  }
}

.text-size-xs {
  font-size: $font-size-xs;

  @include media-breakpoint-between(xs, sm) {
    font-size: .6rem;
  }
}

.rui-text--gradient {
  background-image: linear-gradient(140deg, $primary-color-200 13%, var(--main-theme-color) 84%);
  color: var(--main-theme-color);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;

  .btn {
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: initial;   
  }
}

.rui-text--white,
.theme-dark .rui-text--white {
  color: $white!important;
}

.rui-text--black,
.theme-dark .rui-text--black {
  color: $gray-900!important;
}

.rui-text--weight-normal {
  font-weight: $font-weight-normal;
}

.rui-text--weight-medium {
  font-weight: $font-weight-medium;
}

.rui-text--weight-bold {
  font-weight: $font-weight-bold;
}

.rui-text--opacity {
  opacity: .7;
}

.rui-footer-content a,
.rui-footer-copy a,
.rui-footer-block--3 a,
.rui-footer-btns a,
.underline--anim {
  position: relative;
  text-decoration: none;

  &:after {
    content: '';
    background-color: $link-hover-color;
    width: 0;
    height: 1px;

    position: absolute;
    bottom: -5px;
    right: 0;
    transition: width 350ms ease-in-out;
  }

  &:hover {
    text-decoration: none;

    &:after {
      width: 100%;
      right: auto;
      left: 0;
    }
  }
}