<?php
/**
 * prime-fitness-gym Theme Customizer
 *
 * @package prime-fitness-gym
 */

 // Custom Controls.
require get_template_directory() . '/inc/custom-control/custom-control.php';

// Sanitize callback.
require get_template_directory() . '/inc/customizer/sanitize-callback.php';

// Default
require get_template_directory() . '/inc/customizer/default.php';

// Load customize sanitize.
include get_template_directory() . '/inc/customizer/active-callback.php';


// Theme section.
// require get_template_directory() . '/inc/customizer/theme-section.php';

/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function prime_fitness_gym_customize_register( $wp_customize ) {
	$wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
	$wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
	$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';

	if ( isset( $wp_customize->selective_refresh ) ) {
		$wp_customize->selective_refresh->add_partial(
			'blogname',
			array(
				'selector'        => '.site-title a',
				'render_callback' => 'prime_fitness_gym_customize_partial_blogname',
			)
		);
		$wp_customize->selective_refresh->add_partial(
			'blogdescription',
			array(
				'selector'        => '.site-description',
				'render_callback' => 'prime_fitness_gym_customize_partial_blogdescription',
			)
		);
	}
	// Front Page Link
	require get_template_directory() . '/inc/customizer/home-section.php';

	require get_template_directory() . '/inc/customizer/section-pro.php';

	// Theme Page Link
	require get_template_directory() . '/inc/customizer/theme-options.php';
}
add_action( 'customize_register', 'prime_fitness_gym_customize_register' );

/**
 * Render the site title for the selective refresh partial.
 *
 * @return void
 */
function prime_fitness_gym_customize_partial_blogname() {
	bloginfo( 'name' );
}

/**
 * Render the site tagline for the selective refresh partial.
 *
 * @return void
 */
function prime_fitness_gym_customize_partial_blogdescription() {
	bloginfo( 'description' );
}

/**
 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
 */
