/**
 * Estate Theme
 * @license MIT, https://opensource.org/license/MIT
 */

.image-text .r1-3 { --ratio: 25%; }
.image-text .r1-2 { --ratio: 33.333%; }
.image-text .r1-1 { --ratio: 50%; }
.image-text .r2-1 { --ratio: 66.666%; }
.image-text .r3-1 { --ratio: 75%; }

.image-text .start,
.image-text .end,
.image-text .grid-start,
.image-text .grid-end {
    border-radius: calc(var(--pico-border-radius) * 2);
    box-shadow: var(--pico-box-shadow);
    overflow: hidden;
}

.image-text .start,
.image-text .end {
    padding: 2rem;
}

.image-text .start::after,
.image-text .end::after {
    content: "";
    display: table;
    clear: both;
}

.image-text .start .image,
.image-text .end .image {
    max-width: var(--ratio);
    margin-bottom: 1.5rem;
}

.image-text .start .image {
    float: inline-start;
    margin-inline-end: 2rem;
}

.image-text .end .image {
    float: inline-end;
    margin-inline-start: 2rem;
}

.image-text .grid-start,
.image-text .grid-end {
    border: 1px solid var(--pico-muted-border-color);
    display: flex;
    gap: 0;
    align-items: stretch;
}

.image-text .grid-end {
    flex-direction: row-reverse;
}

.image-text .grid-start :is(.text, .cms-text),
.image-text .grid-end :is(.text, .cms-text) {
    flex: 1;
    min-width: 0;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--pico-contrast-background);
}

.image-text .grid-start .image,
.image-text .grid-end .image {
    flex: 0 0 var(--ratio);
    max-width: var(--ratio);
    background-color: transparent;
    display: flex;
    align-items: center;
}

.image-text .grid-start picture,
.image-text .grid-end picture {
    border-radius: 0;
}

.image-text picture {
    aspect-ratio: 4 / 3;
    display: block;
    overflow: hidden;
    width: 100%;
}

.image-text picture img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

@media (max-width: 767px) {
    .image-text .grid-start,
    .image-text .grid-end {
        flex-direction: column;
    }

    .image-text .grid-start .image,
    .image-text .grid-end .image {
        max-width: 100%;
        flex: 0 0 auto;
        padding: 0;
    }

    .image-text .grid-start img,
    .image-text .grid-end img {
        border-radius: 0;
        width: 100%;
    }
}
