<?php
/**
 * Igaa Theme Customizer.
 */

/**
 * Add postMessage support for site title and description for the Theme Customizer. 
 * Contains also minor modifications of default WP Title Tagline section.
 */
function igaa_customize_register( $wp_customize ) {
	$wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
	$wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
    $wp_customize->get_section('title_tagline')->title = __( 'Logo, Site Title, Tagline and Icon', 'igaa' );
    $wp_customize->get_section('title_tagline')->panel = 'igaa_global_panel';
    $wp_customize->get_section('title_tagline')->priority = 10;
}
add_action( 'customize_register', 'igaa_customize_register' );

/**
 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
 */
function igaa_customize_preview_js() {
	wp_enqueue_script( 'igaa_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20151215', true );
}
add_action( 'customize_preview_init', 'igaa_customize_preview_js' );

/**
 * Kirki powered Theme Customizer config. 
 */
Igaa_Kirki::add_config( 'igaa_config', array(
	'capability'    => 'edit_theme_options',
	'option_type'   => 'theme_mod',
) );

/**
 * Global panel, sections, fields 
 */
Igaa_Kirki::add_panel( 'igaa_global_panel', array(
    'priority'    => 10,
    'title'       => __( 'Global Options', 'igaa' ),
) );

/* Background */
Igaa_Kirki::add_section( 'igaa_global_background', array(
    'title'          => __( 'Background', 'igaa' ),
    'panel'          => 'igaa_global_panel',
    'priority'       => 10,
    'capability'     => 'edit_theme_options',
    'theme_supports' => '',
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_site_background_color',
	'label'       => esc_attr__( 'Body Background Color', 'igaa' ),
	'section'     => 'igaa_global_background',
	'default'     => '#ffffff',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => 'body',
			'property' => 'background-color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => 'body',
                'function' => 'css',
                'property' => 'background-color',
            ),
        )
) );

/* Typography */
Igaa_Kirki::add_section( 'igaa_global_typography', array(
    'title'          => __( 'Typography', 'igaa' ),
    'panel'          => 'igaa_global_panel',
    'priority'       => 10,
    'capability'     => 'edit_theme_options',
    'theme_supports' => '',
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_links_color',
	'label'       => esc_attr__( 'Links Color', 'igaa' ),
	'section'     => 'igaa_global_typography',
	'default'     => '#444',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => '.uk-link, a',
			'property' => 'color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.uk-link, a',
                'function' => 'css',
                'property' => 'color',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_links_hover_color',
	'label'       => esc_attr__( 'Links Hover Color', 'igaa' ),
	'section'     => 'igaa_global_typography',
	'default'     => '#999',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => '.uk-link:hover, a:hover',
			'property' => 'color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.uk-link:hover, a:hover',
                'function' => 'css',
                'property' => 'color',
            ),
        )
) );
/* end Global Panel */

/**
 * Header panel, sections, fields 
 */
Igaa_Kirki::add_panel( 'igaa_header_panel', array(
    'priority'    => 11,
    'title'       => __( 'Header', 'igaa' ),
) );

