﻿.block__textimage {
    padding: var(--padding-lg) 0;
    text-align: center;
}

.block__courses + .block__textimage {
    padding-top: 6rem;
}

.textimage__image {
    width: calc(100% - 4.4rem);
    margin-left: 2.2rem;
    line-height: 0;
    margin-top: 4rem;
    margin-bottom: 5rem;
    position: relative;
}

    .textimage__image:before {
        content: "";
        width: 100%;
        height: 100%;
        position: absolute;
        top: -1.5rem;
        left: -1.5rem;
        padding: 1.5rem 1.5rem 1.2rem;
        clip-path: polygon(0 2%, 100% 0, 98% 100%, 2% 100%);
        background-color: var(--bordercolor);
    }

    .textimage__image:has(> .textimage__bg):before {
        padding: 2rem 2.2rem;
        top: -2rem;
        left: -2.2rem;
    }

    .textimage__image img {
        width: 100%;
        height: auto;
        position: relative;
    }

.textimage__bg {
    aspect-ratio: 730 / 500;
    position: relative;
}

    .textimage__bg img {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
    }

.textimage__text {
    display: flex;
    flex-flow: column;
    justify-content: center;
    height: 100%;
}

    .textimage__text h3 {
        margin-bottom: 3rem;
        transform: rotate(-1.5deg);
    }

        .textimage__text h3 span {
            display: inline-flex;
            white-space: nowrap;
            background-color: var(--red);
            color: var(--white);
            padding: .8rem 1.5rem 0;
            margin: .2rem 0 .6rem;
            clip-path: polygon(1% 8%, 100% 0, 97% 100%, 4% 100%);
        }

            .textimage__text h3 span:has(+br+span) {
                margin-bottom: .2rem;
            }

    .textimage__text:not(.textimage__text--left) {
        align-items: center;
    }

    .textimage__text.textimage__text--left {
        text-align: left;
        align-items: flex-start;
    }

    .textimage__text .button {
        margin-top: 3rem;
    }

@media(max-width: 991px) {
    .block__textimage .row > div:first-of-type {
        order: 0 !important;
    }
    .block__textimage .row > div:last-of-type {
        order: 1 !important;
    }
}

@media(min-width: 992px) {
    .block__courses + .block__textimage {
        padding-top: 16rem;
    }

    .block__textimage:has(+.block__socials) {
        padding-bottom: 12rem;
    }

    .textimage__image {
        width: calc(100% - 9rem);
        margin-top: 4rem;
        margin-left: 4.5rem;
        margin-bottom: 4rem;
    }

        .textimage__image:before {
            padding: 2.5rem 3rem 2rem;
            top: -2.5rem;
            left: -3rem
        }

        .textimage__image:has(> .textimage__bg):before {
            padding: 4rem 4.5rem 3.5rem;
            top: -4rem;
            left: -4.5rem
        }

    .textimage__text h3 span:has(+br+span),
    .textimage__text h3 span {
        margin-bottom: .6rem;
    }

    .textimage__text.textimage__text--left {
        padding-left: 2rem;
    }
}
