/* Native Contao element groups. Only direct children form columns. */
.festspiele-site {
    .content-element-group:is(.cols-2, .cols-grls, .cols-grsl, .cols-45-55, .cols-55-45, .cols-3) {
        --cols-gap: clamp(1.5rem, 3%, 2.5rem);
        --cols-row-gap: 2rem;
        container: content-columns / inline-size;
        display: flex;
        flex-wrap: wrap;
        column-gap: var(--cols-gap);
        row-gap: var(--cols-row-gap);
        overflow-wrap: anywhere;

        > * {
            box-sizing: border-box;
            flex: 0 0 100%;
            min-inline-size: 0;
            margin-block: 0;
        }

        /* A plain nested group is one column containing a vertical stack. */
        > .content-element-group:not(:is(.cols-2, .cols-grls, .cols-grsl, .cols-45-55, .cols-55-45, .cols-3)) {
            display: flex;
            flex-direction: column;
            gap: var(--cols-row-gap);

            > * { min-inline-size: 0; margin-block: 0; }
        }

        :is(img, video, iframe) { max-inline-size: 100%; }
        :is(img, video) { height: auto; }
    }

    @container content-columns (min-width: 42rem) {
        .content-element-group:is(.cols-2, .cols-grls, .cols-grsl, .cols-45-55, .cols-55-45, .cols-3) {
            > :not(h1, h2, h3, h4, h5, h6, script, style, template) {
                flex-basis: calc((100% - var(--cols-gap)) / 2);
            }
        }
    }

    @container content-columns (min-width: 64rem) {
        .content-element-group.cols-grls {
            > :nth-child(odd of :not(h1, h2, h3, h4, h5, h6, script, style, template)) {
                flex-basis: calc((100% - var(--cols-gap)) * .61803398875);
            }
            > :nth-child(even of :not(h1, h2, h3, h4, h5, h6, script, style, template)) {
                flex-basis: calc((100% - var(--cols-gap)) * .38196601125);
            }
        }

        .content-element-group.cols-grsl {
            > :nth-child(odd of :not(h1, h2, h3, h4, h5, h6, script, style, template)) {
                flex-basis: calc((100% - var(--cols-gap)) * .38196601125);
            }
            > :nth-child(even of :not(h1, h2, h3, h4, h5, h6, script, style, template)) {
                flex-basis: calc((100% - var(--cols-gap)) * .61803398875);
            }
        }

        .content-element-group.cols-45-55 {
            > :nth-child(odd of :not(h1, h2, h3, h4, h5, h6, script, style, template)) {
                flex-basis: calc((100% - var(--cols-gap)) * .45);
            }
            > :nth-child(even of :not(h1, h2, h3, h4, h5, h6, script, style, template)) {
                flex-basis: calc((100% - var(--cols-gap)) * .55);
            }
        }

        .content-element-group.cols-55-45 {
            > :nth-child(odd of :not(h1, h2, h3, h4, h5, h6, script, style, template)) {
                flex-basis: calc((100% - var(--cols-gap)) * .55);
            }
            > :nth-child(even of :not(h1, h2, h3, h4, h5, h6, script, style, template)) {
                flex-basis: calc((100% - var(--cols-gap)) * .45);
            }
        }

        .content-element-group.cols-3 {
            > :not(h1, h2, h3, h4, h5, h6, script, style, template) {
                flex-basis: calc((100% - 2 * var(--cols-gap)) / 3);
            }
        }
    }
}
