/* Link — opt-in styled text link. Bare content links get the quiet base
   styles (base.css); use .govbb-link where a link needs the full treatment
   with highlight states. Focus/active show as a gold background instead of an
   outline, matching the error-summary and show/hide links. */

.govbb-link {
  color: var(--govbb-link-color);
  cursor: pointer;
  outline: none;
  text-decoration: underline;
  text-underline-offset: 0.1em;
  text-decoration-thickness: max(1px, 0.0625em);
}

/* Visited links keep the surface's default link colour (links sheet) —
   without this the browser's purple leaks through. */
.govbb-link:visited {
  color: var(--govbb-link-color);
}

.govbb-link:hover {
  color: var(--govbb-link-hover-color);
  background-color: var(--govbb-link-hover-bg);
  text-decoration: none;
}

.govbb-link:active,
.govbb-link:focus-visible {
  color: var(--govbb-link-active-color);
  background-color: var(--govbb-link-active-bg);

  /* renders the ring in forced-colors mode, where the gold bg is stripped */
  outline: 2px solid transparent;
  text-decoration: none;
}

/* Underline only on interaction — for links inside already-underlined or
   dense contexts. */
.govbb-link--no-underline:not(:hover, :active) {
  text-decoration: none;
}

/* Keep visited links in the surrounding text colour. */
.govbb-link--no-visited:visited {
  color: inherit;
}
