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

@use '@carbon/styles/scss/config' as *;
@use '@carbon/styles/scss/theme' as *;
@use '@carbon/styles/scss/type' as *;
@use '../../globals/vars' as *;
@use '../../globals/imports' as *;
@use '../card';

@mixin card-link {
  .#{$prefix}--card__CTA--disabled {
    cursor: not-allowed;
  }

  :host(#{$c4d-prefix}-card-link[disabled]),
  .#{$prefix}--card__CTA--disabled {
    .#{$prefix}--card__heading,
    ::slotted([slot='heading']),
    .#{$prefix}--card__copy,
    .#{$prefix}--card__eyebrow {
      color: $text-disabled;
    }
    .#{$prefix}--card__footer,
    .#{$prefix}--card__wrapper {
      .#{$prefix}--link-with-icon {
        svg {
          color: $text-disabled;
          margin-inline-start: 0;
        }
      }

      ::slotted(svg[slot='footer']),
      svg {
        fill: $text-disabled;
      }
    }
  }

  :host(#{$c4d-prefix}-card-link-heading),
  .#{$prefix}--card-link .#{$prefix}--card__heading {
    @include type-style('heading-02');
  }

  :host(#{$c4d-prefix}-card-link-heading) {
    margin-block-end: 0;
  }
}
