/* stylelint-disable no-descending-specificity */
.ds-emphasised-link {
  align-items: center;
  border: var(--ds-border-rule);
  border-radius: 0.25rem;
  box-sizing: border-box;
  display: inline-flex;
  font-family: var(--ds-type-system-sans-lining);
  font-size: var(--ds-type-scale-0);
  font-weight: 500;
  height: 2rem;
  line-height: var(--ds-type-leading-border-link);
  padding: 0.25rem calc(var(--ds-grid-gap) - 0.25rem) 0.25rem var(--ds-grid-gap);
  text-decoration: none;
  &::after {
    color: var(--ds-color-chicago-45);
    content: '→';
    font-family: var(--ds-type-system-sans-lining);
    margin: 0 0 0 0.375rem;
  }
  span {
    border-bottom: 0.0625rem solid transparent;
    color: var(--ds-color-chicago-45);
    margin: 0.0625rem 0 0 0;
    transition: border-color var(--ds-interactions-transition), color var(--ds-interactions-transition);
    will-change: border-color, color;
  }
  &:hover {
    &::after {
      color: var(--ds-color-chicago-30);
    }
    span {
      border-bottom-color: var(--ds-color-chicago-30);
      color: var(--ds-color-chicago-30);
    }
  }
  &:focus {
    border-color: transparent;
    box-shadow: 0 0 0 0.125rem var(--ds-color-hong-kong-55);
    outline: solid transparent;
    span {
      color: var(--ds-color-chicago-45);
    }
  }
  &:active {
    border-color: var(--ds-color-hong-kong-55);
    box-shadow: none;
    &::after {
      color: var(--ds-color-chicago-45);
    }
    span {
      border-bottom-color: transparent;
      color: var(--ds-color-chicago-45);
    }
  }
}

.ds-emphasised-link--secondary {
  border: 0.0625rem solid var(--ds-color-london-20);
  &::after {
    color: var(--ds-color-london-5);
  }
  span {
    color: var(--ds-color-london-5);
  }
  &:hover {
    &::after {
      color: var(--ds-color-london-5);
    }
    span {
      border-bottom-color: var(--ds-color-london-5);
      color: var(--ds-color-london-5);
    }
  }
  &:focus {
    span {
      color: var(--ds-color-london-5);
    }
  }
  &:active {
    &::after {
      color: var(--ds-color-london-5);
    }
    span {
      color: var(--ds-color-london-5);
    }
  }
}

.ds-emphasised-link--inverse {
  border: var(--ds-border-rule--inverse-emphasised);
  &::after {
    color: var(--ds-color-london-100);
  }
  span {
    color: var(--ds-color-london-100);
  }
  &:hover {
    &::after {
      color: var(--ds-color-london-85);
    }
    span {
      border-bottom-color: var(--ds-color-london-85);
      color: var(--ds-color-london-85);
    }
  }
  &:focus {
    span {
      color: var(--ds-color-london-100);
    }
  }
  &:active {
    &::after {
      color: var(--ds-color-london-100);
    }
    span {
      color: var(--ds-color-london-100);
    }
  }
}
