<?php
/**
 * Header Section
 *
 * @package events_and_celebrations
 */

// ---------------------------------------- HEADER OPTIONS ----------------------------------------------------

$wp_customize->add_section(
	'events_and_celebrations_header_options',
	array(
		'panel' => 'events_and_celebrations_front_page_options',
		'title' => esc_html__( 'Header Options', 'events-and-celebrations' ),
        'priority' => 1,
	)
);

$wp_customize->add_setting(
	'events_and_celebrations_header_button_text',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'events_and_celebrations_header_button_text',
	array(
		'label'           => sprintf( esc_html__( 'Button Text', 'events-and-celebrations' )),
		'section'         => 'events_and_celebrations_header_options',
		'settings'        => 'events_and_celebrations_header_button_text',
		'type'            => 'text',
	)
);

$wp_customize->add_setting(
	'events_and_celebrations_header_button_link' ,
	array(
		'default'           => '',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'events_and_celebrations_header_button_link' ,
	array(
		'label'           => sprintf( esc_html__( 'Button Link', 'events-and-celebrations' )  ),
		'section'         => 'events_and_celebrations_header_options',
		'settings'        => 'events_and_celebrations_header_button_link' ,
		'type'            => 'url',
	)
);

// Add Separator Custom Control
$wp_customize->add_setting( 'events_and_celebrations_menu_separator', array(
	'sanitize_callback' => 'sanitize_text_field',
));

$wp_customize->add_control( new Events_And_Celebrations_Separator_Custom_Control( $wp_customize, 'events_and_celebrations_menu_separator', array(
	'label' => __( 'Menu Settings', 'events-and-celebrations' ),
	'section' => 'events_and_celebrations_header_options',
	'settings' => 'events_and_celebrations_menu_separator',
)));

$wp_customize->add_setting( 'events_and_celebrations_menu_font_size', array(
    'default'           => 16,
    'sanitize_callback' => 'absint',
));

// Add control for site title size
$wp_customize->add_control( 'events_and_celebrations_menu_font_size', array(
    'type'        => 'number',
    'section'     => 'events_and_celebrations_header_options',
    'label'       => __( 'Menu Font Size ', 'events-and-celebrations' ),
    'input_attrs' => array(
        'min'  => 10,
        'max'  => 100,
        'step' => 1,
    ),
));

// Add setting for menu font weight
$wp_customize->add_setting('events_and_celebrations_menu_font_weight', array(
    'default'           => '400',
    'sanitize_callback' => 'sanitize_text_field',
));

// Add control for menu font weight
$wp_customize->add_control('events_and_celebrations_menu_font_weight', array(
    'type'     => 'select',
    'section'  => 'events_and_celebrations_header_options', 
    'label'    => __('Menu Font Weight', 'events-and-celebrations'),
    'choices'  => array(
		'100' => __('100','events-and-celebrations'),
		'200' => __('200','events-and-celebrations'),
		'300' => __('300','events-and-celebrations'),
		'400' => __('400','events-and-celebrations'),
		'500' => __('500','events-and-celebrations'),
		'600' => __('600','events-and-celebrations'),
		'700' => __('700','events-and-celebrations'),
		'800' => __('800','events-and-celebrations'),
		'900' => __('900','events-and-celebrations'),
    ),
));

$wp_customize->add_setting( 'events_and_celebrations_menu_text_transform', array(
    'default'           => 'capitalize', // Default value for text transform
    'sanitize_callback' => 'sanitize_text_field',
) );

// Add control for menu text transform
$wp_customize->add_control( 'events_and_celebrations_menu_text_transform', array(
    'type'     => 'select',
    'section'  => 'events_and_celebrations_header_options', // Adjust the section as needed
    'label'    => __( 'Menu Text Transform', 'events-and-celebrations' ),
    'choices'  => array(
        'none'       => __( 'None', 'events-and-celebrations' ),
        'capitalize' => __( 'Capitalize', 'events-and-celebrations' ),
        'uppercase'  => __( 'Uppercase', 'events-and-celebrations' ),
        'lowercase'  => __( 'Lowercase', 'events-and-celebrations' ),
    ),
) );

// Menu Text Color 
$wp_customize->add_setting(
	'events_and_celebrations_menu_text_color', 
	array(
		'default' => '#ffffff',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize, 
		'events_and_celebrations_menu_text_color', 
		array(
			'label' => __('Menu Color', 'events-and-celebrations'),
			'section' => 'events_and_celebrations_header_options',
		)
	)
);

// Sub Menu Text Color 
$wp_customize->add_setting(
	'events_and_celebrations_sub_menu_text_color', 
	array(
		'default' => '#DB5A81',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize, 
		'events_and_celebrations_sub_menu_text_color', 
		array(
			'label' => __('Sub Menu Color', 'events-and-celebrations'),
			'section' => 'events_and_celebrations_header_options',
		)
	)
);

// Topbar Padding Setting
$wp_customize->add_setting('events_and_celebrations_topbar_padding',array(
		'default' => '',
		'sanitize_callback' => 'absint'
	)
);
$wp_customize->add_control('events_and_celebrations_topbar_padding',array(
		'label' => __('Topbar Padding','events-and-celebrations'),
		'section' => 'events_and_celebrations_header_options',
		'type' => 'number',
		'input_attrs' => array(
			'min' => 0,
			'max' => 50,
			'step' => 1
		)
	)
);
