<?php
/**
 * Theme Customizer
 *
 * @package Kenta Fast Blog
 */

// don't call the file directly
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

if ( ! function_exists( 'kenta_fast_blog_return_yes' ) ) {
	function kenta_fast_blog_return_yes() {
		return 'yes';
	}
}

if ( ! function_exists( 'kenta_fast_blog_return_no' ) ) {
	function kenta_fast_blog_return_no() {
		return 'no';
	}
}

// Enable site wrap by default
add_filter( 'kenta_enable_site_wrap_default_value', 'kenta_fast_blog_return_no' );

//
//  Card style
//
if ( ! function_exists( 'kenta_fast_blog_card_preset' ) ) {
	function kenta_fast_blog_card_preset() {
		return 'inner-shadow';
	}
}
add_filter( 'kenta_card_style_preset_default_value', 'kenta_fast_blog_card_preset' );
add_filter( 'kenta_store_card_style_preset_default_value', 'kenta_fast_blog_card_preset' );
add_filter( 'kenta_global_sidebar_widgets-style_default_value', 'kenta_fast_blog_card_preset' );

//
// Default color preset
//

if ( ! function_exists( 'kenta_fast_blog_default_color_presets' ) ) {
	function kenta_fast_blog_default_color_presets() {
		return 'kenta-fast-blog';
	}
}
add_filter( 'kenta_color_palettes_default_value', 'kenta_fast_blog_default_color_presets' );

if ( ! function_exists( 'kenta_fast_blog_color_presets' ) ) {
	function kenta_fast_blog_color_presets( $presets ) {
		$presets['kenta-fast-blog'] = array(
			'kenta-primary-color'  => '#c4403b',
			'kenta-primary-active' => '#af1d2c',
			'kenta-accent-color'   => '#212a33',
			'kenta-accent-active'  => '#17212a',
			'kenta-base-300'       => '#e2e8f0',
			'kenta-base-200'       => '#f1f5f9',
			'kenta-base-100'       => '#f8fafc',
			'kenta-base-color'     => '#ffffff',
		);

		return $presets;
	}
}
add_filter( 'kenta_filter_color_presets', 'kenta_fast_blog_color_presets' );

//
// Dark color preset
//
if ( ! function_exists( 'kenta_fast_blog_dark_base_color' ) ) {
	function kenta_fast_blog_dark_base_color() {
		return [
			'300'     => '#49515f',
			'200'     => '#2b343d',
			'100'     => '#212a33',
			'default' => '#17212a',
		];
	}
}
add_filter( 'kenta_dark_base_color_default_value', 'kenta_fast_blog_dark_base_color' );

if ( ! function_exists( 'kenta_fast_blog_dark_accent_color' ) ) {
	function kenta_fast_blog_dark_accent_color() {
		return [
			'default' => '#f3f4f6',
			'active'  => '#a3a9a3',
		];
	}
}
add_filter( 'kenta_dark_accent_color_default_value', 'kenta_fast_blog_dark_accent_color' );

//
// Global typography
//
if ( ! function_exists( 'kenta_fast_blog_global_typography' ) ) {
	function kenta_fast_blog_global_typography() {
		return [
			'family'     => 'artifika',
			'fontSize'   => [
				'desktop' => '16px',
				'tablet'  => '__INITIAL_VALUE__',
				'mobile'  => '__INITIAL_VALUE__'
			],
			'variant'    => '400',
			'lineHeight' => '1',
		];
	}
}
add_filter( 'kenta_site_global_typography_default_value', 'kenta_fast_blog_global_typography' );

//
// Preloader
//
if ( ! function_exists( 'kenta_fast_blog_preloader_preset' ) ) {
	function kenta_fast_blog_preloader_preset() {
		return 'preset-4';
	}
}
add_filter( 'kenta_preloader_preset_default_value', 'kenta_fast_blog_preloader_preset' );

if ( ! function_exists( 'kenta_fast_blog_preloader_colors' ) ) {
	function kenta_fast_blog_preloader_colors() {
		return [
			'background' => '#212a33',
			'accent'     => '#fefefe',
			'primary'    => 'var(--kenta-primary-color)',
		];
	}
}
add_filter( 'kenta_preloader_colors_default_value', 'kenta_fast_blog_preloader_colors' );

//
// Form style
//
if ( ! function_exists( 'kenta_fast_blog_form_style' ) ) {
	function kenta_fast_blog_form_style() {
		return 'modern';
	}
}
add_filter( 'kenta_content_form_style_default_value', 'kenta_fast_blog_form_style' );

//
// Header offcanvas
//
if ( ! function_exists( 'kenta_fast_blog_canvas_drawer_placement' ) ) {
	function kenta_fast_blog_canvas_drawer_placement() {
		return 'left';
	}
}
add_filter( 'kenta_canvas_drawer_placement_default_value', 'kenta_fast_blog_canvas_drawer_placement' );

