.image-text-pair-left,
.image-text-pair-right {
    display: flex;
    align-items: stretch;
    gap: 2rem;
    margin-right: auto;
    overflow: hidden;
}

.image-text-pair-left .image-container,
.image-text-pair-right .image-container {
    flex: 1;
    max-width: 50%;
    display: flex;
    align-self: stretch;
}

.image-text-pair-left img,
.image-text-pair-right img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-text-pair-left .image-container,
.image-text-pair-right .image-container {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.image-text-pair-left .text-container,
.image-text-pair-right .text-container {
    width: 32%;
    margin: 50px 50px;
}

.image-text-pair-left {
    flex-direction: row;
}

.image-text-pair-left p,
.image-text-pair-left h1,
.image-text-pair-left h2,
.image-text-pair-left h3,
.image-text-pair-left h4,
.image-text-pair-left h5 {
    text-align: left;
}

.image-text-pair-right {
    flex-direction: row-reverse;
}

.image-text-pair-right p,
.image-text-pair-right h1,
.image-text-pair-right h2,
.image-text-pair-right h3,
.image-text-pair-right h4,
.image-text-pair-right h5 {
    text-align: right;
}

.image-text-pair-right h3,
.image-text-pair-left h3 {
    margin: 60px 0px;
}

/* Tablet styles */
@media (max-width: 768px) {
    .image-text-pair-left,
    .image-text-pair-right {
        flex-direction: column;
        gap: 1rem;
    }

    .image-text-pair-left .image-container,
    .image-text-pair-right .image-container {
        max-width: 100%;
        order: -1;
        min-height: 300px;
    }

    .image-text-pair-left .text-container,
    .image-text-pair-right .text-container {
        width: 90%;
        margin: 30px auto;
        text-align: center !important;
    }

    .image-text-pair-left p,
    .image-text-pair-left h1,
    .image-text-pair-left h2,
    .image-text-pair-left h3,
    .image-text-pair-left h4,
    .image-text-pair-left h5,
    .image-text-pair-right p,
    .image-text-pair-right h1,
    .image-text-pair-right h2,
    .image-text-pair-right h3,
    .image-text-pair-right h4,
    .image-text-pair-right h5 {
        text-align: center !important;
    }

    .image-text-pair-left img,
    .image-text-pair-right img {
        max-width: 100%;
    }
}

/* Mobile styles */
@media (max-width: 480px) {
    .image-text-pair-left .image-container,
    .image-text-pair-right .image-container {
        min-height: 250px;
    }

    .image-text-pair-left .text-container,
    .image-text-pair-right .text-container {
        width: 95%;
        margin: 20px auto;
    }
}