/* Menu */
Igaa_Kirki::add_section( 'igaa_header_menu', array(
    'title'          => __( 'Menu Area', 'igaa' ),
    'panel'          => 'igaa_header_panel',
    'priority'       => 10,
    'capability'     => 'edit_theme_options',
    'theme_supports' => '',
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_menu_item_color',
	'label'       => esc_attr__( 'Menu Font Color', 'igaa' ),
	'section'     => 'igaa_header_menu',
	'default'     => '#444',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => '.uk-navbar-nav > li > a',
			'property' => 'color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.uk-navbar-nav > li > a',
                'function' => 'css',
                'property' => 'color',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_menu_background_color',
	'label'       => esc_attr__( 'Menu Background Color', 'igaa' ),
	'section'     => 'igaa_header_menu',
	'default'     => '#ffffff',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => '.main-navbar',
			'property' => 'background-color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.main-navbar',
                'function' => 'css',
                'property' => 'background-color',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_active_item_color',
	'label'       => esc_attr__( 'Menu Active Item Color', 'igaa' ),
	'section'     => 'igaa_header_menu',
	'default'     => '#444',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => '.uk-navbar-nav > li.uk-active > a',
			'property' => 'color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.uk-navbar-nav > li.uk-active > a',
                'function' => 'css',
                'property' => 'color',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_menu_spacing',
	'label'       => esc_attr__( 'Menu Spacing', 'igaa' ),
    'section'     => 'igaa_header_menu',
	'default'     => 15,
	'choices'     => array(
		'min'  => '0',
		'max'  => '100',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.main-navbar',
			'property' => 'padding-top',
			'units'    => 'px',
		),
        array(
			'element'  => '.main-navbar',
			'property' => 'padding-bottom',
			'units'    => 'px',
		),
		
	),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.main-navbar',
                'function' => 'css',
                'property' => 'padding-top',
                'units'    => 'px',
            ),
            array(
                'element'  => '.main-navbar',
                'function' => 'css',
                'property' => 'padding-bottom',
                'units'    => 'px',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_menu_items_spacing',
	'label'       => esc_attr__( 'Menu Items Spacing', 'igaa' ),
    'section'     => 'igaa_header_menu',
	'default'     => 15,
	'choices'     => array(
		'min'  => '0',
		'max'  => '100',
		'step' => '1',
	),
    'output' => array(
		array(
			'element'  => '.uk-navbar-nav > li > a',
			'property' => 'padding-left',
			'units'    => 'px',
		),
        array(
			'element'  => '.uk-navbar-nav > li > a',
			'property' => 'padding-right',
			'units'    => 'px',
		),
		
	),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.uk-navbar-nav > li > a',
                'function' => 'css',
                'property' => 'padding-left',
                'units'    => 'px',
            ),
            array(
                'element'  => '.uk-navbar-nav > li > a',
                'function' => 'css',
                'property' => 'padding-right',
                'units'    => 'px',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'toggle',
	'settings'    => 'igaa_enable_navbar_transparency',
	'label'       => __( 'Menu Transparency', 'igaa' ),
    'section'     => 'igaa_header_menu',
	'default'     => '2',
	'priority'    => 10,
    'choices'     => array(
		'on'  => esc_attr__( 'On', 'igaa' ),
		'off' => esc_attr__( 'Off', 'igaa' ),
	),
) );

/* Submenu */
Igaa_Kirki::add_section( 'igaa_header_submenu', array(
    'title'          => __( 'Submenu Area', 'igaa' ),
    'panel'          => 'igaa_header_panel',
    'priority'       => 10,
    'capability'     => 'edit_theme_options',
    'theme_supports' => '',
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_submenu_top_margin',
	'label'       => esc_attr__( 'Submenu Top Margin', 'igaa' ),
    'section'     => 'igaa_header_submenu',
	'default'     => 15,
	'choices'     => array(
		'min'  => '-100',
		'max'  => '300',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.uk-dropdown-navbar',
			'property' => 'margin-top',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.uk-dropdown-navbar',
                'function' => 'css',
                'property' => 'margin-top',
                'units'    => 'px',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_submenu_font_color',
	'label'       => esc_attr__( 'Submenu Font Color', 'igaa' ),
	'section'     => 'igaa_header_submenu',
	'default'     => '#444',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => '.uk-dropdown li > a',
			'property' => 'color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.uk-dropdown li > a',
                'function' => 'css',
                'property' => 'color',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_submenu_background_color',
	'label'       => esc_attr__( 'Submenu Background Color', 'igaa' ),
	'section'     => 'igaa_header_submenu',
	'default'     => '#f5f5f5',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => '.uk-dropdown-navbar',
			'property' => 'background-color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.uk-dropdown-navbar',
                'function' => 'css',
                'property' => 'background-color',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_submenu_hover_background_color',
	'label'       => esc_attr__( 'Submenu Hover Background Color', 'igaa' ),
	'section'     => 'igaa_header_submenu',
	'default'     => '#404040',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => '.uk-nav-navbar > li > a:hover, .uk-nav-navbar > li > a:focus',
			'property' => 'background-color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.uk-nav-navbar > li > a:hover, .uk-nav-navbar > li > a:focus',
                'function' => 'css',
                'property' => 'background-color',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_submenu_hover_font_color',
	'label'       => esc_attr__( 'Submenu Hover Font Color', 'igaa' ),
	'section'     => 'igaa_header_submenu',
	'default'     => '#ffffff',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => '.uk-nav-navbar > li > a:hover, .uk-nav-navbar > li > a:focus',
			'property' => 'color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.uk-nav-navbar > li > a:hover, .uk-nav-navbar > li > a:focus',
                'function' => 'css',
                'property' => 'color',
            ),
        )
) );

