<?php
/**
 * Includes theme customizer defaults and starter functions.
 * 
 * @package Ogma
 */

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

if ( ! function_exists( 'ogma_get_customizer_option_value' ) ) :

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

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

    }

endif;

if ( ! function_exists( 'ogma_get_customizer_default' ) ) :

    /**
     * Returns an array of the desired default Ogma Options
     *
     * @return array
     */
    function ogma_get_customizer_default( $setting_id ) {

        $default_values = apply_filters( 'ogma_get_customizer_defaults',
            array(
                //container
                'site_container_layout'                 => 'separate',
                'main_container_width'                  => 1320,
                'boxed_container_width'                 => 1290,
                'ogma_site_mode'                        => 'light-mode',
                //preloader
                'preloader_enable'                      => true,
                'preloader_style'                       => 'wave',
                //social icons
                'social_icon_link_target'               => false,
                'social_icons'                          => json_encode( array( array( 'social_icon' => 'bx bxl-twitter', 'social_url'   => '', 'item_visible'   => 'show' ) ) ),
                //colors
                'primary_theme_color'                   => '#0065C1',
                'text_color'                            => '#3b3b3b',
                'link_color'                            => '#0065C1',
                'link_hover_color'                      => '#005ca8',
                //breadcrumb
                'site_breadcrumb_enable'                => true,
                'site_breadcrumb_types'                 => 'default',
                //sidebar layout
                'sidebar_sticky_enable'                 => true,
                'archive_sidebar_layout'                => 'right-sidebar',
                'posts_sidebar_layout'                  => 'right-sidebar',
                'pages_sidebar_layout'                  => 'right-sidebar',
                //scroll top
                'scroll_top_enable'                     => true,
                'scroll_top_arrow'                      => 'bx-up-arrow-alt',
                //site identity
                'site_identity_tabs'                    => 'general',
                //typography
                'body_font_family'                      => 'Roboto',
                'body_font_weight'                      => '400',
                'body_font_style'                       => 'normal',
                'body_font_transform'                   => 'inherit',
                'body_font_decoration'                  => 'inherit',
                'heading_font_family'                   => 'Nunito',
                'heading_font_weight'                   => '700',
                'heading_font_style'                    => 'normal',
                'heading_font_transform'                => 'inherit',
                'heading_font_decoration'               => 'inherit',
                //performance
                'site_schema_enable'                    => true,
                'posts_date_style'                      => 'publish',
                'posts_date_format'                     => 'default',
                'posts_thumbnail_hover_effect'          => 'hover-effect--one',
                'posts_reading_time_enable'             => true,
                //top header
                'header_top_area_tabs'                  => 'general',
                'header_top_enable'                     => true,
                'header_top_bg_color'                   => '#111111',
                'header_top_date_enable'                => true,
                'header_top_date_format'                => 'date_format_1',
                'header_top_menu_enable'                => true,
                'header_social_enable'                  => true,
                'header_top_placement'                  => 'placement_one',
                //header main area
                'header_main_area_tabs'                 => 'general',
                'header_sticky_enable'                  => true,
                'header_main_area_layout'               => 'header-main-layout--one',
                'header_site_mode_switch_enable'        => true,
                'header_search_enable'                  => true,
                'header_sticky_sidebar_toggle_enable'   => true,
                'header_custom_button_label'            => __( 'Subscribe', 'ogma' ),
                'header_custom_button_link'             => '',
                'header_main_bg_type'                   => 'bg-none',
                'header_main_bg_color'                  => '#0065C1',
                'header_main_bg_image'                  => '',
                //primary menu
                'primary_menu_description_enable'       => true,
                //header ads
                'header_ads_image'                      => '',
                'header_ads_image_link'                 => '',
                //header ticker
                'header_ticker_enable'                  => true,
                'header_ticker_label'                   => __( 'Breaking News', 'ogma' ),
                'ticker_posts_date_filter'              => 'all',
                //frontpage banner
                'frontpage_banner_tabs'                 => 'general',
                'frontpage_banner_layout'               => 'frontpage-banner-layout--one',
                'banner_slider_order_by'                => 'date-desc',
                'banner_slider_category'                => 'all',
                'banner_slider_date_filter'             => 'all',
                'banner_block_category'                 => 'all',
                'banner_block_order_by'                 => 'date-desc',
                'banner_tab_label_latest'               => __( 'Latest', 'ogma' ),
                'banner_tab_label_popular'              => __( 'Popular', 'ogma' ),
                'banner_tab_label_trending'             => __( 'Trending', 'ogma' ),
                'banner_tab_trending_category'          => 'all',
                'banner_one_column_reorder'             => array( 'slider', 'block' ),
                'banner_two_column_reorder'             => array( 'slider', 'tab' ),
                'banner_bg_type'                        => 'bg-none',
                'banner_bg_color'                       => '#F7F8F9',
                'banner_bg_image'                       => '',
                //homepage
                'frontpage_blocks_enable'               => true,
                //front top fullwidth
                'front_top_fullwidth_blocks'            => json_encode(
                    array(
                        array(
                            'type'              => 'news-featured',
                            'option'            => true,
                            'blockTitle'        => __( 'Highlight News', 'ogma' ),
                            'category'          => 'all',
                            'postOrderby'       => 'date-desc',
                            'postDatefilter'    => 'all',
                            'postCount'         => 3,
                            'blocklayout'       => 'one',
                            'postCats'          => true,
                            'postAuthor'        => true,
                            'postDate'          => true,
                            'postComment'       => true,
                            'postMore'          => true,

                        ),
                        array(
                            'type'          => 'ad-block',
                            'option'        => true,
                            'imgSrc'        => '',
                            'imgUrl'        => '',
                            'newTab'        => true,
                        ),
                    )
                ),
                // front middle content
                'front_middle_content_blocks'   => json_encode(
                    array(
                        array(
                            'type'              => 'news-block',
                            'option'            => true,
                            'blockTitle'        => __( 'World News', 'ogma' ),
                            'category'          => 'all',
                            'postOrderby'       => 'date-desc',
                            'postDatefilter'    => 'all',
                            'postCount'         => 5,
                            'blocklayout'       => 'one',
                            'postCats'          => true,
                            'postAuthor'        => true,
                            'postDate'          => true,
                            'postComment'       => true,
                            'postMore'          => true,
                        ),
                        array(
                            'type'              => 'news-list',
                            'option'            => true,
                            'blockTitle'        => __( 'Latest News', 'ogma' ),
                            'category'          => 'all',
                            'postOrderby'       => 'date-desc',
                            'postDatefilter'    => 'all',
                            'postCount'         => 3,
                            'blocklayout'       => 'one',
                            'postCats'          => true,
                            'postAuthor'        => true,
                            'postDate'          => true,
                            'postComment'       => true,
                            'postExcerpt'       => true,
                            'postMore'          => true,

                        ),
                    )
                ),
                //front bottom fullwidth
                'front_bottom_fullwidth_blocks' => json_encode(
                    array(
                        array(
                            'type'              => 'news-carousel',
                            'option'            => true,
                            'blockTitle'        => __( 'Editor Picks', 'ogma' ),
                            'category'          => 'all',
                            'postOrderby'       => 'date-desc',
                            'postDatefilter'    => 'all',
                            'postCount'         => 6,
                            'blocklayout'       => 'one',
                            'postCats'          => true,
                            'postAuthor'        => true,
                            'postDate'          => true,
                            'postComment'       => true,

                        ),
                        array(
                            'type'              => 'news-grid',
                            'option'            => true,
                            'blockTitle'        => __( 'Features and Events', 'ogma' ),
                            'category'          => 'all',
                            'postOrderby'       => 'date-desc',
                            'postDatefilter'    => 'all',
                            'postCount'         => 5,
                            'blocklayout'       => 'one',
                            'postCats'          => true,
                            'postAuthor'        => true,
                            'postDate'          => true,
                            'postComment'       => true,
                            'postExcerpt'       => true,
                            'postMore'          => true,
                        ),
                    )
                ),
                //archive page
                'archive_page_style'                => 'archive-style--classic',
                'archive_title_prefix_enable'       => false,
                'archive_post_readmore_enable'      => true,
                //single posts
                'single_posts_layout'               => 'posts-layout--one',
                'single_posts_author_enable'        => true,
                'single_posts_related_enable'       => true,
                'single_posts_related_label'        => __( 'Related Posts', 'ogma' ),
                //404 error
                'error_page_search_enable'          => true,
                'error_page_button_enable'          => true,
                'error_page_button_label'           => __( 'Back To Home', 'ogma' ),
                //footer main area
                'footer_main_enable'                => true,
                'footer_widget_area_layout'         => 'column-three',
                //footer bottom area
                'footer_bottom_enable'              => true,
                'footer_copyright_info'             => esc_html__( 'Copyright &copy; ogma {year}', 'ogma' )
            )
        );

        return  $default_values[$setting_id];

    }

endif;