@import "../../scss/variables";
@import "../../scss/breakpoints.mixins";
@import "../../scss/typo.mixins";

@keyframes animate-arrow-right {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1, 1);
    transform: translate3d(0, 0, 0) scale(1, 1);
  }

  50% {
    opacity: 0;
    transform: translate(10px, 0) scale(1.3, 1);
    transform: translate3d(10px, 0, 0) scale(1.3, 1);
  }

  51% {
    opacity: 0;
    transform: translate(-10px, 0) scale(1.3, 1);
    transform: translate3d(-10px, 0, 0) scale(1.3, 1);
  }

  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1, 1);
    transform: translate3d(0, 0, 0) scale(1, 1);
  }
}

%link {
  @extend %typo-14;

  display: inline-flex;
  align-items: center;
  padding: 0;
  font-weight: bold;
  color: $color-axa-blue;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  background: transparent;
  border: 0;
  transition:
    transform $transition-normal $transition-ease,
    opacity $transition-normal $transition-ease,
    color $transition-normal $transition-ease;

  &:hover,
  &:focus {
    color: #00005b;
    text-decoration: none;
  }
}

%link--icon-left {
  flex-direction: row-reverse;
}

%link--red {
  color: $color-burnt-sienna;

  &:hover,
  &:focus {
    color: $color-flamingo;
  }
}

%link__icon {
  flex: 0;
  width: 16px;
  min-width: 16px;
  height: 11px;
  padding-left: 5px;
  color: inherit;
  fill: currentColor;
  stroke: currentColor;

  @include media-breakpoint-up(tablet) {
    width: 21px;
    min-width: 21px;
    padding-left: 10px;
  }

  %link:hover &,
  %link:focus & {
    animation: animate-arrow-right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
  }

  %link--icon-left & {
    padding-right: 5px;
    padding-left: 0;

    @include media-breakpoint-up(tablet) {
      padding-right: 10px;
    }
  }
}