//
// Header top row
//
if ( ! function_exists( 'kenta_fast_blog_header_top_row_elements' ) ) {
	function kenta_fast_blog_header_top_row_elements() {
		return [
			'desktop' => [
				[
					'elements' => [ 'menu-2' ],
					'settings' => [ 'width' => '70%', 'justify-content' => 'start' ]
				],
				[
					'elements' => [ 'socials' ],
					'settings' => [ 'width' => '30%', 'justify-content' => 'end' ]
				],
			],
			'mobile'  => [
				[
					'elements' => [ 'menu-2' ],
					'settings' => [ 'width' => '100%', 'justify-content' => 'center' ]
				],
			],
		];
	}
}
add_filter( 'kenta_header_top_row_default_value', 'kenta_fast_blog_header_top_row_elements' );

if ( ! function_exists( 'kenta_fast_blog_header_top_row_background' ) ) {
	function kenta_fast_blog_header_top_row_background() {
		return [
			'type'  => 'color',
			'color' => 'var(--kenta-base-200)',
		];
	}
}
add_filter( 'kenta_header_top_bar_row_background_default_value', 'kenta_fast_blog_header_top_row_background' );

if ( ! function_exists( 'kenta_fast_blog_header_top_row_border_bottom' ) ) {
	function kenta_fast_blog_header_top_row_border_bottom() {
		return [
			'width' => 1,
			'style' => 'solid',
			'color' => 'var(--kenta-base-300)',
		];
	}
}
add_filter( 'kenta_header_top_bar_row_border_bottom_default_value', 'kenta_fast_blog_header_top_row_border_bottom' );

//
// Header primary row
//

if ( ! function_exists( 'kenta_fast_blog_header_primary_row_elements' ) ) {
	function kenta_fast_blog_header_primary_row_elements() {
		return [
			'desktop' => [
				[
					'elements' => [ 'logo' ],
					'settings' => [ 'width' => '100%', 'justify-content' => 'center' ]
				],
			],
			'mobile'  => [
				[
					'elements' => [ 'logo' ],
					'settings' => [ 'width' => '100%', 'justify-content' => 'center' ]
				],
			],
		];
	}
}
add_filter( 'kenta_header_primary_row_default_value', 'kenta_fast_blog_header_primary_row_elements' );

if ( ! function_exists( 'kenta_fast_blog_header_primary_row_height' ) ) {
	function kenta_fast_blog_header_primary_row_height() {
		return '160px';
	}
}
add_filter( 'kenta_header_primary_navbar_row_min_height_default_value', 'kenta_fast_blog_header_primary_row_height' );

//
// Header bottom row
//
if ( ! function_exists( 'kenta_fast_blog_header_bottom_row_elements' ) ) {
	function kenta_fast_blog_header_bottom_row_elements() {
		return [
			'desktop' => [
				[
					'elements' => [ 'trigger' ],
					'settings' => [ 'width' => '20%', 'justify-content' => 'flex-start' ]
				],
				[
					'elements' => [ 'menu-1' ],
					'settings' => [ 'width' => '60%', 'justify-content' => 'center' ]
				],
				[
					'elements' => [ 'theme-switch', 'search' ],
					'settings' => [ 'width' => '20%', 'justify-content' => 'flex-end' ]
				],
			],
			'mobile'  => [
				[
					'elements' => [ 'trigger' ],
					'settings' => [ 'width' => '20%', 'justify-content' => 'flex-start' ]
				],
				[
					'elements' => [ 'socials' ],
					'settings' => [ 'width' => '60%', 'justify-content' => 'center' ]
				],
				[
					'elements' => [ 'theme-switch', 'search' ],
					'settings' => [ 'width' => '20%', 'justify-content' => 'flex-end' ]
				],
			],
		];
	}
}
add_filter( 'kenta_header_bottom_row_default_value', 'kenta_fast_blog_header_bottom_row_elements' );

if ( ! function_exists( 'kenta_fast_blog_header_bottom_row_height' ) ) {
	function kenta_fast_blog_header_bottom_row_height() {
		return '56px';
	}
}
add_filter( 'kenta_header_bottom_row_row_min_height_default_value', 'kenta_fast_blog_header_bottom_row_height' );

if ( ! function_exists( 'kenta_fast_blog_header_bottom_row_border_top' ) ) {
	function kenta_fast_blog_header_bottom_row_border_top() {
		return [
			'width' => 1,
			'style' => 'dashed',
			'color' => 'var(--kenta-base-300)',
		];
	}
}
add_filter( 'kenta_header_bottom_row_row_border_top_default_value', 'kenta_fast_blog_header_bottom_row_border_top' );

if ( ! function_exists( 'kenta_fast_blog_header_bottom_row_border_bottom' ) ) {
	function kenta_fast_blog_header_bottom_row_border_bottom() {
		return [
			'width' => 3,
			'style' => 'solid',
			'color' => 'var(--kenta-primary-color)',
		];
	}
}
add_filter( 'kenta_header_bottom_row_row_border_bottom_default_value', 'kenta_fast_blog_header_bottom_row_border_bottom' );


