/* 
 * Typografi
 * 
 * Setter Oslo kommune-stiler
 * 
 */

@use 'sass:map';
@use '../abstracts/variables';
@use '../abstracts/mixins/typography';
@use '../abstracts/mixins/breakpoints' as *;
@use '../abstracts/functions';

body {
  font-family: #{map.get(variables.$font-family, 'normal')};
  font-size: map.get(variables.$font-size, 'size-16');
  font-weight: map.get(variables.$font-weight, 'light');
  letter-spacing: map.get(variables.$letter-spacing, 'normal');
  line-height: map.get(variables.$line-height, 'body');
}
body,
[data-mode='dark'] {
  color: var(--pkt-color-text-body-default);
}

em {
  font-style: italic;
}

small {
  font-size: map.get(variables.$font-size, 'size-14');
  opacity: 0.8;
}

strong {
  font-weight: map.get(variables.$font-weight, 'medium');
}

/*
 * origo typography
 * prefix pkt
 */

@each $name, $style in variables.$pkt-styles {
  @include typography.generate-text-class($name, $style);
}

@each $name, $style in variables.$pkt-font-weight {
  @include typography.generate-text-class($name, $style);
}

@each $bp-name, $bp-value in variables.$breakpoints {
  @if $bp-value != 0 {
    @include bp-up($bp-value) {
      @each $name, $style in variables.$pkt-styles {
        @include typography.generate-text-class('#{$name}--#{$bp-name}-up', $style);
      }
      @each $name, $style in variables.$pkt-font-weight {
        @include typography.generate-text-class('#{$name}--#{$bp-name}-up', $style);
      }
    }
  }
}

/*
 * Alignment
 */
.pkt-txt-start {
  text-align: left !important;
}

.pkt-txt-end {
  text-align: right !important;
}

.pkt-txt-center {
  text-align: center !important;
}

/* 
 * Truncate text
 * requires inline-block or block
 */
.pkt-truncate-text {
  @include typography.truncate-text();
}
