@use "sass:list";
@use "sass:meta";
@use "../../modules/bem-extensions/modifier-helpers" as modifier_helpers;
@use "./link-properties" as props with (
  $link_class_name: $custom_link_class_name,
  $link_theme_path: $custom_link_theme_path,
  $link_variant_name_list: $link_used_variant_name_list
);

//@layer link_base_variant, link_primary_variant, link_neutral_variant;

@include modifier_helpers.with_default($custom_link_class_name, $link_used_variant_name_list, $link_used_variant_default)
  using ($curr_variant_name) {
  @include props.set_text_color(props.$color_state_map, "#{$curr_variant_name}-text", (hovered: true));
  @include props.set_background_color(props.$color_state_map, "#{$curr_variant_name}-background", (hovered: true));
}

.#{$custom_link_class_name} {
  font-weight: $link_font_weight;
  line-height: $link_line_height;
  text-decoration: $link_text_decoration;
  text-transform: $link_text_transform;
  outline: 0;
  transition: all 0.3s ease;
  cursor: pointer;

  @include modifiers((), "border-underline") {
    text-decoration: none;

    span {
      border-color: $link_border_color;
      border-style: $link_border_style;
      border-width: $link_border_width;
      padding: $link_padding;
    }
  }

  &:hover {
    @include modifiers((), "border-underline") {
      span {
        border-color: $link_border_color_hover;
      }
    }
  }
}
