/* ========================================
   TYPO3 Textpic Layout 12 - BEIDE VARIANTEN
   frame-default = 50/50
   frame-indent-right = 66/33 (Box 2/3)
   ======================================== */

/* Container - Für BEIDE */
.frame-layout-12.frame-type-textpic {
    padding: 0;
    margin: 66px 0 0 0;
    background: transparent;
}

.frame-layout-12 .ce-textpic {
    max-width: 1433px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
}

/* ========================================
   VARIANTE 1: 50/50 (frame-default)
   Box 50%, Bild 60% (mit Overlap)
   ======================================== */

/* Bild bei 50/50 */
.frame-layout-12.frame-default .ce-gallery {
    flex: 0 0 60%;
    max-width: 60%;
    position: relative;
    overflow: hidden;
    z-index: 1;
    min-height: 650px;
    display: flex;
    align-items: center;
}

/* Box bei 50/50 */
.frame-layout-12.frame-default .ce-bodytext {
    flex: 0 0 50%;
    max-width: 50%;
    margin-right: -154px;
    align-self: center;
}

/* ========================================
   VARIANTE 2: 66/33 (frame-indent-right)
   Box 66% (2/3), Bild 44% (um Overlap auszugleichen)
   ======================================== */

/* Bild bei 66/33 - SCHMALER */
.frame-layout-12.frame-indent-right .ce-gallery {
    flex: 0 0 44%;
    max-width: 44%;
    position: relative;
    overflow: hidden;
    z-index: 1;
    min-height: 650px;
    display: flex;
    align-items: center;
}

/* Box bei 66/33 - BREITER (2/3) */
.frame-layout-12.frame-indent-right .ce-bodytext {
    padding: 50px;
    flex: 0 0 66.666%;
    max-width: 66.666%;
    margin-right: -165px;
    align-self: center;
}

/* ========================================
   Gallery/Bild Styling (für BEIDE)
   ======================================== */

