<?php
if (TL_MODE == 'FE') {
    $GLOBALS['TL_CSS'][] = 'files/base/layout/css/elements/custom-elements/ce_rsce_twocolimagewall.min.css|static';
}
?>


<div <?php echo $this->cssID; ?>
        class="content--element <?php echo $this->class; ?> <?php if ($this->no_padding) : ?>no-spacing<?php endif; ?>">
    <div class="ce--inner ">
        <?php if ($this->headline || $this->subline || $this->topline) : ?>
        <div class="ce--headline"
             data-aos="<?php if ($this->animation_type) : ?><?php echo $this->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>">
            <div class="container">
                <?php if ($this->topline) : ?>
                    <span class="ce--topline"><?php echo $this->topline; ?></span>
                <?php endif; ?>
                <?php if ($this->headline) : ?>
                <<?php echo($this->hl); ?>><?php echo($this->headline); ?></<?php echo($this->hl); ?>>
            <?php endif; ?>
            <?php if ($this->subline) : ?>
                <span class="ce--subline"><?php echo $this->subline; ?></span>
            <?php endif; ?>
        </div>
    </div>
    <?php endif; ?>
    <?php foreach ($this->row as $row) : ?>

    <?php
    if (!isset($row->size_left)) {
        $row->{"size_left"} = "";
    }

    if (!isset($row->size_right)) {
        $row->{"size_right"} = "";
    }
    ?>


    <div class="ce--imagetextwall--outer <?php if ($row->bottom_spacing) : ?>with-spacing<?php endif; ?> ">
        <div class="ce--imagetextwall  <?php if ($row->boxed_headline) : ?>with-boxed-image<?php endif; ?>  <?php if ($row->alternate_image) : ?>with-code<?php endif; ?> <?php if ($row->alternate_background) : ?>with-custom-bgcolor<?php endif; ?> <?php if ($row->innerpadding && $row->alternate_background) : ?>with-border<?php endif; ?> <?php if ($row->not_as_bg) : ?>not-as-bg<?php endif; ?> <?php if ($row->image && $row->image_both) : ?>lazy<?php endif; ?>"
             <?php if ($row->image && $row->image_both) : ?>data-bg="<?= Image::get(FilesModel::findByUuid($row->image)->path, $row->size_right[0], $row->size_right[1], $row->size_right[2]); ?>" <?php endif; ?>
             style="
             <?php if ($row->image && $row->image_both) : ?>
                     background-position: center center; background-repeat: no-repeat; background-size: cover;
             <?php endif; ?>
             <?php if ($row->alternate_textcolor) : ?>color:<?php echo $row->alternate_textcolor; ?>;<?php endif; ?><?php if ($row->alternate_background) : ?>background-color:<?php echo $row->alternate_background; ?><?php endif; ?>
                     ">
            <div class="container force-container">
                <div class="row <?php if ($row->video) : ?>align-items-center<?php endif; ?> <?php if ($row->reverse) : ?>reverse-cols<?php endif; ?> <?php if ($row->content_rightcol && !$row->alternate_image) : ?>only-text--right-col<?php endif; ?>">
                    <div class="content--col d-flex align-items-center <?php if ($row->spacing_between) : ?>spacing-between<?php endif; ?> <?php if ($row->alternate_background) : ?>with-bg<?php endif; ?> <?php echo $row->column_width; ?> <?php if ($row->darken_content) : ?>darkened-content<?php endif; ?>"
                         style="<?php if ($row->alternate_background) : ?>background-color:<?php echo $row->alternate_background; ?><?php endif; ?>">

                        <?php if ($row->ce_headline || $row->content || $row->buttons[0]->link_text != ""): ?>
                        <div class="content-col--inner <?php echo $row->textalign; ?>">
                            <?php if ($row->ce_headline) : ?>
                            <div class="content-col--headline-wrapper"
                                 data-aos="<?php if ($row->animation_type) : ?><?php echo $row->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>">
                                <?php if (!$row->onlystyle) : ?>
                                <<?php echo $row->headline_type; ?> class="content-col--headline">
                                <?php echo $row->ce_headline; ?>
                            </<?php echo $row->headline_type; ?>>
                        <?php if ($row->ce_subline) : ?>
                            <span class="ce--subline content-col--subline"
                                  data-aos="<?php if ($row->animation_type) : ?><?php echo $row->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>">
                                <?php echo $row->ce_subline; ?>
                            </span>
                        <?php endif; ?>
                        <?php else : ?>
                            <span class="<?php echo $row->headline_type; ?> content-col--headline"
                                  data-aos="<?php if ($row->animation_type) : ?><?php echo $row->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>">
                                <?php echo $row->ce_headline; ?>
                            </span>
                            <?php if ($row->ce_subline) : ?>
                                <span class="ce--subline content-col--subline"
                                      data-aos="<?php if ($row->animation_type) : ?><?php echo $row->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>">
                                    <?php echo $row->ce_subline; ?>
                                </span>
                            <?php endif; ?><?php endif; ?>
                        </div>
                    <?php endif; ?>
                        <?php if ($row->content) : ?>
                            <div class="content-col--text"
                                 data-aos="<?php if ($row->animation_type) : ?><?php echo $row->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>">
                                <?php echo $row->content; ?>
                            </div>
                        <?php endif; ?>
                        <?php if ($row->buttons) : ?>
                            <div class="ce--buttons mt-2">
                                <?php foreach ($row->buttons as $b) : ?>
                                    <a <?php if ($b->new_tab): ?>target="_blank"<?php endif; ?>
                                       class="d-inline-block btn <?php if ($b->link_size) : ?><?php echo $b->link_size; ?><?php endif; ?> <?php echo $b->link_type; ?>"
                                       data-aos="<?php if ($b->animation_type) : ?><?php echo $b->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>"
                                       href="<?php echo $b->link_url; ?><?php if ($b->link_betreff) : ?>?subject=<?php echo $b->link_betreff; ?><?php endif; ?>"><?php echo $b->link_text; ?> </a>
                                <?php endforeach ?>
                            </div>
                        <?php endif; ?>
                    </div>
                    <?php endif; ?>

                    <?php if ($row->image_leftcol || $row->kachel_left_text): ?>
                        <div class="content-col--image"
                             <?php if ($row->image_leftcol): ?>style="background: url(<?= Image::get(FilesModel::findByUuid($row->image_leftcol)->path, $row->size_left[0], $row->size_left[1], $row->size_left[2]); ?>) center center no-repeat; background-size: cover;" <?php endif; ?>></div>
                    <?php endif; ?>

                    <?php if ($row->kachel_left_text): ?>
                        <div class="kachel-column-width--indicator <?php if ($row->expand_left_kachel): ?>expandable<?php endif; ?>">
                            <div class="column-kachel--wrapper  <?php if ($row->kachel_left_url): ?> with-url<?php endif; ?> <?php echo $row->kachel_left_position; ?>">
                                <div class="column--kachel <?php echo $row->kachel_left_text_position; ?>"
                                     data-aos="<?php if ($row->animation_type_left_kachel) : ?><?php echo $row->animation_type_left_kachel; ?><?php else : ?>animate__fadeInUp<?php endif; ?>"
                                     style="
                                     <?php if ($row->kachel_left_background_color): ?>
                                             background-color: <?= $row->kachel_left_background_color;?>;
                            <?php endif; ?>

                                     <?php if ($row->kachel_left_text_color): ?>
                                             color: <?= $row->kachel_left_text_color;?>;
                            <?php endif; ?>
                                             ">

                                    <?php if ($row->kachel_left_url): ?>
                                        <a href="<?= $row->kachel_left_url; ?>"></a>
                                    <?php endif; ?>

                                    <div class="column-kachel--inner <?php if ($row->kachel_left_hover_text || $row->kachel_left_url): ?>with-hover-content<?php endif; ?>">
                                        <span>
                                            <?php echo $row->kachel_left_text; ?>
                                        </span>

                                        <?php if ($row->kachel_left_hover_text || $row->kachel_left_url): ?>
                                            <div class="kachel-hover--content">
                                                <?php if ($row->kachel_left_hover_text): ?>
                                                    <div class="kachel--long-text">
                                                        <?php echo $row->kachel_left_hover_text; ?>
                                                    </div>
                                                <?php endif; ?>

                                                <?php if ($row->kachel_left_url): ?>
                                                    <div class="kachel--more-button">
                                                        <a class="btn btn-lg btn-outline-secondary"
                                                           href="<?= $row->kachel_left_url; ?>">
                                                            Mehr Infos
                                                        </a>
                                                    </div>
                                                <?php endif; ?>
                                            </div>
                                        <?php endif; ?>

                                    </div>
                                </div>
                            </div>
                        </div>
                    <?php endif; ?>

                </div>
                <?php if (($row->image && !$row->image_both) || $row->alternate_image || $row->content_rightcol || $row->video) : ?>
                <div class="image--col col-12 col-md  <?php if ($row->video) : ?>with-video col-md-6<?php endif; ?>"
                     data-aos="animate__fadeIn">

                    <?php if ($row->boxed_headline) : ?>
                    <div class="boxed-headline">
                        <div class="headline--wrapper"
                             data-aos="<?php if ($this->animation_type) : ?><?php echo $this->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>">
                            <?php if (!$row->boxed_headline_onlystyle) : ?>
                            <<?php echo $row->boxed_headline_type; ?>>
                            <?php echo $row->boxed_headline; ?>
                        </<?php echo $row->boxed_headline_type; ?>>
                        <?php if ($row->boxed_subheadline) : ?>
                            <span class="ce--subline">
                                <?php echo $row->boxed_subheadline; ?>
                            </span>
                        <?php endif; ?>
                        <?php else : ?>
                            <span class="<?php echo $row->boxed_headline_type; ?>"><?php echo $row->boxed_headline; ?></span>
                            <?php if ($row->boxed_subheadline) : ?>
                                <span class="ce--subline">
                                    <?php echo $row->boxed_subheadline; ?>
                                </span>
                            <?php endif; ?>
                            </span>
                        <?php endif; ?>
                    </div>
                </div>
            <?php endif; ?>

                <div
                        style="<?php if ($row->alternate_background) : ?>background-color:<?php echo $row->alternate_background; ?>;<?php endif; ?> background-position: center center; background-repeat: no-repeat; background-size: cover;"
                        class=" <?php if ($row->video) : ?>with-video<?php endif; ?> <?php if ($row->alternate_image): ?>with-iframe<?php endif; ?> <?php if (!$row->not_as_bg && !$row->alternate_image) : ?>lazy<?php endif; ?>

          <?php if (!$row->not_as_bg) : ?>
          image-col--inner
        <?php if ($row->column_width == "col-12 col-md-6 col-lg-5") : ?>
        col-12 col-md-6 col-lg-7
        <?php elseif ($row->column_width == "col-12 col-md-6 col-lg-4") : ?>
        col-12 col-md-6 col-lg-8
        <?php elseif ($row->column_width == "col-12 col-md-6") : ?>
        col-12 col-md-6
        <?php elseif ($row->column_width == "col-12 col-lg-8") : ?>
        col-12 col-lg-4
        <?php elseif ($row->column_width == "col-12 col-lg-9") : ?>
        col-12 col-lg-3
        <?php endif; ?>
        <?php endif;?>
