@import '../../../styles/definitions/breakpoints';
@import '../../../styles/definitions/colors';
@import '../../../constants/modifiers';
@import '../../../styles/mixins';
@import "../../../styles/grid.scss";

$namespace: ".carouselSlideText";
$wrapper-selector: "#{$namespace}_wrapper";

// Component Styles
#{$namespace} {
    &_wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        background-color: var(--background-color, transparent);
        text-align: var(--text-alignment, left);
        font-size: $headingFontSize6;
        color: var(--text-color, $body-color);
        
        &--has-background {
            border-radius: 8px;
            padding: 12px;
        }

        @include media-lg-up {
            padding-left: calc(100% / 12);
            padding-right: calc(100% / 12);

            &--text-size-small {
                font-size: $headingFontSize4;
            }
            &--text-size-medium {
                font-size: $headingFontSize2;
            }
            &--text-size-large {
                font-size: $headingFontSize1;
            }
        }
    }
    &_content {
        display: flex;
        align-items: center;
        width: 100%;
        height: 100%;

        #{$wrapper-selector}--image-left & {
            @include media-md-up {
                flex-direction: row-reverse;
            }
        }

        @include media-md-down {
            flex-direction: column-reverse;
        }
    }
    &_text,
    &_image {
        a:focus {
            outline: none;
        }
    }
    &_text + &_image {
        @include media-md-up {
            $spacing: $grid-gutter-width * 2;
            padding-left: $spacing;

            #{$wrapper-selector}--image-left & {
                padding-left: 0;
                padding-right: $spacing;
            }
        }
        @include media-md-down {
            margin-bottom: $grid-gutter-width;
        }
    }
    &_text {
        display: flex;
        flex-direction: column;
        flex-grow: 1;

        @include media-md-down {
            width: 100%;
            height: 100%;
        }
        @include media-md-up {
            margin-top: 0;
        }
    }
    &_image {
        position: relative;
        width: 100%;
        height: 100%;

        img {
            @include fit(contain, right);
            display: block;
            width: 100%;
            height: 100%;

            @include media-md-down {
                position: absolute;
                top: 0;
                left: 0;
                @include fit(contain, left);
            }
        }

        @include media-md-up {
            max-width: 50%;
            max-height: 75%;
        }
    }
    &_title {
        @include title-3;

        @include media-md-up {
            @include title-xxLarge;
            line-height: 1.2;
        }
    }
    &_description {
        flex-grow: 1;
        opacity: 0.8;
    }
    &_button {
        @include word-wrap;
        margin-top: 16px;
    }
}