function prime_fitness_gym_customize_preview_js() {
	wp_enqueue_script( 'prime_fitness_gym-customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), PRIME_FITNESS_GYM_S_VERSION, true );
}
add_action( 'customize_preview_init', 'prime_fitness_gym_customize_preview_js' );

/**
 *
 */
function prime_fitness_gym_customize_backend_scripts() {

	wp_enqueue_style( 'prime-fitness-gym-fontawesome-all', get_template_directory_uri() . '/assets/css/all.css' );

	wp_enqueue_style( 'prime-fitness-gym-main-css', get_template_directory_uri() . '/assets/css/output.css' );

	wp_enqueue_style( 'prime-fitness-gym-admin-customizer-style', get_template_directory_uri() . '/inc/customizer/css/customizer-style.css' );

	wp_enqueue_script( 'prime-fitness-gym-admin-customizer', get_template_directory_uri() . '/inc/customizer/js/customizer-script.js', array( 'jquery', 'customize-controls' ), '20151215', true );
	wp_enqueue_script( 'prime-fitness-gym-admin-customizer-control', get_template_directory_uri() . '/inc/customizer/js/customize-controls.js', array( 'jquery', 'customize-controls' ), '', true );
}
add_action( 'customize_controls_enqueue_scripts', 'prime_fitness_gym_customize_backend_scripts', 10 );

/**
 * Enqueue the stylesheet.
 */
function prime_fitness_gym_customizer_stylesheet() {

    wp_register_style( 'prime-fitness-gym-admin-css', get_template_directory_uri() . '/inc/customizer/css/customize-controls.css', NULL, NULL, 'all' );
    wp_enqueue_style( 'prime-fitness-gym-admin-css' );
}
add_action( 'customize_controls_print_styles', 'prime_fitness_gym_customizer_stylesheet' );

///////////////////////////// customize  color 

function prime_fitness_gym_customize_css()
{
?>
	<style type="text/css">
		/* ///////////////////////////  color.php /////////////////////////// */
		/* ---------------## Theme Option Section Color Start ##------------- */
		#site-navigation ul li a{
			color: <?php echo esc_html(get_theme_mod('menu_text_color')); ?>;
		}
		.bottomheader{
			background-color: <?php echo esc_html(get_theme_mod('Header_bg_color')); ?>;
		}
		.social-links p{
			color: <?php echo esc_html(get_theme_mod('Phone_color')); ?>;
		}
		.site-navigation .social-links, .socialicon{
			color: <?php echo esc_html(get_theme_mod('Phone_icon_color')); ?>;
		}
		.slider-inner-mainbox .slider-socialicon .socialicon{
			color: <?php echo esc_html(get_theme_mod('social_icon_color')); ?>;
		}
		.widget .widget-title, .widget .wp-block-heading, .widget .wp-block-search__label{
			color: <?php echo esc_html(get_theme_mod('Heading_text_color')); ?>;
		}
		.widget .widget-title, .widget .wp-block-heading, .widget .wp-block-search__label{
			background-color: <?php echo esc_html(get_theme_mod('Heading_background_color')); ?>;
		}
		.widget .search-form{
			background-color: <?php echo esc_html(get_theme_mod('Search_background_color')); ?>;
		}	
		#secondary ul li a, .sidebar-div .wp-block-archives-list li a, .sidebar-div .wp-block-categories-list li a, .sidebar-div .wp-block-latest-posts__list li a, .single_sidebar .wp-block-archives-list li a, .single_sidebar .wp-block-categories-list li a, .single_sidebar .wp-block-latest-posts__list li a, .widget_archive p, .widget_archive select, .widget_categories li a, .widget_recent_entries li a{
			color: <?php echo esc_html(get_theme_mod('Text_color')); ?>;
		}	
		.wp-block-search__button{
			color: <?php echo esc_html(get_theme_mod('Searchbtn_Text_color')); ?>;
		}
		.maincontent .page-title a{
			color: <?php echo esc_html(get_theme_mod('post_title_color')); ?>;
		}
		.maincontent .entry-meta .post-date svg{
			color: <?php echo esc_html(get_theme_mod('post_calender_icon_color')); ?>;
		}
		.maincontent .entry-meta .post-comment svg{
			color: <?php echo esc_html(get_theme_mod('post_comment_icon_color')); ?>;
		}
		.maincontent .entry-meta .post-date a{
			color: <?php echo esc_html(get_theme_mod('post_date_text_color')); ?>;
		}
		.maincontent .entry-meta .post-comment a{
			color: <?php echo esc_html(get_theme_mod('post_comment_text_color')); ?>;
		}
		.post-details .entry-author a{
			color: <?php echo esc_html(get_theme_mod('post_authorname_text_color')); ?>;
		}
		.post-details .entry-time{
			color: <?php echo esc_html(get_theme_mod('post_time_text_color')); ?>;
		}
		.maincontent .readbtn{
			color: <?php echo esc_html(get_theme_mod('post_readmore_color')); ?>;
		}
		#colophon{
			background-color: <?php echo esc_html(get_theme_mod('footer_bg_color')); ?>;
		}

		/* ---------------## Slider Section Color Start ##------------- */
		#featured-slider .entry-container h4{
			color: <?php echo esc_html(get_theme_mod('slider_title_color')); ?>;
		}

		#featured-slider .entry-container .content{
			color: <?php echo esc_html(get_theme_mod('slider_subtitle_color')); ?>;
		}

		#featured-slider .content a, #featured-slider code,
		.wp-block-buttons .wp-block-button__link, .singlepage #submit{
			background: <?php echo esc_html(get_theme_mod('slider_readmore_color')); ?>;
		}

		#featured-slider .content a, #featured-slider code,
		.wp-block-buttons .wp-block-button__link, .singlepage #submit{
			color: <?php echo esc_html(get_theme_mod('slider_readmoretxt_color')); ?>!important;
		}

		#featured-slider .slick-dots li{
			background: <?php echo esc_html(get_theme_mod('slider_slickdot_color')); ?>;
		}

		#featured-slider .slick-dots li.slick-active{
			background: <?php echo esc_html(get_theme_mod('slider_activeslickdot_color')); ?>;
		}

		#featured-slider .sliderbut1 a{
			color: <?php echo esc_html(get_theme_mod('slider_buttontext1_color')); ?>;
		}
		#featured-slider .sliderbut1{
			background: <?php echo esc_html(get_theme_mod('slider_buttonbg1_color')); ?>;
		}
		#featured-slider .sliderbut2 a{
			color: <?php echo esc_html(get_theme_mod('slider_buttontext2_color')); ?>;
		}
		#featured-slider .sliderbut2{
			background: <?php echo esc_html(get_theme_mod('slider_buttonbg2_color')); ?>;
		}
		.button-icon{
			background-color: <?php echo esc_html(get_theme_mod('slider_button_icon_bg_color')); ?>;
		}
		.button-icon svg{
			color: <?php echo esc_html(get_theme_mod('slider_button_icon_color')); ?> !important;
		}
		.slider-inner-mainbox .slider-socialicon .socialicon{
			color: <?php echo esc_html(get_theme_mod('slider_social_icon_color')); ?>;
		}
		/* ---------------## Slider Section Color End ##------------- */

		/* ---------------## About Section Color End ##------------- */
		#featured-about .title-section h5{
			color: <?php echo esc_html(get_theme_mod('aboutsection_heading_text_color')); ?>;
		}
		#featured-about .title-section h1{
			color: <?php echo esc_html(get_theme_mod('aboutsection_sub_heading_text_color')); ?>;
		}
		#featured-about .plans p{
			color: <?php echo esc_html(get_theme_mod('aboutsection_featureabout_text_color')); ?>;
		}
		#featured-about .about-img-box .about-title-up{
			color: <?php echo esc_html(get_theme_mod('aboutsection_about_bigtext_color')); ?>;
		}

		/* ---------------## About Section Color End ##------------- */
		

		/* ---------------## What we Offer Section Color Start ##------------- */
		.featured-whatweoffer{
			background: <?php echo esc_html(get_theme_mod('whatweoffer_background_color')); ?>;
		}
		
		.featured-whatweoffer .head-title{
			color: <?php echo esc_html(get_theme_mod('whatweoffer_title_color')); ?>;
		}

		.featured-whatweoffer .head-subtitle{
			color: <?php echo esc_html(get_theme_mod('whatweoffer_subtitle_color')); ?>;
		}
		
		.featured-whatweoffer .title a{
			color: <?php echo esc_html(get_theme_mod('whatweoffer_cardtitle_color')); ?>;
		}
		/* ---------------## What we Offer Section Color End ##------------- */
	</style>
	
<?php
}
add_action('wp_head', 'prime_fitness_gym_customize_css');
