.body-text {
  &:not(:last-child) {
    margin-bottom: 1em;
  }
}

@each $weight, $var in $font-weights {
  .font-weight--#{$weight} {
    font-weight: $var;
  }

  .title-weight--#{$weight} {
    font-weight: $var;
  }

  .body-weight--#{$weight} {
    font-weight: $var;
  }
}
$body-type: (
  xx-small: (
    font-size: font-size(body, xx-small), line-height: line-height(body, large)
  ), x-small: (
    font-size: font-size(body, x-small), line-height: line-height(body, large)
  ), small: (
    font-size: font-size(body, small), line-height: line-height(body, large)
  ), default: (
    font-size: font-size(body, default), line-height: line-height(body, default)
  ), large: (
    font-size: font-size(body, large), line-height: line-height(body, default)
  ), x-large: (
    font-size: font-size(body, x-large), line-height: line-height(body, x-large)
  )
);

@each $size, $var in $body-type {
  $fontSize: map-get($var, font-size);
  $lineHeight: map-get($var, line-height);

  .body-size--#{$size} {
    font-size: $fontSize;
    line-height: $lineHeight;
    margin: 0;
  }
}
$title-type: (
  x-small: (
    font-size: font-size(title, x-small), line-height: line-height(title, default)
  ), small: (
    font-size: font-size(title, small), line-height: line-height(title, large)
  ), default: (
    font-size: font-size(title, default), line-height: line-height(title, default)
  ), large: (
    font-size: font-size(title, large), line-height: line-height(title, medium)
  ), x-large: (
    font-size: font-size(title, x-large), line-height: line-height(title, default)
  ), xx-large: (
    font-size: font-size(title, xx-large), line-height: line-height(title, small)
  ), jumbo: (
    font-size: font-size(title, jumbo), line-height: line-height(title, small)
  )
);

@each $size, $var in $title-type {
  $fontSize: map-get($var, font-size);
  $lineHeight: map-get($var, line-height);
  $fontSizeWithUnit: $fontSize + 0;
  $fontSizeMultiple: $fontSize * 1.25;

  .title-size--#{$size} {
    font-size: calc(#{$fontSizeWithUnit} + (#{$fontSizeMultiple} - #{$fontSize}) * ((100vw - 400px) / (1440 - 400)));
    line-height: $lineHeight;
    margin: 0;
    position: relative;

    &.title--condensed {
      font-size: calc(#{$fontSizeWithUnit * 1.5} + (#{$fontSizeMultiple} - #{$fontSize}) * ((100vw - 400px) / (1440 - 400)));
      line-height: $lineHeight * 0.85;
    }

    &.title--underline {
      padding-bottom: $fontSizeWithUnit / 2;
      margin-bottom: $fontSizeWithUnit / 2;

      &::after {
        width: $fontSizeWithUnit;
        border-bottom: $fontSizeWithUnit / 7 solid;
      }
    }
  }
}

.title {
  &--condensed {
    @include font-secondary('upper');
  }

  &--underline {
    &::after {
      content: "";
      position: absolute;
      bottom: 0;

      .align--center & {
        left: 50%;
        transform: translateX(-50%);
      }

      .align--right & {
        right: 0;
      }

      .align--left & {
        left: 0;
      }

      .underline--green & {
        border-color: palette(green);
      }

      .underline--gray & {
        border-color: palette(gray);
      }

      .underline--blue & {
        border-color: palette(blue);
      }

      .underline--bright-green & {
        border-color: palette(green, bright);
      }

      .underline--white & {
        border-color: $white;
      }
    }
  }
}
$type-themes: _pick($ui-colors, (default-type, light, base, normal, success, info, danger));

@each $theme, $color in $type-themes {
  .title-theme--#{$theme},
  .body-theme--#{$theme} {
    color: $color;
  }
}

$lock-ups: (
  none: 0,
  small: 1em,
  default: 1.5em,
  large: 2em,
  x-large: 4em
);

@each $size, $padding in $lock-ups {
  .lk--#{$size} {
    padding: {
      top: $padding;
      bottom: $padding;
    }
  }
}

.disclaimer-text {
  font-size: font-size(body, x-small);
  line-height: line-height(body, x-small);
  color: palette(gray);
}

.lk-text__inline-child {
  display: inline-block;
}
