<?php 
// Customize Blog Featured Title
$wp_customize->add_setting (
    'blog_featured_title',
    array(
        'default' => themesflat_customize_default('blog_featured_title'),
        'sanitize_callback' => 'themesflat_sanitize_text'
    )
);
$wp_customize->add_control(
    'blog_featured_title',
    array(
        'type'      => 'text',
        'label'     => esc_html__('Customize Blog Featured Title', 'norstar'),
        'section'   => 'section_content_blog_single',
        'priority'  => 1
    )
);   


//Blog Single Layout
$wp_customize->add_setting(
    'blog_layout_single',
    array(
        'default'           => themesflat_customize_default('blog_layout_single'),
        'sanitize_callback' => 'esc_attr',
    )
);
$wp_customize->add_control( 
    'blog_layout_single',
    array (
        'type'      => 'select',           
        'section'   => 'section_content_blog_single',
        'priority'  => 1,
        'label'         => esc_html__('Sidebar Single Position', 'norstar'),
        'choices'   => array (
            'sidebar-right'     => esc_html__( 'Sidebar Right','norstar' ),
            'sidebar-left'      =>  esc_html__( 'Sidebar Left','norstar' ),
            'fullwidth'         =>   esc_html__( 'Full Width','norstar' ),
            'fullwidth-small'   =>   esc_html__( 'Full Width Small','norstar' ),
            'fullwidth-center'  =>   esc_html__( 'Full Width Center','norstar' ),
        ),
    )
);

$wp_customize->add_setting(
    'blog_width_single',
    array(
        'default'           => themesflat_customize_default('blog_width_single'),
        'sanitize_callback' => 'esc_attr',
    )
);
$wp_customize->add_control( 
    'blog_width_single',
    array (
        'type'      => 'select',           
        'section'   => 'section_content_blog_single',
        'priority'  => 1,
        'label'         => esc_html__('Width Container', 'norstar'),
        'choices'   => array (
            'container'         =>   esc_html__( 'Container','norstar' ),
            'container-small'   =>   esc_html__( 'Container Small','norstar' ),
        ),
    )
);

// Show breadcrumb
$wp_customize->add_setting (
    'post_single_breadcrumb_enabled',
    array (
        'sanitize_callback' => 'themesflat_sanitize_checkbox',
        'default' => themesflat_customize_default('post_single_breadcrumb_enabled'),     
    )
);
$wp_customize->add_control( new themesflat_Checkbox( $wp_customize,
    'post_single_breadcrumb_enabled',
    array(
        'type'      => 'checkbox',
        'label'     => esc_html__('Show Breadcrumb ( OFF | ON )', 'norstar'),
        'section'   => 'section_content_blog_single',
        'priority'  => 2
    ))
);


$wp_customize->add_setting (
    'show_blog_title',
    array (
        'sanitize_callback' => 'themesflat_sanitize_checkbox',
        'default' => themesflat_customize_default('show_blog_title'),     
    )
);
$wp_customize->add_control( new themesflat_Checkbox( $wp_customize,
    'show_blog_title',
    array(
        'type'      => 'checkbox',
        'label'     => esc_html__('Show Blog Single Title ( OFF | ON )', 'norstar'),
        'section'   => 'section_content_blog_single',
        'priority'  => 2
    ))
);

// Social Share
$wp_customize->add_setting(
    'show_social_share',
      array(
          'sanitize_callback' => 'themesflat_sanitize_checkbox',
          'default' => themesflat_customize_default('show_social_share'),     
      )   
  );
  $wp_customize->add_control( new themesflat_Checkbox( $wp_customize,
      'show_social_share',
      array(
          'type' => 'checkbox',
          'label' => esc_html__('Social Share Blog  ( OFF | ON )', 'norstar'),
          'section'   => 'section_content_blog_single',
          'priority' => 3,
      ))
  );

