<?php 
    class Edumodo_Customizer_Archive_Event{
        private $panel_key;
        private $priority;
        public function __construct($panel_key, $priority){
            $this->panel_key = $panel_key;
            $this->priority = $priority;
            $this->event_archive_kirki_config();
        }
        public function event_archive_kirki_config(){

            Kirki::add_section( 'edumodo_section_event_archive', array(
                'title'          => esc_html__( 'Event', 'edumodo' ),
                'panel'          => $this->panel_key,
                'priority'       => $this->priority,
            ) );
                // if (class_exists('Tribe__Events__Main')) {
                Kirki::add_field( 'edumodo_event_page_header_image', [
                    'type'        => 'image',
                    'settings'    => 'edumodo_event_page_header_image',
                    'label'       => esc_html__( 'Breadcrumb Background', 'edumodo' ),
                    'section'     => 'edumodo_section_event_archive',
                    'priority'    => 10,
                    'active_callback' => [
                        [
                            'setting'  => 'edumodo_section_page_title_trigger',
                            'operator' => '==',
                            'value'    => 'on',
                        ]
                    ]
                ] );
                // }
                Kirki::add_field( 'edumodo_event_archive_custom_title', [
                    'type'     => 'text',
                    'settings' => 'edumodo_event_archive_custom_title',
                    'label'    => __( 'Custom Title', 'edumodo' ),
                    'section'  => 'edumodo_section_event_archive',
                    'default'  => esc_html__('Events','edumodo'),
                    'priority' => 10,
                ] );
                Kirki::add_field( 'edumodo_archive_title_typo', [
                    'type'        => 'typography',
                    'settings'    => 'edumodo_archive_title_typo',
                    'label'       => esc_html__( 'Title', 'edumodo' ),
                    'section'     => 'edumodo_section_event_archive',
                    'priority'    => 10,
                    'transport'   => 'auto',
                    'default'     => [
                        'color'			 => '#07294d',
                        'text-transform' => 'none',
                        'font-size'		 => '16px',
                        'line-height'	 => '1.1',
                        'letter-spacing' => '0',
                    ],
                    'output'      => [
                        [
                            'element' => '.tribe-events-calendar-list__event-title  a',
                        ],
                    ],
                ] );
                Kirki::add_field( 'edumodo_event_archive_title_margin', [
                    'type'        => 'dimensions',
                    'settings'    => 'edumodo_event_archive_title_margin',
                    'label'       => esc_html__( 'Title Spacing', 'edumodo' ),
                    'section'     => 'edumodo_section_event_archive',
                    'priority' => 10,
                    'default'     => [
                        'top'  => '15px',
                        'right'  => '0px',
                        'bottom'  => '15px',
                        'left' => '0px',
                    ],
                ] );
        
                // Kirki::add_field( 'edumodo_event_heading_color', [
                //     'type' 	=> 'heading',
                //     'label'	=> 'Color',
                //     'section'     => 'edumodo_section_event_archive',
                //     'priority' => 10,
                // ]);
                Kirki::add_field( 'edumodo_event_archive_content_color', [
                    'type'        => 'color',
                    'settings'    => 'edumodo_event_archive_content_color',
                    'label'       => __( 'Content', 'edumodo' ),
                    'section'     => 'edumodo_section_event_archive',
                    'choices'     => [ 'alpha' => true],
                    'transport'   => 'auto',
                    'priority' => 10,
                ] );
                Kirki::add_field( 'edumodo_event_archive_meta_color', [
                    'type'        => 'color',
                    'settings'    => 'edumodo_event_archive_meta_color',
                    'label'       => __( 'Meta', 'edumodo' ),
                    'section'     => 'edumodo_section_event_archive',
                    'choices'     => [ 'alpha' => true],
                    'transport'   => 'auto',
                    'priority' => 10,
                ] );
                Kirki::add_field( 'edumodo_event_archive_date_color', [
                    'type'        => 'color',
                    'settings'    => 'edumodo_event_archive_date_color',
                    'label'       => __( 'Date', 'edumodo' ),
                    'section'     => 'edumodo_section_event_archive',
                    'choices'     => [ 'alpha' => true],
                    'transport'   => 'auto',
                    'priority' => 10,
                ] );
                Kirki::add_field( 'edumodo_event_archive_date_bg_color', [
                    'type'        => 'color',
                    'settings'    => 'edumodo_event_archive_date_bg_color',
                    'label'       => __( 'Date Background', 'edumodo' ),
                    'section'     => 'edumodo_section_event_archive',
                    'choices'     => [ 'alpha' => true],
                    'transport'   => 'auto',
                    'priority' => 10,
                ] );
                Kirki::add_field( 'edumodo_event_archive_price_color', [
                    'type'        => 'color',
                    'settings'    => 'edumodo_event_archive_price_color',
                    'label'       => __( 'Price', 'edumodo' ),
                    'section'     => 'edumodo_section_event_archive',
                    'choices'     => [ 'alpha' => true],
                    'transport'   => 'auto',
                    'priority' => 10,
                ] );

        }
    }
?>