<?php
/**
 * Banner Section
 *
 * @package technology_software_firm
 */

$wp_customize->add_section(
	'technology_software_firm_banner_section',
	array(
		'panel'    => 'technology_software_firm_front_page_options',
		'title'    => esc_html__( 'Banner Section', 'technology-software-firm' ),
		'priority' => 10,
	)
);

// Banner Section - Enable section.
$wp_customize->add_setting(
	'technology_software_firm_enable_banner_section',
	array(
		'default'           => false,
		'sanitize_callback' => 'technology_software_firm_sanitize_switch',
	)
);

$wp_customize->add_control(
	new Technology_Software_Firm_Toggle_Switch_Custom_Control(
		$wp_customize,
		'technology_software_firm_enable_banner_section',
		array(
			'label'    => esc_html__( 'Enable Banner Section', 'technology-software-firm' ),
			'section'  => 'technology_software_firm_banner_section',
			'settings' => 'technology_software_firm_enable_banner_section',
		)
	)
);

if ( isset( $wp_customize->selective_refresh ) ) {
	$wp_customize->selective_refresh->add_partial(
		'technology_software_firm_enable_banner_section',
		array(
			'selector' => '#technology_software_firm_banner_section .section-link',
			'settings' => 'technology_software_firm_enable_banner_section',
		)
	);
}

// Banner Section - Main title.
$wp_customize->add_setting(
	'technology_software_firm_banner_section_title',
	array(
		'default'           =>  '',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'technology_software_firm_banner_section_title',
	array(
		'label'           => esc_html__( 'Banner Title', 'technology-software-firm' ),
		'section'         => 'technology_software_firm_banner_section',
		'settings'        => 'technology_software_firm_banner_section_title',
		'type'            => 'text',
		'active_callback' => 'technology_software_firm_is_banner_slider_section_enabled',
	)
);

// Banner Section - Description.
$wp_customize->add_setting(
	'technology_software_firm_banner_section_description',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_textarea_field',
	)
);

$wp_customize->add_control(
	'technology_software_firm_banner_section_description',
	array(
		'label'           => esc_html__( 'Banner Description', 'technology-software-firm' ),
		'section'         => 'technology_software_firm_banner_section',
		'settings'        => 'technology_software_firm_banner_section_description',
		'type'            => 'textarea',
		'active_callback' => 'technology_software_firm_is_banner_slider_section_enabled',
	)
);

// Banner Section - Primary button text.
$wp_customize->add_setting(
	'technology_software_firm_banner_button_label_',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'technology_software_firm_banner_button_label_',
	array(
		'label'           => esc_html__( 'Primary Button Text', 'technology-software-firm' ),
		'section'         => 'technology_software_firm_banner_section',
		'settings'        => 'technology_software_firm_banner_button_label_',
		'type'            => 'text',
		'active_callback' => 'technology_software_firm_is_banner_slider_section_enabled',
	)
);

