@use "../abstracts" as *;
@use "sass:string" as s;

:root,
html,
body {
  font-size: 16px;
  line-height: 1.5;
  font-family: "Arimo", $sans-serif-fb;

  @include prefix(
    (
      text-size-adjust: 100%
    ),
    webkit moz ms
  );
}

@include elements(font-global) {
  font-size: inherit;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: hsl(0, 0%, 0%);
}

@include elements(line-height) {
  line-height: inherit;
}

@include elements(font-family) {
  font-family: inherit;
}

@for $i from 1 through 6 {
  $rem: -0.25 * $i + 2.75rem;
  $vw: -0.2 * $i + 1.4vw;

  h#{$i},
  .h#{$i} {
    font-size: $rem;
    line-height: 1.2;

    @include mq(lgup) {
      font-size: calc(#{$rem} + #{$vw});
    }
  }

  .h#{$i}-imp {
    font-size: $rem !important;
    line-height: 1.2 !important;

    @include mq(lgup) {
      font-size: calc(#{$rem} + #{$vw}) !important;
    }
  }
}

a,
.a {
  color: $gray;

  @include prefix(
    (
      text-decoration: none
    ),
    webkit moz
  );

  &:hover {
    color: $dgray;

    @include prefix(
      (
        text-decoration: none
      ),
      webkit moz
    );
  }
}

.a-imp {
  color: $gray !important;

  @include prefix(
    (
      text-decoration: s.unquote("none !important")
    ),
    webkit moz
  );

  &:hover {
    color: $dgray !important;

    @include prefix(
      (
        text-decoration: s.unquote("none !important")
      ),
      webkit moz
    );
  }
}

@include elements(monospace) {
  font-family: "Hack", $monospace-fb;
}

.talign {
  text-align: center;
}

.talign-lft {
  text-align: left;
}

.talign-rgt {
  text-align: right;
}

.talign-just {
  text-align: justify;
}

.talign-imp {
  text-align: center !important;
}

.talign-lft-imp {
  text-align: left !important;
}

.talign-rgt-imp {
  text-align: right !important;
}

.talign-just-imp {
  text-align: justify !important;
}

@each $min-max-mq in $min-max-mqs {
  @include mq($min-max-mq) {
    .talign-#{$min-max-mq} {
      text-align: center;
    }

    .talign-lft-#{$min-max-mq} {
      text-align: left;
    }

    .talign-rgt-#{$min-max-mq} {
      text-align: right;
    }

    .talign-just-#{$min-max-mq} {
      text-align: justify;
    }

    .talign-#{$min-max-mq}-imp {
      text-align: center !important;
    }

    .talign-lft-#{$min-max-mq}-imp {
      text-align: left !important;
    }

    .talign-rgt-#{$min-max-mq}-imp {
      text-align: right !important;
    }

    .talign-just-#{$min-max-mq}-imp {
      text-align: justify !important;
    }
  }
}

.td-ul {
  @include prefix(
    (
      text-decoration: underline
    ),
    webkit moz
  );
}

.td-lt {
  @include prefix(
    (
      text-decoration: line-through
    ),
    webkit moz
  );
}

.td-ol {
  @include prefix(
    (
      text-decoration: overline
    ),
    webkit moz
  );
}

.td-ul-ol {
  @include prefix(
    (
      text-decoration: underline overline
    ),
    webkit moz
  );
}

.td-ul-imp {
  @include prefix(
    (
      text-decoration: s.unquote("underline !important")
    ),
    webkit moz
  );
}

.td-lt-imp {
  @include prefix(
    (
      text-decoration: s.unquote("line-through !important")
    ),
    webkit moz
  );
}

.td-ol-imp {
  @include prefix(
    (
      text-decoration: s.unquote("overline !important")
    ),
    webkit moz
  );
}

.td-ul-ol-imp {
  @include prefix(
    (
      text-decoration: s.unquote("underline overline !important")
    ),
    webkit moz
  );
}

