/* ==========================================================
   DGM – Individuelle Inhaltselemente
   Bild-Text, Bildtrenner und Bildergruppen
   ========================================================== */


/* 1. BILD UND TEXT */

.dgm-image-text {
    display: grid;
    grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
    width: 100%;
    margin: 2rem 0;
}

.dgm-image-text__images,
.dgm-image-text__content {
    min-width: 0;
}

.dgm-image-text--left .dgm-image-text__images {
    grid-column: 1;
    grid-row: 1;
}

.dgm-image-text--left .dgm-image-text__content {
    grid-column: 2;
    grid-row: 1;
}

.dgm-image-text--right {
    grid-template-columns: minmax(0, 1fr) minmax(0, 40%);
}

.dgm-image-text--right .dgm-image-text__content {
    grid-column: 1;
    grid-row: 1;
}

.dgm-image-text--right .dgm-image-text__images {
    grid-column: 2;
    grid-row: 1;
}

.dgm-image-text__images {
    display: grid;
    gap: .75rem;
}

.dgm-image-text__images figure {
    margin: 0;
}

.dgm-image-text__images a {
    display: inline-block;
    max-width: 100%;
}

.dgm-image-text__images img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: contain;
    border-radius: 10px;
}

.dgm-image-text__images figcaption {
    margin-top: .4rem;
    font-size: .9rem;
    color: #555;
}

.dgm-image-text__content h2 {
    margin-top: 0;
    color: #002060;
}


/* 2. BILDTRENNER */

.dgm-image-divider {
    margin: 2.5rem 0;
    width: 100%;
}

.dgm-image-divider figure {
    margin: 0;
}

.dgm-image-divider img {
    display: block;
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 10px;
}

.dgm-image-divider figcaption {
    margin-top: .6rem;
    font-size: .9rem;
    color: #555;
}


/* 3. BILDERGRUPPE */

.dgm-image-group {
    margin: 2rem auto;
    width: 100%;
    min-width: 0;
    text-align: center;
}

.dgm-image-group h2 {
    color: #002060;
    margin-bottom: 1rem;
}

.dgm-image-group__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    margin: 0 auto;
}

.dgm-image-group figure {
    margin: 0;
    min-width: 0;
}

.dgm-image-group__grid figure {
    flex: 0 1 auto;
    width: auto;
    max-width: 100%;
    text-align: center;
}

.dgm-image-group a {
    display: block;
}

.dgm-image-group__grid a {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
}

.dgm-image-group img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
}

.dgm-image-group__grid img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 180px;
    aspect-ratio: auto;
    object-fit: contain;
    background: transparent;
}

.dgm-image-group figcaption {
    margin-top: .5rem;
    font-size: .9rem;
    color: #555;
}

.dgm-image-group__grid figcaption {
    max-width: 260px;
    margin: .5rem auto 0;
}


/* 4. RESPONSIVE DARSTELLUNG */

@media (max-width: 700px) {
    .dgm-image-text,
    .dgm-image-text--right {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .dgm-image-text__images,
    .dgm-image-text__content {
        width: 100%;
    }

    .dgm-image-text__images {
        order: 0;
    }

    .dgm-image-text__content {
        order: 1;
    }

    .dgm-image-text__images img {
        max-height: 340px;
    }
}

@media (max-width: 600px) {
    .dgm-image-group__grid {
        gap: 10px;
    }

    .dgm-image-group__grid figure {
        max-width: 100%;
    }

    .dgm-image-group__grid img {
        max-height: 150px;
    }

    .dgm-image-divider img {
        max-height: 220px;
    }
}