// Banner Section - Primary button link.
$wp_customize->add_setting(
	'technology_software_firm_banner_button_link_',
	array(
		'default'           => '',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'technology_software_firm_banner_button_link_',
	array(
		'label'           => esc_html__( 'Primary Button Link', 'technology-software-firm' ),
		'section'         => 'technology_software_firm_banner_section',
		'settings'        => 'technology_software_firm_banner_button_link_',
		'type'            => 'url',
		'active_callback' => 'technology_software_firm_is_banner_slider_section_enabled',
	)
);

// Banner Section - Secondary button text.
$wp_customize->add_setting(
	'technology_software_firm_banner_secondary_button_label',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'technology_software_firm_banner_secondary_button_label',
	array(
		'label'           => esc_html__( 'Secondary Button Text', 'technology-software-firm' ),
		'section'         => 'technology_software_firm_banner_section',
		'settings'        => 'technology_software_firm_banner_secondary_button_label',
		'type'            => 'text',
		'active_callback' => 'technology_software_firm_is_banner_slider_section_enabled',
	)
);

// Banner Section - Secondary button link.
$wp_customize->add_setting(
	'technology_software_firm_banner_secondary_button_link',
	array(
		'default'           => '',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'technology_software_firm_banner_secondary_button_link',
	array(
		'label'           => esc_html__( 'Secondary Button Link', 'technology-software-firm' ),
		'section'         => 'technology_software_firm_banner_section',
		'settings'        => 'technology_software_firm_banner_secondary_button_link',
		'type'            => 'url',
		'active_callback' => 'technology_software_firm_is_banner_slider_section_enabled',
	)
);

// Banner Section - Hero image.
$wp_customize->add_setting(
	'technology_software_firm_banner_section_image',
	array(
		'default'           => get_template_directory_uri() . '/resource/img/default1.png',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	new WP_Customize_Image_Control(
		$wp_customize,
		'technology_software_firm_banner_section_image',
		array(
			'label'           => esc_html__( 'Banner Image', 'technology-software-firm' ),
			'section'         => 'technology_software_firm_banner_section',
			'active_callback' => 'technology_software_firm_is_banner_slider_section_enabled',
		)
	)
);

// Primary button text color.
$wp_customize->add_setting(
	'technology_software_firm_banner_btn_color',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize,
		'technology_software_firm_banner_btn_color',
		array(
			'label'           => esc_html__( 'Primary Button Label Color', 'technology-software-firm' ),
			'section'         => 'technology_software_firm_banner_section',
			'settings'        => 'technology_software_firm_banner_btn_color',
			'active_callback' => 'technology_software_firm_is_banner_slider_section_enabled',
		)
	)
);

// Primary button background color.
$wp_customize->add_setting(
	'technology_software_firm_banner_btn_bg_color',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize,
		'technology_software_firm_banner_btn_bg_color',
		array(
			'label'           => esc_html__( 'Primary Button Background Color', 'technology-software-firm' ),
			'section'         => 'technology_software_firm_banner_section',
			'settings'        => 'technology_software_firm_banner_btn_bg_color',
			'active_callback' => 'technology_software_firm_is_banner_slider_section_enabled',
		)
	)
);

// Primary button border color.
$wp_customize->add_setting(
	'technology_software_firm_banner_btn_border_color',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize,
		'technology_software_firm_banner_btn_border_color',
		array(
			'label'           => esc_html__( 'Primary Button Border Color', 'technology-software-firm' ),
			'section'         => 'technology_software_firm_banner_section',
			'settings'        => 'technology_software_firm_banner_btn_border_color',
			'active_callback' => 'technology_software_firm_is_banner_slider_section_enabled',
		)
	)
);

// Secondary button text color.
$wp_customize->add_setting(
	'technology_software_firm_banner_secondary_btn_color',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize,
		'technology_software_firm_banner_secondary_btn_color',
		array(
			'label'           => esc_html__( 'Secondary Button Label Color', 'technology-software-firm' ),
			'section'         => 'technology_software_firm_banner_section',
			'settings'        => 'technology_software_firm_banner_secondary_btn_color',
			'active_callback' => 'technology_software_firm_is_banner_slider_section_enabled',
		)
	)
);

// Secondary button background color.
$wp_customize->add_setting(
	'technology_software_firm_banner_secondary_btn_bg_color',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize,
		'technology_software_firm_banner_secondary_btn_bg_color',
		array(
			'label'           => esc_html__( 'Secondary Button Background Color', 'technology-software-firm' ),
			'section'         => 'technology_software_firm_banner_section',
			'settings'        => 'technology_software_firm_banner_secondary_btn_bg_color',
			'active_callback' => 'technology_software_firm_is_banner_slider_section_enabled',
		)
	)
);

// Secondary button border color.
$wp_customize->add_setting(
	'technology_software_firm_banner_secondary_btn_border_color',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize,
		'technology_software_firm_banner_secondary_btn_border_color',
		array(
			'label'           => esc_html__( 'Secondary Button Border Color', 'technology-software-firm' ),
			'section'         => 'technology_software_firm_banner_section',
			'settings'        => 'technology_software_firm_banner_secondary_btn_border_color',
			'active_callback' => 'technology_software_firm_is_banner_slider_section_enabled',
		)
	)
);
