<?php 

/**
 * Enqueue scripts and styles.
 */
function edify_scripts() {
	
	// Add CSS Files
	wp_enqueue_style( 'edify-fonts', edify_fonts_url(), array(), EDIFY_VERSION );
	

    if( is_rtl() ){
        wp_enqueue_style( 'bootstrap-rtl', EDIFY_PLUGINS.'/bootstrap/bootstrap.rtl.min.css', array() );
    }else{
        wp_enqueue_style( 'bootstrap', EDIFY_PLUGINS.'/bootstrap/bootstrap.css', array() );
    }

	wp_enqueue_style('remixicon' , EDIFY_PLUGINS. '/remixicon/remixicon.css');	
	wp_enqueue_style('fontawesome' , EDIFY_PLUGINS. '/fontawesome/css/all.css');	
	wp_enqueue_style('edify-gutenberg-blog' , EDIFY_CSS. '/gutenberg.css');	
	wp_enqueue_style('edify-blog' , EDIFY_CSS. '/blog.css');	
	wp_enqueue_style('edify-woo' , EDIFY_CSS. '/woocommerce.css');	
	wp_enqueue_style('edify-main-style' , EDIFY_CSS. '/style.css');	
	wp_enqueue_style('edify-responsive' , EDIFY_CSS. '/responsive.css');	
	wp_enqueue_style( 'edify-style', get_stylesheet_uri() );
	wp_style_add_data( 'edify-style', 'rtl', 'replace' );

	// Load JS Files
	wp_enqueue_script( 'popper', EDIFY_PLUGINS . '/bootstrap/popper.min.js', array('jquery'), EDIFY_VERSION, true );
	wp_enqueue_script( 'bootstrap', EDIFY_PLUGINS . '/bootstrap/bootstrap.js', array('jquery'), EDIFY_VERSION, true );
	wp_enqueue_script( 'menu-script', EDIFY_JS . '/menu.js', array('jquery'), EDIFY_VERSION, true );
	wp_enqueue_script( 'edify-script', EDIFY_JS . '/script.js', array('jquery'), EDIFY_VERSION, true );

	wp_localize_script( 'menu-script', 'screenReaderText', array( 'expand'   => __( 'Expand child menu', 'edify' ),
		'collapse' => __( 'Collapse child menu', 'edify' ),
	));
	
	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
		wp_enqueue_script( 'comment-reply' );
	}
}
add_action( 'wp_enqueue_scripts', 'edify_scripts' );



/*
Register Fonts
 */
// function edify_fonts_url() {
//     $font_url = '';

//     /*
//     Translators: If there are characters in your language that are not supported
//     by chosen font(s), translate this to 'off'. Do not translate into your own language.
//      */
//     if ( 'off' !== _x( 'on', 'Google font: on or off', 'edify' ) ) {
//         $font_url = 'https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&display=swap;subset=latin,latin,latin-ext,latin-ext,latin,latin-ext,latin-ext';
//     }
//     return $font_url;
// }

