<?php
function rawindustry_blog_setting( $wp_customize ) {
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh';
	$wp_customize->add_panel(
		'rawindustry_frontpage_sections', array(
			'priority' => 32,
			'title' => esc_html__( 'Frontpage Sections', 'raw-industry' ),
		)
	);
	
 
	/*=========================================
	Slider Section
	=========================================*/
	$wp_customize->add_section(
		'slider_setting', array(
			'title' => esc_html__( 'Slider Section', 'raw-industry' ),
			'description'=> __('<a>Note :</a> Image Size Should Be 1200*700','raw-industry'),
			'priority' => 1,
			'panel' => 'rawindustry_frontpage_sections',
		)
	);



	$wp_customize->add_setting('rawindustry_slider_tabs', array(
	   'sanitize_callback' => 'wp_kses_post',
	));

	$wp_customize->add_control(new rawindustry_Tab_Control($wp_customize, 'rawindustry_slider_tabs', array(
	   'section' => 'slider_setting',
	   'priority' => 2,
	   'buttons' => array(
	      array(
         	'name' => esc_html__('General', 'raw-industry'),
            'icon' => 'dashicons dashicons-welcome-write-blog',
            'fields' => array(
            	'slider1',
            	'slider2',
            	'slider3',
            	'slider4',
            	'slider5',
            	'slider6',
				'slider_btn1text',
				'slider_btn2text'
            ),
            'active' => true,
         ), 
	      array(
            'name' => esc_html__('Style', 'raw-industry'),
        	'icon' => 'dashicons dashicons-art',
            'fields' => array(
                'slider_titlecolor',
				'slider_descriptioncolor',
				'slider_btn1textcolor',
				'slider_btn1bgcolor',
				'slider_btn2textcolor',
				'slider_btn2bgcolor',
				'slider_Arrowcolor',
				'slider_ArrowBGcolor',
				'slider_ArrowBGHovercolor'

            ),
     	),
		 array(
		   'name' => esc_html__('Layout', 'raw-industry'),
		   'icon' => 'dashicons dashicons-layout',
		   'fields' => array(
			   'rawindustry_slider_section_width',
		   ),
		)
	    
    	),
	))); 


	

	// General Tab

	// Slider 1
	$wp_customize->add_setting( 
    	'slider1',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider1',
		array(
		    'label'   		=> __('Slider 1','raw-industry'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);		



	// Slider 2
	$wp_customize->add_setting(
    	'slider2',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'slider2',
		array(
		    'label'   		=> __('Slider 2','raw-industry'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);	


	// Slider 3
	$wp_customize->add_setting(
    	'slider3',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 5,
		)
	);	

	$wp_customize->add_control( 
		'slider3',
		array(
		    'label'   		=> __('Slider 3','raw-industry'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);	


	// Slider 4
	$wp_customize->add_setting(
    	'slider4',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 6,
		)
	);	

	$wp_customize->add_control( 
		'slider4',
		array(
		    'label'   		=> __('Slider 4','raw-industry'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);



	// Slider 5
	$wp_customize->add_setting(
    	'slider5',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 7,
		)
	);	

	$wp_customize->add_control( 
		'slider5',
		array(
		    'label'   		=> __('Slider 5','raw-industry'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	); 

	// Slider 6
	$wp_customize->add_setting(
    	'slider6',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 7,
		)
	);	

	$wp_customize->add_control( 
		'slider6',
		array(
		    'label'   		=> __('Slider 6','raw-industry'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);

	// slider btn1text
	$sliderbtn1text = esc_html__('More About Us', 'raw-industry' );
	$wp_customize->add_setting(
    	'slider_btn1text',
    	array(
			'default' => $sliderbtn1text,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 6,
		)
	);	

	$wp_customize->add_control( 
		'slider_btn1text',
		array(
		    'label'   		=> __('Button 1 Text','raw-industry'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);

	// slider btn2text
	$sliderbtn2text = esc_html__('Our Services', 'raw-industry' );
	$wp_customize->add_setting(
    	'slider_btn2text',
    	array(
			'default' => $sliderbtn2text,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 6,
		)
	);	

	$wp_customize->add_control( 
		'slider_btn2text',
		array(
		    'label'   		=> __('Button 2 Text','raw-industry'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);



	// Style setting

	// slider title Color
	$slidertitlecolor = esc_html__('#fff', 'raw-industry' );
	$wp_customize->add_setting(
    	'slider_titlecolor',
    	array(
			'default' => $slidertitlecolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_titlecolor',
		array(
		    'label'   		=> __('Title Color','raw-industry'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// slider description Color
	$sliderdescriptioncolor = esc_html__('#fff', 'raw-industry' );
	$wp_customize->add_setting(
    	'slider_descriptioncolor',
    	array(
			'default' => $sliderdescriptioncolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_descriptioncolor',
		array(
		    'label'   		=> __('Description Color','raw-industry'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// slider btn1text Color
	$sliderbtn1textcolor = esc_html__('#fff', 'raw-industry' );
	$wp_customize->add_setting(
    	'slider_btn1textcolor',
    	array(
			'default' => $sliderbtn1textcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_btn1textcolor',
		array(
		    'label'   		=> __('Button 1 Text Color','raw-industry'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// slider btn1bg Color
	$sliderbtn1bgcolor = esc_html__('#E11D07', 'raw-industry' );
	$wp_customize->add_setting(
    	'slider_btn1bgcolor',
    	array(
			'default' => $sliderbtn1bgcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_btn1bgcolor',
		array(
		    'label'   		=> __('Button 1 BG Color','raw-industry'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// slider btn2text Color
	$sliderbtn2textcolor = esc_html__('#000', 'raw-industry' );
	$wp_customize->add_setting(
    	'slider_btn2textcolor',
    	array(
			'default' => $sliderbtn2textcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_btn2textcolor',
		array(
		    'label'   		=> __('Button 2 Text Color','raw-industry'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// slider btn2bg Color
	$sliderbtn2bgcolor = esc_html__('#fff', 'raw-industry' );
	$wp_customize->add_setting(
    	'slider_btn2bgcolor',
    	array(
			'default' => $sliderbtn2bgcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_btn2bgcolor',
		array(
		    'label'   		=> __('Button 2 BG Color','raw-industry'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


	// slider Arrow Color
	$sliderArrowcolor = esc_html__('#fff', 'raw-industry' );
	$wp_customize->add_setting(
    	'slider_Arrowcolor',
    	array(
			'default' => $sliderArrowcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_Arrowcolor',
		array(
		    'label'   		=> __('Slider Arrow Color','raw-industry'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


		// slider Arrow BG Color
	$sliderArrowBGcolor = esc_html__('#E11D07', 'raw-industry' );
	$wp_customize->add_setting(
    	'slider_ArrowBGcolor',
    	array(
			'default' => $sliderArrowBGcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_ArrowBGcolor',
		array(
		    'label'   		=> __('Slider Arrow BG Color','raw-industry'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


	// slider Arrow BG Hover Color
	$sliderArrowBGHovercolor = esc_html__('#000', 'raw-industry' );
	$wp_customize->add_setting(
    	'slider_ArrowBGHovercolor',
    	array(
			'default' => $sliderArrowBGHovercolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_ArrowBGHovercolor',
		array(
		    'label'   		=> __('Slider Arrow BG Hover Color','raw-industry'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// layout setting
	$wp_customize->add_setting('rawindustry_slider_section_width',array(
		'default' => 'Full Width',
		'sanitize_callback' => 'rawindustry_sanitize_choices',
	));
	$wp_customize->add_control('rawindustry_slider_section_width',array(
		'type' => 'select',
		'label' => __('Section Width','raw-industry'),
		'choices' => array (
			'Box Width' => __('Box Width','raw-industry'),
			'Full Width' => __('Full Width','raw-industry')
		),
		'section' => 'slider_setting',
	));


	
	/*=========================================
	Feature Section
	=========================================*/
	$wp_customize->add_section(
		'Feature_setting', array(
			'title' => esc_html__( 'Feature Section', 'raw-industry' ),
			'priority' => 2,
			'panel' => 'rawindustry_frontpage_sections',
		)
	);



	$wp_customize->add_setting('rawindustry_Feature_tabs', array(
	   'sanitize_callback' => 'wp_kses_post',
	));

	$wp_customize->add_control(new rawindustry_Tab_Control($wp_customize, 'rawindustry_Feature_tabs', array(
	   'section' => 'Feature_setting',
	   'priority' => 2,
	   'buttons' => array( 
	      array(
         	'name' => esc_html__('General', 'raw-industry'),
            'icon' => 'dashicons dashicons-welcome-write-blog',
            'fields' => array(
            	'feature_disable_section',
            	'feature1',
				'feature_icon1',
            	'feature2',
				'feature_icon2',
				'featurebox1_title',
				'featurebox1_description',
				'featurebox2_title',
				'featurebox2_description'
            ),
            'active' => true,
         ),
	      array(
            'name' => esc_html__('Style', 'raw-industry'),
        	'icon' => 'dashicons dashicons-art',
            'fields' => array(
            	'feature_titlecolor',
				'feature_descriptioncolor',
				'featureBoxBGcolor'

            ),
     	),
		 array(
		   'name' => esc_html__('Layout', 'raw-industry'),
		   'icon' => 'dashicons dashicons-layout',
		   'fields' => array(
			   'rawindustry_feature_padding',
			   'raw_industry_feature_top_padding',
			   'raw_industry_feature_bottom_padding'
		   ),
		)
	    
    	),
	))); 



	// General

	// hide show feature section
	$wp_customize->add_setting(
        'feature_disable_section',
        array(
            'sanitize_callback' => 'wp_kses_post',
        )
    ); 
    $wp_customize->add_control(
        new rawindustry_Toggle_Switch_Custom_Control(
            $wp_customize,
            'feature_disable_section',
            array(
                'settings'      => 'feature_disable_section',
                'section'       => 'Feature_setting',
                'label'         => __( 'Disable Section', 'raw-industry' ),
                'on_off_label'  => array(
                    'on' => __( 'Yes', 'raw-industry' ),
                    'off' => __( 'No', 'raw-industry' )
                ),
            )
        )
    );


	// feature 1
	$wp_customize->add_setting( 
    	'feature1',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 1,
		)
	);	

	$wp_customize->add_control( 
		'feature1',
		array(
		    'label'   		=> __('feature 1','raw-industry'),
		    'section'		=> 'Feature_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);	
	
	// feature 1 icon
	$wp_customize->add_setting(
    	'feature_icon1',
    	array(
			'default' => 'fa fa-lightbulb-o',
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 2,
		)
	);	

	$wp_customize->add_control( 
		'feature_icon1',
		array(
		    'label'   		=> __('Icon 1','raw-industry'),
		    'section'		=> 'Feature_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);	


	// feature 2
	$wp_customize->add_setting(
    	'feature2',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 2,
		)
	);	

	$wp_customize->add_control( 
		'feature2',
		array(
		    'label'   		=> __('feature 2','raw-industry'),
		    'section'		=> 'Feature_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);	


	// feature 2 icon
	$wp_customize->add_setting(
    	'feature_icon2',
    	array(
			'default' => 'fa fa-lightbulb-o',
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'feature_icon2',
		array(
		    'label'   		=> __('Icon 2','raw-industry'),
		    'section'		=> 'Feature_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);	



	// feature box 1 title
	$featurebox1title = esc_html__('High Performance', 'raw-industry' );
	$wp_customize->add_setting(
    	'featurebox1_title',
    	array(
			'default' => $featurebox1title,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 6,
		)
	);	

	$wp_customize->add_control( 
		'featurebox1_title',
		array(
		    'label'   		=> __('Box 1 Title','raw-industry'),
		    'section'		=> 'Feature_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);

	// feature box 1 description
	$featurebox1description = esc_html__('There are many variations of passages of Lorem Ipsum avail', 'raw-industry' );
	$wp_customize->add_setting(
    	'featurebox1_description',
    	array(
			'default' => $featurebox1description,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 6,
		)
	);	

	$wp_customize->add_control( 
		'featurebox1_description',
		array(
		    'label'   		=> __('Box 1 Description','raw-industry'),
		    'section'		=> 'Feature_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);

	// feature box 2 title
	$featurebox2title = esc_html__('No Hidden Issues', 'raw-industry' );
	$wp_customize->add_setting(
    	'featurebox2_title',
    	array(
			'default' => $featurebox2title,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 6,
		)
	);	

	$wp_customize->add_control( 
		'featurebox2_title',
		array(
		    'label'   		=> __('Box 2 Title','raw-industry'),
		    'section'		=> 'Feature_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);

	// feature box 2 description
	$featurebox2description = esc_html__('There are many variations of passages of Lorem Ipsum avail', 'raw-industry' );
	$wp_customize->add_setting(
    	'featurebox2_description',
    	array(
			'default' => $featurebox2description,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 6,
		)
	);	

	$wp_customize->add_control( 
		'featurebox2_description',
		array(
		    'label'   		=> __('Box 2 Description','raw-industry'),
		    'section'		=> 'Feature_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);

	

	// style

	// feature titlecolor color
	$featuretitlecolor = esc_html__('#000', 'raw-industry' );
	$wp_customize->add_setting(
    	'feature_titlecolor',
    	array(
			'default' => $featuretitlecolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'feature_titlecolor',
		array(
		    'label'   		=> __('Title Color','raw-industry'),
		    'section'		=> 'Feature_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// feature descriptioncolor color
	$featuredescriptioncolor = esc_html__('#908e8e', 'raw-industry' );
	$wp_customize->add_setting(
    	'feature_descriptioncolor',
    	array(
			'default' => $featuredescriptioncolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'feature_descriptioncolor',
		array(
		    'label'   		=> __('Description Color','raw-industry'),
		    'section'		=> 'Feature_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


		// feature Box color
	$featureBoxBGcolor = esc_html__('#E11D07', 'raw-industry' );
	$wp_customize->add_setting(
    	'featureBoxBGcolor',
    	array(
			'default' => $featureBoxBGcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'featureBoxBGcolor',
		array(
		    'label'   		=> __('Feature Box BG Color','raw-industry'),
		    'section'		=> 'Feature_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);



    // feature section padding 
	$wp_customize->add_setting('rawindustry_feature_padding',array(
	'sanitize_callback'   => 'esc_html'
	));
	$wp_customize->add_control('rawindustry_feature_padding',array(
	'label' => __('Section Padding','raw-industry'),
	'section' => 'Feature_setting'
	));

	$wp_customize->add_setting('raw_industry_feature_top_padding',array(
		'default' => '0',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('raw_industry_feature_top_padding',array(
		'type' => 'number',
		'label' => __('Top','raw-industry'),
		'section' => 'Feature_setting',
	));

	$wp_customize->add_setting('raw_industry_feature_bottom_padding',array(
		'default' => '0',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('raw_industry_feature_bottom_padding',array(
		'type' => 'number',
		'label' => __('Bottom','raw-industry'),
		'section' => 'Feature_setting',
	));
  

	
  




	/*=========================================
	Service Section
	=========================================*/
	$wp_customize->add_section(
		'Service_setting', array(
			'title' => esc_html__( 'Service Section', 'raw-industry' ),
			'priority' => 2,
			'panel' => 'rawindustry_frontpage_sections',
		)
	);



	$wp_customize->add_setting('rawindustry_Service_tabs', array(
	   'sanitize_callback' => 'wp_kses_post',
	));

	$wp_customize->add_control(new rawindustry_Tab_Control($wp_customize, 'rawindustry_Service_tabs', array(
	   'section' => 'Service_setting',
	   'priority' => 2,
	   'buttons' => array( 
	      array(
         	'name' => esc_html__('General', 'raw-industry'),
            'icon' => 'dashicons dashicons-welcome-write-blog',
            'fields' => array(
            	'service_disable_section',
            	'service_heading',
            	'Service1',
				'service_icon1',
            	'Service2',
				'service_icon2',
            	'Service3',
				'service_icon3',
            	'Service4',
				'service_icon4',
            	'Service5',
				'service_icon5',
            	'Service6',
				'service_icon6'

            ),
            'active' => true,
         ),
	      array(
            'name' => esc_html__('Style', 'raw-industry'),
        	'icon' => 'dashicons dashicons-art',
            'fields' => array(
				'service_headingcolor',
            	'service_boxtitlecolorcolor',
				'service_boxdescriptioncolorcolor',
            	'service_buttontextcolor'
            ),
     	),
  		array(
	        'name' => esc_html__('Layout', 'raw-industry'),
	        'icon' => 'dashicons dashicons-layout',
	        'fields' => array(
				'rawindustry_service_section_width',
	            'rawindustry_service_padding',
	            'raw_industry_service_top_padding',
	            'raw_industry_service_bottom_padding'
	        ),
     	)
	    
    	),
	))); 



	// General

	// hide show service section
	$wp_customize->add_setting(
        'service_disable_section',
        array(
            'sanitize_callback' => 'wp_kses_post',
        )
    ); 
    $wp_customize->add_control(
        new rawindustry_Toggle_Switch_Custom_Control(
            $wp_customize,
            'service_disable_section',
            array(
                'settings'      => 'service_disable_section',
                'section'       => 'Service_setting',
                'label'         => __( 'Disable Section', 'raw-industry' ),
                'on_off_label'  => array(
                    'on' => __( 'Yes', 'raw-industry' ),
                    'off' => __( 'No', 'raw-industry' )
                ),
            )
        )
    );



    // service title
	$wp_customize->add_setting(
    	'service_heading',
    	array(
			'default' => '',
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 1,
		)
	);	

	$wp_customize->add_control( 
		'service_heading',
		array(
		    'label'   		=> __('Heading','raw-industry'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);	


	// Service 1
	$wp_customize->add_setting( 
    	'Service1',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 1,
		)
	);	

	$wp_customize->add_control( 
		'Service1',
		array(
		    'label'   		=> __('Service 1','raw-industry'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);		


	// service 1 icon
	$wp_customize->add_setting(
    	'service_icon1',
    	array(
			'default' => 'fa fa-lightbulb-o',
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 2,
		)
	);	

	$wp_customize->add_control( 
		'service_icon1',
		array(
		    'label'   		=> __('Icon 1','raw-industry'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);	



	// Service 2
	$wp_customize->add_setting(
    	'Service2',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 2,
		)
	);	

	$wp_customize->add_control( 
		'Service2',
		array(
		    'label'   		=> __('Service 2','raw-industry'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);	

	// service 2 icon
	$wp_customize->add_setting(
    	'service_icon2',
    	array(
			'default' => 'fa fa-lightbulb-o',
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 2,
		)
	);	

	$wp_customize->add_control( 
		'service_icon2',
		array(
		    'label'   		=> __('Icon 2','raw-industry'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);	



	// Service 3
	$wp_customize->add_setting(
    	'Service3',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'Service3',
		array(
		    'label'   		=> __('Service 3','raw-industry'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);	

	// service 3 icon
	$wp_customize->add_setting(
    	'service_icon3',
    	array(
			'default' => 'fa fa-lightbulb-o',
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 2,
		)
	);	

	$wp_customize->add_control( 
		'service_icon3',
		array(
		    'label'   		=> __('Icon 3','raw-industry'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);	


	// Service 4
	$wp_customize->add_setting(
    	'Service4',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'Service4',
		array(
		    'label'   		=> __('Service 4','raw-industry'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);

	// service 4 icon
	$wp_customize->add_setting(
    	'service_icon4',
    	array(
			'default' => 'fa fa-lightbulb-o',
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 2,
		)
	);	

	$wp_customize->add_control( 
		'service_icon4',
		array(
		    'label'   		=> __('Icon 4','raw-industry'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);	



	// Service 5
	$wp_customize->add_setting(
    	'Service5',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 5,
		)
	);	

	$wp_customize->add_control( 
		'Service5',
		array(
		    'label'   		=> __('Service 5','raw-industry'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);

	// service 5 icon
	$wp_customize->add_setting(
    	'service_icon5',
    	array(
			'default' => 'fa fa-lightbulb-o',
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 2,
		)
	);	

	$wp_customize->add_control( 
		'service_icon5',
		array(
		    'label'   		=> __('Icon 5','raw-industry'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);	


	
	// Service 6
	$wp_customize->add_setting(
    	'Service6',
    	array(
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 5,
		)
	);	

	$wp_customize->add_control( 
		'Service6',
		array(
		    'label'   		=> __('Service 6','raw-industry'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);

	// service 6 icon
	$wp_customize->add_setting(
    	'service_icon6',
    	array(
			'default' => 'fa fa-lightbulb-o',
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 2,
		)
	);	

	$wp_customize->add_control( 
		'service_icon6',
		array(
		    'label'   		=> __('Icon 6','raw-industry'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);	



	// style

	// service headingcolor color
	$serviceheadingcolor = esc_html__('#000', 'raw-industry' );
	$wp_customize->add_setting(
    	'service_headingcolor',
    	array(
			'default' => $serviceheadingcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'service_headingcolor',
		array(
		    'label'   		=> __('Heading Color','raw-industry'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


	// service boxtitlecolor color
	$serviceboxtitlecolorcolor = esc_html__('#000', 'raw-industry' );
	$wp_customize->add_setting(
    	'service_boxtitlecolorcolor',
    	array(
			'default' => $serviceboxtitlecolorcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'service_boxtitlecolorcolor',
		array(
		    'label'   		=> __('Title Color','raw-industry'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// service boxdescriptioncolor color
	$serviceboxdescriptioncolorcolor = esc_html__('#908e8e', 'raw-industry' );
	$wp_customize->add_setting(
    	'service_boxdescriptioncolorcolor',
    	array(
			'default' => $serviceboxdescriptioncolorcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'service_boxdescriptioncolorcolor',
		array(
		    'label'   		=> __('Description Color','raw-industry'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


	// service buttontext color
	$servicebuttontextcolor = esc_html__('#272727', 'raw-industry' );
	$wp_customize->add_setting(
    	'service_buttontextcolor',
    	array(
			'default' => $servicebuttontextcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'service_buttontextcolor',
		array(
		    'label'   		=> __('Button Text Color','raw-industry'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);



	// layout setting

	$wp_customize->add_setting('rawindustry_service_section_width',array(
		'default' => 'Box Width',
		'sanitize_callback' => 'rawindustry_sanitize_choices',
	));
	$wp_customize->add_control('rawindustry_service_section_width',array(
		'type' => 'select',
		'label' => __('Section Width','raw-industry'),
		'choices' => array (
			'Box Width' => __('Box Width','raw-industry'),
			'Full Width' => __('Full Width','raw-industry')
		),
		'section' => 'Service_setting',
	));


    // service section padding 
	$wp_customize->add_setting('rawindustry_service_padding',array(
      'sanitize_callback'   => 'esc_html'
    ));
    $wp_customize->add_control('rawindustry_service_padding',array(
      'label' => __('Section Padding','raw-industry'),
      'section' => 'Service_setting'
    ));

    $wp_customize->add_setting('raw_industry_service_top_padding',array(
        'default' => '5',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('raw_industry_service_top_padding',array(
	    'type' => 'number',
	    'label' => __('Top','raw-industry'),
	    'section' => 'Service_setting',
    ));

 	$wp_customize->add_setting('raw_industry_service_bottom_padding',array(
        'default' => '2',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('raw_industry_service_bottom_padding',array(
	    'type' => 'number',
	    'label' => __('Bottom','raw-industry'),
	    'section' => 'Service_setting',
    ));



    /*=========================================
	Blog Section
	=========================================*/
	$wp_customize->add_section(
		'blog_setting', array(
			'title' => esc_html__( 'Blog Section', 'raw-industry' ),
			'priority' => 3,
			'panel' => 'rawindustry_frontpage_sections',
		)
	);



	

	$wp_customize->add_setting('rawindustry_blog_tabs', array(
	   'sanitize_callback' => 'wp_kses_post',
	));

	$wp_customize->add_control(new rawindustry_Tab_Control($wp_customize, 'rawindustry_blog_tabs', array(
	   'section' => 'blog_setting',
	   'priority' => 2,
	   'buttons' => array(
	      array(
         	'name' => esc_html__('General', 'raw-industry'),
            'icon' => 'dashicons dashicons-welcome-write-blog',
            'fields' => array(
				'blog_disable_section',
            	'blog_heading'
            ),
            'active' => true,
         ), 
	      array(
            'name' => esc_html__('Style', 'raw-industry'),
        	'icon' => 'dashicons dashicons-art',
            'fields' => array(
                'blog_headingcolor',
                'blog_titlecolor',
                'blog_descriptioncolor',
                'blog_btntextcolor',
				'blog_btnbgcolor',
                'blog_datetextcolor',
				'blog_datetextbgcolor'

            ),
     	), array(
	        'name' => esc_html__('Layout', 'raw-industry'),
	        'icon' => 'dashicons dashicons-layout',
	        'fields' => array(
				'rawindustry_blog_section_width',
	            'rawindustry_blog_padding',
	            'raw_industry_blog_top_padding',
	            'raw_industry_blog_bottom_padding'
	        ),
     	)
	    
    	),
	))); 


	// General Tab


	// hide show blog section
	$wp_customize->add_setting(
        'blog_disable_section',
        array(
            'sanitize_callback' => 'wp_kses_post',
        )
    ); 
    $wp_customize->add_control(
        new rawindustry_Toggle_Switch_Custom_Control(
            $wp_customize,
            'blog_disable_section',
            array(
                'settings'      => 'blog_disable_section',
                'section'       => 'blog_setting',
                'label'         => __( 'Disable Section', 'raw-industry' ),
                'on_off_label'  => array(
                    'on' => __( 'Yes', 'raw-industry' ),
                    'off' => __( 'No', 'raw-industry' )
                ),
            )
        )
    );
	

	// blog heading
	$wp_customize->add_setting(
    	'blog_heading',
    	array(
			'default' => '',
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 1,
		)
	);	

	$wp_customize->add_control( 
		'blog_heading',
		array(
		    'label'   		=> __('Heading','raw-industry'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);	


	// Style setting

	// blog heading Color
	$blogheadingcolor = esc_html__('#000', 'raw-industry' );
	$wp_customize->add_setting(
    	'blog_headingcolor',
    	array(
			'default' => $blogheadingcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'blog_headingcolor',
		array(
		    'label'   		=> __('Heading Color','raw-industry'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


	// blog title Color
	$blogtitlecolor = esc_html__('#000', 'raw-industry' );
	$wp_customize->add_setting(
    	'blog_titlecolor',
    	array(
			'default' => $blogtitlecolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'blog_titlecolor',
		array(
		    'label'   		=> __('Title Color','raw-industry'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// blog description Color
	$blogdescriptioncolor = esc_html__('#908e8e', 'raw-industry' );
	$wp_customize->add_setting(
    	'blog_descriptioncolor',
    	array(
			'default' => $blogdescriptioncolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'blog_descriptioncolor',
		array(
		    'label'   		=> __('Description Color','raw-industry'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


	// blog btntext Color
	$blogbtntextcolor = esc_html__('#fff', 'raw-industry' );
	$wp_customize->add_setting(
    	'blog_btntextcolor',
    	array(
			'default' => $blogbtntextcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'blog_btntextcolor',
		array(
		    'label'   		=> __('Button Text Color','raw-industry'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// blog btnbg Color
	$blogbtnbgcolor = esc_html__('#E11D07', 'raw-industry' );
	$wp_customize->add_setting(
    	'blog_btnbgcolor',
    	array(
			'default' => $blogbtnbgcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'blog_btnbgcolor',
		array(
		    'label'   		=> __('Button BG Color','raw-industry'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// blog datetext Color
	$blogdatetextcolor = esc_html__('#fff', 'raw-industry' );
	$wp_customize->add_setting(
    	'blog_datetextcolor',
    	array(
			'default' => $blogdatetextcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'blog_datetextcolor',
		array(
		    'label'   		=> __('Date & Comments Color','raw-industry'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// blog datetextbg Color
	$blogdatetextbgcolor = esc_html__('#042264', 'raw-industry' );
	$wp_customize->add_setting(
    	'blog_datetextbgcolor',
    	array(
			'default' => $blogdatetextbgcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'blog_datetextbgcolor',
		array(
		    'label'   		=> __('Date & Comments Color','raw-industry'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);



	// layout setting

	$wp_customize->add_setting('rawindustry_blog_section_width',array(
		'default' => 'Box Width',
		'sanitize_callback' => 'rawindustry_sanitize_choices',
	));
	$wp_customize->add_control('rawindustry_blog_section_width',array(
		'type' => 'select',
		'label' => __('Section Width','raw-industry'),
		'choices' => array (
			'Box Width' => __('Box Width','raw-industry'),
			'Full Width' => __('Full Width','raw-industry')
		),
		'section' => 'blog_setting',
	));


    // blog section padding 
	$wp_customize->add_setting('rawindustry_blog_padding',array(
		'sanitize_callback'   => 'esc_html'
	));
	$wp_customize->add_control('rawindustry_blog_padding',array(
		'label' => __('Section Padding','raw-industry'),
		'section' => 'blog_setting'
	));

	$wp_customize->add_setting('raw_industry_blog_top_padding',array(
		'default' => '2',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('raw_industry_blog_top_padding',array(
		'type' => 'number',
		'label' => __('Top','raw-industry'),
		'section' => 'blog_setting',
	));

	$wp_customize->add_setting('raw_industry_blog_bottom_padding',array(
		'default' => '0',
		'sanitize_callback' => 'sanitize_text_field'
	));
	$wp_customize->add_control('raw_industry_blog_bottom_padding',array(
		'type' => 'number',
		'label' => __('Bottom','raw-industry'),
		'section' => 'blog_setting',
	));
  
  


	$wp_customize->register_control_type('rawindustry_Tab_Control');

}

add_action( 'customize_register', 'rawindustry_blog_setting' );

// service selective refresh
function rawindustry_blog_section_partials( $wp_customize ){	
	// blog_title
	$wp_customize->selective_refresh->add_partial( 'blog_title', array(
		'selector'            => '.home-blog .title h6',
		'settings'            => 'blog_title',
		'render_callback'  => 'rawindustry_blog_title_render_callback',
	
	) );
	
	// blog_subtitle
	$wp_customize->selective_refresh->add_partial( 'blog_subtitle', array(
		'selector'            => '.home-blog .title h2',
		'settings'            => 'blog_subtitle',
		'render_callback'  => 'rawindustry_blog_subtitle_render_callback',
	
	) );
	
	// blog_description
	$wp_customize->selective_refresh->add_partial( 'blog_description', array(
		'selector'            => '.home-blog .title p',
		'settings'            => 'blog_description',
		'render_callback'  => 'rawindustry_blog_description_render_callback',
	
	) );	
	}

add_action( 'customize_register', 'rawindustry_blog_section_partials' );

// blog_title
function rawindustry_blog_title_render_callback() {
	return get_theme_mod( 'blog_title' );
}

// blog_subtitle
function rawindustry_blog_subtitle_render_callback() {
	return get_theme_mod( 'blog_subtitle' );
}

// service description
function rawindustry_blog_description_render_callback() {
	return get_theme_mod( 'blog_description' );
}