/* Mobile Menu */
Igaa_Kirki::add_section( 'igaa_header_mobile_menu', array(
    'title'          => __( 'Mobile Menu Area', 'igaa' ),
    'panel'          => 'igaa_header_panel',
    'priority'       => 10,
    'capability'     => 'edit_theme_options',
    'theme_supports' => '',
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_mobile_menu_background_color',
	'label'       => esc_attr__( 'Mobile Menu Background Color', 'igaa' ),
	'section'     => 'igaa_header_mobile_menu',
	'default'     => '#333',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => '.uk-offcanvas-bar',
			'property' => 'background-color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.uk-offcanvas-bar',
                'function' => 'css',
                'property' => 'background-color',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_mobile_menu_hover_background_color',
	'label'       => esc_attr__( 'Mobile Menu Hover Background Color', 'igaa' ),
	'section'     => 'igaa_header_mobile_menu',
	'default'     => '#404040',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => '.uk-nav-offcanvas > .uk-open > a, html:not(.uk-touch) .uk-nav-offcanvas > li > a:focus, html:not(.uk-touch) .uk-nav-offcanvas > li > a:hover',
			'property' => 'background-color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.uk-nav-offcanvas > .uk-open > a, html:not(.uk-touch) .uk-nav-offcanvas > li > a:focus, html:not(.uk-touch) .uk-nav-offcanvas > li > a:hover',
                'function' => 'css',
                'property' => 'background-color',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_mobile_menu_hover_font_color',
	'label'       => esc_attr__( 'Mobile Menu Hover Font Color', 'igaa' ),
	'section'     => 'igaa_header_mobile_menu',
	'default'     => '#ffffff',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => '.uk-nav-offcanvas > .uk-open > a, html:not(.uk-touch) .uk-nav-offcanvas > li > a:focus, html:not(.uk-touch) .uk-nav-offcanvas > li > a:hover',
			'property' => 'color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.uk-nav-offcanvas > .uk-open > a, html:not(.uk-touch) .uk-nav-offcanvas > li > a:focus, html:not(.uk-touch) .uk-nav-offcanvas > li > a:hover',
                'function' => 'css',
                'property' => 'color',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_mobile_active_item_color',
	'label'       => esc_attr__( 'Mobile Menu Active Item Color', 'igaa' ),
	'section'     => 'igaa_header_mobile_menu',
	'default'     => '#ffffff',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => 'html .uk-nav.uk-nav-offcanvas > li.uk-active > a',
			'property' => 'color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => 'html .uk-nav.uk-nav-offcanvas > li.uk-active > a',
                'function' => 'css',
                'property' => 'color',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_mobile_active_item_background_color',
	'label'       => esc_attr__( 'Mobile Menu Active Item Background Color', 'igaa' ),
	'section'     => 'igaa_header_mobile_menu',
	'default'     => '#1a1a1a',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => 'html .uk-nav.uk-nav-offcanvas > li.uk-active > a',
			'property' => 'background-color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => 'html .uk-nav.uk-nav-offcanvas > li.uk-active > a',
                'function' => 'css',
                'property' => 'background-color',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_mobile_submenu_hover_font_color',
	'label'       => esc_attr__( 'Mobile Menu Submenu Hover Font Color', 'igaa' ),
	'section'     => 'igaa_header_mobile_menu',
	'default'     => '#ffffff',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => 'html:not(.uk-touch) .uk-nav-offcanvas ul a:hover',
			'property' => 'color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => 'html:not(.uk-touch) .uk-nav-offcanvas ul a:hover',
                'function' => 'css',
                'property' => 'color',
            ),
        )
) );


