<?php
/**
 * Customizer: Add Panels and Sections.
 *
 * Registers custom panels and sections within the WordPress Customizer 
 * to organize theme options and settings.
 *
 * @package Yaatra
 */

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

add_action( 'customize_register', 'yaatra_register_customizer_panels_sections' );

if ( ! function_exists( 'yaatra_register_customizer_panels_sections' ) ) :
    
    /**
     * Implements the Theme Customizer settings for the theme.
     *
     * Registers and configures theme settings and controls within the WordPress Customizer.
     *
     * @param WP_Customize_Manager $wp_customize The Theme Customizer object.
     * 
     * @since 1.0.0
     */

    function yaatra_register_customizer_panels_sections( $wp_customize ) {

        /*
         * Failsafe is safe
         */
        if ( ! isset( $wp_customize ) ) {
            return;
        }
    /*--------------------------- Add Panels -------------------------------------*/
        
        /**
         * Add Panel for General Settings
         * 
         * Customize > General Settings
         * 
         * @uses $wp_customize->add_panel() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_panel/
         * @since 1.0.0
         */
        $wp_customize->add_panel( 'yaatra_panel_general',
            array(
                'priority'  => 5,
                'title'     => __( 'General Settings', 'yaatra' )
            )
        );

        /**
         * Add Panel for Header Settings
         * 
         * Customize > Header Settings
         * 
         * @uses $wp_customize->add_panel() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_panel/
         * @since 1.0.0
         */
        $wp_customize->add_panel( 'yaatra_panel_header',
            array(
                'priority'  => 10,
                'title'     => __( 'Header Settings', 'yaatra' )
            )
        );

        /**
         * Add Panel for Frontpage Settings
         * 
         * Customize > Frontpage Settings
         * 
         * @uses $wp_customize->add_panel() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_panel/
         * @since 1.0.0
         */
        $wp_customize->add_panel( 'yaatra_panel_frontpage',
            array(
                'priority'  => 15,
                'title'     => __( 'Frontpage Settings', 'yaatra' )
            )
        );

        /**
         * Add Panel for Innerpage Settings
         * 
         * Customize > Innerpage Settings
         * 
         * @uses $wp_customize->add_panel() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_panel/
         * @since 1.0.0
         */
        $wp_customize->add_panel( 'yaatra_panel_innerpage',
            array(
                'priority'  => 20,
                'title'     => __( 'Innerpage Settings', 'yaatra' )
            )
        );

    }
    
endif;