/* stylelint-disable no-descending-specificity */
.ds-link-with-arrow {
  --link-with-arrow-glyph: '→';
  align-items: flex-start;
  display: inline-flex;
  flex-wrap: nowrap;
  font-family: var(--ds-type-system-sans-lining);
  font-size: var(--ds-type-scale-1);
  font-style: normal;
  font-weight: 500;
  line-height: var(--ds-type-leading-border-link);
  text-decoration: none;
  span {
    border-bottom: 0.125rem solid transparent;
    color: var(--ds-color-london-5);
    transition: border-color var(--ds-interactions-transition), color var(--ds-interactions-transition);
    will-change: border-color, color;
  }
  &:hover {
    span {
      border-bottom-color: var(--ds-color-chicago-45);
      color: var(--ds-color-chicago-30);
    }
  }
  &:focus {
    outline: solid transparent;
    span {
      border-bottom-color: transparent;
      box-shadow: 0 0 0 0.125rem var(--ds-color-hong-kong-55);
    }
  }
  &:active {
    span {
      border-bottom-color: var(--ds-color-hong-kong-55);
      box-shadow: none;
      color: var(--ds-color-london-5);
    }
  }
  &::before {
    color: var(--ds-color-london-5);
    margin: 0 0.375rem 0 0;
  }
  &::after {
    color: var(--ds-color-london-5);
    margin: 0 0 0 0.25rem;
  }
  &.ds-link-with-arrow--text-right {
    &::before {
      content: var(--link-with-arrow-glyph);
    }
  }
  &.ds-link-with-arrow--text-left {
    &::after {
      content: var(--link-with-arrow-glyph);
    }
  }
  &.ds-link-with-arrow--left {
    --link-with-arrow-glyph: '←';
  }
}

.ds-link-with-arrow--minor {
  font-size: var(--ds-type-scale-0);
  span {
    border-bottom-width: 0.0625rem;
  }
  &:focus {
    span {
      box-shadow: 0 0 0 0.0625rem var(--ds-color-hong-kong-55);
    }
  }
  &:active {
    span {
      box-shadow: none;
    }
  }
}

.ds-link-with-arrow--serif {
  font-family: var(--ds-type-system-serif-lining);
}

.ds-link-with-arrow--selected {
  font-weight: 700;
  &.ds-link-with-arrow--text-right {
    &::before {
      color: var(--ds-color-economist-red);
    }
  }
  &.ds-link-with-arrow--text-left {
    &::after {
      color: var(--ds-color-economist-red);
    }
  }
}
