/**
 * Text neben Bild, mit getrennten Bildern fuer Desktop und Mobil.
 * Bildposition (links/rechts) ueber die Modifier-Klasse image-left / image-right.
 * Wird per AssetCollector vom Content Block geladen.
 */

.text-with-dual-image {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2.5rem;
}

.text-with-dual-image.image-right {
    flex-direction: row-reverse;
}

/* Bild oben, volle Breite (orientiert an der Content-Breite wie andere CEs) */
.text-with-dual-image.image-top {
    flex-direction: column;
    align-items: stretch;
}

.text-with-dual-image.image-top .tdi-image,
.text-with-dual-image.image-top .tdi-text {
    flex: 1 1 100%;
    width: 100%;
}

.text-with-dual-image .tdi-image {
    flex: 1 1 45%;
    min-width: 280px;
    margin: 0;
}

.text-with-dual-image .tdi-image picture,
.text-with-dual-image .tdi-image img {
    display: block;
    width: 100%;
    height: auto;
}

/* Optionale Hintergrundflaeche mit abgerundeten Ecken (Checkbox im CE).
   Farbe entspricht der frueher in die Rasterbilder eingebackenen Flaeche. */
.text-with-dual-image .tdi-image--boxed picture {
    background-color: #f8f9fd;
    border-radius: 12px;
    padding: 24px;
}

.text-with-dual-image .tdi-image figcaption {
    margin-top: 0.5rem;
}

.text-with-dual-image .tdi-text {
    flex: 1 1 45%;
    min-width: 280px;
}

.text-with-dual-image .tdi-text h1,
.text-with-dual-image .tdi-text h2,
.text-with-dual-image .tdi-text h3,
.text-with-dual-image .tdi-text h4,
.text-with-dual-image .tdi-text h5,
.text-with-dual-image .tdi-text h6 {
    margin-top: 0;
}

.text-with-dual-image .tdi-subheader {
    margin: 0.5rem 0 0;
    opacity: 0.95;
}

.text-with-dual-image .tdi-body {
    margin-top: 0.75rem;
}

.text-with-dual-image .tdi-body > :first-child {
    margin-top: 0;
}

.text-with-dual-image .tdi-body > :last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .text-with-dual-image,
    .text-with-dual-image.image-right {
        flex-direction: column;
        gap: 1.5rem;
    }

    .text-with-dual-image .tdi-image,
    .text-with-dual-image .tdi-text {
        flex-basis: 100%;
        width: 100%;
    }

    /* SVGs mobil nicht auf volle Breite aufziehen, sondern begrenzen
       und zentrieren (Rasterbilder bleiben volle Breite).
       #content-Variante noetig, da layout.css "#content img" per
       ID-Spezifitaet sonst die max-width ueberschreibt. */
    #content .text-with-dual-image .tdi-image img[src$=".svg"],
    .text-with-dual-image .tdi-image img[src$=".svg"] {
        max-width: 460px;
        margin-left: auto;
        margin-right: auto;
    }
}
