.image-text-block {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.image-text-block .image-text-image {
    flex: 1;
}

.image-text-block .image-text-image img {
    width: 100%;
    height: auto;
    display: block;
}

.image-text-block .image-text-figure {
    display: table;
    margin: 0;
    max-width: 100%;
}

.image-text-block .image-text-content {
    flex: 1;
}

.image-text-block .image-text-content ul,
.image-text-block .image-text-content ol {
    padding-left: 1.5em;
}

.image-text-block .image-text-content li {
    margin-bottom: 0.8em;
    line-height: 1.6;
}

.image-text-block .image-text-content p {
    line-height: 1.6;
}

/* Image link */
.image-text-block .image-text-figure a {
    display: block;
    text-decoration: none;
}

/* Image caption */
.image-text-block .image-text-caption {
    display: table-caption;
    caption-side: bottom;
    margin-top: 6px;
    font-size: 0.8em;
    color: inherit;
}

/* Reset WordPress block wrappers inside content area */
.image-text-block .image-text-content .container {
    padding-left: 0;
    padding-right: 0;
}

.image-text-block .image-text-content .row {
    margin-left: 0;
    margin-right: 0;
}

.image-text-block .image-text-content [class*="col"] {
    padding-left: 0;
    padding-right: 0;
}

/* Side-by-side: image-right via flex order */
.image-text-block.image-right .image-text-image { order: 2; }
.image-text-block.image-right .image-text-content { order: 1; }
.image-text-block.image-right .image-text-image {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Flow-around mode: float-based, disables flexbox */
.image-text-block.layout-flow { display: block; }
.image-text-block.layout-flow::after { content: ""; display: table; clear: both; }
.image-text-block.layout-flow .image-text-image { display: block; }
.image-text-block.layout-flow .image-text-content { overflow: visible; }
.image-text-block.layout-flow.image-left .image-text-image { float: left; margin-bottom: 15px; }
.image-text-block.layout-flow.image-right .image-text-image { float: right; margin-bottom: 15px; }

@media (max-width: 767px) {
    .image-text-block {
        gap: 20px !important;
        align-items: stretch;
    }

    .image-text-block.mobile-image-first {
        flex-direction: column;
    }

    .image-text-block.mobile-text-first {
        flex-direction: column-reverse;
    }

    /* Reset order for image-right in mobile */
    .image-text-block.image-right .image-text-image,
    .image-text-block.image-right .image-text-content { order: unset; }

    /* Center image on mobile */
    .image-text-block .image-text-image,
    .image-text-block.image-right .image-text-image {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Flow mode mobile: switch to flex column */
    .image-text-block.layout-flow {
        display: flex;
        flex-direction: column;
    }
    .image-text-block.layout-flow::after { display: none; }
    .image-text-block.layout-flow .image-text-image {
        float: none;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .image-text-block.layout-flow.mobile-text-first {
        flex-direction: column-reverse;
    }
}
