<?php
namespace ThemeAtelier\EventfulForElementor\Admin\Widgets\Options;
class EventfulForElementorStyleTitle
{
    public static function ppfe_style_title_options($widget)
    {

        // Title.
        $widget->start_controls_section(
            'section_grid_title_style',
            [
                'label'     => esc_html__('Title', 'eventful-for-elementor'),
                'tab'       => \Elementor\Controls_Manager::TAB_STYLE,
                'condition' => [
                    'show_title' => 'yes',
                ],
            ]
        );

        // Title typography.
        $widget->add_group_control(
            \Elementor\Group_Control_Typography::get_type(),
            [
                'name'     => 'grid_title_style_typography',
                'global' => [
                    'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Typography::TYPOGRAPHY_PRIMARY,
                ],
                'selector' => '{{WRAPPER}} .eventful .eventful__item .eventful__item--title, {{WRAPPER}} .eventful .eventful__item .eventful__item--title a',
            ]
        );

        $widget->start_controls_tabs('grid_title_color_style');

        // Normal tab.
        $widget->start_controls_tab(
            'grid_title_style_normal',
            array(
                'label' => esc_html__('Normal', 'eventful-for-elementor'),
            )
        );

        // Title color.
        $widget->add_control(
            'grid_title_style_color',
            [
                'type'      => \Elementor\Controls_Manager::COLOR,
                'label'     => esc_html__('Color', 'eventful-for-elementor'),
                'global' => [
                    'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_SECONDARY,
                ],
                'selectors' => [
                    '{{WRAPPER}} .eventful .eventful__item .title, {{WRAPPER}} .eventful .eventful__item .eventful__item--title a' => 'color: {{VALUE}};',
                ],
            ]
        );

        $widget->end_controls_tab();

        // Hover tab.
        $widget->start_controls_tab(
            'grid_title_style_hover',
            array(
                'label' => esc_html__('Hover', 'eventful-for-elementor'),
            )
        );

        // Title hover color.
        $widget->add_control(
            'grid_title_style_hover_color',
            array(
                'type'      => \Elementor\Controls_Manager::COLOR,
                'label'     => esc_html__('Color', 'eventful-for-elementor'),
                'global' => [
                    'default' => \Elementor\Core\Kits\Documents\Tabs\Global_Colors::COLOR_PRIMARY,
                ],
                'selectors' => array(
                    '{{WRAPPER}} .eventful .eventful__item .title, {{WRAPPER}} .eventful .eventful__item .eventful__item--title a:hover' => 'color: {{VALUE}};',
                ),
            )
        );

        $widget->end_controls_tab();

        $widget->end_controls_tabs();

        // Title margin.
        $widget->add_responsive_control(
            'grid_title_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 .title, {{WRAPPER}} .eventful .eventful__item .eventful__item--title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );

        $widget->end_controls_section();
    }
}
