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

<div <?php echo $this->cssID; ?> class="content--element <?php echo $this->class; ?>">
    <div class="ce--inner container">
        <?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; ?>">

            <?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"
                  data-aos="<?php if ($this->animation_type) : ?><?php echo $this->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>"><?php echo $this->subline; ?></span>
        <?php endif; ?>
    </div>
    <?php endif; ?>
    <div class="ce--image-text  <?php if ($this->as_rows) : ?>as--rows<?php endif; ?>">
        <div class="row">
            <?php foreach ($this->rows as $row) : ?>
                <?php if (!$this->as_rows) : ?><div class="col-md-4" data-aos="<?php if ($row->animation_type) : ?><?php echo $row->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>">
                    <div class="col--inner">
                    <div class="row"><?php endif; ?>
                <?php if ($this->as_rows) : ?>
                <div class="col-12"
                     data-aos="<?php if ($row->animation_type) : ?><?php echo $row->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>">
                <div class="col--inner">
                <div class="row"><?php endif; ?>
                <div data-aos="<?php if ($row->animation_type) : ?><?php echo $row->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>"
                     class="col-12 image <?php if ($this->as_rows) : ?>col-md-4 col-lg-3<?php endif; ?>  <?php if (!$this->as_rows) : ?>order-2<?php endif; ?>">
                    <div class="image--wrapper">
                        <img class="lazy"
                             data-src="<?= Image::get(FilesModel::findByUuid($row->image)->path, null, null, null); ?>">
                    </div>
                </div>
                <?php if ($this->as_rows) : ?>
                <div class="col-md-8 col-lg-9">
                <div class="col--inner"><?php endif; ?>
            <div data-aos="<?php if ($row->animation_type) : ?><?php echo $row->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>"
                 class="headline col-12  <?php if (!$this->as_rows) : ?>order-1<?php endif; ?>">
                <?php if (!$row->onlystyle) : ?>
                <<?php echo $row->headline_type; ?> <?php if ($row->headline_image) : ?>class="mb-0" <?php endif; ?>>
                <?php echo $row->headline; ?>
                </<?php echo $row->headline_type; ?>>
            <?php else : ?>
                <span class="<?php if ($row->headline_image) : ?>mb-0<?php endif; ?> <?php echo $row->headline_type; ?>">
                                                                <?php echo $row->headline; ?>
                                                            </span>
            <?php endif; ?>
                </div>
                <div data-aos="<?php if ($row->animation_type) : ?><?php echo $row->animation_type; ?><?php else : ?>animate__fadeInUp<?php endif; ?>"
                     class="text col-12  <?php if (!$this->as_rows) : ?>order-3<?php endif; ?>">
                    <?php echo $row->text; ?>
                </div>
                <?php if (!$this->as_rows) : ?>
                </div>
                </div><?php endif; ?>
                <?php if ($this->as_rows) : ?>
                </div>
                </div>
                </div>
                </div><?php endif; ?>
                </div>
            <?php endforeach; ?>
        </div>
    </div>
</div>
</div>