<?php
namespace AITheme\Elementor\Widgets;

use Elementor\Controls_Manager;

if (!defined('ABSPATH')) exit;

class Text_Minimal extends AI_Widget_Base {
    public function get_name() { return 'ai_text_minimal'; }
    public function get_title() { return __('Text Minimal', 'ai-theme'); }
    public function get_icon() { return 'eicon-text'; }
    public function get_categories() { return array('ai-theme-text'); }

    protected function register_controls() {
        $this->start_controls_section('content_section', ['label' => __('Content', 'ai-theme'), 'tab' => Controls_Manager::TAB_CONTENT]);
        $this->add_control('title', ['label' => __('Title', 'ai-theme'), 'type' => Controls_Manager::TEXT]);
        $this->add_control('content', ['label' => __('Content', 'ai-theme'), 'type' => Controls_Manager::WYSIWYG]);
        $this->end_controls_section();
    }

    protected function render() {
        $s = $this->get_settings_for_display();
        ?>
        <section class="ai-text ai-text-minimal py-12 bg-white">
            <div class="ai-container-narrow">
                <?php if (!empty($s['title'])) : ?><h2 class="text-3xl font-bold text-gray-900 mb-6"><?php echo esc_html($s['title']); ?></h2><?php endif; ?>
                <?php if (!empty($s['content'])) : ?><div class="ai-text-content prose prose-lg text-gray-600 max-w-none"><?php echo wp_kses_post($s['content']); ?></div><?php endif; ?>
            </div>
        </section>
        <?php
    }
}
