/* -------------------------------------------
    Text Marquee Widget
---------------------------------------------- */
@import '../../assets/sass/config';
@import '../../assets/sass/mixins';
@import '../../assets/sass/direction';

.marquee {
    --wolmart-marquee-animation-duration: 25s;
    --wolmart-marquee-color: var(--wolmart-heading-color);
    --wolmart-marquee-hover-color: var(--wolmart-heading-color);
    --wolmart-marquee-item-spacing: .2em;
    --wolmart-marquee-stroke-color: var(--wolmart-heading-color);
    --wolmart-marquee-stroke-hover-color: var(--wolmart-heading-color);
    --wolmart-marquee-fill-color: transparent;
    --wolmart-marquee-fill-hover-color: transparent;
    --wolmart-marquee-stroke-width: 2px;
    --wolmart-marquee-image-size: 300px;

    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    font-size: 8rem;
}

.marquee-inner-content {
    color: var(--wolmart-marquee-color);
    animation: marquee-animation linear infinite var(--wolmart-marquee-animation-duration);
    transition: color .3s, -webkit-text-fill-color .3s, -webkit-text-stroke-color .3s;

    &:hover {
        color: var(--wolmart-marquee-hover-color);
    }
}

.mq-anim-direction-rtl .marquee-inner-content {
    transform: translateX(20%);
    animation: marquee-animation-reverse linear infinite var(--wolmart-marquee-animation-duration);
}

.mq-layout-vertical {
    display: flex;
    flex-direction: column;
}

/* Text Marquee */
.mq-type-text {
    .marquee-inner-content {
        transform: translateX(-20%);
    }

    .text-marquee {
        padding-#{$left}: var(--wolmart-marquee-item-spacing);
    }
}

.mq-text-type-outline .marquee-inner-content {
    -webkit-text-stroke-width: var(--wolmart-marquee-stroke-width);
    -webkit-text-stroke-color: var(--wolmart-marquee-stroke-color);
    -webkit-text-fill-color: var(--wolmart-marquee-fill-color);

    &:hover {
        -webkit-text-stroke-color: var(--wolmart-marquee-stroke-hover-color);
        -webkit-text-fill-color: var(--wolmart-marquee-fill-hover-color);
    }
}

/* Image Marquee */
.mq-type-image {
    .marquee-inner-content {
        display: flex;
    }

    &.mq-layout-horizontal .marquee-inner-content {
        flex: 0 0 auto;
        height: var(--wolmart-marquee-image-size);
        overflow: hidden;

        img {
            margin-#{$left}: var(--wolmart-marquee-item-spacing);
            height: var(--wolmart-marquee-image-size);
        }
    }

    &.mq-layout-vertical {
        max-height: var(--wolmart-marquee-height);
    }

    &.mq-layout-vertical .marquee-inner-content {
        transform: translateY(-20%);
        flex-direction: column;
        animation: marquee-vertical-animation linear infinite var(--wolmart-marquee-animation-duration);

        img {
            margin-top: var(--wolmart-marquee-item-spacing);
            width: var(--wolmart-marquee-image-size);
        }
    }

    &.mq-anim-direction-down .marquee-inner-content {
        transform: translateY(20%);
        animation: marquee-vertical-animation-reverse linear infinite var(--wolmart-marquee-animation-duration);
    }
}

@keyframes marquee-animation {
    from {
        transform: translateX(-20%);
    }

    to {
        transform: translateX(-120%);
    }
}

@keyframes marquee-animation-reverse {
    from {
        transform: translateX(20%);
    }

    to {
        transform: translateX(120%);
    }
}

@keyframes marquee-vertical-animation {
    from {
        transform: translateY(-20%);
    }

    to {
        transform: translateY(-120%);
    }
}

@keyframes marquee-vertical-animation-reverse {
    from {
        transform: translateY(20%);
    }

    to {
        transform: translateY(120%);
    }
}