<?php
/**
 * Enqueue scripts and styles.
 */
function digital_marketing_blog_scripts() {
	wp_enqueue_style( 'fontawesome', esc_url(get_theme_file_uri('assets/css/fontawesome.css')) );
	wp_enqueue_style( 'slick-theme', esc_url(get_theme_file_uri('assets/slick-1.8.1/slick/slick-theme.css')) );
	wp_enqueue_style( 'slick', esc_url(get_theme_file_uri('assets/slick-1.8.1/slick/slick.css')) );
	wp_enqueue_style( 'digital-marketing-blog-style', get_stylesheet_uri() );

	$banner_colors = get_theme_mod('banner_button_colors');
	$bg = "#8574e9";
	$txt = "#ffffff";
	$bg_hover = "#ffffff";
	$txt_hover = "#8574e9";
	if($banner_colors){
		$bg = $banner_colors['btn_bg'];
		$txt = $banner_colors['btn_text'];
		$bg_hover = $banner_colors['btn_hover_bg'];
		$txt_hover = $banner_colors['btn_hover_text'];
	}

	$inline_style_data = '
	section.banner-section {
		position: relative;
	}

	.banner__col .button a {
		background: '.$bg.';
		color: '.$txt.';
	}

	.banner__col .button a:hover {
		background: '.$bg_hover.';
		color: '.$txt_hover.';
	}
	
	';

	wp_add_inline_style('digital-marketing-blog-style', $inline_style_data);
	wp_enqueue_script( 'digital-marketing-blog-slick-js', esc_url( get_template_directory_uri() ) . '/assets/slick-1.8.1/slick/slick.js', array( 'jquery' ), NULL, true );
	wp_enqueue_script( 'imagesloaded.pkgd', esc_url( get_template_directory_uri() ) . '/assets/js/imagesloaded.pkgd.min.js', array( 'jquery' ), '1.0', true );
	wp_enqueue_script( 'masonry' );
	wp_enqueue_script( 'digital-marketing-blog-menu', esc_url( get_template_directory_uri() ) . '/assets/js/menu.js', array( 'jquery' ), '1.0', true );
	wp_enqueue_script( 'digital-marketing-blog-active', esc_url( get_template_directory_uri() ) . '/assets/js/active.js', array( 'jquery' ), '1.0', true );
	
	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
		wp_enqueue_script( 'comment-reply' );
	}
}
add_action( 'wp_enqueue_scripts', 'digital_marketing_blog_scripts' );

add_action('customize_controls_enqueue_scripts', 'digital_marketing_blog_customizer_scripts');
function digital_marketing_blog_customizer_scripts(){
	wp_enqueue_style('customizer-style', esc_url(get_theme_file_uri('inc/customizer/customizer-style.css')), array(), '49879', 'all');
}
