<?php
/**
 * IT Software Service functions and definitions
 *
 * @package it-software-service
 * @since 1.0
 */

if ( ! function_exists( 'it_software_service_support' ) ) :
	function it_software_service_support() {

		load_theme_textdomain( 'it-software-service', get_template_directory() . '/languages' );

		// Add support for block styles.
		add_theme_support( 'wp-block-styles' );

		add_theme_support('woocommerce');

		// Enqueue editor styles.
		add_editor_style(get_stylesheet_directory_uri() . '/assets/css/editor-style.css');
	}

endif;

add_action( 'after_setup_theme', 'it_software_service_support' );

if ( ! function_exists( 'it_software_service_styles' ) ) :
	function it_software_service_styles() {
		// Register theme stylesheet.
		$it_software_service_theme_version = wp_get_theme()->get( 'Version' );

		$it_software_service_version_string = is_string( $it_software_service_theme_version ) ? $it_software_service_theme_version : false;
		wp_enqueue_style(
			'it-software-service-style',
			get_template_directory_uri() . '/style.css',
			array(),
			$it_software_service_version_string
		);

		wp_enqueue_style( 'dashicons' );

		wp_enqueue_style( 'animate-css', esc_url(get_template_directory_uri()).'/assets/css/animate.css' );

		wp_enqueue_script( 'jquery-wow', esc_url(get_template_directory_uri()) . '/assets/js/wow.js', array('jquery') );

		wp_enqueue_script(
      'lettering-js',
      esc_url(get_template_directory_uri()) . '/assets/js/jquery.lettering.js',
      array('jquery')
    );

		wp_style_add_data( 'it-software-service-style', 'rtl', 'replace' );

		//font-awesome
		wp_enqueue_style( 'fontawesome', get_template_directory_uri() . '/inc/fontawesome/css/all.css'
			, array(), '7.0.0' );

		// Enqueue Custom Script
		wp_enqueue_script(
		    'it-software-service-custom-script',
		    get_template_directory_uri() . '/assets/js/custom-script.js',
		    array('jquery'),
		    $it_software_service_version_string,
		    true
		);
	}
endif;

add_action( 'wp_enqueue_scripts', 'it_software_service_styles' );

// Add block patterns
require get_template_directory() . '/inc/block-patterns.php';

// Add block styles
require get_template_directory() . '/inc/block-styles.php';

// Block Filters
require get_template_directory() . '/inc/block-filters.php';

// Svg icons
require get_template_directory() . '/inc/icon-function.php';