<?php 
/**
 * Fields For General Options
 * @since 1.0
 * @package RoyalNews
 */

function royalnews_customizer_advanced( $section ){
	$section[ 'general_options' ] = array(
		'title' => esc_html__( 'General Options', 'royalnews' ),
		'priority'    => 250,
		'fields' => array(
			'dark_mode' => array(
				'type' => 'radio-buttonset',
				'label' => esc_html__( 'Dark Mode', 'royalnews' ),
				'default' => 'toggle',
				'description' => esc_html__( 'Toggle will appear in header after menu', 'royalnews' ),
				'priority' => 10,
				'choices'     => array(
					'enable' => esc_html__( 'Enable', 'royalnews' ),
					'toggle' => esc_html__( 'Toggle', 'royalnews' ),
					'disable' => esc_html__( 'Disable', 'royalnews' )					
				)
			),
			'enable_preloader' => array(
				'type' => 'toggle',
				'label' => esc_html__( 'Enable Preloader', 'royalnews' ),
				'default' => false,
				'priority'    => 20,
			),
			'primary-color' => array(
				'type'        => 'color',
				'label'       => esc_html__( 'Site Primary Color', 'royalnews' ),
				'default'     => '#d82926',
				'choices'     => array(
					'alpha' => true,
				),
				'output' => array(
				    array(
				        'element'  => '.royalnews-main-slider-initialize .slick-arrow,
				         .royalnews-stories-main-wrapper .royalnews-exclusive-posts .royalnews-main-stories .royalnews-stories-wrap .slick-arrow,
				         .royalnews-footer-news-wrapper .royalnews-footer-news-initilize .slick-arrow, .royalnews-footer-news-wrapper .royalnews-footer-news-initilize .slick-dots .slick-active button, .royalnews-time-wrapper .royalnews-digital-clock-wrapper .royalnews-time, .royalnews-banner-slider-wrapper .royalnews-slider-right-wrapper .royalnews-banner-post .royalnews-main-single-slide .royalnews-slider-data .royalnews-post-categories li a,
				         .site-content .royalnews-post-content-area .royalnews-post-content-wrapper .royalnews-post-content .royalnews-post-content-inner .royalnews-blog .royalnews-post-info-wrapper .royalnews-post-cat .royalnews-post-categories li a, .royalnews-scroll-arrow, .royalnews-footer-news-wrapper .royalnews-footer-news-initilize .slick-dots .slick-active button, .royalnews-news-spinner span, .site-main .royalnews-single-inner .royalnews-single-content-wrap .royalnews-post-categories li a, .form-submit .submit',
				        'element'  => '.royalnews-time-wrapper .royalnews-digital-clock-wrapper .royalnews-time,
				        .royalnews-banner-slider-wrapper .royalnews-slider-right-wrapper .royalnews-banner-post .royalnews-main-single-slide .royalnews-slider-data .royalnews-post-categories li a,
				        .site-content .royalnews-post-content-area .royalnews-post-content-wrapper .royalnews-post-content .royalnews-post-content-inner .royalnews-blog .royalnews-post-info-wrapper .royalnews-post-cat .royalnews-post-categories li a,
				        .royalnews-footer-news-wrapper .royalnews-footer-news-initilize .royalnews-footer-news-inner .royalnews-slider-data .royalnews-post-categories li a, .royalnews-scroll-arrow,
				        .royalnews-footer-news-wrapper .royalnews-footer-news-initilize .slick-dots .slick-active button,
				        .royalnews-footer-news-wrapper .royalnews-footer-news-initilize .slick-arrow,
				        .royalnews-main-slider-initialize .slick-arrow,
				        .royalnews-stories-main-wrapper .royalnews-exclusive-posts .royalnews-main-stories .royalnews-stories-wrap .slick-arrow, .royalnews-archive-post-navigator-wrap .pagination .nav-links > *.current, .form-submit .submit, .site-main .royalnews-single-inner .royalnews-single-content-wrap .royalnews-post-categories li a',
				        'property' => 'background',
				    ),
				    array(
				    	'element' => '.royalnews-loader-wrapper .royalnews-loader',
				    	'property' => 'border-top-color'
				    ),
				    array(
				    	'element' => '.royalnews-loader-wrapper .royalnews-loader',
				    	'property' => 'border-bottom-color'
				    ),
				),
			),
			'container-width' => array(
				'type'        => 'slider',
				'label'       => esc_html__( 'Container Width', 'royalnews' ),
				'default'     => '1140',
				'priority'    => 30,
				'choices'     => array(
					'min'  => 0,
					'max'  => 2500,
					'step' => 1,
				),
				'output' => array(
				    array(
				        'element'  => '.container',
				        'property' => 'max-width',
				        'units' => 'px'
				    )
				),
			),
			'heading_typography_options' => array(
			    'label' => esc_html__( 'Heading Typography ', 'royalnews' ),
			    'type'  => 'typography',
			    'priority' => 40,
			    'choices' => array( 
			        'fonts' => array(
			        	'google' => array( 'popularity', 30 ),
			        )
			    ),
			    'default'     =>array(
			        'font-family' => 'Roboto',
			        'variant' => 'regular',
			        'font-style' => 'normal',
			        'text-transform' => 'none',
			        'font-size' => '14px',
			        'line-height' => '1.5',
			        'letter-spacing' => '0'
			    ),
			    'output'    =>  array(
			        array(
			            'element'   => 'body h1, body h2, body h3, body h4, body h5, body h6',
			        )
			    )
			),
			'general_typography_options' => array(
			    'label' => esc_html__( 'Site Typography ', 'royalnews' ),
			    'type'  => 'typography',
			    'priority' => 50,
			    'choices' => array( 
			        'fonts' => array(
			        	'google' => array( 'popularity', 30 ),
			        )
			    ),
			    'default'     =>array(
			        'font-family' => 'Roboto',
			        'variant' => 'regular',
			        'font-style' => 'normal',
			        'text-transform' => 'none',
			        'font-size' => '14px',
			        'line-height' => '1.5',
			        'letter-spacing' => '0'
			    ),
			    'output'    =>  array(
			        array(
			            'element'   => 'body',
			        )
			    )
			)
		)
	);
	return $section;
}

add_filter( 'royalnews_customizer_theme_option_panel', 'royalnews_customizer_advanced' );