<?php
namespace ThemeAtelier\EventfulForElementor\Admin\Widgets\Options;

use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
use Elementor\Core\Kits\Documents\Tabs\Global_Typography;

class EventfulForElementorStyleContent
{
    public static function ppfe_style_content_options($widget)
    {
        // Content.
        $widget->start_controls_section(
            'section_grid_content_style',
            [
                'label' => esc_html__('Content', 'eventful-for-elementor'),
                'tab'   => \Elementor\Controls_Manager::TAB_STYLE,
                'condition' => [
                    'show_content' => 'yes',
                ],
            ]
        );

        // Content typography.
        $widget->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name'      => 'grid_content_style_typography',
                'global' => [
                    'default' => Global_Typography::TYPOGRAPHY_TEXT,
                ],
                'selector'  => '{{WRAPPER}} .eventful .eventful__item .eventful__item__content p',
            ]
        );

        // Content color.
        $widget->add_control(
            'grid_content_style_color',
            [
                'type'      => \Elementor\Controls_Manager::COLOR,
                'label'     => esc_html__('Color', 'eventful-for-elementor'),
                'global' => [
                    'default' => Global_Colors::COLOR_TEXT,
                ],
                'selectors' => [
                    '{{WRAPPER}} .eventful .eventful__item .eventful__item__content' => 'color: {{VALUE}};',
                ],
            ]
        );

        // Content margin
        $widget->add_responsive_control(
            'grid_content_style_margin',
            [
                'label'      => esc_html__('Margin', 'eventful-for-elementor'),
                'type'       => \Elementor\Controls_Manager::DIMENSIONS,
                'size_units' => ['px'],
                'default' => [
					'top' => 0,
					'right' => 0,
					'bottom' => 10,
					'left' => 0,
					'unit' => 'px',
					'isLinked' => false,
				],
                'selectors'  => [
                    '{{WRAPPER}} .eventful .eventful__item .eventful__item__content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

        $widget->end_controls_section();
    }
}
