// Change link
.link-change {
    position: relative;
    display: inline-block;
    margin: 0 6px;
    padding: 0 4px;
    color: $color-secondary;
    text-decoration: none;
    transition: color 200ms $ease-cubic;

    @include breakpoint (sm) {
        padding: 0 8px;
    }

    // Line
    &:after {
        content: "";
        position: absolute;
        z-index: -1;
        background-color: rgba($color-secondary, 0.22);
        width: 100%;
        height: 8px;
        bottom: 3px;
        left: 0;
        border-radius: 50vh;
        transition: all 200ms $ease-cubic;
        transition-delay: 50ms;

        @include breakpoint (sm) {
            height: 14px;
            bottom: 5px;
        }
    }

    // Icon
    .icon {
        position: relative;
        z-index: 3;
        top: -3px;
        display: inline-flex;
        justify-content: center;
        align-items: center;
        width: 22px;
        height: 22px;
        margin-left: 6px;
        background-color: #fff;
        border-radius: 50vh;

        svg {
            height: auto;
        }
    }

    // Hover
    &:hover {
        color: $color-text;

        &:after {
            background-color: rgba($color-secondary, 0.4);
        }
        svg * {
            animation-play-state: running;
        }
    }
}


// Link with animated letters
.link-translate {
    display: inline-block;

    .text {
        position: relative;
        overflow: hidden;

        &:after {
            content: attr(data-text);
            position: absolute;
            top: 50%;
            left: 0;
            width: 100%;
            text-align: center;
            transform: translateY(-50%);
            opacity: 1;
            transition: all 275ms $ease-cubic;
            will-change: transform, opacity;
        }

        span {
            display: inline-block;
            transform: translateY(-75%);
            opacity: 0;
            transition: all 275ms $ease-cubic;
            will-change: transform, opacity;
        }
    }

    // Hover
    &:hover {
        .text {
            &:after {
                transform: translateY(25%);
                opacity: 0;
            }

            span {
                transform: translateY(0);
                opacity: 1;
            }
        }
    }
}