// Enable Entry Footer Content
$wp_customize->add_setting(
  'show_entry_footer_content',
    array(
        'sanitize_callback' => 'themesflat_sanitize_checkbox',
        'default' => themesflat_customize_default('show_entry_footer_content'),     
    )   
);
$wp_customize->add_control( new themesflat_Checkbox( $wp_customize,
    'show_entry_footer_content',
    array(
        'type' => 'checkbox',
        'label' => esc_html__('Entry Footer ( OFF | ON )', 'norstar'),
        'section' => 'section_content_blog_single',
        'priority' => 4,
    ))
);

// Show Related Posts
$wp_customize->add_setting (
    'show_related_post',
    array (
        'sanitize_callback' => 'themesflat_sanitize_checkbox',
        'default' => themesflat_customize_default('show_related_post'),     
    )
);
$wp_customize->add_control( new themesflat_Checkbox( $wp_customize,
    'show_related_post',
    array(
        'type'      => 'checkbox',
        'label'     => esc_html__('Related Posts ( OFF | ON )', 'norstar'),
        'section'   => 'section_content_blog_single',
        'priority'  => 5
    ))
);

//Related Posts Style
$wp_customize->add_setting(
    'related_post_style',
    array(
        'default'           => themesflat_customize_default('related_post_style'),
        'sanitize_callback' => 'esc_attr',
    )
);
$wp_customize->add_control( 
    'related_post_style',
    array(
        'type'      => 'select',           
        'section'   => 'section_content_blog_single',
        'priority'  => 6,
        'label'         => esc_html__('Related Posts Style', 'norstar'),
        'choices'   => array(
            'blog-list' => esc_html__( 'Blog List','norstar' ),
            'blog-grid'=>   esc_html__( 'Blog Grid','norstar' ),
    ))
);

// Gird columns Related Posts
$wp_customize->add_setting(
    'grid_columns_post_related',
    array(
        'default'           => themesflat_customize_default('grid_columns_post_related'),
        'sanitize_callback' => 'themesflat_sanitize_grid_post_related',
    )
);
$wp_customize->add_control(
    'grid_columns_post_related',
    array(
        'type'      => 'select',           
        'section'   => 'section_content_blog_single',
        'priority'  => 7,
        'label'     => esc_html__('Columns Of Related Posts', 'norstar'),
        'choices'   => array(                
            2     => esc_html__( '2 Columns', 'norstar' ),
            3     => esc_html__( '3 Columns', 'norstar' ),
            4     => esc_html__( '4 Columns', 'norstar' ),                
        )
    )
);

// Number Of Related Posts
$wp_customize->add_setting (
    'number_related_post',
    array(
        'default' => themesflat_customize_default('number_related_post'),
        'sanitize_callback' => 'themesflat_sanitize_text'
    )
);
$wp_customize->add_control(
    'number_related_post',
    array(
        'type'      => 'text',
        'label'     => esc_html__('Number Of Related Posts', 'norstar'),
        'section'   => 'section_content_blog_single',
        'priority'  => 8
    )
);


$wp_customize->add_setting (
    'related_post_content_elements',
    array (
        'sanitize_callback' => 'themesflat_sanitize_text',
        'default' => themesflat_customize_default('related_post_content_elements'),     
    )
);
$wp_customize->add_control( new themesflat_Control_Drag_And_Drop( $wp_customize,
    'related_post_content_elements',
    array(
        'type'      => 'draganddrop-controls',
        'label'     => esc_html__('Related Post Content Elements', 'norstar'),
        'description' => esc_html__( 'Drag and drop elements to re-order.', 'norstar' ),
        'section'   => 'section_content_blog_single',
        'priority'  => 9,
        'choices' => array(
            'tag'             => esc_html__( 'Tag', 'norstar' ),
            'meta'            => esc_html__( 'Meta', 'norstar' ),
            'title'           => esc_html__( 'Title', 'norstar' ),
            'excerpt_content' => esc_html__( 'excerpt' ,'norstar')
        ),  
        
        'active_callback' => function () use ( $wp_customize ) {

            return 1 === $wp_customize->get_setting( 'show_related_post' )->value();

        },
    ))
); 

