<?php
/**
 * ITSWEBER CMS – Default Theme: Intro Section Template
 * Page Builder section template (3.2.0)
 *
 * Variables: $data (array), $section (DB row), $sectionId (string)
 *
 * @author  Benny Weber
 * @copyright ITSWEBER, www.itsweber.de
 */

$_s_classes = ['intro-section'];
if (!empty($data['color_scheme'])) $_s_classes[] = 'section--scheme-' . $data['color_scheme'];
if (!empty($data['section_text_color'])) $_s_classes[] = 'section--text-' . $data['section_text_color'];
if (!empty($data['text_align']))   $_s_classes[] = 'section--align-' . $data['text_align'];
if (!empty($data['max_width']))    $_s_classes[] = 'section--maxw-' . $data['max_width'];
?>
<section id="<?= e($sectionId) ?>" class="<?= e(implode(' ', $_s_classes)) ?>">
    <div class="container">
        <h2 class="reveal"><?= e($data['title'] ?? '') ?></h2>
        <?php if (!empty($data['subtitle'])): ?>
        <p class="section-subtitle reveal"><?= e($data['subtitle']) ?></p>
        <?php endif; ?>
        <?php if (!empty($data['text'])): ?>
        <div class="intro-text reveal"><?= nl2br(e($data['text'])) ?></div>
        <?php endif; ?>
        <?php if (!empty($data['cta_text'])): ?>
        <div class="intro-cta reveal">
            <a href="<?= e($data['cta_url'] ?? '#') ?>" class="btn btn-secondary"><?= e($data['cta_text']) ?></a>
        </div>
        <?php endif; ?>
    </div>
</section>
