<?php
/**
 * Enqueue scripts and styles.
 */
function glamer_scripts() {
	global $wp_query;
	wp_enqueue_style('fontawesome', get_theme_file_uri('assets/css/fontawesome.min.css'), array(),  GLAMER_VERSION, 'all');
	wp_enqueue_style('magnific-popup', get_theme_file_uri('assets/css/magnific-popup.min.css'), array(), GLAMER_VERSION, 'all');
	wp_enqueue_style('bootstrap', get_theme_file_uri('assets/css/bootstrap-min.css'), array(),  GLAMER_VERSION, 'all');
	wp_enqueue_style('swiper', get_theme_file_uri('assets/css/swiper-bundle.min.css'), array(),  GLAMER_VERSION, 'all');
	wp_enqueue_style('animation', get_theme_file_uri('assets/css/animation.css'), array(),  GLAMER_VERSION, 'all');
	wp_enqueue_style('superfish', get_theme_file_uri('assets/css/superfish.css'), array(),  GLAMER_VERSION, 'all');
	wp_enqueue_style('slicknav-min', get_theme_file_uri('assets/css/slicknav-min.css'), array(),  GLAMER_VERSION, 'all');
	wp_enqueue_style('glamer-typography', get_theme_file_uri('assets/css/typography.css'), array(), GLAMER_VERSION, 'all');
	wp_enqueue_style('glamer-theme', get_theme_file_uri('assets/css/theme.css'), array(), GLAMER_VERSION, 'all');
	wp_enqueue_style('glamer-responsive', get_theme_file_uri('assets/css/responsive.css'), array(), GLAMER_VERSION, 'all');
	wp_enqueue_style('glamer-style', get_stylesheet_uri(), array(), GLAMER_VERSION, 'all');
	wp_style_add_data('glamer-style', 'rtl', 'replace');
	wp_enqueue_style('glamer-title-fonts', '//fonts.googleapis.com/css2?family=Kanit:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap', '', '1.0.0', 'screen');
	wp_enqueue_style('glamer-body-fonts', 'https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap', '', '1.0.0', 'screen');
	//Enqueue scripts.
	wp_enqueue_script('macy', get_theme_file_uri('assets/js/macy.min.js'), array(),  GLAMER_VERSION, true);
	wp_enqueue_script('bootstrap', get_theme_file_uri('assets/js/bootstrap.bundle.min.js'), array(), GLAMER_VERSION, true);	
	wp_enqueue_script('swiper', get_theme_file_uri('assets/js/swiper-bundle.min.js'), array('jquery'), GLAMER_VERSION, true);
	wp_enqueue_script('jquery-magnific-popup', get_theme_file_uri('assets/js/jquery.magnific-popup.min.js'), array('jquery'), GLAMER_VERSION, true);
	wp_enqueue_script('superfish', get_theme_file_uri('assets/js/superfish.min.js'), array('jquery'), GLAMER_VERSION, true);
	wp_enqueue_script('jquery-slicknav', get_theme_file_uri('assets/js/jquery-slicknav-min.js'), array('jquery'), GLAMER_VERSION, true);
	wp_enqueue_script('glamer-main', get_theme_file_uri('assets/js/main.js'), array('jquery'), GLAMER_VERSION, true);

	if (is_singular() && comments_open() && get_option('thread_comments')) {
		wp_enqueue_script('comment-reply');
	}
}
add_action('wp_enqueue_scripts', 'glamer_scripts');

function glamer_backend_admin_styles() {
	wp_enqueue_style('glamer-backend-css', get_theme_file_uri('assets/css/glamer-backend.css'), array(),  GLAMER_VERSION, 'all');
}
add_action('admin_enqueue_scripts', 'glamer_backend_admin_styles');