<?php
/**
 * ITSWEBER CMS – Default Theme: HTML / Editor 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
 */

$title       = $data['title'] ?? '';
$subtitle    = $data['subtitle'] ?? '';
$contentHtml = $data['content_html'] ?? '';
$maxWidth    = $data['max_width'] ?? '';

$extra = [];
if ($maxWidth !== '') $extra[] = 'section--maxw-' . $maxWidth;
?>
<section class="<?= build_section_classes('html', $data, $extra) ?>" id="<?= e($sectionId) ?>">
    <div class="container">
        <?php if ($title !== '' || $subtitle !== ''): ?>
        <div class="html-section-header reveal">
            <?php if ($title !== ''): ?>
            <h2 class="html-section-title"><?= e($title) ?></h2>
            <?php endif; ?>
            <?php if ($subtitle !== ''): ?>
            <p class="html-section-subtitle"><?= e($subtitle) ?></p>
            <?php endif; ?>
        </div>
        <?php endif; ?>

        <?php if ($contentHtml !== ''): ?>
        <div class="html-section-content">
            <?= $contentHtml ?>
        </div>
        <?php endif; ?>
    </div>
</section>
