@layer components {

    @property --image-text-vertical-alignment {
        syntax: "start|center|end";
        initial-value: start;
        inherits: false;
    }

    @property --image-text-columns {
        syntax: "*";
        initial-value: fit-content(100%) auto;
        inherits: false;
    }

    @property --image-text-background-color {
        syntax: "<color>";
        initial-value: #F3F4F5;
        inherits: false;
    }

    @property --image-text-heading-color {
        syntax: "<color>";
        initial-value: #333333;
        inherits: true;
    }

    content-block[type="image-text-block"] > .image-text-content, .image-text-list > .image-text-content {
        display: grid;
        grid-template-columns: var(--image-text-columns);
        gap: var(--size-4);
        align-items: var(--image-text-vertical-alignment);
        padding: var(--size-8) var(--size-4);

        &[center] {
            --image-text-columns: 1fr;
            justify-items: center;
            text-align: center;
            gap: var(--size-4);
        }

        content-block:has(> &) {
            background-color: var(--image-text-background-color);
        }

        .image-text-list:has(> &) {
            :nth-of-type(even) {
              background-color: var(--image-text-background-color);
            }
        }

        .sub-heading {
            display: block;
            margin-bottom: var(--size-3);
            color: var(--image-text-heading-color);
        }

        :is(img) {
            justify-self: var(--image-text-image-alignment, end);
            max-width: 100%;
            height: auto;
            object-fit: contain;
        }

        @media screen and (min-width: 768px) {
            gap: var(--size-9);
        }
    }
}
