@use "variables" as *;
@use "../util/breakpoints" as *;

/* h1-h6 */

h1,
.h1 {
  font-size: $h1-size;
  font-weight: $font-weight-300;
}

h2,
.h2 {
  font-size: $h2-size;
  font-weight: $font-weight-300;
}

h3,
.h3 {
  font-size: $h3-size;
  font-weight: $font-weight-300;
}

h4,
.h4 {
  font-size: $h4-size;
  font-weight: $font-weight-300;
}

h5,
.h5 {
  font-size: $h5-size;
  font-weight: $font-weight-300;
}

h6,
.h6 {
  font-size: $base-font-size;
  font-weight: $font-weight-300;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  margin-bottom: 0.5rem;
  margin-top: 0.25rem;
  color: var(--text-core-hc);
  line-height: 1.1;
}

p,
.p {
  padding-bottom: $base-font-size * 0.5;
}

//using map from breakpoint.scss
@each $breakName, $breakValue in $breakpoints-up {
  //font size
  $fs: (
    "font-size": (
      "prefix": "text",
      "values": (
        "small": $font-size-sm,
        "default": $base-font-size,
        "medium": $font-size-md,
        "large": $font-size-lg,
        "extralarge": $font-size-xl,
      ),
    ),
  );

  @each $property, $map in $fs {
    $prefix: map-get($map, "prefix");
    $values: map-get($map, "values");

    @each $k, $v in $values {
      @if $breakName != "" {
        @media (min-width: $breakValue) {
          .#{$prefix}-#{$breakName}-#{$k} {
            #{$property}: $v;
          }
        }
      } @else {
        .#{$prefix}-#{$k} {
          #{$property}: $v;
        }
      }
    }
  }

  //font weight
  $fw: (
    "font-weight": (
      "prefix": "text",
      "values": (
        "thin": $font-weight-300,
        "regular": $font-weight-400,
        "semibold": $font-weight-600,
        "bold": $font-weight-700,
        "extrabold": $font-weight-800,
      ),
    ),
  );

  @each $property, $map in $fw {
    $prefix: map-get($map, "prefix");
    $values: map-get($map, "values"); 

    @each $k, $v in $values {
      @if $breakName != "" {
        @media (min-width: $breakValue) {
          .#{$prefix}-#{$breakName}-#{$k} {
            #{$property}: $v;
          }
        }
      } @else {
        .#{$prefix}-#{$k} {
          #{$property}: $v;
        }
      }
    }
  }
} //end breakpoints

.text-italic {
  font-style: italic;
}

.text-lowercase {
  text-transform: lowercase;
}

.text-uppercase {
  text-transform: uppercase;
}

.text-capitalize {
  text-transform: capitalize;
}

.text-nowrap {
  white-space: nowrap;
}

.text-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-hc {
  color: var(--text-core-hc);
}

.text-lc {
  color: var(--text-core-lc);
}

a.text-link{
  color: var(--bg-core-primary-dark);
  border-bottom:1px dotted;
  transition: all 0.15s ease-in-out;
}

a.text-link:hover{
  color: var(--bg-core-primary-darken);
  border-bottom:none;


}

// $fs: (
//   "font-size": (
//     "prefix": "fs",
//     "values": (
//       "sm": $font-size-sm,
//       "md": $font-size-md,
//       "lg": $font-size-lg,
//       "xl": $font-size-xl,
//     ),
//   ),
// );

// @each $property, $map in $fs {
//   $prefix: map-get($map, "prefix");
//   $values: map-get($map, "values");

//   @each $k, $v in $values {
//     @if ($k == "default") {
//       .#{$prefix} {
//         #{$property}: $v;
//       }
//     } @else {
//       .#{$prefix}-#{$k} {
//         #{$property}: $v;
//       }
//     }
//   }
// }

//font weight
// $fw: (
//   "font-weight": (
//     "prefix": "fw",
//     "values": (
//       "light": $font-weight-300,
//       "regular": $font-weight-400,
//       "semibold": $font-weight-600,
//       "bold": $font-weight-700,
//       "extrabold": $font-weight-800,
//     ),
//   ),
// );

// @each $property, $map in $fw {
//   $prefix: map-get($map, "prefix");
//   $values: map-get($map, "values");

//   @each $k, $v in $values {
//     @if ($k == "default") {
//       .#{$prefix} {
//         #{$property}: $v;
//       }
//     } @else {
//       .#{$prefix}-#{$k} {
//         #{$property}: $v;
//       }
//     }
//   }
// }
