<?php
/**
 * Theme Customizer Controls
 *
 * @package somalite
 */


if ( ! function_exists( 'somalite_customizer_color_register' ) ) :
function somalite_customizer_color_register( $wp_customize ) {

    // Color Settings 
    $wp_customize->add_section(
        'soma_color_settings',
        array (
            'priority'      => 25,
            'capability'    => 'edit_theme_options',
            'theme_supports'=> '',
            'title'         => esc_html__( 'Color Settings', 'somalite' )
        )
    );

    // Title label
    $wp_customize->add_setting( 
        'somalite_label_color_settings', 
        array(
              'sanitize_callback' => 'somalite_sanitize_title',
        ) 
    );

    $wp_customize->add_control( 
        new Somalite_Title_Info_Control( $wp_customize, 'somalite_label_color_settings', 
        array(
            'label'       => esc_html__( 'Color Settings', 'somalite' ),
            'section'     => 'soma_color_settings',
            'type'        => 'somalite-title',
            'settings'    => 'somalite_label_color_settings',
        ) 
    ));

    //Heading Color
    $wp_customize->add_setting(
        'sm_headings_color',
        array(
            'type' => 'theme_mod',
            'default'           => '#dd3333',
            'sanitize_callback' => 'sanitize_hex_color'
        )
    );

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
        $wp_customize,
        'sm_headings_color',
        array(
        'label'      => esc_html__( 'Select Headings Color', 'somalite' ),
        'section'    => 'soma_color_settings',
        'settings'   => 'sm_headings_color',
        ) )
    );

    //Heading Hover Color
    $wp_customize->add_setting(
        'sm_headings_hover_color',
        array(
            'type' => 'theme_mod',
            'default'           => '#dd3333',
            'sanitize_callback' => 'sanitize_hex_color'
        )
    );

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
        $wp_customize,
        'sm_headings_hover_color',
        array(
        'label'      => esc_html__( 'Select Headings Hover Color', 'somalite' ),
        'section'    => 'soma_color_settings',
        'settings'   => 'sm_headings_hover_color',
        ) )
    );

    //Page Heading Color
    $wp_customize->add_setting(
        'sm_page_heading_color',
        array(
            'type' => 'theme_mod',
            'default'           => '#ffffff',
            'sanitize_callback' => 'sanitize_hex_color'
        )
    );

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
        $wp_customize,
        'sm_page_heading_color',
        array(
        'label'      => esc_html__( 'Select Page Title Heading Color', 'somalite' ),
        'section'    => 'soma_color_settings',
        'settings'   => 'sm_page_heading_color',
        ) )
    );

    // Link Color
    $wp_customize->add_setting(
        'sm_link_color',
        array(
            'type' => 'theme_mod',
            'default'           => '#b5b4b4',
            'sanitize_callback' => 'sanitize_hex_color'
        )
    );

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
        $wp_customize,
        'sm_link_color',
        array(
        'label'      => esc_html__( 'Select Link Color', 'somalite' ),
        'section'    => 'soma_color_settings',
        'settings'   => 'sm_link_color',
        ) )
    );

    // Link Hover Color
    $wp_customize->add_setting(
        'sm_link_hover_color',
        array(
            'type' => 'theme_mod',
            'default'           => '#dd3333',
            'sanitize_callback' => 'sanitize_hex_color'
        )
    );

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
        $wp_customize,
        'sm_link_hover_color',
        array(
        'label'      => esc_html__( 'Select Link Hover Color', 'somalite' ),
        'section'    => 'soma_color_settings',
        'settings'   => 'sm_link_hover_color',
        ) )
    );

    // Button BG Color
    $wp_customize->add_setting(
        'sm_button_bg_color',
        array(
            'type' => 'theme_mod',
            'default'           => '#fff',
            'sanitize_callback' => 'sanitize_hex_color'
        )
    );

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
        $wp_customize,
        'sm_button_bg_color',
        array(
        'label'      => esc_html__( 'Select Button Bg Color', 'somalite' ),
        'section'    => 'soma_color_settings',
        'settings'   => 'sm_button_bg_color',
        ) )
    );

    // Button text Color
    $wp_customize->add_setting(
        'sm_button_text_color',
        array(
            'type' => 'theme_mod',
            'default'           => '#555',
            'sanitize_callback' => 'sanitize_hex_color'
        )
    );

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
        $wp_customize,
        'sm_button_text_color',
        array(
        'label'      => esc_html__( 'Select Button Text Color', 'somalite' ),
        'section'    => 'soma_color_settings',
        'settings'   => 'sm_button_text_color',
        ) )
    );

    // Button border Color
    $wp_customize->add_setting(
        'sm_button_border_color',
        array(
            'type' => 'theme_mod',
            'default'           => '#dedede',
            'sanitize_callback' => 'sanitize_hex_color'
        )
    );

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
        $wp_customize,
        'sm_button_border_color',
        array(
        'label'      => esc_html__( 'Select Button Border Color', 'somalite' ),
        'section'    => 'soma_color_settings',
        'settings'   => 'sm_button_border_color',
        ) )
    );

    // Button Hover BG Color
    $wp_customize->add_setting(
        'sm_button_hover_bg_color',
        array(
            'type' => 'theme_mod',
            'default'           => '#dd3333',
            'sanitize_callback' => 'sanitize_hex_color'
        )
    );

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
        $wp_customize,
        'sm_button_hover_bg_color',
        array(
        'label'      => esc_html__( 'Select Button Hover Bg Color', 'somalite' ),
        'section'    => 'soma_color_settings',
        'settings'   => 'sm_button_hover_bg_color',
        ) )
    );

    // Button Hover Text Color
    $wp_customize->add_setting(
        'sm_button_hover_text_color',
        array(
            'type' => 'theme_mod',
            'default'           => '#fff',
            'sanitize_callback' => 'sanitize_hex_color'
        )
    );

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
        $wp_customize,
        'sm_button_hover_text_color',
        array(
        'label'      => esc_html__( 'Select Button Hover Text Color', 'somalite' ),
        'section'    => 'soma_color_settings',
        'settings'   => 'sm_button_hover_text_color',
        ) )
    );

    // Button Hover Border Color
    $wp_customize->add_setting(
        'sm_button_hover_border_color',
        array(
            'type' => 'theme_mod',
            'default'           => '#dd3333',
            'sanitize_callback' => 'sanitize_hex_color'
        )
    );

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
        $wp_customize,
        'sm_button_hover_border_color',
        array(
        'label'      => esc_html__( 'Select Button Hover Border Color', 'somalite' ),
        'section'    => 'soma_color_settings',
        'settings'   => 'sm_button_hover_border_color',
        ) )
    );

    // CTA Button Hover Color
    $wp_customize->add_setting(
        'sm_cta_btn_hover_color',
        array(
            'type' => 'theme_mod',
            'default'           => '#dd3333',
            'sanitize_callback' => 'sanitize_hex_color'
        )
    );

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
        $wp_customize,
        'sm_cta_btn_hover_color',
        array(
        'label'      => esc_html__( 'Select Call to Action Section Button Hover Color', 'somalite' ),
        'section'    => 'soma_color_settings',
        'settings'   => 'sm_cta_btn_hover_color',
        ) )
    );  

    $wp_customize->add_setting(
        'sm_cta_content_color',
        array(
            'type' => 'theme_mod',
            'default'           => '#555555',
            'sanitize_callback' => 'sanitize_hex_color'
        )
    );

    $wp_customize->add_control(
        new WP_Customize_Color_Control(
        $wp_customize,
        'sm_cta_content_color',
        array(
        'label'      => esc_html__( 'Select Call to Action Section Content Color', 'somalite' ),
        'section'    => 'soma_color_settings',
        'settings'   => 'sm_cta_content_color',
        ) )
    );  

}
endif;

add_action( 'customize_register', 'somalite_customizer_color_register' );