/* Back button — a "return to the previous page" link with the brand's swept
   arrow. Compose with .govbb-link (class="govbb-link govbb-back-button") to
   inherit the shared link colour and hover/active/focus treatment; this file
   adds only the layout and the arrow.

   The arrow is the 11×8 vector from the Figma pattern library (drawn pointing
   right, flipped here), applied as a mask over currentcolor so it follows the
   link's state colour and scales with the text (0.55em/0.4em = 11px/8px at
   the 20px body size). */

.govbb-back-button {
  display: inline-flex;
  align-items: center;
  gap: var(--govbb-space-xs);
  font-size: var(--govbb-font-size-body);

  &::before {
    content: '';
    flex-shrink: 0;
    width: 0.55em;
    height: 0.4em;
    background: currentcolor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 8'%3E%3Cpath d='M4.57884 3C4.49774 2.09583 4.29682 1.17692 4.0012 0C6.19256 2.44118 11 4 11 4C11 4 6.68912 5.23529 4 8C4.29283 6.79432 4.47477 5.84169 4.56047 5H0V3L4.57884 3Z'/%3E%3C/svg%3E")
      center / contain no-repeat;
    transform: rotate(180deg);
  }
}

/* Forced colors strips the currentcolor background behind the mask, which
   would erase the arrow — repaint it in the system link color. */
@media (forced-colors: active) {
  .govbb-back-button::before {
    forced-color-adjust: none;
    background: LinkText;
  }
}
