<?php
/**
 * Includes default settings and starter functions for the theme Customizer.
 * 
 * @package Blogbuster
 */

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

if ( ! function_exists( 'blogbuster_get_customizer_option_value' ) ) :

    /**
     * Get the customizer value `get_theme_mod()`
     * 
     * @since 1.0.0
     */
    function blogbuster_get_customizer_option_value( $setting_id ) {

        return get_theme_mod( $setting_id, blogbuster_get_customizer_default( $setting_id ) );

    }

endif;

if ( ! function_exists( 'blogbuster_get_customizer_default' ) ) :

    /**
     * Returns an array of the default Blogbuster Options.
     *
     * @return array
     */
    function blogbuster_get_customizer_default( $setting_id ) {

        $default_values = apply_filters( 'blogbuster_get_customizer_defaults',
            array(
                //container
                'blogbuster_site_container_layout'      => 'separate',
                'blogbuster_background_animation_enable'    => true,
                //preloader
                'blogbuster_preloader_enable'           => true,
                'blogbuster_preloader_style'            => 'wave',
                //social icons
                'blogbuster_social_icon_link_target'    => false,
                'blogbuster_social_icons'               => json_encode( array( array( 'social_icon' => 'fab fa-facebook', 'social_url'   => '', 'item_visible'   => 'show' ) ) ),
                //colors
                'blogbuster_primary_theme_color'        => '#ce7900',
                'blogbuster_text_color'                 => '#3b3b3b',
                'blogbuster_link_color'                 => '#ce7900',
                'blogbuster_link_hover_color'           => '#ce7900',
                //scroll top
                'blogbuster_scroll_top_enable'          => true,
                'blogbuster_scroll_top_arrow'           => 'fa-arrow-up',
                //sidebar layout
                'blogbuster_global_sidebar_sticky_enable'   => true,
                'blogbuster_archive_sidebar_layout'                => 'right-sidebar',
                'blogbuster_posts_sidebar_layout'                  => 'right-sidebar',
                'blogbuster_pages_sidebar_layout'                  => 'right-sidebar',
                //typography
                'blogbuster_body_font_family'                      => 'Roboto',
                'blogbuster_body_font_weight'                      => '400',
                'blogbuster_body_font_style'                       => 'normal',
                'blogbuster_body_font_transform'                   => 'inherit',
                'blogbuster_body_font_decoration'                  => 'inherit',
                'blogbuster_heading_font_family'                   => 'Nunito',
                'blogbuster_heading_font_weight'                   => '700',
                'blogbuster_heading_font_style'                    => 'normal',
                'blogbuster_heading_font_transform'                => 'inherit',
                'blogbuster_heading_font_decoration'               => 'inherit',
                //performance
                'blogbuster_site_schema_enable'         => true,
                //header
                'blogbuster_site_identity_tabs'         => 'general',
                'blogbuster_site_mode_switch_enable'    => false,
                'blogbuster_site_mode'                  => 'light-mode',
                'blogbuster_header_social_icons_enable' => true,
                'blogbuster_header_search_enable'       => true,
                'blogbuster_header_sticky_enable'       => true,
                //frontpage featured
                'blogbuster_front_featured_enable'      => true,
                'blogbuster_front_featured_section_title'   => __( 'Featured Items', 'blogbuster' ),
                'blogbuster_front_featured_items'       => json_encode( array( array( 'item_category' => '', 'item_image'   => '', 'item_visible'   => 'show' ) ) ),
                // frontpage sticky
                'blogbuster_front_sticky_post_enable'   => true,
                'blogbuster_front_sticky_post_section_title'    => __( 'Sticky Post', 'blogbuster' ),
                //archive page
                'blogbuster_archive_page_style'                => 'archive-style--grid',
                'blogbuster_archive_title_prefix_enable'       => false,
                'blogbuster_archive_post_readmore_enable'      => true,
                'blogbuster_archive_read_more_type'            => 'icon',
                'blogbuster_archive_read_more_icon'            => 'fa-forward',
                'blogbuster_archive_post_read_more'            => __( 'Read More', 'blogbuster' ),
                //single post
                'blogbuster_single_posts_author_enable'        => true,
                'blogbuster_single_posts_related_enable'       => true,
                'blogbuster_single_posts_related_label'        => __( 'Related Posts', 'blogbuster' ),
                //footer main area
                'blogbuster_footer_main_enable'         => true,
                'blogbuster_footer_widget_area_layout'  => 'column-three',
                //footer bottom area
                'blogbuster_footer_bottom_enable'              => true,
                'blogbuster_footer_copyright_info'             => esc_html__( 'Copyright &copy; Blogbuster {year}', 'blogbuster' )
            )
        );

        return  $default_values[$setting_id];

    }

endif;