//
// Link widget styles
//

%link,
*:link
{
    color: $link_color;

    &:visited
    {
        color: $link_visited_color;

        *:selected &
        {
            color: mix($selected_fg_color, $link_visited_color, 60%);
        }
    }

    &:hover
    {
        $_fg:  lighten($link_color, 10%);
        color: $_fg;

        *:selected &
        {
            color: mix($selected_fg_color, $_fg, 90%);
        }
    }

    &:active
    {
        color: $link_color;

        *:selected &
        {
            color: mix($selected_fg_color, $link_color, 80%);
        }
    }

    &:disabled,
    &:disabled:backdrop
    {
        color: transparentize(desaturate($link_color, 100%), 0.2);
    }

    &:backdrop
    {
        &:backdrop:hover,
        &:backdrop:hover:selected,
        &
        {
            color: transparentize($link_color, 0.1);
        }
    }

    @at-root %link_selected,
    &:selected,
    *:selected &
    {
        color: mix($selected_fg_color, $link_color, 80%);
    }
}

button:link,
button:visited
{
    @extend %undecorated_button;

    @extend %link;

    text-shadow: none;

    &:hover,
    &:active,
    &:checked
    {
        @extend %undecorated_button;

        text-shadow: none;
    }

    > label
    {
        @extend %link;

        text-decoration-line: underline;
    }
}
