/**
 *
 * @ai-apps/angular v2.152.0 | _link.scss
 *
 * Copyright 2014, 2023 IBM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0

 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


//
// Copyright IBM Corp. 2016, 2018
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

//-----------------------------
// Link
//-----------------------------

@import '../../globals/scss/colors';
@import '../../globals/scss/vars';
@import '../../globals/scss/theme';
@import '../../globals/scss/typography';
@import '../../globals/scss/helper-mixins';
@import '../../globals/scss/vendor/@carbon/elements/scss/import-once/import-once';
@import '../../globals/scss/css--reset';

/// Link styles
/// @access private
/// @group link
@mixin link {
  .#{$prefix}--link {
    @include reset;
    @include type-style('body-short-01');

    display: inline-flex;
    color: $link-01;
    outline: none;
    text-decoration: none;
    transition: color $duration--fast-01 motion(standard, productive);

    &:hover {
      color: $hover-primary-text;
      text-decoration: underline;
    }

    &:active,
    &:active:visited,
    &:active:visited:hover {
      color: $text-01;
      text-decoration: underline;
    }

    &:focus {
      @include focus-outline;
    }

    &:visited {
      color: $link-01;
    }

    &:visited:hover {
      color: $hover-primary-text;
    }
  }

  .#{$prefix}--link--disabled,
  .#{$prefix}--link--disabled:hover {
    @include reset;
    @include type-style('body-short-01');

    color: $disabled-02;
    cursor: not-allowed;
    font-weight: 400;
    text-decoration: none;
  }

  .#{$prefix}--link.#{$prefix}--link--visited:visited {
    color: $visited-link;
  }

  .#{$prefix}--link.#{$prefix}--link--visited:visited:hover {
    color: $hover-primary-text;
  }

  .#{$prefix}--link.#{$prefix}--link--inline {
    text-decoration: underline;

    &:focus,
    &:visited {
      text-decoration: none;
    }
  }

  .#{$prefix}--link--disabled.#{$prefix}--link--inline {
    text-decoration: underline;
  }

  .#{$prefix}--link--sm {
    @include type-style('helper-text-01');
  }

  .#{$prefix}--link--lg {
    @include type-style('body-short-02');
  }

  .#{$prefix}--link__icon {
    display: inline-flex;
    align-self: center;
    margin-left: $spacing-03;
  }
}

@include exports('link') {
  @include link;
}
