<?php

// Prevent Direct Access
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

new \Kirki\Section( 'inner_pages_section', array(
	'title'          => esc_html__('Inner Pages', 'maxo-fa'),
	'priority'       => 21,
) );

// Top Background Image
new \Kirki\Field\Image( array(
	'settings'    => 'blog_top_background',
	'label'       => esc_html__('Inner Pages Top Section Background Image', 'maxo-fa'),
	'section'     => 'inner_pages_section',
	'choices'     => array(
		'save_as' => 'id',
	),
) );

// --------- Blog List ---------

// Blog list divider
new \Kirki\Field\Custom( array(
	'settings'    => 'blog_list_divider',
	'section'     => 'inner_pages_section',
	'default'     => '<hr>',
) );

// blog list Settings Title
new \Kirki\Field\Custom( array(
	'settings'    => 'blog_list_settings_title',
	'section'     => 'inner_pages_section',
	'default'     => '<h3 class="custom-title">'.esc_html__('Blog Posts List Page', 'maxo-fa').'</h3>',
) );

// Show Author
new \Kirki\Field\Checkbox( array(
	'settings'    => 'blog_list_show_author',
	'label'       => esc_html__('Show Author', 'maxo-fa'),
	'section'     => 'inner_pages_section',
	'default'     => true,
) );

// Show Date
new \Kirki\Field\Checkbox( array(
	'settings'    => 'blog_list_show_date',
	'label'       => esc_html__('Show Publish Date', 'maxo-fa'),
	'section'     => 'inner_pages_section',
	'default'     => true,
) );

// Show Categories
new \Kirki\Field\Checkbox( array(
	'settings'    => 'blog_list_show_categories',
	'label'       => esc_html__('Show Categories', 'maxo-fa'),
	'section'     => 'inner_pages_section',
	'default'     => true,
) );

// Show Tags
new \Kirki\Field\Checkbox( array(
	'settings'    => 'blog_list_show_tags',
	'label'       => esc_html__('Show Tags', 'maxo-fa'),
	'section'     => 'inner_pages_section',
	'default'     => true,
) );

// --------- Blog Single ---------

// Blog single divider
new \Kirki\Field\Custom( array(
	'settings'    => 'blog_single_divider',
	'section'     => 'inner_pages_section',
	'default'     => '<hr>',
) );

// blog single Settings Title
new \Kirki\Field\Custom( array(
	'settings'    => 'blog_single_settings_title',
	'section'     => 'inner_pages_section',
	'default'     => '<h3 class="custom-title">'.esc_html__('Blog Single', 'maxo-fa').'</h3>',
) );

// blog single info section Title
new \Kirki\Field\Custom( array(
	'settings'    => 'blog_single_info_section_title',
	'section'     => 'inner_pages_section',
	'default'     => '<h4>---- '.esc_html__('Post Info Section', 'maxo-fa').'</h4>',
) );

// Show Author
new \Kirki\Field\Checkbox( array(
	'settings'    => 'blog_single_show_author',
	'label'       => esc_html__('Show Author', 'maxo-fa'),
	'section'     => 'inner_pages_section',
	'default'     => true,
) );

// Show Date
new \Kirki\Field\Checkbox( array(
	'settings'    => 'blog_single_show_date',
	'label'       => esc_html__('Show Publish Date', 'maxo-fa'),
	'section'     => 'inner_pages_section',
	'default'     => true,
) );

// Show Categories
new \Kirki\Field\Checkbox( array(
	'settings'    => 'blog_single_show_categories',
	'label'       => esc_html__('Show Categories', 'maxo-fa'),
	'section'     => 'inner_pages_section',
	'default'     => true,
) );

// Show Tags
new \Kirki\Field\Checkbox( array(
	'settings'    => 'blog_single_show_tags',
	'label'       => esc_html__('Show Tags', 'maxo-fa'),
	'section'     => 'inner_pages_section',
	'default'     => true,
) );

// blog single end Title
new \Kirki\Field\Custom( array(
	'settings'    => 'blog_single_end_title',
	'section'     => 'inner_pages_section',
	'default'     => '<h4>---- '.esc_html__('End of Post', 'maxo-fa').'</h4>',
) );

// Show End Categories
new \Kirki\Field\Checkbox( array(
	'settings'    => 'blog_single_show_end_categories',
	'label'       => esc_html__('Show Categories', 'maxo-fa'),
	'section'     => 'inner_pages_section',
	'default'     => false,
) );

// End Categories Title
new \Kirki\Field\Text( array(
	'settings' => 'blog_single_end_categories_title',
	'label'    => esc_html__('Categories Title', 'maxo-fa'),
	'section'  => 'inner_pages_section',
	'default'  => esc_html__('Categories', 'maxo-fa'),
	'active_callback' => [
		[
			'setting'  => 'blog_single_show_end_categories',
			'operator' => '==',
			'value'    => true,
		]
	],
) );

// Show End Tags
new \Kirki\Field\Checkbox( array(
	'settings'    => 'blog_single_show_end_tags',
	'label'       => esc_html__('Show Tags', 'maxo-fa'),
	'section'     => 'inner_pages_section',
	'default'     => false,
) );

// End Tags Title
new \Kirki\Field\Text( array(
	'settings' => 'blog_single_end_tags_title',
	'label'    => esc_html__('Tags Title', 'maxo-fa'),
	'section'  => 'inner_pages_section',
	'default'  => esc_html__('Tags', 'maxo-fa'),
	'active_callback' => [
		[
			'setting'  => 'blog_single_show_end_tags',
			'operator' => '==',
			'value'    => true,
		]
	],
) );
