<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * Frontpage Blog.
 *
 * @package leatherhouse-companion
 */

defined( 'ABSPATH' ) || exit;

if ( ! class_exists( 'leatherhouse_Customize_Homepage_Blog_Option' ) ) :

	class leatherhouse_Customize_Homepage_Blog_Option extends leatherhouse_Customize_Base_Option {

		/**
		 * Arguments for options.
		 *
		 * @return array
		 */
		public function elements() {

			return array(

				'leatherhouse_main_blog_heading'              => array(
					'setting' => array(),
					'control' => array(
						'type'     => 'parent_heading',
						'priority' => 1,
						'label'    => esc_html__( 'News Options', 'leather-house' ),
						'section'  => 'leatherhouse_theme_blog',
					),
				),

				'leatherhouse_blog_disabled'                  => array(
					'setting' => array(
						'default'           => true,
						'sanitize_callback' => array( 'leatherhouse_Customizer_Sanitize', 'sanitize_checkbox' ),
					),
					'control' => array(
						'type'     => 'toggle',
						'priority' => 2,
						'label'    => esc_html__( 'News Enable/Disable', 'leather-house' ),
						'section'  => 'leatherhouse_theme_blog',
					),
				),

				
				// Blog Extra.
				'leatherhouse_blog_extra_heading'             => array(
					'setting' => array(),
					'control' => array(
						'type'            => 'heading',
						'priority'        => 80,
						'label'           => esc_html__( 'Extra Settings', 'leather-house' ),
						'section'         => 'leatherhouse_theme_blog',
						'active_callback' => 'leatherhouse_blog_extra_heading',
					),
				),

				// container.
				'leatherhouse_blog_container_size'            => array(
					'setting' => array(
						'default'           => 'container-full',
						'sanitize_callback' => array( 'leatherhouse_Customizer_Sanitize', 'sanitize_radio' ),
					),
					'control' => array(
						'type'            => 'radio',
						'priority'        => 90,
						'is_default_type' => true,
						'label'           => esc_html__( 'Section Width', 'leather-house' ),
						'section'         => 'leatherhouse_theme_blog',
						'choices'         => array(
							'av-container'   => esc_html__( 'Container', 'leather-house' ),
							'container-full' => esc_html__( 'Container Full', 'leather-house' ),
						),
						'active_callback' => 'leatherhouse_blog_container_size',
					),
				),
				// column layout.
				'leatherhouse_blog_column_layout'             => array(
					'setting' => array(
						'default'           => '3',
						'sanitize_callback' => array( 'leatherhouse_Customizer_Sanitize', 'sanitize_radio' ),
					),
					'control' => array(
						'type'            => 'radio_image',
						'priority'        => 100,
						'label'           => esc_html__( 'Column Layout', 'leather-house' ),
						'section'         => 'leatherhouse_theme_blog',
						'choices'         => array(
							'2' => get_template_directory_uri() . '/assets/images/icons/column-2.png',
							'3' => get_template_directory_uri() . '/assets/images/icons/column-3.png',
							'4' => get_template_directory_uri() . '/assets/images/icons/column-4.png',
						),
						'active_callback' => 'leatherhouse_blog_column_layout',
					),
				),

				// Blog Button Enable disable.
				'leatherhouse_blog_button_disabled'           => array(
					'setting' => array(
						'default'           => true,
						'sanitize_callback' => array( 'leatherhouse_Customizer_Sanitize', 'sanitize_checkbox' ),
					),
					'control' => array(
						'type'            => 'toggle',
						'priority'        => 150,
						'label'           => esc_html__( 'Button Enable/Disable', 'leather-house' ),
						'section'         => 'leatherhouse_theme_blog',
						'active_callback' => 'leatherhouse_blog_button_disabled',
					),
				),

				// Section Color Settings Heading.
				'leatherhouse_blog_section_color_heading'     => array(
					'setting' => array(),
					'control' => array(
						'type'            => 'heading',
						'priority'        => 1500,
						'label'           => esc_html__( 'Section Color Settings', 'leather-house' ),
						'section'         => 'leatherhouse_theme_blog',
						'active_callback' => 'leatherhouse_blog_section_color_heading',
					),
				),

				// Section Color Settings Enable Disable.
				'leatherhouse_blog_section_color_disable'     => array(
					'setting' => array(
						'default'           => false,
						'sanitize_callback' => array( 'leatherhouse_Customizer_Sanitize', 'sanitize_checkbox' ),
					),
					'control' => array(
						'type'            => 'toggle',
						'priority'        => 1550,
						'label'           => esc_html__( 'Section Color Enable/Disable', 'leather-house' ),
						'section'         => 'leatherhouse_theme_blog',
						'active_callback' => 'leatherhouse_blog_section_color_disable',
					),
				),

				// Title Color.
				'leatherhouse_blog_section_title_color'       => array(
					'setting' => array(
						'default'           => '#252525',
						'sanitize_callback' => array( 'leatherhouse_Customizer_Sanitize', 'sanitize_alpha_color' ),
					),
					'control' => array(
						'type'            => 'color',
						'priority'        => 1580,
						'label'           => esc_html__( 'Title Color', 'leather-house' ),
						'description'     => esc_html__( 'Set The Color For Section Title.', 'leather-house' ),
						'section'         => 'leatherhouse_theme_blog',
						'choices'         => array(
							'alpha' => true,
						),
						'active_callback' => 'leatherhouse_blog_section_title_color',
					),
				),

				// Description Color.
				'leatherhouse_blog_section_description_color' => array(
					'setting' => array(
						'default'           => '#252525',
						'sanitize_callback' => array( 'leatherhouse_Customizer_Sanitize', 'sanitize_alpha_color' ),
					),
					'control' => array(
						'type'            => 'color',
						'priority'        => 1600,
						'label'           => esc_html__( 'Description Color', 'leather-house' ),
						'description'     => esc_html__( 'Set The Color For Section Description.', 'leather-house' ),
						'section'         => 'leatherhouse_theme_blog',
						'choices'         => array(
							'alpha' => true,
						),
						'active_callback' => 'leatherhouse_blog_section_description_color',
					),
				),
			);
		}
	}

	new leatherhouse_Customize_Homepage_Blog_Option();

endif;