"
                        <?php if (!$row->alternate_image && ($row->image && !$row->image_both) && !$row->not_as_bg) : ?>data-bg="<?= Image::get(FilesModel::findByUuid($row->image)->path, $row->size_right[0], $row->size_right[1], $row->size_right[2]); ?>" <?php endif; ?>>
                    <?php if ($row->not_as_bg) : ?>
                        <div class="image--wrapper">
                            <img class="lazy"
                                 data-src="<?= Image::get(FilesModel::findByUuid($row->image)->path, $row->size_right[0], $row->size_right[1], $row->size_right[2]); ?>">
                        </div>
                    <?php endif; ?>



                    <?php if ($row->alternate_image) : ?><?php echo str_replace("https:", "", str_replace("src", "data-source", html_entity_decode($row->alternate_image))); ?><?php endif; ?>



                    <?php if ($row->video) : ?>
                        <div class="video--wrapper">
                            <video controls data-src="{{file::<?= $row->video ?>}}">
                                <source type="video/mp4" src="{{file::<?= $row->video ?>}}">
                            </video>
                        </div>
                    <?php endif; ?>


                </div>
                <?php if ($row->content_rightcol) : ?>
                    <div class="image-col--extra-text"
                         data-aos="<?php if ($row->animation_type) : ?><?php echo $row->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>">
                        <?php echo $row->content_rightcol; ?>
                    </div>
                <?php endif; ?>


                <?php if ($row->kachel_right_text): ?>
                    <div class="kachel-column-width--indicator <?php if ($row->expand_right_kachel): ?>expandable<?php endif; ?>">
                        <div class="column-kachel--wrapper <?php echo $row->kachel_right_position; ?>  <?php if ($row->kachel_right_url): ?> with-url<?php endif; ?>">
                            <div class="column--kachel  <?php echo $row->kachel_right_text_position; ?>"
                                 data-aos="<?php if ($row->animation_type_right_kachel) : ?><?php echo $row->animation_type_right_kachel; ?><?php else : ?>animate__fadeInUp<?php endif; ?>"
                                 style="
                                 <?php if ($row->kachel_right_background_color): ?>
                                         background-color: <?= $row->kachel_right_background_color;?>;
                            <?php endif; ?>

                                 <?php if ($row->kachel_right_text_color): ?>
                                         color: <?= $row->kachel_right_text_color;?>;
                            <?php endif; ?>
                                         ">

                                <?php if ($row->kachel_right_url): ?>
                                    <a href="<?= $row->kachel_right_url; ?>"></a>
                                <?php endif; ?>

                                <div class="column-kachel--inner <?php if ($row->kachel_right_hover_text || $row->kachel_right_url): ?>with-hover-content<?php endif; ?>">
                                    <span>
                                        <?php echo $row->kachel_right_text; ?>
                                    </span>

                                    <?php if ($row->kachel_right_hover_text || $row->kachel_right_url): ?>
                                        <div class="kachel-hover--content">
                                            <?php if ($row->kachel_right_hover_text): ?>
                                                <div class="kachel--long-text">
                                                    <?php echo $row->kachel_right_hover_text; ?>
                                                </div>
                                            <?php endif; ?>

                                            <?php if ($row->kachel_right_url): ?>
                                                <div class="kachel--more-button">
                                                    <a class="btn btn-lg btn-outline-secondary"
                                                       href="<?= $row->kachel_right_url; ?>">
                                                        Mehr Infos
                                                    </a>
                                                </div>
                                            <?php endif; ?>
                                        </div>
                                    <?php endif; ?>
                                </div>
                            </div>
                        </div>
                    </div>
                <?php endif; ?>

            </div>
            <?php endif; ?>
        </div>
    </div>
</div></div>
<?php endforeach; ?>
</div></div>