<?php
function personallawyer_blog_setting( $wp_customize ) {
$selective_refresh = isset( $wp_customize->selective_refresh ) ? 'postMessage' : 'refresh';
	$wp_customize->add_panel(
		'personallawyer_frontpage_sections', array(
			'priority' => 32,
			'title' => esc_html__( 'Frontpage Sections', 'personal-lawyer' ),
		)  
	);
	

	/*=========================================
	Slider Section
	=========================================*/
	$wp_customize->add_section(
		'slider_setting', array(
			'title' => esc_html__( 'Slider Section', 'personal-lawyer' ),
			'description'=> __('<a>Note :</a> Image Size Should Be 1500*800','personal-lawyer'),
			'priority' => 1,
			'panel' => 'personallawyer_frontpage_sections',
		)
	);


	$wp_customize->add_setting('personallawyer_reset_slider_settings',array(
	  'sanitize_callback'   => 'sanitize_text_field'
	));
	$wp_customize->add_control(new personallawyer_Reset_Custom_Control($wp_customize, 'personallawyer_reset_slider_settings',array(
	  'type' => 'reset_control',
	   'priority' => 1,
	  'label' => __('Reset Slider Settings', 'personal-lawyer'),
	  'description' => 'personal_lawyer_slider_reset_settings',
	  'section' => 'slider_setting'
	)));
	

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

	$wp_customize->add_control(new personallawyer_Tab_Control($wp_customize, 'personallawyer_slider_tabs', array(
	   'section' => 'slider_setting',
	   'priority' => 2,
	   'buttons' => array(
	      array(
         	'name' => esc_html__('General', 'personal-lawyer'),
            'icon' => 'dashicons dashicons-welcome-write-blog',
            'fields' => array(
            	'slider1',
            	'slider2',
            	'slider3',
            	'slider4',
            	'slider5',
            	'slider6',
				'slider_btntext'
            ),
            'active' => true,
         ), 
	      array(
            'name' => esc_html__('Style', 'personal-lawyer'),
        	'icon' => 'dashicons dashicons-art',
            'fields' => array(
                'slider_titlecolor',
                'slider_descriptioncolor',
                'slider_btntxt1color',
                'slider_btnbg1color',
                'slider_btnHovercolor',
                'slider_btnHoverbgcolor'


            ),
     	),
		 array(
		   'name' => esc_html__('Layout', 'personal-lawyer'),
		   'icon' => 'dashicons dashicons-layout',
		   'fields' => array(
			   'personal_lawyer_slider_section_width',
			   'personallawyer_slider_padding',
			   'personal_lawyer_slider_top_padding',
			   'personal_lawyer_slider_bottom_padding'
		   ),
		)
	    
    	),
	))); 


	

	// 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','personal-lawyer'),
		    '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','personal-lawyer'),
		    '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','personal-lawyer'),
		    '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','personal-lawyer'),
		    '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','personal-lawyer'),
		    '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','personal-lawyer'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);

	// slider btntext
	$wp_customize->add_setting(
    	'slider_btntext',
    	array(
			'default' => 'READ MORE',
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 1,
		)
	);	

	$wp_customize->add_control( 
		'slider_btntext',
		array(
		    'label'   		=> __('Button Text','personal-lawyer'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);	

	// Style setting

	// slider title Color
	$slidertitlecolor = esc_html__('#fff', 'personal-lawyer' );
	$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','personal-lawyer'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


	// slider description Color
	$sliderdescriptioncolor = esc_html__('#fff', 'personal-lawyer' );
	$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','personal-lawyer'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// slider btntxt1 Color
	$sliderbtntxt1color = esc_html__('#fff', 'personal-lawyer' );
	$wp_customize->add_setting(
    	'slider_btntxt1color',
    	array(
			'default' => $sliderbtntxt1color,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_btntxt1color',
		array(
		    'label'   		=> __('Button Text Color','personal-lawyer'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// slider btnbg1 Color
	$sliderbtnbg1color = esc_html__('#fe0201', 'personal-lawyer' );
	$wp_customize->add_setting(
    	'slider_btnbg1color',
    	array(
			'default' => $sliderbtnbg1color,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_btnbg1color',
		array(
		    'label'   		=> __('Button BG Color','personal-lawyer'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


	// slider btn Hover BG Color
	$sliderbtnHoverbGcolor = esc_html__('#3c3f6c', 'personal-lawyer' );
	$wp_customize->add_setting(
    	'slider_btnHoverbgcolor',
    	array(
			'default' => $sliderbtnHoverbGcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_btnHoverbgcolor',
		array(
		    'label'   		=> __('Button Hover BG Color','personal-lawyer'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


// slider btn Hover Color
	$sliderbtnHovercolor = esc_html__('#fff', 'personal-lawyer' );
	$wp_customize->add_setting(
    	'slider_btnHovercolor',
    	array(
			'default' => $sliderbtnHovercolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'slider_btnHovercolor',
		array(
		    'label'   		=> __('Button Hover Text Color','personal-lawyer'),
		    'section'		=> 'slider_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// layout setting

	$wp_customize->add_setting('personal_lawyer_slider_section_width',array(
        'default' => 'Full Width',
        'sanitize_callback' => 'personallawyer_sanitize_choices',
    ));
    $wp_customize->add_control('personal_lawyer_slider_section_width',array(
        'type' => 'select',
        'label' => __('Section Width','personal-lawyer'),
        'choices' => array (
            'Box Width' => __('Box Width','personal-lawyer'),
            'Full Width' => __('Full Width','personal-lawyer')
        ),
        'section' => 'slider_setting',
    ));


// slider section padding 
	$wp_customize->add_setting('personallawyer_slider_padding',array(
      'sanitize_callback'   => 'esc_html'
    ));
    $wp_customize->add_control('personallawyer_slider_padding',array(
      'label' => __('Section Padding','personal-lawyer'),
      'section' => 'slider_setting'
    ));

    $wp_customize->add_setting('personal_lawyer_slider_top_padding',array(
        'default' => '0',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('personal_lawyer_slider_top_padding',array(
	    'type' => 'number',
	    'label' => __('Top','personal-lawyer'),
	    'section' => 'slider_setting',
    ));

 	$wp_customize->add_setting('personal_lawyer_slider_bottom_padding',array(
        'default' => '0',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('personal_lawyer_slider_bottom_padding',array(
	    'type' => 'number',
	    'label' => __('Bottom','personal-lawyer'),
	    'section' => 'slider_setting',
    ));



	/*=========================================
	Service Section
	=========================================*/
	$wp_customize->add_section(
		'Service_setting', array(
			'title' => esc_html__( 'Service Section', 'personal-lawyer' ),
			'priority' => 2,
			'panel' => 'personallawyer_frontpage_sections',
		)
	);


	$wp_customize->add_setting('personallawyer_reset_Service_settings',array(
	  'sanitize_callback'   => 'sanitize_text_field'
	));
	$wp_customize->add_control(new personallawyer_Reset_Custom_Control($wp_customize, 'personallawyer_reset_Service_settings',array(
	  'type' => 'reset_control',
	   'priority' => 1,
	  'label' => __('Reset Service Settings', 'personal-lawyer'),
	  'description' => 'personal_lawyer_Service_reset_settings',
	  'section' => 'Service_setting'
	)));
	

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

	$wp_customize->add_control(new personallawyer_Tab_Control($wp_customize, 'personallawyer_Service_tabs', array(
	   'section' => 'Service_setting',
	   'priority' => 2,
	   'buttons' => array(
	      array(
         	'name' => esc_html__('General', 'personal-lawyer'),
            'icon' => 'dashicons dashicons-welcome-write-blog',
            'fields' => array(
            	'service_disable_section',
				'personallawyer_service_image_height',
            	'service_subheading',
            	'service_heading',
            	'Service1',
            	'Service2',
            	'Service3',
            	'Service4',
            	'Service5',
            	'Service6',
				'Service_btntext'
				
            ),
            'active' => true,
         ),
	      array(
            'name' => esc_html__('Style', 'personal-lawyer'),
        	'icon' => 'dashicons dashicons-art',
            'fields' => array(
            	'service_subheadingcolor',
            	'service_headingcolor',
            	'service_boxtitlecolorcolor',
            	'service_boxdescriptioncolorcolor',
            	'service_buttonbgcolor',
            	'service_buttontextcolor',
            	'service_buttonbghovercolor',
            	'service_boxbgcolor',
            	'service_buttontexthovercolor'
            ),
     	),
  		array(
	        'name' => esc_html__('Layout', 'personal-lawyer'),
	        'icon' => 'dashicons dashicons-layout',
	        'fields' => array(
	            'personal_lawyer_service_section_width',
	            'personallawyer_service_padding',
	            'personal_lawyer_service_top_padding',
	            'personal_lawyer_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 personallawyer_Toggle_Switch_Custom_Control(
            $wp_customize,
            'service_disable_section',
            array(
                'settings'      => 'service_disable_section',
                'section'       => 'Service_setting',
                'label'         => __( 'Disable Section', 'personal-lawyer' ),
                'on_off_label'  => array(
                    'on' => __( 'Yes', 'personal-lawyer' ),
                    'off' => __( 'No', 'personal-lawyer' )
                ),
            )
        )
    );


	// service img height
    $wp_customize->add_setting('personallawyer_service_image_height',array(
        'default' => 350,
        'sanitize_callback' => 'personallawyer_sanitize_float'
    ));
    $wp_customize->add_control(new personallawyer_Custom_Control( $wp_customize, 'personallawyer_service_image_height',array(
	    'label' => __('Image Height','personal-lawyer'),
	    'section' => 'Service_setting',
	    'input_attrs' => array(
	            'min' => 0,
	            'max' => 500,
	            'step' => 1,
	        ),
    )));


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

	$wp_customize->add_control( 
		'service_subheading',
		array(
		    'label'   		=> __('Sub Heading','personal-lawyer'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);	

    // 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','personal-lawyer'),
		    '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','personal-lawyer'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'dropdown-pages',
			'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','personal-lawyer'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'dropdown-pages',
			'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','personal-lawyer'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'dropdown-pages',
			'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','personal-lawyer'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'dropdown-pages',
			'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','personal-lawyer'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'dropdown-pages',
			'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','personal-lawyer'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'dropdown-pages',
			'transport'         => $selective_refresh,
		)  
	);

	// Service btntext
	$wp_customize->add_setting(
    	'Service_btntext',
    	array(
			'default' => 'READ MORE',
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 1,
		)
	);	

	$wp_customize->add_control( 
		'Service_btntext',
		array(
		    'label'   		=> __('Button Text','personal-lawyer'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);	


	// style

	// service subheadingcolor color
	$servicesubheadingcolor = esc_html__('#000', 'personal-lawyer' );
	$wp_customize->add_setting(
    	'service_subheadingcolor',
    	array(
			'default' => $servicesubheadingcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'service_subheadingcolor',
		array(
		    'label'   		=> __('SubHeading Color','personal-lawyer'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// service headingcolor color
	$serviceheadingcolor = esc_html__('#3c3f6c', 'personal-lawyer' );
	$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','personal-lawyer'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


	// service boxtitlecolor color
	$serviceboxtitlecolorcolor = esc_html__('#fff', 'personal-lawyer' );
	$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','personal-lawyer'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// service boxdescriptioncolor color
	$serviceboxdescriptioncolorcolor = esc_html__('#fff', 'personal-lawyer' );
	$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','personal-lawyer'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


	// service buttonbg color
	$servicebuttonbgcolor = esc_html__('#FE8901', 'personal-lawyer' );
	$wp_customize->add_setting(
    	'service_buttonbgcolor',
    	array(
			'default' => $servicebuttonbgcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'service_buttonbgcolor',
		array(
		    'label'   		=> __('Button BG Color','personal-lawyer'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// service buttontext color
	$servicebuttontextcolor = esc_html__('#fff', 'personal-lawyer' );
	$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','personal-lawyer'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// service buttonbghover color
	$servicebuttonbghovercolor = esc_html__('#fe0201', 'personal-lawyer' );
	$wp_customize->add_setting(
    	'service_buttonbghovercolor',
    	array(
			'default' => $servicebuttonbghovercolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'service_buttonbghovercolor',
		array(
		    'label'   		=> __('Button BG Hover Color','personal-lawyer'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);



// service button text hover color
	$servicebuttontexthovercolor = esc_html__('#fff', 'personal-lawyer' );
	$wp_customize->add_setting(
    	'service_buttontexthovercolor',
    	array(
			'default' => $servicebuttontexthovercolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'service_buttontexthovercolor',
		array(
		    'label'   		=> __('Button Text Hover Color','personal-lawyer'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);



	// service boxbg color
	$serviceboxbgcolor = esc_html__('#3c3f6c', 'personal-lawyer' );
	$wp_customize->add_setting(
    	'service_boxbgcolor',
    	array(
			'default' => $serviceboxbgcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 4,
		)
	);	

	$wp_customize->add_control( 
		'service_boxbgcolor',
		array(
		    'label'   		=> __('Box BG Color','personal-lawyer'),
		    'section'		=> 'Service_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


	// layout setting

	$wp_customize->add_setting('personal_lawyer_service_section_width',array(
        'default' => 'Box Width',
        'sanitize_callback' => 'personallawyer_sanitize_choices',
    ));
    $wp_customize->add_control('personal_lawyer_service_section_width',array(
        'type' => 'select',
        'label' => __('Section Width','personal-lawyer'),
        'choices' => array (
            'Box Width' => __('Box Width','personal-lawyer'),
            'Full Width' => __('Full Width','personal-lawyer')
        ),
        'section' => 'Service_setting',
    ));


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

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

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



    /*=========================================
	Blog Section
	=========================================*/
	$wp_customize->add_section(
		'blog_setting', array(
			'title' => esc_html__( 'Blog Section', 'personal-lawyer' ),
			'priority' => 3,
			'panel' => 'personallawyer_frontpage_sections',
		)
	);


	$wp_customize->add_setting('personallawyer_reset_blog_settings',array(
	  'sanitize_callback'   => 'sanitize_text_field'
	));
	$wp_customize->add_control(new personallawyer_Reset_Custom_Control($wp_customize, 'personallawyer_reset_blog_settings',array(
	  'type' => 'reset_control',
	   'priority' => 1,
	  'label' => __('Reset Blog Settings', 'personal-lawyer'),
	  'description' => 'personal_lawyer_blog_reset_settings',
	  'section' => 'blog_setting'
	)));
	

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

	$wp_customize->add_control(new personallawyer_Tab_Control($wp_customize, 'personallawyer_blog_tabs', array(
	   'section' => 'blog_setting',
	   'priority' => 2,
	   'buttons' => array(
	      array(
         	'name' => esc_html__('General', 'personal-lawyer'),
            'icon' => 'dashicons dashicons-welcome-write-blog',
            'fields' => array(
				'blog_disable_section',
				'personallawyer_blog_image_height',
            	'blog_subheading',
            	'blog_heading'
            ),
            'active' => true,
         ), 
	      array(
            'name' => esc_html__('Style', 'personal-lawyer'),
        	'icon' => 'dashicons dashicons-art',
            'fields' => array(
                'blog_subheadingcolor',
                'blog_headingcolor',
                'blog_titlecolor',
                'blog_descriptioncolor',
                'blog_buttontextcolor',
                'blog_buttonbgcolor',
                'blog_authorandcategorycolor',
                'blog_authorandcategorybgcolor'


            ),
     	),
		 array(
		   'name' => esc_html__('Layout', 'personal-lawyer'),
		   'icon' => 'dashicons dashicons-layout',
		   'fields' => array(
			   'personal_lawyer_blog_section_width',
			   'personallawyer_blog_padding',
			   'personal_lawyer_blog_top_padding',
			   'personal_lawyer_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 personallawyer_Toggle_Switch_Custom_Control(
            $wp_customize,
            'blog_disable_section',
            array(
                'settings'      => 'blog_disable_section',
                'section'       => 'blog_setting',
                'label'         => __( 'Disable Section', 'personal-lawyer' ),
                'on_off_label'  => array(
                    'on' => __( 'Yes', 'personal-lawyer' ),
                    'off' => __( 'No', 'personal-lawyer' )
                ),
            )
        )
    );


	// blog img height
    $wp_customize->add_setting('personallawyer_blog_image_height',array(
        'default' => 250,
        'sanitize_callback' => 'personallawyer_sanitize_float'
    ));
    $wp_customize->add_control(new personallawyer_Custom_Control( $wp_customize, 'personallawyer_blog_image_height',array(
	    'label' => __('Image Height','personal-lawyer'),
	    'section' => 'blog_setting',
	    'input_attrs' => array(
	            'min' => 0,
	            'max' => 500,
	            'step' => 1,
	        ),
    )));


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

	$wp_customize->add_control( 
		'blog_subheading',
		array(
		    'label'   		=> __('Sub Heading','personal-lawyer'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);	

	// blog subheading Color
	$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','personal-lawyer'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'text',
			'transport'         => $selective_refresh,
		)  
	);	


	// Style setting

	// blog subheading Color
	$blogsubheadingcolor = esc_html__('#000', 'personal-lawyer' );
	$wp_customize->add_setting(
    	'blog_subheadingcolor',
    	array(
			'default' => $blogsubheadingcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'blog_subheadingcolor',
		array(
		    'label'   		=> __('SubHeading Color','personal-lawyer'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// blog heading Color
	$blogheadingcolor = esc_html__('#3C3E6B', 'personal-lawyer' );
	$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','personal-lawyer'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


	// blog title Color
	$blogtitlecolor = esc_html__('#3C3E6B', 'personal-lawyer' );
	$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','personal-lawyer'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// blog description Color
	$blogdescriptioncolor = esc_html__('#3C3E6B', 'personal-lawyer' );
	$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','personal-lawyer'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);


	// blog buttontext Color
	$blogbuttontextcolor = esc_html__('#3C3E6B', 'personal-lawyer' );
	$wp_customize->add_setting(
    	'blog_buttontextcolor',
    	array(
			'default' => $blogbuttontextcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'blog_buttontextcolor',
		array(
		    'label'   		=> __('Button Text Color','personal-lawyer'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// blog buttonbg Color
	$blogbuttonbgcolor = esc_html__('#3C3E6B', 'personal-lawyer' );
	$wp_customize->add_setting(
    	'blog_buttonbgcolor',
    	array(
			'default' => $blogbuttonbgcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'blog_buttonbgcolor',
		array(
		    'label'   		=> __('Button Border Color','personal-lawyer'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// blog authorandcategory Color
	$blogauthorandcategorycolor = esc_html__('#fff', 'personal-lawyer' );
	$wp_customize->add_setting(
    	'blog_authorandcategorycolor',
    	array(
			'default' => $blogauthorandcategorycolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'blog_authorandcategorycolor',
		array(
		    'label'   		=> __('Author & Category Color','personal-lawyer'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// blog authorandcategorybg Color
	$blogauthorandcategorybgcolor = esc_html__('#3C3E6B', 'personal-lawyer' );
	$wp_customize->add_setting(
    	'blog_authorandcategorybgcolor',
    	array(
			'default' => $blogauthorandcategorybgcolor,
			'capability'     	=> 'edit_theme_options',
			'sanitize_callback' => 'wp_kses_post',
			'priority'      => 3,
		)
	);	

	$wp_customize->add_control( 
		'blog_authorandcategorybgcolor',
		array(
		    'label'   		=> __('Author & Category BG Color','personal-lawyer'),
		    'section'		=> 'blog_setting',
			'type' 			=> 'color',
			'transport'         => $selective_refresh,
		)  
	);

	// layout setting

	$wp_customize->add_setting('personal_lawyer_blog_section_width',array(
        'default' => 'Box Width',
        'sanitize_callback' => 'personallawyer_sanitize_choices',
    ));
    $wp_customize->add_control('personal_lawyer_blog_section_width',array(
        'type' => 'select',
        'label' => __('Section Width','personal-lawyer'),
        'choices' => array (
            'Box Width' => __('Box Width','personal-lawyer'),
            'Full Width' => __('Full Width','personal-lawyer')
        ),
        'section' => 'blog_setting',
    ));


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

    $wp_customize->add_setting('personal_lawyer_blog_top_padding',array(
        'default' => '5',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('personal_lawyer_blog_top_padding',array(
	    'type' => 'number',
	    'label' => __('Top','personal-lawyer'),
	    'section' => 'blog_setting',
    ));

 	$wp_customize->add_setting('personal_lawyer_blog_bottom_padding',array(
        'default' => '2',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control('personal_lawyer_blog_bottom_padding',array(
	    'type' => 'number',
	    'label' => __('Bottom','personal-lawyer'),
	    'section' => 'blog_setting',
    ));


	$wp_customize->register_control_type('personallawyer_Tab_Control');

}

add_action( 'customize_register', 'personallawyer_blog_setting' );

// service selective refresh
function personallawyer_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'  => 'personallawyer_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'  => 'personallawyer_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'  => 'personallawyer_blog_description_render_callback',
	
	) );	
	}

add_action( 'customize_register', 'personallawyer_blog_section_partials' );

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

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

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