/* Page Title */
Igaa_Kirki::add_section( 'igaa_header_hero', array(
    'title'          => __( 'Page Title Area', 'igaa' ),
    'panel'          => 'igaa_header_panel',
    'priority'       => 10,
    'capability'     => 'edit_theme_options',
    'theme_supports' => '',
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_hero_area_background_color',
	'label'       => esc_attr__( 'Page Title Area Background Color', 'igaa' ),
	'section'     => 'igaa_header_hero',
	'default'     => '#f1f1f1',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => '.hero-area',
			'property' => 'background-color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.hero-area',
                'function' => 'css',
                'property' => 'background-color',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_hero_area_title_color',
	'label'       => esc_attr__( 'Page Title Color', 'igaa' ),
	'section'     => 'igaa_header_hero',
	'default'     => '#444',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => '.page-title',
			'property' => 'color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.page-title',
                'function' => 'css',
                'property' => 'color',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'image',
	'settings'    => 'igaa_page_title_area_background_image',
	'label'       => esc_attr__( 'Page Title Area Background Image', 'igaa' ),
	'section'     => 'igaa_header_hero',
	'default'     => '',
	'priority'    => 10,
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_page_title_top_spacing',
	'label'       => esc_attr__( 'Page Title Area Top Spacing', 'igaa' ),
    'section'     => 'igaa_header_hero',
	'default'     => 100,
	'choices'     => array(
		'min'  => '0',
		'max'  => '500',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.hero-area',
			'property' => 'padding-top',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.hero-area',
                'function' => 'css',
                'property' => 'padding-top',
                'units'    => 'px',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_page_title_bottom_spacing',
	'label'       => esc_attr__( 'Page Title Area Bottom Spacing', 'igaa' ),
    'section'     => 'igaa_header_hero',
	'default'     => 100,
	'choices'     => array(
		'min'  => '0',
		'max'  => '500',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.hero-area',
			'property' => 'padding-bottom',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.hero-area',
                'function' => 'css',
                'property' => 'padding-bottom',
                'units'    => 'px',
            ),
        )
) );

/* end Header Panel */

/**
 * Content Area panel, sections, fields 
 */
Igaa_Kirki::add_panel( 'igaa_content_panel', array(
    'priority'    => 12,
    'title'       => __( 'Content Area', 'igaa' ),
) );