// theme switch element
if ( ! function_exists( 'kenta_fast_blog_theme_switch_icon' ) ) {
	function kenta_fast_blog_theme_switch_icon() {
		return [
			'value'   => 'fas fa-circle-half-stroke',
			'library' => 'fa-solid',
		];
	}
}
add_filter( 'kenta_header_el_theme_switch_light_icon_default_value', 'kenta_fast_blog_theme_switch_icon' );
add_filter( 'kenta_header_el_theme_switch_dark_icon_default_value', 'kenta_fast_blog_theme_switch_icon' );

// search element
if ( ! function_exists( 'kenta_fast_blog_search_icon' ) ) {
	function kenta_fast_blog_search_icon() {
		return [
			'value'   => 'fas fa-q',
			'library' => 'fa-solid'
		];
	}
}
add_filter( 'kenta_header_el_search_icon_button_icon_default_value', 'kenta_fast_blog_search_icon' );

// logo element
if ( ! function_exists( 'kenta_fast_blog_header_logo_title_typography' ) ) {
	function kenta_fast_blog_header_logo_title_typography() {
		return [
			'family'        => 'bigshot-one',
			'fontSize'      => '28px',
			'variant'       => '700',
			'lineHeight'    => '1.5',
			'textTransform' => 'uppercase',
		];
	}
}
add_filter( 'kenta_header_el_logo_site_title_typography_default_value', 'kenta_fast_blog_header_logo_title_typography' );

if ( ! function_exists( 'kenta_fast_blog_header_logo_title_color' ) ) {
	function kenta_fast_blog_header_logo_title_color() {
		return [
			'initial' => 'var(--kenta-primary-color)',
			'hover'   => 'var(--kenta-primary-color)',
		];
	}
}
add_filter( 'kenta_header_el_logo_site_title_color_default_value', 'kenta_fast_blog_header_logo_title_color' );

if ( ! function_exists( 'kenta_fast_blog_header_logo_content_alignment' ) ) {
	function kenta_fast_blog_header_logo_content_alignment() {
		return 'center';
	}
}
add_filter( 'kenta_header_el_logo_content_alignment_default_value', 'kenta_fast_blog_header_logo_content_alignment' );

add_filter( 'kenta_header_el_logo_enable_site_tagline_default_value', 'kenta_fast_blog_return_yes' );

// socials element
if ( ! function_exists( 'kenta_fast_blog_header_socials_icons_color_type' ) ) {
	function kenta_fast_blog_header_socials_icons_color_type() {
		return 'custom';
	}
}
add_filter( 'kenta_header_el_socials_icons_color_type_default_value', 'kenta_fast_blog_header_socials_icons_color_type' );

//
// Footer bottom row
//
if ( ! function_exists( 'kenta_fast_blog_footer_bottom_row_border_top' ) ) {
	function kenta_fast_blog_footer_bottom_row_border_top() {
		return [
			'width' => 3,
			'style' => 'solid',
			'color' => 'var(--kenta-primary-color)',
		];
	}
}
add_filter( 'kenta_footer_bottom_row_border_top_default_value', 'kenta_fast_blog_footer_bottom_row_border_top' );

//
// Sticky header
//
add_filter( 'kenta_sticky_header_default_value', 'kenta_fast_blog_return_yes' );

if ( ! function_exists( 'kenta_fast_blog_sticky_rows' ) ) {
	function kenta_fast_blog_sticky_rows() {
		return 'bottom-row';
	}
}
add_filter( 'kenta_sticky_header_rows_default_value', 'kenta_fast_blog_sticky_rows' );

//
// Article & Archive header style
//
if ( ! function_exists( 'kenta_fast_blog_article_featured_image_position' ) ) {
	/**
	 * Change default article featured image position design
	 *
	 * @return string
	 */
	function kenta_fast_blog_article_featured_image_position() {
		return 'behind';
	}
}
add_filter( 'kenta_post_featured_image_position_default_value', 'kenta_fast_blog_article_featured_image_position' );
//add_filter( 'kenta_page_featured_image_position_default_value', 'kenta_fast_blog_article_featured_image_position' );

if ( ! function_exists( 'kenta_fast_blog_featured_image_background_overlay' ) ) {
	/**
	 * Change default hero background for single posts and pages
	 *
	 * @return array
	 */
	function kenta_fast_blog_featured_image_background_overlay() {
		return array(
			'type'     => 'gradient',
			'gradient' => 'linear-gradient(349deg,rgb(4,17,32) 0%,rgba(9,17,27,0.11) 100%)'
		);
	}
}
add_filter( 'kenta_post_featured_image_background_overlay_default_value', 'kenta_fast_blog_featured_image_background_overlay' );
//add_filter( 'kenta_page_featured_image_background_overlay_default_value', 'kenta_fast_blog_featured_image_background_overlay' );

if ( ! function_exists( 'kenta_fast_blog_featured_image_elements_override' ) ) {
	function kenta_fast_blog_featured_image_elements_override() {
		return array(
			'override' => '#fff'
		);
	}
}
add_filter( 'kenta_post_featured_image_elements_override_default_value', 'kenta_fast_blog_featured_image_elements_override' );
//add_filter( 'kenta_page_featured_image_elements_override_default_value', 'kenta_fast_blog_featured_image_elements_override' );
