.section-with-text-and-image {
    display: flex;
    gap: 1.5em;
    align-items: center;
    margin: 1.5em 0;
}

/* left: image on the left (default) */
.section-with-text-and-image[data-layout="left"] .image {
    order: 1;
}
.section-with-text-and-image[data-layout="left"] .body {
    order: 2;
}

/* right: image on the right */
.section-with-text-and-image[data-layout="right"] .image {
    order: 2;
}
.section-with-text-and-image[data-layout="right"] .body {
    order: 1;
}

/* top: image above text */
.section-with-text-and-image[data-layout="top"] {
    flex-direction: column;
}

/* bottom: image below text */
.section-with-text-and-image[data-layout="bottom"] {
    flex-direction: column-reverse;
}

.section-with-text-and-image .image {
    width: 40%;
    height: auto;
    border-radius: 6px;
}

.section-with-text-and-image[data-layout="top"] .image,
.section-with-text-and-image[data-layout="bottom"] .image {
    width: 100%;
}

.section-with-text-and-image .body {
    flex: 1;
}

.section-with-text-and-image .header {
    margin: 0 0 0.5em 0;
    font-size: 1.5em;
    text-align: center;
}

.section-with-text-and-image .text {
    margin: 0;
}

@media (max-width: 600px) {
    .section-with-text-and-image {
        flex-direction: column;
    }
    .section-with-text-and-image .image {
        width: 100%;
        order: 1;
    }
    .section-with-text-and-image .body {
        order: 2;
    }
}
