/* Frontend Styles für Content-Image-Overlap Block */

/* Bereits vorhandene .ce-textpic Styles werden aus main.css verwendet */
/* Hier kommen nur spezifische Anpassungen für den Überlappungseffekt */

/* WordPress fügt wp-block-group wrapper hinzu */
.wp-block-group.ce-textpic.ce-nowrap,
.ce-textpic.ce-nowrap {
    display: flex !important;
    flex-direction: column;
    position: relative;
    margin: 0 !important;
    padding-top: 80px;
}

/* Weniger Abstand wenn kein Bild vorhanden */
.ce-textpic.ce-textonly {
    padding-top: 20px;
}

/* Fix für WordPress Group Blocks */
.wp-block-group.ce-textpic > .wp-block-group,
.wp-block-group.ce-gallery > .wp-block-group,
.wp-block-group.ce-bodytext > .wp-block-group {
    width: 100%;
    margin: 0;
    padding: 0 !important;
}

/* Remove default WordPress spacing */
.wp-block-group.ce-textpic.ce-nowrap > .wp-block-group {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Basis-Layout für mobile */
.ce-textpic.ce-nowrap .ce-gallery,
.wp-block-group.ce-gallery {
    width: 100%;
    z-index: 1;
}

.ce-textpic.ce-nowrap .ce-bodytext,
.wp-block-group.ce-bodytext {
    width: 100%;
    margin-top: -80px;
    z-index: 2;
    padding: 0 1.25rem;
}

.ce-textpic.ce-nowrap .ce-bodytext__inner {
    background: #fff;
    padding: 1.875rem 1.5625rem;
}

.ce-textpic.ce-nowrap .ce-bodytext__inner header h2 {
    color: #d68a27;
    font-size: 2.75rem;
    font-weight: 900;
    margin-top: 0;
    margin-bottom: 1.25rem;
    line-height: 1.2;
}

.ce-textpic.ce-nowrap .ce-bodytext__inner p {
    color: #000;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.ce-textpic.ce-nowrap .ce-bodytext__inner p:last-child {
    margin-bottom: 0;
}

.ce-textpic.ce-nowrap .ce-bodytext__inner h4 {
    color: #000;
    font-weight: bold;
    margin-top: 1.25rem;
    margin-bottom: 0.625rem;
}

.ce-textpic ol,
.ce-bodytext ol,
.ce-textpic .wp-block-list,
.ce-bodytext .wp-block-list {
    counter-reset: item;
    list-style: none;
    padding-left: 0;
}

.ce-textpic ol li,
.ce-bodytext ol li,
.ce-textpic .wp-block-list li,
.ce-bodytext .wp-block-list li {
    display: flex;
    list-style: disc;
    counter-increment: item;
    margin-top: .25rem;
    margin-bottom: 1.5625rem;
    align-items: flex-start;
}

/* Nummerierte Kreise (Standard) */
.list-style-numbered .ce-textpic ol li:before,
.list-style-numbered .ce-bodytext ol li:before,
.list-style-numbered .ce-textpic .wp-block-list li:before,
.list-style-numbered .ce-bodytext .wp-block-list li:before,
.ce-textpic.list-style-numbered ol li:before,
.ce-bodytext.list-style-numbered ol li:before,
.ce-textpic.list-style-numbered .wp-block-list li:before,
.ce-bodytext.list-style-numbered .wp-block-list li:before {
    content: counter(item) ".";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #d68a27;
    border-radius: 50%;
    width: 1.875rem;
    min-width: 1.875rem;
    height: 1.875rem;
    position: relative;
    margin-right: 1.25rem;
    margin-top: -0.25rem;
    color: #fff;
    font-weight: bold;
    font-size: .875rem;
}

/* Einfache Bullets */
.list-style-bullets .ce-textpic ol,
.list-style-bullets .ce-bodytext ol,
.list-style-bullets .ce-textpic .wp-block-list,
.list-style-bullets .ce-bodytext .wp-block-list,
.ce-textpic.list-style-bullets ol,
.ce-bodytext.list-style-bullets ol,
.ce-textpic.list-style-bullets .wp-block-list,
.ce-bodytext.list-style-bullets .wp-block-list {
    list-style: disc;
    padding-left: 2rem;
}

.list-style-bullets .ce-textpic ol li,
.list-style-bullets .ce-bodytext ol li,
.list-style-bullets .ce-textpic .wp-block-list li,
.list-style-bullets .ce-bodytext .wp-block-list li,
.ce-textpic.list-style-bullets ol li,
.ce-bodytext.list-style-bullets ol li,
.ce-textpic.list-style-bullets .wp-block-list li,
.ce-bodytext.list-style-bullets .wp-block-list li {
    display: list-item;
    counter-increment: none;
}

.list-style-bullets .ce-textpic ol li::marker,
.list-style-bullets .ce-bodytext ol li::marker,
.list-style-bullets .ce-textpic .wp-block-list li::marker,
.list-style-bullets .ce-bodytext .wp-block-list li::marker,
.ce-textpic.list-style-bullets ol li::marker,
.ce-bodytext.list-style-bullets ol li::marker,
.ce-textpic.list-style-bullets .wp-block-list li::marker,
.ce-bodytext.list-style-bullets .wp-block-list li::marker {
    color: #d68a27;
}

.list-style-bullets .ce-textpic ol li:before,
.list-style-bullets .ce-bodytext ol li:before,
.list-style-bullets .ce-textpic .wp-block-list li:before,
.list-style-bullets .ce-bodytext .wp-block-list li:before,
.ce-textpic.list-style-bullets ol li:before,
.ce-bodytext.list-style-bullets ol li:before,
.ce-textpic.list-style-bullets .wp-block-list li:before,
.ce-bodytext.list-style-bullets .wp-block-list li:before {
    display: none;
}

/* Button Styles */
.ce-textpic .wp-block-buttons,
.ce-bodytext .wp-block-buttons {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.ce-textpic .wp-block-button__link,
.ce-bodytext .wp-block-button__link {
    display: inline-flex;
    border: 1px solid #d68a27;
    min-height: 2.5rem;
    min-width: 2.5rem;
    border-radius: 0;
    font-size: 1rem;
    font-weight: bold;
    justify-content: center;
    align-items: center;
    position: relative;
    text-decoration: none;
    text-transform: uppercase;
    transition: all 300ms ease-in-out;
    background: #d68a27;
    color: #fff;
    padding: 0 0.9375rem;
    height: auto;
}

.ce-textpic .wp-block-button__link:hover,
.ce-bodytext .wp-block-button__link:hover {
    background: transparent;
    color: #d68a27;
}

.ce-textpic .wp-block-button__link:after,
.ce-bodytext .wp-block-button__link:after {
    content: "";
    display: inline-block;
    width: 0.625rem;
    height: 0.625rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    margin-left: 0.9375rem;
    transition: none;
}

.ce-textpic.ce-nowrap .image {
    margin: 0;
    line-height: 0;
}

.ce-textpic.ce-nowrap .image img {
    width: 100%;
    height: auto;
    display: block;
}

.ce-textpic.ce-nowrap .image-caption {
    font-size: 0.875rem;
    color: rgba(0, 0, 0, 0.4);
    margin-top: 0.625rem;
    padding: 0.3125rem 0;
}

@media (max-width: 1024px) {
    .ce-textpic.ce-nowrap {
        flex-direction: column !important;
    }

    .ce-textpic .ce-bodytext,
    .ce-textpic .ce-gallery {
        width: 100% !important;
    }
}

/* Tablet und größer */
@media (min-width: 1024px) {
    .ce-textpic.ce-nowrap,
    .wp-block-group.ce-textpic.ce-nowrap {
        flex-direction: row !important;
        align-items: flex-start;
        gap: 0;
    }

    /* Bild rechts - Text links */
    .ce-textpic.ce-nowrap.ce-right .ce-gallery,
    .ce-textpic.ce-nowrap.ce-right > .wp-block-group.ce-gallery,
    .wp-block-group.ce-textpic.ce-nowrap.ce-right .wp-block-group.ce-gallery {
        width: 60% !important;
        order: 2;
        margin-left: -100px !important;
        flex-shrink: 0;
    }

    .ce-textpic.ce-nowrap.ce-right .ce-bodytext,
    .ce-textpic.ce-nowrap.ce-right > .wp-block-group.ce-bodytext,
    .wp-block-group.ce-textpic.ce-nowrap.ce-right .wp-block-group.ce-bodytext {
        width: 50% !important;
        order: 1;
        margin-top: 80px !important;
        padding: 0 !important;
        padding-right: 0 !important;
        flex-shrink: 0;
    }

    /* Bild links - Text rechts */
    .ce-textpic.ce-nowrap.ce-left .ce-gallery,
    .ce-textpic.ce-nowrap.ce-left > .wp-block-group.ce-gallery,
    .wp-block-group.ce-textpic.ce-nowrap.ce-left .wp-block-group.ce-gallery {
        width: 60% !important;
        order: 1;
        margin-right: -100px !important;
        flex-shrink: 0;
    }

    .ce-textpic.ce-nowrap.ce-left .ce-bodytext,
    .ce-textpic.ce-nowrap.ce-left > .wp-block-group.ce-bodytext,
    .wp-block-group.ce-textpic.ce-nowrap.ce-left .wp-block-group.ce-bodytext {
        width: 50% !important;
        order: 2;
        margin-top: 80px !important;
        padding: 0 !important;
        padding-left: 0 !important;
        flex-shrink: 0;
    }

    .ce-textpic.ce-nowrap .ce-bodytext__inner {
        padding: 2.5rem 3.125rem;
    }

    .ce-textpic.ce-nowrap .ce-bodytext__inner header h2 {
        font-size: 2.75rem;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .ce-textpic.ce-nowrap.ce-right .ce-gallery {
        width: 55%;
        margin-left: -120px;
    }

    .ce-textpic.ce-nowrap.ce-right .ce-bodytext {
        width: 50%;
        margin-top: 100px;
    }

    .ce-textpic.ce-nowrap.ce-left .ce-gallery {
        width: 55%;
        margin-right: -120px;
    }

    .ce-textpic.ce-nowrap.ce-left .ce-bodytext {
        width: 50%;
        margin-top: 100px;
    }

    .ce-textpic.ce-nowrap .ce-bodytext__inner header h2 {
        font-size: 2.75rem;
    }
}

/* Hintergrund-Container Anpassungen */
[class*=c-container--background] .ce-textpic.ce-nowrap .image-caption {
    color: rgba(255, 255, 255, 0.5);
}

[class*=c-container--background] .ce-textpic.ce-nowrap .ce-bodytext__inner {
    background: rgba(255, 255, 255, 0.98);
}
