/**
 * Component: Text With Image
 * 
 * Styles for the Text With Image component.
 *
 * @package SCDA-2025
 */

/* Basic component styling */
.text-with-image {
    &.bg-texture {
        position: relative;
        z-index: 2;
        background-image: url('../../../assets/images/patterns/white-cloth.jpg');
        background-repeat: repeat;
        margin: 39px 0;

        @media screen and (max-width: 768px) {
            margin: 30px 0;
        }
        &:before {
            content: '';
            display: block;
            position: absolute;
            top: -39px;
            left: 0;
            width: 100%;
            height: 39px;
            background-image: url('../../../assets/images/patterns/white-cloth-top-edge.png');
            background-repeat: repeat-x;
            z-index: 1;
        }
        &:after {
            content: '';
            display: block;
            position: absolute;
            bottom: -39px;
            left: 0;
            width: 100%;
            height: 39px;
            background-image: url('../../../assets/images/patterns/white-cloth-bottom-edge.png');
            background-repeat: repeat-x;
            z-index: 1;
        }
    }
    &.image-right {
        .row {
            flex-direction: row-reverse;
        }
    }
    &.edge {
        overflow: hidden;
        
        .container {
            @media screen and (max-width: 991px) {
                width: 100%;
            }
        }
        &.image-left {
            .image {
                margin-right: -5%;
                left: calc(-5% + 15px);
                padding-left: 0;

                @media screen and (max-width: 991px) {
                    padding-right: 0;
                    margin-right: 0;
                    left: auto;
                }
                img {
                    padding-right: calc(var(--bs-gutter-x) * .5);

                    @media screen and (max-width: 991px) {
                        padding-right: 0;
                    }
                }
            }
        }
        &.image-right {
            .image {
                margin-left: -5%;
                right: calc(-5% + 15px);
                padding-right: 0;

                @media screen and (max-width: 991px) {
                    padding-left: 0;
                    margin-left: 0;
                    right: auto;
                }
                img {
                    padding-left: calc(var(--bs-gutter-x) * .5);

                    @media screen and (max-width: 991px) {
                        padding-left: 0;
                    }
                }
            }
        }
        &.image-size-half {
            .image {
                width: 55%;

                @media screen and (max-width: 991px) {
                    width: 100%;
                }
            }
        }
        &.image-size-third {
            .image {
                width: 38.33333333%;

                @media screen and (max-width: 991px) {
                    width: 100%;
                }
            }
        }
        &.image-size-quarter {
            .image {
                width: 30%;

                @media screen and (max-width: 991px) {
                    width: 100%;
                }
            }
        }
        .image {
            position: relative;
        }
        .content {
            @media screen and (max-width: 991px) {
                width: 90%;
                margin: 0 auto;
            }
        }
    }
    .image {
        margin-bottom: 0;
        
        @media screen and (max-width: 991px) {
            margin-bottom: var(--spacing-sm);
        }
        @media screen and (max-width: 576px) {
            margin-bottom: var(--spacing-xs);
        }
        img {
            width: 100%;
            height: auto;
        }
    }
    .content {
        display: flex;
        flex-direction: column;
        justify-content: center;

        @media screen and (max-width: 991px) {
            margin-top: 0;
        }
        .button-group {
            margin-bottom: var(--spacing-sm);
        }
        * {
            &:last-child {
                margin-bottom: 0;
            }
        }
    }
}