<?php
/**
 * ITSWEBER CMS – Page Builder Admin Form: Intro
 * Loaded via AJAX into section cards.
 *
 * @author  Benny Weber
 * @copyright ITSWEBER, www.itsweber.de
 *
 * @var array $data    Decoded JSON content
 * @var array $section DB row (id, section_type, instance_label, ...)
 */
?>

<?php admin_field('text', 'title', __('admin.section.heading'), $data['title'] ?? '', [
    'placeholder' => __('admin.section.intro_ph_title'),
]) ?>

<?php admin_field('text', 'subtitle', __('admin.section.subtitle'), $data['subtitle'] ?? '', [
    'placeholder' => __('admin.section.intro_ph_subtitle'),
]) ?>

<?php admin_field('textarea', 'text', __('admin.section.intro_text'), $data['text'] ?? '', [
    'placeholder' => __('admin.section.intro_ph_text'),
    'rows'        => 5,
    'hint'        => __('admin.section.line_breaks_preserved'),
]) ?>

<?php admin_field('text', 'cta_text', __('admin.section.cta_text'), $data['cta_text'] ?? '', [
    'placeholder' => __('admin.section.intro_ph_cta'),
    'hint'        => __('admin.section.leave_blank_to_hide'),
]) ?>

<?php admin_field('text', 'cta_url', __('admin.section.cta_url'), $data['cta_url'] ?? '', [
    'placeholder' => __('admin.section.intro_ph_cta_url'),
]) ?>

<?php admin_section_separator() ?>

<?php admin_field_grid_open(3) ?>
    <?php admin_color_scheme_field($data['color_scheme'] ?? '', true) ?>
    <?php render_section_text_color_field($data) ?>
    <?php admin_field('select', 'text_align', __('admin.section.text_align'), $data['text_align'] ?? '', [
        'options'    => ['' => __('admin.section.align_default'), 'left' => __('admin.section.align_left')],
        'wrap_style' => 'margin:0;',
    ]) ?>
    <?php admin_field('select', 'max_width', __('admin.section.text_width'), $data['max_width'] ?? '', [
        'options'    => [
            ''   => __('admin.section.width_default'),
            'sm' => __('admin.section.width_sm'),
            'md' => __('admin.section.width_md'),
            'lg' => __('admin.section.width_lg'),
        ],
        'wrap_style' => 'margin:0;',
    ]) ?>
<?php admin_field_grid_close() ?>
