<?php
/**
 * Page Header Settings.
 *
 * @package pawfect
 */

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;

/**
* Page Header Settings.
*/

if ( ! class_exists( 'pawfect_Customize_Page_Header_Option' ) ) :

	class pawfect_Customize_Page_Header_Option extends pawfect_Customize_Base_Option {


		public function elements() {


			return array(

			    'pawfect_page_header_heading'     => array(
					'setting' => array(),
					'control' => array(
						'type'    => 'heading',
						'priority'        => 1,
						'label'   => esc_html__( 'Page Header Settings', 'pawfect' ),
						'section' => 'pawfect_page_header_section',
					),
				),

				'pawfect_page_header_enable_disable'            => array(
					'setting' => array(
						'default'           => true,
						'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_checkbox' ),
					),
					'control' => array(
						'type'     => 'toggle',
						'priority' => 5,
						'label'    => esc_html__( 'Enable Page Header', 'pawfect' ),
						'description'    => esc_html__( 'Show/hide the page header section on all pages except the homepage.', 'pawfect' ),
						'section'  => 'pawfect_page_header_section',
					),
				),

				// Background Color
				'pawfect_page_header_background_color' => array(
					'setting' => array(
						'default'           => '#FFFFFF',
						'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_alpha_color' ),
					),
					'control' => array(
						'type'            => 'color',
						'priority'        => 10,
						'label'           => esc_html__( 'Background Color', 'pawfect' ),
						'description'     => esc_html__( 'Choose the background color for the page header section.', 'pawfect' ),
						'section'         => 'pawfect_page_header_section',
						'choices'         => array(
							'alpha' => true,
						),
						'active_callback' => array(
                            array( $this, 'is_control_value_active' ),
                            'pawfect_page_header_enable_disable',
                            true
                        ),
					),
				),

				// Background Image
				'pawfect_page_header_background_image' => array(
					'setting' => array(
						'default'           => '',
						'sanitize_callback' => 'esc_url_raw',
					),
					'control' => array(
						'type'            => 'image',
						'priority'        => 15,
						'label'           => esc_html__( 'Background Image', 'pawfect' ),
						'description'     => esc_html__( 'Upload a background image for the page header. Recommended size: 1920x400px or larger.', 'pawfect' ),
						'section'         => 'pawfect_page_header_section',
						'active_callback' => array(
                            array( $this, 'is_control_value_active' ),
                            'pawfect_page_header_enable_disable',
                            true
                        ),
					),
				),

				// Overlay Opacity
				'pawfect_page_header_overlay_opacity' => array(
					'setting' => array(
						'default' => array(
							'slider' => 50,
							'suffix' => '%',
						),
						'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_slider' ),
					),
					'control' => array(
						'type' => 'pawfect-range-slider',
						'priority' => 20,
						'label' => esc_html__( 'Background Overlay Opacity', 'pawfect' ),
						'description' => esc_html__( 'Adjust the darkness of the overlay when using background images for better text readability.', 'pawfect' ),
						'section' => 'pawfect_page_header_section',
						'suffix' => '%',
						'input_attrs' => array(
							'min' => 0,
							'max' => 100,
							'step' => 5,
						),
						'active_callback' => array(
                            array( $this, 'is_control_value_active' ),
                            'pawfect_page_header_enable_disable',
                            true
                        ),
						
					),
				),

				// Text Color
				'pawfect_page_header_text_color' => array(
					'setting' => array(
						'default'           => '#333333',
						'sanitize_callback' => 'sanitize_hex_color',
					),
					'control' => array(
						'type'            => 'color',
						'priority'        => 25,
						'label'           => esc_html__( 'Text Color', 'pawfect' ),
						'description'     => esc_html__( 'Choose the color for page titles and breadcrumb text.', 'pawfect' ),
						'section'         => 'pawfect_page_header_section',
						'active_callback' => array(
                            array( $this, 'is_control_value_active' ),
                            'pawfect_page_header_enable_disable',
                            true
                        ),
					),
				),

				// Header Height - Responsive
				'pawfect_page_header_height' => array(
					'setting' => array(
						'default' => json_encode(array(
							'desktop' => 300,
							'tablet' => 250,
							'mobile' => 200,
						)),
						'sanitize_callback' => array('Pawfect_Responsive_Range_Control', 'sanitize_responsive_range'),
						'transport' => 'postMessage',
					),
					'control' => array(
						'type' => 'pawfect-responsive-range',
						'priority' => 30,
						'section' => 'pawfect_page_header_section',
						'label' => esc_html__('Header Height', 'pawfect'),
						'description' => esc_html__('Adjust the height of the page header section across different devices.', 'pawfect'),
						'media_query' => true,
						'suffix' => 'px',
						'input_attrs' => array(
							'min' => 200,
							'max' => 600,
							'step' => 10,
						),
						'active_callback' => array(
                            array( $this, 'is_control_value_active' ),
                            'pawfect_page_header_enable_disable',
                            true
                        ),
					),
				),

				// Show Breadcrumbs
				'pawfect_page_header_breadcrumbs_enable' => array(
					'setting' => array(
						'default'           => true,
						'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_checkbox' ),
					),
					'control' => array(
						'type'            => 'toggle',
						'priority'        => 35,
						'label'           => esc_html__( 'Show Breadcrumbs', 'pawfect' ),
						'description'     => esc_html__( 'Display breadcrumb navigation in the page header.', 'pawfect' ),
						'section'         => 'pawfect_page_header_section',
						'active_callback' => array(
                            array( $this, 'is_control_value_active' ),
                            'pawfect_page_header_enable_disable',
                            true
                        ),
					),
				),

				// Breadcrumb Type
				'pawfect_breadcrumb_type' => array(
					'setting' => array(
						'default'           => 'theme_default',
						'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_radio' ),
					),
					'control' => array(
						'type'            => 'select',
						'priority'        => 36,
						'is_default_type' => true,
						'label'           => esc_html__( 'Select Breadcrumb Type', 'pawfect' ),
						'description'     => esc_html__( 'You need to install and activate the respective plugin to show their Breadcrumb. Otherwise, your default theme Breadcrumb will appear. If you see error in search console, then we recommend to use plugin Breadcrumb.', 'pawfect' ),
						'section'         => 'pawfect_page_header_section',
						'choices'         => array(
							'theme_default' => esc_html__( 'Theme Default', 'pawfect' ),
							'yoast_plugin'  => esc_html__( 'Yoast Plugin', 'pawfect' ),
							'rankmath_plugin' => esc_html__( 'Rank Math Plugin', 'pawfect' ),
							'navxt_plugin'  => esc_html__( 'NavXT Plugin', 'pawfect' ),
						),
						'active_callback' => array(
                            array( $this, 'is_control_value_active' ),
                            'pawfect_page_header_breadcrumbs_enable',
                            true
                        ),
					),
				),

				// =======================================================
				// == PAGE TYPOGRAPHY HEADING
				// =======================================================

				'pawfect_page_typography_heading' => array(
					'setting' => array(),
					'control' => array(
						'type'    => 'heading',
						'priority' => 40,
						'label'   => esc_html__( 'Typography', 'pawfect' ),
						'section' => 'pawfect_page_header_section',
					),
				),

				// Page Title Font Size - Responsive
				'pawfect_page_title_font_size' => array(
					'setting' => array(
						'default' => json_encode(array(
							'desktop' => 36,
							'tablet' => 32,
							'mobile' => 28,
						)),
						'sanitize_callback' => array('Pawfect_Responsive_Range_Control', 'sanitize_responsive_range'),
						'transport' => 'postMessage',
					),
					'control' => array(
						'type' => 'pawfect-responsive-range',
						'priority' => 41,
						'section' => 'pawfect_page_header_section',
						'label' => esc_html__('Page Title Font Size', 'pawfect'),
						'description' => esc_html__('Set the font size for page titles across different devices.', 'pawfect'),
						'media_query' => true,
						'suffix' => 'px',
						'input_attrs' => array(
							'min' => 18,
							'max' => 60,
							'step' => 2,
						),
					),
				),

				// Page Content Font Size - Responsive
				'pawfect_page_content_font_size' => array(
					'setting' => array(
						'default' => json_encode(array(
							'desktop' => 16,
							'tablet' => 15,
							'mobile' => 14,
						)),
						'sanitize_callback' => array('Pawfect_Responsive_Range_Control', 'sanitize_responsive_range'),
						'transport' => 'postMessage',
					),
					'control' => array(
						'type' => 'pawfect-responsive-range',
						'priority' => 42,
						'section' => 'pawfect_page_header_section',
						'label' => esc_html__('Content /Breadcrumb Font Size', 'pawfect'),
						'description' => esc_html__('Set the font size for page content text across different devices.', 'pawfect'),
						'media_query' => true,
						'suffix' => 'px',
						'input_attrs' => array(
							'min' => 12,
							'max' => 24,
							'step' => 1,
						),
					),
				),

			);

		}

	}

endif;