<?php
/**
 * EasySite Pro Child Theme functions.
 *
 * @package EasySite_Pro_Child
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Enqueue parent and child styles.
 */
function easysite_child_enqueue_styles() {
	$parent = wp_get_theme( 'easysite-pro' );

	wp_enqueue_style(
		'easysite-pro-parent',
		get_template_directory_uri() . '/style.css',
		array(),
		$parent->get( 'Version' )
	);

	wp_enqueue_style(
		'easysite-pro-child',
		get_stylesheet_uri(),
		array( 'easysite-pro-parent', 'easysite-pro-main' ),
		wp_get_theme()->get( 'Version' )
	);
}
add_action( 'wp_enqueue_scripts', 'easysite_child_enqueue_styles', 20 );

/**
 * Example: override a theme mod default for this child site only.
 */
function easysite_child_defaults() {
	if ( ! get_theme_mod( 'easysite_main_color' ) ) {
		set_theme_mod( 'easysite_main_color', '#7c3aed' );
	}
}
add_action( 'after_setup_theme', 'easysite_child_defaults' );