@for $i from 1 through 9 {
  .fw-#{$i}00 {
    font-weight: #{$i}00;
  }

  .fw-#{$i}00-imp {
    font-weight: #{$i}00 !important;
  }
}

@each $min-max-mq in $min-max-mqs {
  @include mq($min-max-mq) {
    @for $i from 1 through 9 {
      .fw-#{$min-max-mq}-#{$i}00 {
        font-weight: #{$i}00;
      }

      .fw-#{$min-max-mq}-#{$i}00-imp {
        font-weight: #{$i}00 !important;
      }
    }
  }
}

@for $i from 5 through 9 {
  .fs-0#{$i} {
    font-size: s.unquote("0.#{$i}rem");
  }

  .fs-0#{$i}-imp {
    font-size: s.unquote("0.#{$i}rem") !important;
  }
}

@for $i from 1 through 9 {
  .fs-1#{$i} {
    font-size: s.unquote("1.#{$i}rem");
  }

  .fs-1#{$i}-imp {
    font-size: s.unquote("1.#{$i}rem") !important;
  }
}

@for $i from 2 through 5 {
  .fs-#{$i}0 {
    font-size: #{$i}rem;
  }

  .fs-#{$i}5 {
    font-size: s.unquote("#{$i}.5rem");
  }

  .fs-#{$i}0-imp {
    font-size: #{$i}rem !important;
  }

  .fs-#{$i}5-imp {
    font-size: s.unquote("#{$i}.5rem") !important;
  }
}

@each $min-max-mq in $min-max-mqs {
  @include mq($min-max-mq) {
    @for $i from 5 through 9 {
      .fs-#{$min-max-mq}-0#{$i} {
        font-size: s.unquote("0.#{$i}rem");
      }

      .fs-#{$min-max-mq}-0#{$i}-imp {
        font-size: s.unquote("0.#{$i}rem") !important;
      }
    }

    @for $i from 1 through 9 {
      .fs-#{$min-max-mq}-1#{$i} {
        font-size: s.unquote("1.#{$i}rem");
      }

      .fs-#{$min-max-mq}-1#{$i}-imp {
        font-size: s.unquote("1.#{$i}rem") !important;
      }
    }

    @for $i from 2 through 5 {
      .fs-#{$min-max-mq}-#{$i}0 {
        font-size: #{$i}rem;
      }

      .fs-#{$min-max-mq}-#{$i}0-imp {
        font-size: #{$i}rem !important;
      }
    }
  }
}

main.main-document {
  font-size: 10pt;
  font-family: "Arimo", "Arial", sans-serif;
  line-height: 1.15;

  @for $i from 1 through 3 {
    $em: -0.25 * $i + 2.75em;

    h#{$i},
    .h#{$i} {
      font-size: $em;
      line-height: 1.15;
      font-family: "Tinos-Bold", $serif-fb;
    }

    .h#{$i}-imp {
      font-size: $em !important;
      line-height: 1.15 !important;
      font-family: "Tinos-Bold", $serif-fb !important;
    }
  }

  @each $head, $head-size in $head-sizes {
    h#{$head},
    .h#{$head} {
      font-size: $head-size;
      line-height: 1.15;
      font-family: "Tinos-Bold", $serif-fb;
    }

    .h#{$head}-imp {
      font-size: $head-size !important;
      line-height: 1.15 !important;
      font-family: "Tinos-Bold", $serif-fb !important;
    }
  }

  a {
    color: blue;
    text-decoration: underline;
    text-shadow: none;

    &:hover {
      color: blue;
      text-decoration: underline;
    }
  }

  @for $i from 1 through 9 {
    .fs-1#{$i}pt {
      font-size: 1#{$i}pt;
    }

    .fs-1#{$i}pt-imp {
      font-size: 1#{$i}pt !important;
    }
  }

  p.p-pgnum {
    position: absolute;
    z-index: z("pgnum");
    bottom: 0;
    @include pgnum(right);

    &.d-none-before {
      &::before {
        display: none;
      }
    }
  }
}

.txtfx {
  text-shadow: 0 5px 10px $black-05;
}