$wp_customize->add_setting (
    'related_post_meta_elements',
    array (
        'sanitize_callback' => 'themesflat_sanitize_text',
        'default' => themesflat_customize_default('related_post_meta_elements'),     
    )
);
$wp_customize->add_control( new themesflat_Control_Drag_And_Drop( $wp_customize,
    'related_post_meta_elements',
    array(
        'type'      => 'draganddrop-controls',
        'label'     => esc_html__('Related Post Meta Elements', 'norstar'),
        'description' => esc_html__( 'Drag and drop elements to re-order.', 'norstar' ),
        'section'   => 'section_content_blog_single',
        'priority'  => 9,
        'choices' => array(
            'category'    => esc_html__( 'Category', 'norstar' ),
            'author'    => esc_html__( 'Author', 'norstar' ),
            'date'      => esc_html__( 'Date', 'norstar' ),
            'view'  => esc_html__( 'View', 'norstar' ),
            'comment'   => esc_html__( 'Comment', 'norstar' ),
        ),  
        
        'active_callback' => function () use ( $wp_customize ) {

            return 1 === $wp_customize->get_setting( 'show_related_post' )->value();

        },
    ))
); 

// post single elements
$wp_customize->add_setting (
    'post_single_content_elements',
    array (
        'sanitize_callback' => 'themesflat_sanitize_text',
        'default' => themesflat_customize_default('post_single_content_elements'),     
    )
);
$wp_customize->add_control( new themesflat_Control_Drag_And_Drop( $wp_customize,
    'post_single_content_elements',
    array(
        'type'      => 'draganddrop-controls',
        'label'     => esc_html__('Post Single Content Elements', 'norstar'),
        'description' => esc_html__( 'Drag and drop elements to re-order.', 'norstar' ),
        'section'   => 'section_content_blog_single',
        'priority'  => 12,
        'choices' => array(
            'tag'             => esc_html__( 'Tag', 'norstar' ),
            'meta'            => esc_html__( 'Meta', 'norstar' ),
            'title'           => esc_html__( 'Title', 'norstar' ),
            'excerpt_content' => esc_html__( 'excerpt' ,'norstar')
        ),                
    ))
); 


// Meta Elements
$wp_customize->add_setting (
    'meta_elements_single',
    array (
        'sanitize_callback' => 'themesflat_sanitize_text',
        'default' => themesflat_customize_default('meta_elements_single'),     
    )
);
$wp_customize->add_control( new themesflat_Control_Drag_And_Drop( $wp_customize,
    'meta_elements_single',
    array(
        'type'      => 'draganddrop-controls',
        'label'     => esc_html__('Meta Single Elements', 'norstar'),
        'description' => esc_html__( 'Drag and drop elements to re-order.', 'norstar' ),
        'section'   => 'section_content_blog_single',
        'priority'  => 13,
        'choices' => array(
            'category'    => esc_html__( 'Category', 'norstar' ),
            'author'    => esc_html__( 'Author', 'norstar' ),
            'date'      => esc_html__( 'Date', 'norstar' ),
            'view'  => esc_html__( 'View', 'norstar' ),
            'comment'   => esc_html__( 'Comment', 'norstar' ),
        ),        
    ))
); 


// socials share
$wp_customize->add_setting(
    'social_single_links',
    array(
      'sanitize_callback' => 'esc_attr',
      'default' => themesflat_customize_default('social_single_links'),     
    )   
  );
  $wp_customize->add_control( new themesflat_SocialIcons($wp_customize,
      'social_single_links',
      array(
          'type' => 'social-icons',
          'label' => esc_html__('Social Media', 'norstar'),
          'section' => 'section_content_blog_single',
          'priority' => 14,
      ))
);


$wp_customize->add_setting(
    'scroll_indicator_single',
    array(
      'sanitize_callback' => 'esc_attr',
      'default' => themesflat_customize_default('scroll_indicator_single'),     
    )   
); 

$wp_customize->add_control( new themesflat_Checkbox( $wp_customize,
    'scroll_indicator_single',
    array(
        'type'      => 'checkbox',
        'label'     => esc_html__('Scroll Indicator Header ( OFF | ON )', 'norstar'),
        'section'   => 'section_content_blog_single',
        'priority'  => 15,
         
    ))
);






