/**
* Mixins to typography.
*/

/**
* Headings.
*/

@mixin heading-1 {
  font-family: $font-general-sans;
  font-size: 60px;
  font-weight: $font-weight-medium;
  line-height: 100%;
  letter-spacing: 0;

  em {
    font-family: $font-galaxie-copernicus;
    font-weight: $font-weight-semibold;
    font-style: italic;
    line-height: 110%;
  }
}

@mixin heading-1-mobile {
  font-family: $font-general-sans;
  font-size: 34px;
  font-weight: $font-weight-medium;
  line-height: 115%;
  letter-spacing: 0;

  em {
    font-family: $font-galaxie-copernicus;
    font-weight: $font-weight-semibold;
    font-style: italic;
    letter-spacing: -0.72px;
  }
}

@mixin heading-2 {
  font-family: $font-general-sans;
  font-size: 52px;
  font-weight: $font-weight-medium;
  line-height: 100%;
  letter-spacing: -0.52px;

  em {
    font-family: $font-galaxie-copernicus;
    font-weight: $font-weight-semibold;
    font-style: italic;
  }
}

@mixin heading-2-mobile {
  font-family: $font-general-sans;
  font-size: 30px;
  font-weight: $font-weight-medium;
  line-height: 120%;
  letter-spacing: 0;

  em {
    font-family: $font-galaxie-copernicus;
    font-weight: $font-weight-semibold;
    font-style: italic;
    letter-spacing: -0.6px;
  }
}

@mixin heading-3 {
  font-family: $font-general-sans;
  font-size: 40px;
  font-weight: $font-weight-medium;
  line-height: 115%;
  letter-spacing: -1.32px;

  em {
    font-family: $font-galaxie-copernicus;
    font-weight: $font-weight-semibold;
    font-style: italic;
  }
}

@mixin heading-3-mobile {
  font-family: $font-general-sans;
  font-size: 28px;
  font-weight: $font-weight-medium;
  line-height: 120%;
  letter-spacing: 0;

  em {
    font-family: $font-galaxie-copernicus;
    font-weight: $font-weight-semibold;
    font-style: italic;
    letter-spacing: -0.6px;
  }
}

@mixin heading-4 {
  font-family: $font-general-sans;
  font-size: 30px;
  font-weight: $font-weight-medium;
  line-height: 115%;

  em {
    font-family: $font-galaxie-copernicus;
    font-weight: $font-weight-semibold;
    font-style: italic;
    letter-spacing: -1.16px;
  }
}

@mixin heading-4-mobile {
  font-family: $font-general-sans;
  font-size: 24px;
  font-weight: $font-weight-medium;
  line-height: 115%;
  letter-spacing: 0;

  em {
    font-family: $font-galaxie-copernicus;
    font-weight: $font-weight-semibold;
    font-style: italic;
    letter-spacing: -0.48px;
  }
}

@mixin heading-5 {
  font-family: $font-general-sans;
  font-size: 24px;
  font-weight: $font-weight-medium;
  line-height: 120%;

  em {
    font-family: $font-galaxie-copernicus;
    font-weight: $font-weight-semibold;
    font-style: italic;
    letter-spacing: -0.48px;
  }
}

@mixin heading-5-mobile {
  font-family: $font-general-sans;
  font-size: 20px;
  font-weight: $font-weight-medium;
  line-height: 130%;
  letter-spacing: 0.2px;

  em {
    font-family: $font-galaxie-copernicus;
    font-weight: $font-weight-semibold;
    font-style: italic;
    letter-spacing: -0.4px;
  }
}

@mixin heading-6 {
  font-family: $font-general-sans;
  font-size: 18px;
  font-weight: $font-weight-medium;
  line-height: 130%;
  letter-spacing: 0.18px;
}

@mixin heading-6-mobile {
  font-family: $font-general-sans;
  font-size: 16px;
  font-weight: $font-weight-semibold;
  line-height: 120%;
  letter-spacing: 0.36px;
}

/**
* Texts.
*/
@mixin text-display {
  font-family: $font-galaxie-copernicus;
  font-size: 70px;
  font-style: italic;
  font-weight: $font-weight-semibold;
  line-height: 110%;
}

@mixin text-display-mobile {
  font-family: $font-galaxie-copernicus;
  font-size: 40px;
  font-style: italic;
  font-weight: $font-weight-semibold;
  line-height: 130%;
}

@mixin text-large {
  font-family: $font-general-sans;
  font-size: 20px;
  font-style: normal;
  font-weight: $font-weight-medium;
  line-height: 120%;
  letter-spacing: 0.2px;
}

@mixin text-large-mobile {
  font-family: $font-general-sans;
  font-size: 16px;
  font-style: normal;
  font-weight: $font-weight-medium;
  line-height: 140%;
  letter-spacing: 0.2px;
}

@mixin text {
  font-family: $font-general-sans;
  font-size: 18px;
  font-style: normal;
  font-weight: $font-weight-medium;
  line-height: 130%;
  letter-spacing: 0.18px;
}

@mixin text-mobile {
  font-family: $font-general-sans;
  font-size: 16px;
  font-style: normal;
  font-weight: $font-weight-medium;
  line-height: 150%;
  letter-spacing: 0.18px;
}

@mixin text-small {
  font-family: $font-general-sans;
  font-size: 16px;
  font-style: normal;
  font-weight: $font-weight-medium;
  line-height: 130%;
  letter-spacing: 0.16px;
}

@mixin text-x-small {
  font-family: $font-general-sans;
  font-size: 14px;
  font-style: normal;
  font-weight: $font-weight-medium;
  line-height: 140%;
}

@mixin text-xs-small {
  font-family: $font-general-sans;
  font-size: 12px;
  font-style: normal;
  font-weight: $font-weight-medium;
  line-height: 140%;
}

@mixin text-link {
  @include text-small;

  letter-spacing: 0.26px;
  font-weight: $font-weight-semibold;
  line-height: normal;
}

@mixin text-button {
  @include text-x-small;

  letter-spacing: 0.14px;
  font-weight: $font-weight-semibold;
  line-height: normal;
}

@mixin pre {
  @include text-x-small;

  padding: $spacing-4 $spacing-8;
  font-family: Courier, monospace;
  font-weight: $font-weight-medium;
  color: $color-gray-warm;
  white-space: break-spaces;
  background-color: $color-black;
}

/**
* Hide text but make screen reader reachable.
*/

@mixin screen-reader {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/**
* Add ellipsis to a text.
*/

@mixin ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/**
* Add hyphenate to a text.
*/

@mixin hyphenate {
  hyphens: auto;
  word-wrap: break-word;
  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-next-line value-no-vendor-prefix */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: $line;
  overflow: hidden;
}
