/*
  text-link: Figma "link" component (LinkType=M and S). Works on <a> and <button>.
  Label in text/link/secondary with a border/width underline in button/secondary/border-secondary;
  on hover the label turns text/muted and the underline border/color/link-hover (the same grey). M sits in a 48-pixel tap area, S in a 24-pixel one.
*/
.text-link {
  display: inline-flex;
  align-items: center;
  min-height: calc(var(--space-l) + var(--space-s));
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--text-link-secondary);
  font-family: var(--text-style-link-m-font-family);
  font-weight: var(--text-style-link-m-font-weight);
  font-size: var(--text-style-link-m-font-size);
  line-height: var(--text-style-link-m-line-height);
  /* Figma draws the line as a border along the bottom of the text box: unbroken, below the descenders */
  text-decoration: underline;
  text-decoration-color: var(--button-secondary-border-secondary);
  text-decoration-thickness: var(--border-width);
  text-decoration-skip-ink: none;
  text-underline-position: under;
  text-underline-offset: var(--border-width);
  letter-spacing: 0; /* link styles have no tracking in Figma */
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
/* Only for a mouse or trackpad: phones treat a tap as a hover that sticks after the tap */
@media (hover: hover) {
  .text-link:hover {
    color: var(--text-muted);
    text-decoration-color: var(--border-color-link-hover); /* same colour as text/muted */
  }
}
.text-link:focus-visible {
  outline: var(--border-width) solid var(--action-accent-interactive);
  outline-offset: var(--border-width);
}
.text-link[hidden] { display: none; }

.text-link--s {
  min-height: var(--space-m);
  font-family: var(--text-style-link-s-font-family);
  font-weight: var(--text-style-link-s-font-weight);
  font-size: var(--text-style-link-s-font-size);
  line-height: var(--text-style-link-s-line-height);
  text-underline-offset: 0;
}
