<?php

//Add the Site Section
	//Site panel
	$wp_customize->add_panel( 'site', array(
	'priority'    => 1,
	'title'       => esc_html( __( 'Site', 'smerk' ) ),
	'description' => esc_html( __( 'My Description', 'smerk' ) ),
	'icon'        => 'dashicons-admin-site',
    ) );
	
	//Site Section
	$wp_customize->add_section( 'site_color', array(
	'title'    => esc_html( __( 'Color', 'smerk' ) ),
	'panel'    => 'site',
	'priority' => 201,
	'icon'     => 'dashicons-admin-appearance',
      ) );

    $wp_customize->add_section( 'site_content', array(
	'title'    => esc_html( __( 'Content', 'smerk' ) ),
	'panel'    => 'site',
	'priority' => 202,
	'icon'     => 'dashicons-format-aside',
     ) );

    $wp_customize->add_section( 'site_heading', array(
	'title'    => esc_html( __( 'Heading', 'smerk' ) ),
	'panel'    => 'site',
	'priority' => 203,
	'icon'     => 'dashicons-admin-customizer',
     ) );

    $wp_customize->add_section( 'site_bg', array(
	'title'    => esc_html( __( 'Background', 'smerk' ) ),
	'panel'    => 'site',
	'priority' => 204,
	'icon'     => 'dashicons-format-image',
    ) );

    $wp_customize->add_section( 'site_bt', array(
	'title'    => esc_html( __( 'Button', 'smerk' ) ),
	'panel'    => 'site',
	'priority' => 205,
	'icon'     => 'dashicons-format-image',
    ) );
	
	$wp_customize->add_section( 'site_cont', array(
	'title'    => esc_html( __( 'Google', 'smerk' ) ),
	'panel'    => 'site',
	'priority' => 206,
	'icon'     => 'dashicons-format-image',
    ) );
	
    $wp_customize->add_section( 'site_general', array(
	'title'    => esc_html( __( 'General', 'smerk' ) ),
	'panel'    => 'site',
	'priority' => 199,
	'icon'     => 'dashicons-format-image',
    ) );
	
	//Site Setting
	
	$wp_customize->add_setting( 'navi_back_color' , array(
    'default'     => '#FFFFFF',
    'transport'   => 'refresh',
	'sanitize_callback' => 'smerk_sanitize_hexcolor'
	
    ) );
	
	$wp_customize->add_setting('content_site',
    array(
        'default'   => 'Roboto',
        'transport' => 'refresh',
		'sanitize_callback' => 'font_family_sanitize'
    ));
	
	
	$wp_customize->add_setting('content_site_font',
    array(
        'default'   => '16px',
        'transport' => 'refresh',
		'sanitize_callback' => 'bookish_sanitize_text'
    ));
	
	$wp_customize->add_setting('content_site_font_color',
    array(
        'default'   => '#FFFFF',
        'transport' => 'refresh',
		'sanitize_callback' => 'smerk_sanitize_hexcolor'
    ));
	
	$wp_customize->add_setting( 'si_bg' , array(
    'default'     => '#FFFFFF',
    'transport'   => 'refresh',
	'sanitize_callback' => 'smerk_sanitize_hexcolor'
    ) );
	
	$wp_customize->add_setting('heading_site',
    array(
        'default'   => 'Roboto',
        'transport' => 'refresh',
		'sanitize_callback' => 'font_family_sanitize'
    ));
	
	
	$wp_customize->add_setting('heading_site_font',
    array(
        'default'   => '16px',
        'transport' => 'refresh','
		sanitize_callback' => 'bookish_sanitize_text'
    ));
	
	$wp_customize->add_setting('heading_site_font_color',
    array(
        'default'   => '#FFFFF',
        'transport' => 'refresh',
		'sanitize_callback' => 'smerk_sanitize_hexcolor'
    ));
	
	$wp_customize->add_setting( 'button_color' , array(
    'default'     => '#FFFFFF',
    'transport'   => 'refresh',
	'sanitize_callback' => 'smerk_sanitize_hexcolor'
    ) );
	
	$wp_customize->add_setting( 'button_hover_color' , array(
    'default'     => '#FFFFFF',
    'transport'   => 'refresh',
	'sanitize_callback' => 'smerk_sanitize_hexcolor'
    ) );
	
	$wp_customize->add_setting( 'post_date_color' , array(
    'default'     => '#999999',
    'transport'   => 'refresh',
	'sanitize_callback' => 'smerk_sanitize_hexcolor'
    ) );
	
	
	
	
	//Site Control
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nav_bt', array(
	'label'        => __( 'Primary Color', 'smerk' ),
	'help'      => esc_html( __( 'Setup Primary Color For Navigation Menu', 'smerk' ) ),
	'section'    => 'site_color',
	'settings'   => 'navi_back_color',
    ) ) );
	
	
	$wp_customize->add_control(new WP_Customize_Control( $wp_customize,'content_site',
    array(
        'section'  => 'site_content',
		'settings' => 'content_site',
        'label'    => 'Font Family',
        'type'     => 'select',
        'choices'  => array(
		   'Source Sans Pro' => 'Source Sans Pro',
		   'Roboto'  => 'Roboto',
		   'Roboto Condensed' => 'Roboto Condensed',
		   'Slabo' => 'Slabo',
		   'Lato' => 'Lato',
		   'Oswald' => 'Oswald',
		   'Montserrat' => 'Montserrat',
           'PT Sans' => 'PT Sans'		   
		   
		),
    ) ));
	
	
	
	$wp_customize->add_control(new WP_Customize_Control( $wp_customize,'content_site_font',
    array(
        'section'  => 'site_content',
		'settings' => 'content_site_font',
        'label'    => 'Font Size',
        'type'     => 'text',
    )));
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'content_site_font_color', array(
	'label'        => __( 'Font Color', 'smerk' ),
	'help'      => esc_html( __( 'Setup Font color for Content', 'smerk' ) ),
	'section'    => 'site_content',
	'settings'   => 'content_site_font_color',
    ) ) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'si_bg', array(
	'label'        => __( 'Background Color', 'smerk' ),
	'help'      => esc_html( __( 'Setup background color for Body', 'smerk' ) ),
	'section'    => 'site_bg',
	'settings'   => 'si_bg',
    ) ) );
	
	$wp_customize->add_control(new WP_Customize_Control( $wp_customize,'heading_site',
    array(
        'section'  => 'site_heading',
		'settings' => 'heading_site',
        'label'    => 'Font Family',
        'type'     => 'select',
        'choices'  => array(
		   'Source Sans Pro' => 'Source Sans Pro',
		   'Roboto'  => 'Roboto',
		   'Roboto Condensed' => 'Roboto Condensed',
		   'Slabo' => 'Slabo',
		   'Lato' => 'Lato',
		   'Oswald' => 'Oswald',
		   'Montserrat' => 'Montserrat',
           'PT Sans' => 'PT Sans'		   
		   
		),
    ) ));
	
	
	
	$wp_customize->add_control(new WP_Customize_Control( $wp_customize,'heading_site_font',
    array(
        'section'  => 'site_heading',
		'settings' => 'heading_site_font',
        'label'    => 'Font Size',
        'type'     => 'text',
    )));
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'heading_site_font_color', array(
	'label'        => __( 'Font Color', 'smerk' ),
	'help'      => esc_html( __( 'Setup Font color for Heading', 'smerk' ) ),
	'section'    => 'site_heading',
	'settings'   => 'heading_site_font_color',
    ) ) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'si_bt', array(
	'label'        => __( 'Button Color', 'smerk' ),
	'help'      => esc_html( __( 'Setup Button color for Body', 'smerk' ) ),
	'section'    => 'site_bt',
	'settings'   => 'button_color',
    ) ) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'si_bt_hov', array(
	'label'        => __( 'Button Hover Color', 'smerk' ),
	'help'      => esc_html( __( 'Setup Button Hover color for Body', 'smerk' ) ),
	'section'    => 'site_bt',
	'settings'   => 'button_hover_color',
    ) ) );
	
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'si_pt_bt', array(
	'label'        => __( 'Post Date color', 'smerk' ),
	'help'      => esc_html( __( 'Setup Post Date for Button', 'smerk' ) ),
	'section'    => 'site_general',
	'settings'   => 'post_date_color',
    ) ) );
	
	
	
    /**
    * Adds sanitization callback function: Number
    * @package Smerk
    */ 
    function smerk_sanitize_number($input) {
    if ( isset( $input ) && is_numeric( $input ) ) {
        return $input;
    }
    }
	
	/**
    * Adds sanitization callback function: Font Family
    * @package Smerk
    */ 
	function font_family_sanitize( $input ) {
    $valid = array(
        'Source Sans Pro' => 'Source Sans Pro',
		'Roboto'  => 'Roboto',
		'Roboto Condensed' => 'Roboto Condensed',
		'Slabo' => 'Slabo',
		'Lato' => 'Lato',
	    'Oswald' => 'Oswald',
		'Montserrat' => 'Montserrat',
        'PT Sans' => 'PT Sans'	
    );
 
    if ( array_key_exists( $input, $valid ) ) {
        return $input;
    } else {
        return '';
    }
}
	
?>