<?php
/**
 * ITSWEBER CMS – Page Builder Admin Form: CTA (Call to Action)
 * 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', 'eyebrow', __('admin.section.eyebrow'), $data['eyebrow'] ?? '', [
    'placeholder' => __('admin.section.cta_ph_eyebrow'),
]) ?>

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

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

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

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

<?php admin_field('text', 'cta2_text', __('admin.section.cta_text_2'), $data['cta2_text'] ?? '', [
    'placeholder' => __('admin.section.cta_ph_cta2'),
    'hint'        => __('admin.section.optional'),
]) ?>

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

<?php admin_media_picker('image', $data['image'] ?? '', __('admin.section.background_image'), 'image', 'path/to/image.jpg') ?>

<?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', 'overlay_strength', __('admin.section.overlay'), $data['overlay_strength'] ?? '', [
        'options'    => [
            ''       => __('admin.section.overlay_none'),
            'light'  => __('admin.section.overlay_light'),
            'medium' => __('admin.section.overlay_medium'),
            'heavy'  => __('admin.section.overlay_heavy'),
        ],
        'wrap_style' => 'margin:0;',
    ]) ?>
<?php admin_field_grid_close() ?>