/* Styling */
Igaa_Kirki::add_section( 'igaa_content_styling', array(
    'title'          => __( 'Content Styling', 'igaa' ),
    'panel'          => 'igaa_content_panel',
    'priority'       => 10,
    'capability'     => 'edit_theme_options',
    'theme_supports' => '',
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_content_top_spacing',
	'label'       => esc_attr__( 'Content Top Spacing', 'igaa' ),
    'section'     => 'igaa_content_styling',
	'default'     => 25,
	'choices'     => array(
		'min'  => '0',
		'max'  => '300',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.site-main',
			'property' => 'padding-top',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.site-main',
                'function' => 'css',
                'property' => 'padding-top',
                'units'    => 'px',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_content_bottom_spacing',
	'label'       => esc_attr__( 'Content Bottom Spacing', 'igaa' ),
    'section'     => 'igaa_content_styling',
	'default'     => 25,
	'choices'     => array(
		'min'  => '0',
		'max'  => '300',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.site-main',
			'property' => 'padding-bottom',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.site-main',
                'function' => 'css',
                'property' => 'padding-bottom',
                'units'    => 'px',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_content_left_spacing',
	'label'       => esc_attr__( 'Content Left Spacing', 'igaa' ),
    'section'     => 'igaa_content_styling',
	'default'     => 25,
	'choices'     => array(
		'min'  => '0',
		'max'  => '300',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.site-main',
			'property' => 'padding-left',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.site-main',
                'function' => 'css',
                'property' => 'padding-left',
                'units'    => 'px',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_content_right_spacing',
	'label'       => esc_attr__( 'Content Right Spacing', 'igaa' ),
    'section'     => 'igaa_content_styling',
	'default'     => 25,
	'choices'     => array(
		'min'  => '0',
		'max'  => '300',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.site-main',
			'property' => 'padding-right',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.site-main',
                'function' => 'css',
                'property' => 'padding-right',
                'units'    => 'px',
            ),
        )
) );

/* Colors */
Igaa_Kirki::add_section( 'igaa_content_colors', array(
    'title'          => __( 'Content Colors', 'igaa' ),
    'panel'          => 'igaa_content_panel',
    'priority'       => 11,
    'capability'     => 'edit_theme_options',
    'theme_supports' => '',
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_content_background_color',
	'label'       => esc_attr__( 'Content Area Background Color', 'igaa' ),
	'section'     => 'igaa_content_colors',
	'default'     => '#ffffff',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => '.site-main',
			'property' => 'background-color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.site-main',
                'function' => 'css',
                'property' => 'background-color',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_content_heading_color',
	'label'       => esc_attr__( 'Content Headings Color', 'igaa' ),
	'section'     => 'igaa_content_colors',
	'default'     => '#444444',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => '.entry-title, .entry-title a',
			'property' => 'color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.entry-title, .entry-title a',
                'function' => 'css',
                'property' => 'color',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_content_heading_hover_color',
	'label'       => esc_attr__( 'Content Headings Hover Color', 'igaa' ),
	'section'     => 'igaa_content_colors',
	'default'     => '#999999',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => '.entry-title a:hover',
			'property' => 'color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.entry-title a:hover',
                'function' => 'css',
                'property' => 'color',
            ),
        )
) );
/* end Content Area Panel */

/**
 * Sidebar panel, sections, fields
 */
Igaa_Kirki::add_panel( 'igaa_sidebar_panel', array(
    'priority'    => 13,
    'title'       => __( 'Sidebar', 'igaa' ),
) );

/* Layout */
Igaa_Kirki::add_section( 'igaa_sidebar_layout', array(
    'title'          => __( 'Sidebar Layout', 'igaa' ),
    'panel'          => 'igaa_sidebar_panel',
    'priority'       => 10,
    'capability'     => 'edit_theme_options',
    'theme_supports' => '',
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'radio',
	'settings'    => 'igaa_sidebar_position',
	'label'       => esc_attr__( 'Blog Sidebar Position', 'igaa' ),
	'section'     => 'igaa_sidebar_layout',
	'default'     => 'right',
	'priority'    => 10,
	'choices'     => array(
		'left'   => esc_attr__( 'Left', 'igaa' ),
		'right' => esc_attr__( 'Right', 'igaa' ),
		'none'  => esc_attr__( 'None', 'igaa' ),
	),
) );

