/*
 * Copyright (c) 2026, Salesforce, Inc.,
 * All rights reserved.
 * For full license text, see the LICENSE.txt file
 */

/**
 * @summary Makes links and buttons appear as regular text
 */
.slds-text-link_reset {
  cursor: pointer;
  line-height: inherit;
  font-size: inherit;

  &:active {
    outline: none;
  }

  &,
  &:active,
  &:focus,
  &:hover {
    color: inherit;
    text-decoration: inherit;
  }
}

/**
 * Used in combination with `.slds-text-link--reset`, you can apply the class `.slds-text-link` to a child element to reset its styles back to that of a link.
 */
.slds-text-link {
  color: var(--slds-g-color-accent-2);
  text-decoration: none;
  transition: color 0.1s linear;

  &:hover,
  &:focus {
    text-decoration: underline;
    color: var(--slds-g-color-accent-3);
  }

  &:active {
    color: var(--slds-g-color-accent-3);
  }
}

/**
 * Faux links are used on areas that can't be wrapped in an `a` element, but need to appear to be a link with an underline on hover. An example is in the page header for Object home. The `H1` and `button` that sit next to each other have the `.slds-text-link--faux` class on their parent element.
 */
.slds-text-link_faux,
.slds-type-focus {
  border-block-end: var(--slds-g-sizing-border-1) solid transparent;
  border-radius: 0;
  color: currentColor;
  cursor: pointer;

  &:hover,
  &:focus {
    color: currentColor;
    border-block-end-color: currentColor;
  }
}

/**
 * @summary Blur focus is an accessibility class that will add a blurred border to an element when it is focused.
 */
.slds-has-blur-focus {
  color: currentColor;

  &:hover,
  &:focus,
  &:active {
    color: currentColor;
    text-decoration: none;
  }

  &:focus {
    outline: 0;
    box-shadow: none;
  }

  &:focus-visible {
    box-shadow: var(--slds-g-shadow-outline-focus-1);
    outline: 0;
    border-color: transparent;
  }
}

/**
 * Input focus styles, this is applied via JavaScript when needing to apply focus styles to a containing element when the input gets focus
 */
.slds-has-input-focus {
  outline: 0;
  border-color: transparent;
  background-color: var(--slds-g-color-surface-container-1);
  box-shadow: var(--slds-g-shadow-outline-focus-1);
}
