/* Explicit widths prevent empty, absolutely positioned contents collapsing. */
.vereins-logos > .uk-width-1-4 {
    box-sizing: border-box;
    width: 25%;
    flex: 0 0 25%;
    min-width: 0;
}
.vereins-logos--group {
    width: 100%;
    min-width: 0;
}
.vereins-logos .vereins-logos--imagecontainer > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.vereins-logos .vereins-logos--imagecontainer.fullcover > img {
    object-fit: cover;
}

/* Two adjacent logos wider than 4:1 share two columns, stacked vertically. */
.vereins-logos > .vereins-logos--stacked {
    width: 50%;
    flex: 0 0 50%;
}
.vereins-logos--stacked > .vereins-logos--group {
    display: grid;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 10px;
    aspect-ratio: 100 / 33;
}
.vereins-logos--stacked .teaser {
    padding-top: 0;
    min-height: 0;
}

/* Preserve the Bildungsportal's two-column layout on small screens. */
@media (max-width: 639px) {
    .vereins-logos--responsive > .uk-width-1-4 {
        width: 50%;
        flex-basis: 50%;
    }
    .vereins-logos--responsive > .vereins-logos--stacked {
        width: 100%;
        flex-basis: 100%;
    }
}

/* Footer themes override the generic grid and fix individual logos at 83px. */
footer .frame-type-clubLogos .vereins-logos > .uk-width-1-4 {
    flex: 0 0 25%;
    min-width: 0;
}
footer .frame-type-clubLogos .vereins-logos > .vereins-logos--stacked {
    flex: 0 0 50%;
    width: 50%;
}
footer .frame-type-clubLogos .vereins-logos .vereins-logos--stacked > .vereins-logos--group {
    /* Two 83px logos plus the existing 15px column gutter. */
    max-width: 181px;
    height: 90px;
    padding-top: 10px;
    aspect-ratio: auto;
    gap: 5px;
}
footer .frame-type-clubLogos .vereins-logos .vereins-logos--stacked .teaser {
    padding-top: 0;
    max-width: none;
    width: 100%;
}
footer .frame-type-clubLogos .vereins-logos .vereins-logos--stacked .vereins-logos--imagecontainer {
    margin-top: 0;
    margin-bottom: 0;
}
@media (max-width: 959px) {
    footer .frame-type-clubLogos .vereins-logos .vereins-logos--stacked > .vereins-logos--group {
        max-width: none;
        height: auto;
        aspect-ratio: 2 / 1;
    }
}
@media (max-width: 639px) {
    footer .frame-type-clubLogos .vereins-logos--responsive > .uk-width-1-4 {
        flex-basis: 50%;
    }
    footer .frame-type-clubLogos .vereins-logos--responsive > .vereins-logos--stacked {
        flex-basis: 100%;
        width: 100%;
    }
    footer .uk-grid > .uk-grid-margin {
        margin-top: 10px;
    }
}