/* Styling */
Igaa_Kirki::add_section( 'igaa_sidebar_styling', array(
    'title'          => __( 'Sidebar Styling', 'igaa' ),
    'panel'          => 'igaa_sidebar_panel',
    'priority'       => 10,
    'capability'     => 'edit_theme_options',
    'theme_supports' => '',
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_sidebar_content_top_spacing',
	'label'       => esc_attr__( 'Sidebar Content Top Spacing', 'igaa' ),
    'section'     => 'igaa_sidebar_styling',
	'default'     => 25,
	'choices'     => array(
		'min'  => '0',
		'max'  => '300',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.sidebar-content',
			'property' => 'padding-top',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.sidebar-content',
                'function' => 'css',
                'property' => 'padding-top',
                'units'    => 'px',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_sidebar_content_bottom_spacing',
	'label'       => esc_attr__( 'Sidebar Content Bottom Spacing', 'igaa' ),
    'section'     => 'igaa_sidebar_styling',
	'default'     => 25,
	'choices'     => array(
		'min'  => '0',
		'max'  => '300',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.sidebar-content',
			'property' => 'padding-bottom',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.sidebar-content',
                'function' => 'css',
                'property' => 'padding-bottom',
                'units'    => 'px',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_sidebar_content_left_spacing',
	'label'       => esc_attr__( 'Sidebar Content Left Spacing', 'igaa' ),
    'section'     => 'igaa_sidebar_styling',
	'default'     => 25,
	'choices'     => array(
		'min'  => '0',
		'max'  => '100',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.sidebar-content',
			'property' => 'padding-left',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.sidebar-content',
                'function' => 'css',
                'property' => 'padding-left',
                'units'    => 'px',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_sidebar_content_right_spacing',
	'label'       => esc_attr__( 'Sidebar Content Right Spacing', 'igaa' ),
    'section'     => 'igaa_sidebar_styling',
	'default'     => 25,
	'choices'     => array(
		'min'  => '0',
		'max'  => '100',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.sidebar-content',
			'property' => 'padding-right',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.sidebar-content',
                'function' => 'css',
                'property' => 'padding-right',
                'units'    => 'px',
            ),
        )
) );

/* Colors */
Igaa_Kirki::add_section( 'igaa_sidebar_colors', array(
    'title'          => __( 'Sidebar Colors', 'igaa' ),
    'panel'          => 'igaa_sidebar_panel',
    'priority'       => 10,
    'capability'     => 'edit_theme_options',
    'theme_supports' => '',
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'color',
	'settings'    => 'igaa_sidebar_background_color',
	'label'       => esc_attr__( 'Sidebar Background Color', 'igaa' ),
	'section'     => 'igaa_sidebar_colors',
	'default'     => '#ffffff',
	'priority'    => 10,
	'alpha'       => true,
    'output' => array(
		array(
			'element'  => '.sidebar-content',
			'property' => 'background-color',
			
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.sidebar-content',
                'function' => 'css',
                'property' => 'background-color',
            ),
        )
) );

/* end Sidebar Panel */

/**
 * Single post panel, sections, fields
 */
Igaa_Kirki::add_panel( 'igaa_single_post_panel', array(
    'priority'    => 14,
    'title'       => __( 'Single Post', 'igaa' ),
) );

/* Layout */
Igaa_Kirki::add_section( 'igaa_single_post_layout', array(
    'title'          => __( 'Single Post Layout', 'igaa' ),
    'panel'          => 'igaa_single_post_panel',
    'priority'       => 10,
    'capability'     => 'edit_theme_options',
    'theme_supports' => '',
) );

Igaa_Kirki::add_field( 'igaa_config', array(
    'type'        => 'sortable',
    'settings'    => 'igaa_single_post_template_parts',
    'label'       => __( 'Single Post Template Parts', 'igaa' ),
    'description' => __( 'Enable/disable and reorder the template parts of single post.', 'igaa' ),
    'section'     => 'igaa_single_post_layout',
    'default'     => array(
        'title',
        'meta',
        'featured-image',
        'content',
        'taxonomy'
    ),
    'choices'     => array(
        'title'          => __( 'Title', 'igaa' ),
        'meta'           => __( 'Meta', 'igaa' ),
        'featured-image' => __( 'Featured Image', 'igaa' ),
        'content'        => __( 'Content', 'igaa' ),
        'taxonomy'       => __( 'Taxonomy', 'igaa' ),
    ),
    'priority'    => 10,
) );

/* Styling */
Igaa_Kirki::add_section( 'igaa_single_post_styling', array(
    'title'          => __( 'Single Post Styling', 'igaa' ),
    'panel'          => 'igaa_single_post_panel',
    'priority'       => 10,
    'capability'     => 'edit_theme_options',
    'theme_supports' => '',
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_single_post_title_top_spacing',
	'label'       => esc_attr__( 'Single Post Title Top Spacing', 'igaa' ),
    'section'     => 'igaa_single_post_styling',
	'default'     => 0,
	'choices'     => array(
		'min'  => '-300',
		'max'  => '300',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.single-post-header',
			'property' => 'margin-top',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.single-post-header',
                'function' => 'css',
                'property' => 'margin-top',
                'units'    => 'px',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_single_post_title_bottom_spacing',
	'label'       => esc_attr__( 'Single Post Title Bottom Spacing', 'igaa' ),
    'section'     => 'igaa_single_post_styling',
	'default'     => 0,
	'choices'     => array(
		'min'  => '-300',
		'max'  => '300',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.single-post-header',
			'property' => 'margin-bottom',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.single-post-header',
                'function' => 'css',
                'property' => 'margin-bottom',
                'units'    => 'px',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_single_post_meta_top_spacing',
	'label'       => esc_attr__( 'Single Post Meta Top Spacing', 'igaa' ),
    'section'     => 'igaa_single_post_styling',
	'default'     => 0,
	'choices'     => array(
		'min'  => '-300',
		'max'  => '300',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.single-post-meta',
			'property' => 'margin-top',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.single-post-meta',
                'function' => 'css',
                'property' => 'margin-top',
                'units'    => 'px',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_single_post_meta_bottom_spacing',
	'label'       => esc_attr__( 'Single Post Meta Bottom Spacing', 'igaa' ),
    'section'     => 'igaa_single_post_styling',
	'default'     => 50,
	'choices'     => array(
		'min'  => '-300',
		'max'  => '300',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.single-post-meta',
			'property' => 'margin-bottom',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.single-post-meta',
                'function' => 'css',
                'property' => 'margin-bottom',
                'units'    => 'px',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_single_post_content_top_spacing',
	'label'       => esc_attr__( 'Single Post Content Top Spacing', 'igaa' ),
    'section'     => 'igaa_single_post_styling',
	'default'     => 15,
	'choices'     => array(
		'min'  => '-300',
		'max'  => '300',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.single-post-content',
			'property' => 'margin-top',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.single-post-content',
                'function' => 'css',
                'property' => 'margin-top',
                'units'    => 'px',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_single_post_content_bottom_spacing',
	'label'       => esc_attr__( 'Single Post Content Bottom Spacing', 'igaa' ),
    'section'     => 'igaa_single_post_styling',
	'default'     => 15,
	'choices'     => array(
		'min'  => '-300',
		'max'  => '300',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.single-post-content',
			'property' => 'margin-bottom',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.single-post-content',
                'function' => 'css',
                'property' => 'margin-bottom',
                'units'    => 'px',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_single_post_taxonomy_top_spacing',
	'label'       => esc_attr__( 'Single Post Taxonomy Top Spacing', 'igaa' ),
    'section'     => 'igaa_single_post_styling',
	'default'     => 50,
	'choices'     => array(
		'min'  => '-300',
		'max'  => '300',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.single-post-taxonomy',
			'property' => 'margin-top',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.single-post-taxonomy',
                'function' => 'css',
                'property' => 'margin-top',
                'units'    => 'px',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_single_post_taxonomy_bottom_spacing',
	'label'       => esc_attr__( 'Single Post Taxonomy Bottom Spacing', 'igaa' ),
    'section'     => 'igaa_single_post_styling',
	'default'     => 0,
	'choices'     => array(
		'min'  => '-300',
		'max'  => '300',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.single-post-taxonomy',
			'property' => 'margin-bottom',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.single-post-taxonomy',
                'function' => 'css',
                'property' => 'margin-bottom',
                'units'    => 'px',
            ),
        )
) );

/* end Single Post Panel */

/**
 * Footer panel, sections, fields 
 */
Igaa_Kirki::add_panel( 'igaa_footer_panel', array(
    'priority'    => 15,
    'title'       => __( 'Footer', 'igaa' ),
) );

/* Styling */
Igaa_Kirki::add_section( 'igaa_footer_styling', array(
    'title'          => __( 'Footer Styling', 'igaa' ),
    'panel'          => 'igaa_footer_panel',
    'priority'       => 11,
    'capability'     => 'edit_theme_options',
    'theme_supports' => '',
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_footer_top_spacing',
	'label'       => esc_attr__( 'Footer Top Spacing', 'igaa' ),
    'section'     => 'igaa_footer_styling',
	'default'     => 50,
	'choices'     => array(
		'min'  => '0',
		'max'  => '300',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.site-footer',
			'property' => 'padding-top',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.site-footer',
                'function' => 'css',
                'property' => 'padding-top',
                'units'    => 'px',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_footer_bottom_spacing',
	'label'       => esc_attr__( 'Footer Bottom Spacing', 'igaa' ),
    'section'     => 'igaa_footer_styling',
	'default'     => 50,
	'choices'     => array(
		'min'  => '0',
		'max'  => '300',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.site-footer',
			'property' => 'padding-bottom',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.site-footer',
                'function' => 'css',
                'property' => 'padding-bottom',
                'units'    => 'px',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_footer_left_spacing',
	'label'       => esc_attr__( 'Footer Left Spacing', 'igaa' ),
    'section'     => 'igaa_footer_styling',
	'default'     => 0,
	'choices'     => array(
		'min'  => '0',
		'max'  => '300',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.site-footer',
			'property' => 'padding-left',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.site-footer',
                'function' => 'css',
                'property' => 'padding-left',
                'units'    => 'px',
            ),
        )
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'slider',
	'settings'    => 'igaa_footer_right_spacing',
	'label'       => esc_attr__( 'Footer Right Spacing', 'igaa' ),
    'section'     => 'igaa_footer_styling',
	'default'     => 0,
	'choices'     => array(
		'min'  => '0',
		'max'  => '300',
		'step' => '5',
	),
    'output' => array(
		array(
			'element'  => '.site-footer',
			'property' => 'padding-right',
			'units'    => 'px',
		),
    ),
    'transport'   => 'postMessage',
    'js_vars'     => array(
            array(
                'element'  => '.site-footer',
                'function' => 'css',
                'property' => 'padding-right',
                'units'    => 'px',
            ),
        )
) );

/* Copyright */
Igaa_Kirki::add_section( 'igaa_footer_copyright', array(
    'title'          => __( 'Footer Bottom', 'igaa' ),
    'panel'          => 'igaa_footer_panel',
    'priority'       => 11,
    'capability'     => 'edit_theme_options',
    'theme_supports' => '',
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'     => 'textarea',
	'settings' => 'igaa_copyright_text',
	'label'    => esc_attr__( 'Copyright Text', 'igaa' ),
	'section'  => 'igaa_footer_copyright',
	'default'  => esc_attr__( 'Made by e-press24', 'igaa' ),
	'priority' => 10,
    'transport' => 'postMessage',
	'js_vars'   => array(
		array(
			'element'  => '.site-info',
			'function' => 'html',
			
		),
		
	)
) );

/* end Footer Panel */

/**
 * Animations panel, sections, fields 
 */
Igaa_Kirki::add_panel( 'igaa_animations_panel', array(
    'priority'    => 16,
    'title'       => __( 'Animations', 'igaa' ),
) );

Igaa_Kirki::add_section( 'igaa_content_animations', array(
    'title'          => __( 'Content Animations', 'igaa' ),
    'panel'          => 'igaa_animations_panel',
    'priority'       => 11,
    'capability'     => 'edit_theme_options',
    'theme_supports' => '',
) );

Igaa_Kirki::add_field( 'igaa_config', array(
	'type'        => 'radio',
	'settings'    => 'igaa_entry_content_animations',
	'label'       => esc_attr__( 'Entry Blog Content Animations', 'igaa' ),
	'section'     => 'igaa_content_animations',
	'default'     => 'fade',
	'priority'    => 10,
	'choices'     => array(
		'fade'   => esc_attr__( 'Fade (Default)', 'igaa' ),
		'scaleup' => esc_attr__( 'Scale Up', 'igaa' ),
		'scaledown'  => esc_attr__( 'Scale Down', 'igaa' ),
        'slidetop'  => esc_attr__( 'Slide Top', 'igaa' ),
        'slidebottom'  => esc_attr__( 'Slide Bottom', 'igaa' ),
        'slideleft'  => esc_attr__( 'Slide Left', 'igaa' ),
        'slideright'  => esc_attr__( 'Slide Right', 'igaa' ),
	),
) ); 