/**
* Mixins to create typography rules.
*/

/**
* Headings.
*/
@mixin heading-base {
  font-style: normal;
  font-family: $font-default;
  font-weight: $font-weight-bold;
  hyphens: auto;
  word-break: break-word;
}

@mixin heading-1 {
  font-size: 48px;
  line-height: 110%;
  letter-spacing: -1.44px;
}

@mixin heading-1-mobile {
  font-size: 32px;
  letter-spacing: -0.96px;
}

@mixin heading-2 {
  font-size: 34px;
  line-height: 110%;
  letter-spacing: -1.02px;
}

@mixin heading-2-mobile {
  font-size: 28px;
  letter-spacing: -0.56px;
}

@mixin heading-3 {
  font-size: 28px;
  line-height: 110%;
  letter-spacing: -0.56px;
}

@mixin heading-3-mobile {
  font-size: 26px;
  letter-spacing: -0.52px;
}

@mixin heading-4 {
  font-size: 24px;
  line-height: 130%;
  letter-spacing: -0.48px;
}

@mixin heading-4-mobile {
  font-size: 22px;
  letter-spacing: -0.44px;
}

@mixin heading-5 {
  font-size: 20px;
  line-height: 130%;
  letter-spacing: -0.4px;
}

@mixin heading-5-mobile {
  //
}

@mixin heading-6 {
  font-size: 18px;
  line-height: 140%;
  letter-spacing: -0.36px;
}

@mixin heading-6-mobile {
  //
}

/**
* Texts.
*/
@mixin text-base {
  font-style: normal;
  font-family: $font-default;
  font-weight: $font-weight-regular;
  line-height: 150%;
}

@mixin text {
  font-size: 18px;
  letter-spacing: -0.18px;
}

@mixin text-mobile {
  //
}

@mixin text-lg {
  font-size: 20px;
  letter-spacing: -0.2px;
}

@mixin text-lg-mobile {
  //
}

/**
* Text utilities.
*/
@mixin text-underline {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2rem;
  cursor: pointer;
}

/**
* Hide text but make screen reader reachable.
*/
@mixin screen-reader {
  border: 0;
  clip-path: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

/**
* Add ellipsis to a text.
*/
@mixin ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/**
* Add hyphenate to a text.
*/
@mixin hyphenate {
  hyphens: auto;
  overflow-wrap: break-word;
}

/**
* Add line-clamp to text.
* Pass numbers os lines which should be should.
* Can only be used with @include.
*/
@mixin line-clamp($line: 3) {
  /* stylelint-disable */
  display: -webkit-box;
  -webkit-line-clamp: $line;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* stylelint-enable */
}

@mixin pre {
  @include text-dev;

  background-color: #aaa;
  color: $color-black;
  font-family: Courier, monospace !important;
  padding: 8px 16px;
  white-space: normal;

  b {
    font-weight: $font-weight-bold;
  }
}

@mixin text-dev {
  font-family: 'Courier New', Courier, monospace;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
}