.frame-layout-12 .ce-gallery .ce-row,
.frame-layout-12 .ce-gallery .ce-column {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.frame-layout-12 .ce-gallery figure {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
}

.frame-layout-12 .ce-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Bild rechtsbündig */
.frame-layout-12 .ce-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* ========================================
   Box Styling (für BEIDE)
   ======================================== */

.frame-layout-12 .ce-bodytext {
    background: #e73331;
    color: #ffffff;
    padding: 66px 0px 66px 66px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
    border-radius: 8px;

    /* Box überlappt VON LINKS ins Bild */
    margin-right: -154px; /* Overlap von links! */
}

/* Text Styling */
.frame-layout-12 .ce-bodytext p {
    font-size: 1.25rem;
    font-weight: 200;
    margin: 0 0 40px 0;
    line-height: 1.8;
    color: #ffffff;
}

.frame-layout-12 .ce-bodytext p strong {
    color: #FFFFFF;
    font-weight: 700;
}

.frame-layout-12 .ce-bodytext h2 {
    font-size: 2.25rem;
    font-weight: 200;
    line-height: 1.3;
    margin: 0 0 22px 0;
    color: #ffffff;
}

/* "wie hausgemacht" fett */
.frame-layout-12 .ce-bodytext h2 strong {
    font-weight: 500;
    color: #ffffff;
}

/* Alle Texte weiß */
.frame-layout-12 .ce-bodytext,
.frame-layout-12 .ce-bodytext * {
    color: #FFFFFF !important;
}

/* Links */
.frame-layout-12 .ce-bodytext a {
    color: #FFFFFF !important;
    text-decoration: underline;
}

.frame-layout-12 .ce-bodytext a:hover {
    text-decoration: none;
}

/* ========================================
   Reihenfolge
   ======================================== */

.frame-layout-12 .ce-textpic.ce-right {
    flex-direction: row-reverse;
}

.frame-layout-12 .ce-gallery {
    order: 1;
}

.frame-layout-12 .ce-bodytext {
    order: 2;
}




/* ========================================
   Responsive - Desktop
   ======================================== */

@media (max-width: 1600px) {
    .frame-layout-12 .ce-gallery {
        min-height: 600px;
    }
}

@media (max-width: 1400px) {
    /* 50/50 Variante */
    .frame-layout-12.frame-default .ce-bodytext {
        margin-right: -120px;
        padding: 70px 50px;
    }

    /* 66/33 Variante */
    .frame-layout-12.frame-indent-right .ce-bodytext {
        margin-right: -120px;
        padding: 70px 50px;
        flex: 0 0 63%;
        max-width: 63%;
    }

    .frame-layout-12.frame-indent-right .ce-gallery {
        flex: 0 0 45%;
        max-width: 45%;
    }

    .frame-layout-12 .ce-gallery {
        min-height: 550px;
    }
}

@media (max-width: 1200px) {
    /* 50/50 Variante */
    .frame-layout-12.frame-default .ce-bodytext {
        padding: 60px 50px;
        margin-right: -100px;
        flex: 0 0 50%;
        max-width: 50%;
    }

    .frame-layout-12.frame-default .ce-gallery {
        flex: 0 0 55%;
        max-width: 55%;
    }

    /* 66/33 Variante */
    .frame-layout-12.frame-indent-right .ce-bodytext {
        padding: 60px 50px;
        margin-right: -100px;
        flex: 0 0 60%;
        max-width: 60%;
    }

    .frame-layout-12.frame-indent-right .ce-gallery {
        flex: 0 0 48%;
        max-width: 48%;
    }

    .frame-layout-12 .ce-gallery {
        min-height: 500px;
    }

    .frame-layout-12 .ce-bodytext h2,
    .frame-layout-12 .ce-bodytext h3 {
        font-size: 2rem;
    }

    .frame-layout-12 .ce-bodytext p {
        margin-bottom: 30px;
    }
}

/* ========================================
   Responsive - Tablet
   ======================================== */

@media (max-width: 991px) {
    /* Beide Varianten gleich machen auf Tablet */
    .frame-layout-12 .ce-bodytext {
        padding: 50px 40px;
        margin-right: -60px !important;
        flex: 0 0 52% !important;
        max-width: 52% !important;
    }

    .frame-layout-12 .ce-gallery {
        flex: 0 0 52% !important;
        max-width: 52% !important;
        min-height: 450px;
    }

    .frame-layout-12 .ce-bodytext h2,
    .frame-layout-12 .ce-bodytext h3 {
        font-size: 1.75rem;
    }

    .frame-layout-12 .ce-bodytext p {
        font-size: 1.125rem;
    }
}

/* ========================================
   Responsive - Mobile
   ======================================== */

@media (max-width: 768px) {
    .frame-layout-12.frame-type-textpic {
        margin: 50px 0;
    }

    /* BEIDE Varianten stacken */
    .frame-layout-12 .ce-textpic {
        flex-direction: column !important;
    }

    .frame-layout-12 .ce-bodytext,
    .frame-layout-12.frame-default .ce-bodytext {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        order: 1;
        padding: 50px 30px;
        margin-right: 0 !important;
        margin-left: 0 !important;
        margin-bottom: -50px;
        border-radius: 8px;
        z-index: 2;
    }

    .frame-layout-12 .ce-gallery,
    .frame-layout-12.frame-default .ce-gallery {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        order: 2;
        min-height: 400px;
        z-index: 1;
    }

    /* Bild zentriert auf Mobile */
    .frame-layout-12 .ce-row {
        justify-content: center;
    }

    .frame-layout-12 .ce-bodytext h2,
    .frame-layout-12 .ce-bodytext h3 {
        font-size: 1.5rem;
    }

    .frame-layout-12 .ce-bodytext p {
        font-size: 1.1rem;
        margin-bottom: 25px;
    }
}

@media (max-width: 576px) {
    .frame-layout-12 .ce-bodytext {
        padding: 40px 25px;
        margin-bottom: -40px;
    }

    .frame-layout-12 .ce-gallery {
        min-height: 350px;
    }

    .frame-layout-12 .ce-bodytext h2,
    .frame-layout-12 .ce-bodytext h3 {
        font-size: 1.35rem;
    }

}

/* ========================================
   Animation
   ======================================== */

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-80px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInImage {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.frame-layout-12 .ce-gallery {
    animation: fadeInImage 0.8s ease-out;
}

.frame-layout-12 .ce-bodytext {
    animation: slideInFromLeft 0.8s ease-out 0.2s backwards;
}

/* ========================================
   Print
   ======================================== */

@media print {
    .frame-layout-12 .ce-textpic {
        flex-direction: column !important;
        page-break-inside: avoid;
    }

    .frame-layout-12 .ce-bodytext {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
        background: #e73331 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .frame-layout-12 .ce-gallery {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        min-height: 400px;
    }
}