.s-anchors {
    --_an-a-fc: var(--theme-link-color, var(--black-600));
    --_an-a-fc-hover: var(--theme-link-color-hover, var(--blue-400));
    --_an-a-fc-visited: var(--theme-link-color-visited, var(--black-400));

    // CONTEXTUAL STYLES
    .highcontrast-mode({
        a[href] {
            text-decoration: underline;
        }
    });

    // MODIFIERS
    &&__underlined {
        a:not(.s-link),
        .s-btn.s-btn__link {
            text-decoration: underline;
        }
    }

    // VARIANTS
    &&__danger {
        --_an-a-fc: var(--red-400);
        --_an-a-fc-hover: var(--red-500);
        --_an-a-fc-visited: var(--red-600);
    }

    &&__grayscale {
        --_an-a-fc: var(--black-500);
        --_an-a-fc-hover: var(--black-600);
    }

    &&__inherit {
        a:not(.s-link):not(.s-btn),
        .s-btn.s-btn__link {
            // This ensures inherited colors are applied instead of generic link colors targeting `a`
            // See lib/components/link/link.less
            color: var(--_an-a-fc) !important;
        }

        --_an-a-fc: inherit;
        --_an-a-fc-hover: inherit;
        --_an-a-fc-visited: inherit;
    }

    &&__muted {
        --_an-a-fc: var(--black-400);
    }

    p& > a[href],
    p > a[href] {
        text-decoration: underline;
    }

    a:not(.s-link),
    .s-btn.s-btn__link {
        &:active,
        &:hover {
            color: var(--_an-a-fc-hover);
            text-decoration: underline;
        }

        color: var(--_an-a-fc, inherit);
        text-decoration: none;
    }

    a:not(.s-link):visited {
        &:hover {
            color: var(--_an-a-fc-hover, inherit);
        }

        color: var(--_an-a-fc-visited, inherit);
    }
}
