<?php
/**
 * Theme customizer with real-time update
 *
 * Very helpful: http://ottopress.com/2012/theme-customizer-part-deux-getting-rid-of-options-pages/
 *
 * @package Organic Startup
 * @since Organic Startup 1.0
 */

/**
 * Begin the customizer functions.
 *
 * @param array $wp_customize Returns classes and sanitized inputs.
 */
function organic_startup_theme_customizer( $wp_customize ) {

	include get_template_directory() . '/customizer/customizer-controls.php';

	include get_template_directory() . '/customizer/customizer-sanitize.php';

	/**
	 * Return an array of all categories.
	 */
	function organic_startup_post_categories() {
		$cats    = array();
		$cats[0] = esc_html__( 'All Categories', 'organic-startup' );
		foreach ( get_categories() as $categories => $category ) {
			$cats[ $category->term_id ] = $category->name;
		}

		return $cats;
	}

	/**
	 * Render the site title for the selective refresh partial.
	 *
	 * @since Organic Startup 1.0
	 * @see organic_startup_customize_register()
	 *
	 * @return void
	 */
	function organic_startup_customize_partial_blogname() {
		bloginfo( 'name' );
	}

	/**
	 * Render the site tagline for the selective refresh partial.
	 *
	 * @since Organic Startup 1.0
	 * @see organic_startup_customize_register()
	 *
	 * @return void
	 */
	function organic_startup_customize_partial_blogdescription() {
		bloginfo( 'description' );
	}

	// Set site name and description text to be previewed in real-time.
	$wp_customize->get_setting( 'blogname' )->transport        = 'postMessage';
	$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';

	if ( isset( $wp_customize->selective_refresh ) ) {
		$wp_customize->selective_refresh->add_partial( 'blogname', array(
			'selector'            => '.site-title a',
			'container_inclusive' => false,
			'render_callback'     => 'organic_startup_customize_partial_blogname',
		) );
		$wp_customize->selective_refresh->add_partial( 'blogdescription', array(
			'selector'            => '.site-description',
			'container_inclusive' => false,
			'render_callback'     => 'organic_startup_customize_partial_blogdescription',
		) );
	}

	/*
	-------------------------------------------------------------------------------------------------------
		Site Title Section
	-------------------------------------------------------------------------------------------------------
	*/

		// Logo uploader.
		$wp_customize->add_setting( 'organic_startup_logo_dark', array(
			'default'           => get_template_directory_uri() . '/images/logo.png',
			'sanitize_callback' => 'esc_url_raw',
		) );
		$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'organic_startup_logo_dark', array(
			'label'    => __( 'Logo (Dark)', 'organic-startup' ),
			'section'  => 'title_tagline',
			'settings' => 'organic_startup_logo_dark',
			'priority' => 9,
		) ) );

		// Title Font Selector.
		$wp_customize->add_setting( 'organic_startup_title_font', array(
			'default'           => 'quicksand',
			'sanitize_callback' => 'sanitize_key',
		) );
		$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'organic_startup_title_font', array(
			'type'     => 'select',
			'label'    => esc_html__( 'Title Font', 'organic-startup' ),
			'section'  => 'title_tagline',
			'choices'  => array(
				'rochester'        => __( 'Rochester', 'organic-startup' ),
				'staatliches'      => __( 'Staatliches', 'organic-startup' ),
				'overlock'         => __( 'Overlock', 'organic-startup' ),
				'noto_serif'       => __( 'Noto Serif', 'organic-startup' ),
				'poppins'          => __( 'Poppins', 'organic-startup' ),
				'muli'             => __( 'Muli', 'organic-startup' ),
				'oxygen'           => __( 'Oxygen', 'organic-startup' ),
				'pt_sans'          => __( 'PT Sans', 'organic-startup' ),
				'libre_franklin'   => __( 'Libre Franklin', 'organic-startup' ),
				'droid_serif'      => __( 'Droid Serif', 'organic-startup' ),
				'helvetica_neue'   => __( 'Helvetica Neue', 'organic-startup' ),
				'lora'             => __( 'Lora', 'organic-startup' ),
				'merriweather'     => __( 'Merriweather', 'organic-startup' ),
				'montserrat'       => __( 'Montserrat', 'organic-startup' ),
				'oswald'           => __( 'Oswald', 'organic-startup' ),
				'playfair_display' => __( 'Playfair Display', 'organic-startup' ),
				'quicksand'        => __( 'Quicksand', 'organic-startup' ),
				'raleway'          => __( 'Raleway', 'organic-startup' ),
				'roboto'           => __( 'Roboto', 'organic-startup' ),
				'roboto_slab'      => __( 'Roboto Slab', 'organic-startup' ),
				'source_sans_pro'  => __( 'Source Sans Pro', 'organic-startup' ),
				'lato'             => __( 'Lato', 'organic-startup' ),
				'encode_sans'      => __( 'Encode Sans', 'organic-startup' ),
				'lily_script'      => __( 'Lily Script One', 'organic-startup' ),
				'cinzel'           => __( 'Cinzel', 'organic-startup' ),
				'shrikhand'        => __( 'Shrikhand', 'organic-startup' ),
				'amatic_sc'        => __( 'Amatic SC', 'organic-startup' ),
				'berkshire_swash'  => __( 'Berkshire Swash', 'organic-startup' ),
				'abril_fatface'    => __( 'Abril Fatface', 'organic-startup' ),
				'patua_one'        => __( 'Patua One', 'organic-startup' ),
				'monoton'          => __( 'Monoton', 'organic-startup' ),
			),
			'priority' => 10,
		) ) );

		// Title Font Weight.
		$wp_customize->add_setting( 'organic_startup_title_font_weight', array(
			'default'           => 'normal',
			'sanitize_callback' => 'organic_startup_sanitize_font_weight',
		) );
		$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'organic_startup_title_font_weight', array(
			'type'     => 'select',
			'label'    => esc_html__( 'Title Font Weight', 'organic-startup' ),
			'section'  => 'title_tagline',
			'choices'  => array(
				'normal'  => __( 'Normal', 'organic-startup' ),
				'bold'    => __( 'Bold', 'organic-startup' ),
				'lighter' => __( 'Light', 'organic-startup' ),
			),
			'priority' => 11,
		) ) );

		// Custom Display Site Title Option.
		$wp_customize->add_setting( 'organic_startup_site_title', array(
			'default'           => '1',
			'sanitize_callback' => 'organic_startup_sanitize_checkbox',
			'transport'         => 'postMessage',
		) );
		$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'organic_startup_site_title', array(
			'label'    => esc_html__( 'Display Site Title', 'organic-startup' ),
			'type'     => 'checkbox',
			'section'  => 'title_tagline',
			'settings' => 'organic_startup_site_title',
			'priority' => 12,
		) ) );

		// Custom Display Tagline Option.
		$wp_customize->add_setting( 'organic_startup_site_tagline', array(
			'default'           => '1',
			'sanitize_callback' => 'organic_startup_sanitize_checkbox',
			'transport'         => 'postMessage',
		) );
		$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'organic_startup_site_tagline', array(
			'label'    => esc_html__( 'Display Site Tagline', 'organic-startup' ),
			'type'     => 'checkbox',
			'section'  => 'title_tagline',
			'settings' => 'organic_startup_site_tagline',
			'priority' => 13,
		) ) );

		// Sticky Navigation Option.
		$wp_customize->add_setting( 'organic_startup_sticky_nav', array(
			'default'           => '',
			'sanitize_callback' => 'organic_startup_sanitize_checkbox',
		) );
		$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'organic_startup_sticky_nav', array(
			'label'    => esc_html__( 'Sticky Header Navigation', 'organic-startup' ),
			'type'     => 'checkbox',
			'section'  => 'title_tagline',
			'settings' => 'organic_startup_sticky_nav',
			'priority' => 14,
		) ) );

		// Transparent Header Option.
		$wp_customize->add_setting( 'organic_startup_header_transparent', array(
			'default'           => '',
			'sanitize_callback' => 'organic_startup_sanitize_checkbox',
		) );
		$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'organic_startup_header_transparent', array(
			'label'    => esc_html__( 'Transparent Header Background', 'organic-startup' ),
			'type'     => 'checkbox',
			'section'  => 'title_tagline',
			'settings' => 'organic_startup_header_transparent',
			'priority' => 16,
		) ) );

		// Logo Align.
		$wp_customize->add_setting( 'organic_startup_logo_align', array(
			'default'           => 'left',
			'sanitize_callback' => 'organic_startup_sanitize_align',
		) );
		$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'organic_startup_logo_align', array(
			'type'     => 'radio',
			'label'    => esc_html__( 'Logo & Title Alignment', 'organic-startup' ),
			'section'  => 'title_tagline',
			'choices'  => array(
				'left'   => esc_html__( 'Left Align', 'organic-startup' ),
				'center' => esc_html__( 'Center Align', 'organic-startup' ),
				'right'  => esc_html__( 'Right Align', 'organic-startup' ),
			),
			'priority' => 18,
		) ) );

		// Navigation Align.
		$wp_customize->add_setting( 'organic_startup_nav_position', array(
			'default'           => 'top',
			'sanitize_callback' => 'organic_startup_sanitize_position',
		) );
		$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'organic_startup_nav_position', array(
			'type'     => 'radio',
			'label'    => esc_html__( 'Navigation Position', 'organic-startup' ),
			'section'  => 'title_tagline',
			'choices'  => array(
				'top'   => esc_html__( 'Top Position', 'organic-startup' ),
				'left'  => esc_html__( 'Left Position', 'organic-startup' ),
				'right' => esc_html__( 'Right Position', 'organic-startup' ),
			),
			'priority' => 20,
		) ) );

		/*
		-------------------------------------------------------------------------------------------------------
			Colors Section
		-------------------------------------------------------------------------------------------------------
		*/

		// Site Title Color.
		$wp_customize->add_setting( 'organic_startup_colors_site_title', array(
			'default'           => '#000000',
			'sanitize_callback' => 'sanitize_hex_color',
			'transport'         => 'postMessage',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'organic_startup_colors_site_title', array(
			'label'    => esc_html__( 'Site Title Color', 'organic-startup' ),
			'section'  => 'colors',
			'settings' => 'organic_startup_colors_site_title',
			'priority' => 10,
		) ) );

		// Nav Background.
		$wp_customize->add_setting( 'organic_startup_colors_nav', array(
			'default'           => '#ffffff',
			'sanitize_callback' => 'sanitize_hex_color',
			'transport'         => 'postMessage',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'organic_startup_colors_nav', array(
			'label'    => esc_html__( 'Header Background Color', 'organic-startup' ),
			'section'  => 'colors',
			'settings' => 'organic_startup_colors_nav',
			'priority' => 20,
		) ) );

		// Nav Background.
		$wp_customize->add_setting( 'organic_startup_colors_content', array(
			'default'           => '#ffffff',
			'sanitize_callback' => 'sanitize_hex_color',
			'transport'         => 'postMessage',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'organic_startup_colors_content', array(
			'label'    => esc_html__( 'Content Background Color', 'organic-startup' ),
			'section'  => 'colors',
			'settings' => 'organic_startup_colors_content',
			'priority' => 25,
		) ) );

		// Footer Background Color.
		$wp_customize->add_setting( 'organic_startup_colors_footer', array(
			'default'           => '#f4f4f4',
			'sanitize_callback' => 'sanitize_hex_color',
			'transport'         => 'postMessage',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'organic_startup_colors_footer', array(
			'label'    => esc_html__( 'Footer Background Color', 'organic-startup' ),
			'section'  => 'colors',
			'settings' => 'organic_startup_colors_footer',
			'priority' => 30,
		) ) );

		// Link Color.
		$wp_customize->add_setting( 'organic_startup_colors_links', array(
			'default'           => '#00cc66',
			'sanitize_callback' => 'sanitize_hex_color',
			'transport'         => 'postMessage',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'organic_startup_colors_links', array(
			'label'    => esc_html__( 'Link Color', 'organic-startup' ),
			'section'  => 'colors',
			'settings' => 'organic_startup_colors_links',
			'priority' => 40,
		) ) );

		// Link Hover Color.
		$wp_customize->add_setting( 'organic_startup_colors_links_hover', array(
			'default'           => '#009966',
			'sanitize_callback' => 'sanitize_hex_color',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'organic_startup_colors_links_hover', array(
			'label'    => esc_html__( 'Link Hover Color', 'organic-startup' ),
			'section'  => 'colors',
			'settings' => 'organic_startup_colors_links_hover',
			'priority' => 50,
		) ) );

		// Heading Link Color.
		$wp_customize->add_setting( 'organic_startup_colors_heading_links', array(
			'default'           => '#000000',
			'sanitize_callback' => 'sanitize_hex_color',
			'transport'         => 'postMessage',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'organic_startup_colors_heading_links', array(
			'label'    => esc_html__( 'Heading Link Color', 'organic-startup' ),
			'section'  => 'colors',
			'settings' => 'organic_startup_colors_heading_links',
			'priority' => 60,
		) ) );

		// Heading Link Hover Color.
		$wp_customize->add_setting( 'organic_startup_colors_heading_links_hover', array(
			'default'           => '#009966',
			'sanitize_callback' => 'sanitize_hex_color',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'organic_startup_colors_heading_links_hover', array(
			'label'    => esc_html__( 'Heading Link Hover Color', 'organic-startup' ),
			'section'  => 'colors',
			'settings' => 'organic_startup_colors_heading_links_hover',
			'priority' => 70,
		) ) );

		// Button Color.
		$wp_customize->add_setting( 'organic_startup_colors_button', array(
			'default'           => '#00cc66',
			'sanitize_callback' => 'sanitize_hex_color',
			'transport'         => 'postMessage',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'organic_startup_colors_button', array(
			'label'    => esc_html__( 'Button Color', 'organic-startup' ),
			'section'  => 'colors',
			'settings' => 'organic_startup_colors_button',
			'priority' => 80,
		) ) );

		// Button Hover Color.
		$wp_customize->add_setting( 'organic_startup_colors_button_hover', array(
			'default'           => '#009966',
			'sanitize_callback' => 'sanitize_hex_color',
		) );
		$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'organic_startup_colors_button_hover', array(
			'label'    => esc_html__( 'Button Hover Color', 'organic-startup' ),
			'section'  => 'colors',
			'settings' => 'organic_startup_colors_button_hover',
			'priority' => 90,
		) ) );

		/*
		-------------------------------------------------------------------------------------------------------
			Theme Options Panel
		-------------------------------------------------------------------------------------------------------
		*/

		$wp_customize->add_panel( 'organic_startup_theme_options', array(
			'priority'       => 1,
			'capability'     => 'edit_theme_options',
			'theme_supports' => '',
			'title'          => esc_html__( 'Theme Options', 'organic-startup' ),
			'description'    => esc_html__( 'This panel allows you to customize specific areas of the theme.', 'organic-startup' ),
		) );

		/*
		-------------------------------------------------------------------------------------------------------
			Page Templates Section
		-------------------------------------------------------------------------------------------------------
		*/

		$wp_customize->add_section( 'organic_startup_templates_section', array(
			'title'    => esc_html__( 'Page Template Options', 'organic-startup' ),
			'priority' => 100,
			'panel'    => 'organic_startup_theme_options',
		) );

		// Blog Categories.
		$wp_customize->add_setting( 'organic_startup_blog_category', array(
			'default'           => '0',
			'sanitize_callback' => 'organic_startup_sanitize_multi_select',
		) );
		$wp_customize->add_control( new Organic_Startup_Multiple_Select_Control( $wp_customize, 'organic_startup_blog_category', array(
			'settings' => 'organic_startup_blog_category',
			'label'    => 'Select Blog Categories',
			'section'  => 'organic_startup_templates_section',
			'type'     => 'multiple-select',
			'choices'  => organic_startup_post_categories(),
			'priority' => 10,
		) ) );

		// Project Categories.
		$wp_customize->add_setting( 'organic_startup_project_category', array(
			'default'           => '0',
			'sanitize_callback' => 'organic_startup_sanitize_multi_select',
		) );
		$wp_customize->add_control( new Organic_Startup_Multiple_Select_Control( $wp_customize, 'organic_startup_project_category', array(
			'settings' => 'organic_startup_project_category',
			'label'    => 'Select Portfolio Categories',
			'section'  => 'organic_startup_templates_section',
			'type'     => 'multiple-select',
			'choices'  => organic_startup_post_categories(),
			'priority' => 20,
		) ) );

		// Testimonials Categories.
		$wp_customize->add_setting( 'organic_startup_testimonial_category', array(
			'default'           => '0',
			'sanitize_callback' => 'organic_startup_sanitize_multi_select',
		) );
		$wp_customize->add_control( new Organic_Startup_Multiple_Select_Control( $wp_customize, 'organic_startup_testimonial_category', array(
			'settings' => 'organic_startup_testimonial_category',
			'label'    => 'Select Testimonial Categories',
			'section'  => 'organic_startup_templates_section',
			'type'     => 'multiple-select',
			'choices'  => organic_startup_post_categories(),
			'priority' => 40,
		) ) );

		// Project Columns Option.
		$wp_customize->add_setting( 'project_columns', array(
			'default'           => 'two',
			'sanitize_callback' => 'organic_startup_sanitize_columns',
		) );
		$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'project_columns', array(
			'label'    => esc_html__( 'Portfolio Project Columns', 'organic-startup' ),
			'section'  => 'organic_startup_templates_section',
			'settings' => 'project_columns',
			'type'     => 'radio',
			'choices'  => array(
				'one'   => esc_html__( 'One Column', 'organic-startup' ),
				'two'   => esc_html__( 'Two Columns', 'organic-startup' ),
				'three' => esc_html__( 'Three Columns', 'organic-startup' ),
				'four'  => esc_html__( 'Four Columns', 'organic-startup' ),
			),
			'priority' => 60,
		) ) );

		// Project Columns Option.
		$wp_customize->add_setting( 'testimonial_columns', array(
			'default'           => 'four',
			'sanitize_callback' => 'organic_startup_sanitize_columns',
		) );
		$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'testimonial_columns', array(
			'label'    => esc_html__( 'Testimonial Columns', 'organic-startup' ),
			'section'  => 'organic_startup_templates_section',
			'settings' => 'testimonial_columns',
			'type'     => 'radio',
			'choices'  => array(
				'two'   => esc_html__( 'Two Columns', 'organic-startup' ),
				'three' => esc_html__( 'Three Columns', 'organic-startup' ),
				'four'  => esc_html__( 'Four Columns', 'organic-startup' ),
				'five'  => esc_html__( 'Five Columns', 'organic-startup' ),
			),
			'priority' => 80,
		) ) );

		/*
		-------------------------------------------------------------------------------------------------------
			Layout Options
		-------------------------------------------------------------------------------------------------------
		*/

		$wp_customize->add_section( 'organic_startup_layout_section', array(
			'title'       => esc_html__( 'Layout', 'organic-startup' ),
			'description' => esc_html__( 'Toggle the display and layout of various elements throughout the theme. Content widths should be entered in pixel (px) format.', 'organic-startup' ),
			'priority'    => 104,
			'panel'       => 'organic_startup_theme_options',
		) );

		// Header Max Width.
		$wp_customize->add_setting( 'organic_startup_header_width', array(
			'default'           => '',
			'sanitize_callback' => 'organic_startup_sanitize_text',
		) );
		$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'organic_startup_header_width', array(
			'label'    => esc_html__( 'Header Width', 'organic-startup' ),
			'section'  => 'organic_startup_layout_section',
			'settings' => 'organic_startup_header_width',
			'type'     => 'text',
			'priority' => 5,
		) ) );

		// Content Max Width.
		$wp_customize->add_setting( 'organic_startup_content_width', array(
			'default'           => '1240px',
			'sanitize_callback' => 'organic_startup_sanitize_text',
		) );
		$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'organic_startup_content_width', array(
			'label'    => esc_html__( 'Content Width', 'organic-startup' ),
			'section'  => 'organic_startup_layout_section',
			'settings' => 'organic_startup_content_width',
			'type'     => 'text',
			'priority' => 15,
		) ) );

		// Footer Max Width.
		$wp_customize->add_setting( 'organic_startup_footer_width', array(
			'default'           => '1240px',
			'sanitize_callback' => 'organic_startup_sanitize_text',
		) );
		$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'organic_startup_footer_width', array(
			'label'    => esc_html__( 'Footer Width', 'organic-startup' ),
			'section'  => 'organic_startup_layout_section',
			'settings' => 'organic_startup_footer_width',
			'type'     => 'text',
			'priority' => 20,
		) ) );

		// Site Max Width.
		$wp_customize->add_setting( 'organic_startup_site_width', array(
			'default'           => '',
			'sanitize_callback' => 'organic_startup_sanitize_text',
		) );
		$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'organic_startup_site_width', array(
			'label'    => esc_html__( 'Site Width', 'organic-startup' ),
			'section'  => 'organic_startup_layout_section',
			'settings' => 'organic_startup_site_width',
			'type'     => 'text',
			'priority' => 25,
		) ) );

		// Display Post Image Title Overlay.
		$wp_customize->add_setting( 'display_img_title_post', array(
			'default'           => '1',
			'sanitize_callback' => 'organic_startup_sanitize_checkbox',
		) );
		$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'display_img_title_post', array(
			'label'    => esc_html__( 'Overlay Post Title On Featured Image?', 'organic-startup' ),
			'section'  => 'organic_startup_layout_section',
			'settings' => 'display_img_title_post',
			'type'     => 'checkbox',
			'priority' => 60,
		) ) );

		// Display Page Image Title Overlay.
		$wp_customize->add_setting( 'display_img_title_page', array(
			'default'           => '1',
			'sanitize_callback' => 'organic_startup_sanitize_checkbox',
		) );
		$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'display_img_title_page', array(
			'label'    => esc_html__( 'Overlay Page Title On Featured Image?', 'organic-startup' ),
			'section'  => 'organic_startup_layout_section',
			'settings' => 'display_img_title_page',
			'type'     => 'checkbox',
			'priority' => 80,
		) ) );

		/*
		-------------------------------------------------------------------------------------------------------
			Fonts
		-------------------------------------------------------------------------------------------------------
		*/

		$wp_customize->add_section( 'organic_startup_fonts_section', array(
			'title'    => esc_html__( 'Fonts', 'organic-startup' ),
			'priority' => 110,
			'panel'    => 'organic_startup_theme_options',
		) );

		// Font Selector.
		$wp_customize->add_setting( 'organic_startup_fonts', array(
			'default'           => 'quicksand_roboto',
			'sanitize_callback' => 'sanitize_key',
		) );
		$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'organic_startup_fonts', array(
			'type'     => 'select',
			'label'    => esc_html__( 'Font Pairing', 'organic-startup' ),
			'section'  => 'organic_startup_fonts_section',
			'choices'  => array(
				'helvetica_neue_double'            => __( 'Helvetica Neue', 'organic-startup' ),
				'quicksand_roboto'                 => __( 'Quicksand + Roboto', 'organic-startup' ),
				'oswald_droid_serif'               => __( 'Oswald + Droid Serif', 'organic-startup' ),
				'montserrat_merriweather'          => __( 'Montserrat + Merriweather', 'organic-startup' ),
				'raleway_roboto_slab'              => __( 'Roboto Slab + Raleway', 'organic-startup' ),
				'playfair_display_source_sans_pro' => __( 'Playfair Display + Source Sans Pro', 'organic-startup' ),
				'quicksand_lora'                   => __( 'Quicksand + Lora', 'organic-startup' ),
				'cinzel_roboto'                    => __( 'Cinzel + Roboto', 'organic-startup' ),
				'merriweather_encode_sans'         => __( 'Merriweather + Encode Sans', 'organic-startup' ),
				'lato_merriweather'                => __( 'Lato + Merriweather', 'organic-startup' ),
				'roboto_merriweather'              => __( 'Roboto + Merriweather', 'organic-startup' ),
				'roboto_condensed_roboto'          => __( 'Roboto Condensed + Roboto', 'organic-startup' ),
				'raleway_open_sans'                => __( 'Raleway + Open Sans', 'organic-startup' ),
				'abril_poppins'                    => __( 'Abril Fatface + Poppins', 'organic-startup' ),
				'oxygen_noto_serif'                => __( 'Oxygen + Noto Serif', 'organic-startup' ),
				'aleo_muli'                        => __( 'Aleo + Muli', 'organic-startup' ),
			),
			'priority' => 40,
		) ) );

		// Menu Font Selector.
		$wp_customize->add_setting( 'organic_startup_nav_font', array(
			'default'           => 'roboto',
			'sanitize_callback' => 'sanitize_key',
		) );
		$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'organic_startup_nav_font', array(
			'type'     => 'select',
			'label'    => esc_html__( 'Main Menu Font', 'organic-startup' ),
			'section'  => 'organic_startup_fonts_section',
			'choices'  => array(
				'noto_serif'       => __( 'Noto Serif', 'organic-startup' ),
				'poppins'          => __( 'Poppins', 'organic-startup' ),
				'muli'             => __( 'Muli', 'organic-startup' ),
				'oxygen'           => __( 'Oxygen', 'organic-startup' ),
				'pt_sans'          => __( 'PT Sans', 'organic-startup' ),
				'libre_franklin'   => __( 'Libre Franklin', 'organic-startup' ),
				'droid_serif'      => __( 'Droid Serif', 'organic-startup' ),
				'helvetica_neue'   => __( 'Helvetica Neue', 'organic-startup' ),
				'lora'             => __( 'Lora', 'organic-startup' ),
				'merriweather'     => __( 'Merriweather', 'organic-startup' ),
				'montserrat'       => __( 'Montserrat', 'organic-startup' ),
				'oswald'           => __( 'Oswald', 'organic-startup' ),
				'playfair_display' => __( 'Playfair Display', 'organic-startup' ),
				'quicksand'        => __( 'Quicksand', 'organic-startup' ),
				'raleway'          => __( 'Raleway', 'organic-startup' ),
				'roboto'           => __( 'Roboto', 'organic-startup' ),
				'roboto_slab'      => __( 'Roboto Slab', 'organic-startup' ),
				'source_sans_pro'  => __( 'Source Sans Pro', 'organic-startup' ),
				'lato'             => __( 'Lato', 'organic-startup' ),
				'encode_sans'      => __( 'Encode Sans', 'organic-startup' ),
				'cinzel'           => __( 'Cinzel', 'organic-startup' ),
				'shrikhand'        => __( 'Shrikhand', 'organic-startup' ),
				'amatic_sc'        => __( 'Amatic SC', 'organic-startup' ),
				'berkshire_swash'  => __( 'Berkshire Swash', 'organic-startup' ),
				'abril_fatface'    => __( 'Abril Fatface', 'organic-startup' ),
				'patua_one'        => __( 'Patua One', 'organic-startup' ),
			),
			'priority' => 60,
		) ) );

		/*
		-------------------------------------------------------------------------------------------------------
			Footer Section
		-------------------------------------------------------------------------------------------------------
		*/

		$wp_customize->add_section( 'organic_startup_footer_section', array(
			'title'       => esc_html__( 'Footer', 'organic-startup' ),
			'description' => esc_html__( 'Replace the footer text. The footer social media links can be added by creating a Social Menu in the Menus section.', 'organic-startup' ),
			'priority'    => 120,
		) );

		// Footer Text.
		$wp_customize->add_setting( 'organic_startup_footer_text', array(
			'sanitize_callback' => 'organic_startup_sanitize_text',
			'transport'         => 'postMessage',
		) );
		$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'organic_startup_footer_text', array(
			'label'    => esc_html__( 'Footer Text', 'organic-startup' ),
			'section'  => 'organic_startup_footer_section',
			'settings' => 'organic_startup_footer_text',
			'type'     => 'text',
			'priority' => 10,
		) ) );

}
add_action( 'customize_register', 'organic_startup_theme_customizer' );

/**
 * Binds JavaScript handlers to make Customizer preview reload changes
 * asynchronously.
 */
function organic_startup_customize_preview_js() {
	wp_register_script( 'jquery-bg-brightness', get_template_directory_uri() . '/js/jquery.brightness.js', array( 'jquery' ), '1.0', true );
	wp_enqueue_script( 'startup-customizer', get_template_directory_uri() . '/customizer/js/customizer.js', array( 'customize-preview', 'jquery-bg-brightness' ), '1.0', true );
}
add_action( 'customize_preview_init', 'organic_startup_customize_preview_js' );

/**
 * Logo Resizer
 */
require get_template_directory() . '/customizer/logo-resizer.php';
