// Copyright 2018-Present Okta, Inc.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

body {
  color: $text-body;
  font-family: $body-font-family;
  font-style: normal;
  font-weight: 400;
  line-height: $base-line-height;
  font-feature-settings: 'lnum', 'pnum';
}

a {
  color: cv('action');

  // ASA: https://github.com/okta/odyssey/issues/256
  .button, &.button {
    text-decoration: none;
  }

  // ASA: https://github.com/okta/odyssey/issues/256
  &:hover:not(.button) {
    color: cv('action', 'dark');
  }

  // ASA: https://github.com/okta/odyssey/issues/256
  &:visited:not(.button) {
    // https://github.com/okta/odyssey/issues/258
    // color: cv('violet', 'dark');
  }

  /* stylelint-disable selector-no-qualifying-type */
  &[target='_blank']:not([href^='mailto:'])::after {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-left: 0.2em;
    background-image: get-icon('external', cv('action', 'base'));
    background-repeat: no-repeat;
    vertical-align: middle;
  }
  /* stylelint-enable */
}

abbr {
  border-bottom: 1px dashed cv('action', 'base');
}

em {
  font-style: italic;
}

strong {
  font-weight: 600;
}

sup {
  font-size: ms(-2);
  line-height: 1;
  vertical-align: super;
}

blockquote {
  margin: 0 0 $base-spacing;
  padding: 0 0 0 $em-small-spacing;
  border-left: 2px solid $base-border-color;
}

p {
  max-width: $max-line-length;
  margin-bottom: $base-spacing;

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

ol,
ul {
  &:not([class]) {
    max-width: $max-line-length;
    margin: 0 0 $base-spacing 0;
    padding: 0 0 0 $base-spacing;
    list-style-position: outside;

    li {
      margin-bottom: $small-spacing;

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

    p + & {
      margin-top: -$small-spacing;
    }

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

/* stylelint-disable-next-line no-descending-specificity */
ul:not([class]) {
  list-style-type: disc;
}

/* stylelint-disable-next-line no-descending-specificity */
ol:not([class]) {
  list-style-type: decimal;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 $base-spacing 0;
  color: $text-heading;
  font-weight: 600;
  line-height: $heading-line-height;
}

h1 {
  font-size: ms(5);
}

h2 {
  font-size: ms(4);
}

h3 {
  font-size: ms(3);
}

h4 {
  font-size: ms(2);
}

h5 {
  font-size: ms(1);
  line-height: $base-line-height;
}

h6 {
  margin-bottom: $small-spacing;
  font-size: ms(0);
}

.legalese {
  color: $text-sub;
  font-size: ms(-1);
}
