<?php 
if (class_exists('Kirki')) {

	/**
	* Remove sections default
	*/
	function auliettalites_changer_sections( $wp_customize ) {
	    $wp_customize->remove_section( 'title_tagline' );
	    $wp_customize->remove_section( 'colors' );
	    $wp_customize->remove_section( 'background_image' );
	    $wp_customize->remove_panel( 'tt_font_typography_panel' );
	}

	add_action( 'customize_register', 'auliettalites_changer_sections' );

	// Custormizer setting ----------------------------------------------------------------------------------------------
	Kirki::add_config( 'auliettalite_theme_option', array(
		'capability'    => 'edit_theme_options',
		'option_type'   => 'theme_mod',
	) );

	/*----------------------------*/
	#Header
	/*----------------------------*/
	// Kirki::add_panel( 'auliettalite_header_setting', array(
	//     'title'       => esc_html__( 'Header', 'auliettalite' ),
	//     'priority'    => 1,
	// ) );
	// Site Indentity
	Kirki::add_section( 'title_tagline', array(
	    'title'          => esc_html__( 'Site Indentity', 'auliettalite' ),
	    // 'panel'          => 'auliettalite_header_setting',
	    'priority'       => 2,
	) );
	Kirki::add_field( 'auliettalite_theme_option', [
		'type'        => 'radio',
		'settings'    => 'auliettalite_logo_type',
		'label'       => esc_html__( 'Header Type', 'auliettalite' ),
		'section'     => 'title_tagline',
		'default'     => 'logo',
		'priority'    => 5,
		'choices'     => [
			'logo'   => esc_html__( 'Logo', 'auliettalite' ),
			'Title' => esc_html__( 'Title', 'auliettalite' ),
		],
	] );
	Kirki::add_field( 'auliettalite_theme_option', [
		'type'        => 'radio-buttonset',
		'settings'    => 'auliettalite_hide_tagline',
		'label'       => esc_html__( 'Display tagline?', 'auliettalite' ),
		'section'     => 'title_tagline',
		'default'     => 'hide',
		'priority'    => 15,
		'choices'     => [
			'show'   => esc_html__( 'Show', 'auliettalite' ),
			'hide' => esc_html__( 'Hide', 'auliettalite' ),
		],
	] );

	/*------------------------------
			Genaral
	--------------------------------*/
	Kirki::add_panel( 'auliettalite_style_setting', array(
	    'title'       => esc_html__( 'Site Setting', 'auliettalite' ),
	    'priority'    => 5,
	) );	
	Kirki::add_section( 'colors', array(
	    'title'          => esc_html__( 'Color', 'auliettalite' ),
	    'panel'          => 'auliettalite_style_setting',
	    'priority'       => 5,
	) );
	Kirki::add_field( 'auliettalite_theme_option', [
		'type'        => 'color',
		'settings'    => 'auliettalite_accent_color',
		'label'       => __( 'Accent Color', 'auliettalite' ),
		'section'     => 'colors',
		'default'     => '#e8a49c',
	] );
	Kirki::add_field( 'auliettalite_theme_option', [
		'type'        => 'color',
		'settings'    => 'auliettalite_secondary_color',
		'label'       => __( 'Secondary Color', 'auliettalite' ),
		'section'     => 'colors',
		'default'     => '#ddd',
	] );
	Kirki::add_section( 'background_image', array(
	    'title'          => esc_html__( 'Background Image', 'auliettalite' ),
	    'panel'          => 'auliettalite_style_setting',
	    'priority'       => 10,
	) );
	/* ------------------------------
			Blog Setting
	--------------------------------*/
	Kirki::add_panel( 'auliettalite_blog', array(
	    'title'       => esc_html__( 'Blog Setting', 'auliettalite' ),
	    'priority'    => 10,
	) );

	Kirki::add_section( 'auliettalite_blog_layout_setting', array(
	    'title'          => esc_html__( 'Blog Layout', 'auliettalite' ),
	    'panel'          => 'auliettalite_blog',
	    'priority'       => 1,
	) );
	Kirki::add_field( 'auliettalite_theme_option', [
		'type'        => 'image',
		'settings'    => 'image_banner_blog',
		'label'       => esc_html__( 'Image Banner (URL)', 'auliettalite' ),
		'section'     => 'auliettalite_blog_layout_setting',
		'default'     => '',
		'priority'       => 2,
	] );
	Kirki::add_field( 'auliettalite_theme_option', [
		'type'     => 'text',
		'settings' => 'title_banner_blog',
		'label'    => esc_html__( 'Title Blog', 'auliettalite' ),
		'section'  => 'auliettalite_blog_layout_setting',
		'default'  => esc_html__( 'Our Blog', 'auliettalite' ),
		'priority' => 3,
	] );
	Kirki::add_section( 'auliettalite_archive_setting', array(
	    'title'          => esc_html__( 'Blog Archive', 'auliettalite' ),
	    'panel'          => 'auliettalite_blog',
	    'priority'       => 2,
	) );
	Kirki::add_field( 'auliettalite_theme_option', [
		'type'        => 'image',
		'settings'    => 'image_banner_archive',
		'label'       => esc_html__( 'Image Banner (URL)', 'auliettalite' ),
		'section'     => 'auliettalite_archive_setting',
		'default'     => '',
		'priority'       => 2,
	] );

	// #Social Media
	Kirki::add_section( 'auliettalite_social_network', array(
	    'title'          => esc_html__( 'Social Networks', 'auliettalite' ),
	    'priority'       => 15,
	) );
	Kirki::add_field( 'auliettalite_theme_option', [
		'type'     => 'text',
		'settings' => 'auliettalite_facebook_url',
		'label'    => esc_html__( 'Facebook Url', 'auliettalite' ),
		'section'  => 'auliettalite_social_network',
		'priority' => 1,
	] );
	Kirki::add_field( 'auliettalite_theme_option', [
		'type'     => 'text',
		'settings' => 'auliettalite_twitter_url',
		'label'    => esc_html__( 'Twitter Url', 'auliettalite' ),
		'section'  => 'auliettalite_social_network',
		'priority' => 2,
	] );
	Kirki::add_field( 'auliettalite_theme_option', [
		'type'     => 'text',
		'settings' => 'auliettalite_instagram_url',
		'label'    => esc_html__( 'Instagram Url', 'auliettalite' ),
		'section'  => 'auliettalite_social_network',
		'priority' => 3,
	] );
	Kirki::add_field( 'auliettalite_theme_option', [
		'type'     => 'text',
		'settings' => 'auliettalite_pinterest_url',
		'label'    => esc_html__( 'Pinterest Url', 'auliettalite' ),
		'section'  => 'auliettalite_social_network',
		'priority' => 4,
	] );
	Kirki::add_field( 'auliettalite_theme_option', [
		'type'     => 'text',
		'settings' => 'auliettalite_linkedin_url',
		'label'    => esc_html__( 'Linkedin Url', 'auliettalite' ),
		'section'  => 'auliettalite_social_network',
		'priority' => 5,
	] );
	Kirki::add_field( 'auliettalite_theme_option', [
		'type'     => 'text',
		'settings' => 'auliettalite_youtube_url',
		'label'    => esc_html__( 'Youtube Url', 'auliettalite' ),
		'section'  => 'auliettalite_social_network',
		'priority' => 6,
	] );
	Kirki::add_field( 'auliettalite_theme_option', [
		'type'     => 'text',
		'settings' => 'auliettalite_vimeo_url',
		'label'    => esc_html__( 'Vimeo Url', 'auliettalite' ),
		'section'  => 'auliettalite_social_network',
		'priority' => 7,
	] );

	#Footer
	Kirki::add_section( 'auliettalite_footer_setting', array(
	    'title'          => esc_html__( 'Footer', 'auliettalite' ),
	    'priority'       => 20,
	) );
	Kirki::add_field( 'auliettalite_theme_option', [
		'type'     => 'textarea',
		'settings' => 'auliettalite_footer_copyright_text',
		'label'    => esc_html__( 'Copyright Text', 'auliettalite' ),
		'section'  => 'auliettalite_footer_setting',
	] );

}

?>