<?php
if( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly.
}

$prefix = BREEK_LITE_THEMEPREFIX . '_';

/* Start Blog Settings */

$wp_customize->add_panel( $prefix . 'blog_panel', array(
    'title'       => esc_html_x( 'Blog', 'admin', 'breek-lite' ),
    'description' => esc_html_x( 'Customize your blog appearance and functionality.', 'admin', 'breek-lite' ),
    'priority'    => 30,
));

/* Section: Blog -> General Settings */

$wp_customize->add_section( $prefix . 'blog_settings', array(
    'title'    => esc_html_x( 'General Settings', 'admin', 'breek-lite' ),
    'priority' => 30,
    'panel'    => $prefix . 'blog_panel',
));  
// Display Date
$wp_customize->add_setting( $prefix . 'enable_global_date', array(
    'default'           => '1',
    'sanitize_callback' => 'sanitize_text_field',
));    
$wp_customize->add_control( $prefix . 'enable_global_date', array(
    'label'   => esc_html_x( 'Display Date', 'admin', 'breek-lite' ),
    'section' => $prefix . 'blog_settings',
    'type'    => 'radio',
    'choices' => array(
        '1' => esc_html_x( 'ON', 'admin', 'breek-lite' ),
        '0' => esc_html_x( 'OFF', 'admin', 'breek-lite' ),
    ),
));
// Display Comments Counter
$wp_customize->add_setting( $prefix . 'enable_global_comments', array(
    'default'           => '1',
    'sanitize_callback' => 'sanitize_text_field',
));    
$wp_customize->add_control( $prefix . 'enable_global_comments', array(
    'label'   => esc_html_x( 'Display Comments Counter', 'admin', 'breek-lite' ),
    'section' => $prefix . 'blog_settings',
    'type'    => 'radio',
    'choices' => array(
        '1' => esc_html_x( 'ON', 'admin', 'breek-lite' ),
        '0' => esc_html_x( 'OFF', 'admin', 'breek-lite' ),
    ),
));
// Display Excerpt
$wp_customize->add_setting( $prefix . 'grid_display_excerpt', array(
    'default'           => '1',
    'sanitize_callback' => 'sanitize_text_field',
));    
$wp_customize->add_control( $prefix . 'grid_display_excerpt', array(
    'label'   => esc_html_x( 'Display Excerpt', 'admin', 'breek-lite' ),
    'section' => $prefix . 'blog_settings',
    'type'    => 'radio',
    'choices' => array(
        '1' => esc_html_x( 'ON', 'admin', 'breek-lite' ),
        '0' => esc_html_x( 'OFF', 'admin', 'breek-lite' ),
    ),
));

/* Section: Blog -> Single Post */

$wp_customize->add_section( $prefix . 'blog_single_post', array(
    'title'    => esc_html_x( 'Single Post', 'admin', 'breek-lite' ),
    'priority' => 30,
    'panel'    => $prefix . 'blog_panel',
));
    
// Display Table of Contents
$wp_customize->add_setting( $prefix . 'enable_single_toc', array(
    'default'           => '1',
    'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control( $prefix . 'enable_single_toc', array(
    'label'       => esc_html_x( 'Display Table of Contents', 'admin', 'breek-lite' ),
    'description' => esc_html_x( 'This option will display a table of contents on the top of the single post.', 'admin', 'breek-lite' ),
    'section'     => $prefix . 'blog_single_post',
    'type'        => 'radio',
    'choices'     => array(
        '1' => esc_html_x( 'ON', 'admin', 'breek-lite' ),
        '0' => esc_html_x( 'OFF', 'admin', 'breek-lite' ),
    ),
));

// Single TOC state
$wp_customize->add_setting( $prefix . 'single_toc_state', array(
    'default'           => 'closed',
    'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( $prefix . 'single_toc_state', array(
    'label'       => esc_html_x( 'TOC State', 'admin', 'breek-lite' ),
    'description' => esc_html_x( 'By default the TOC toggle is closed, this option is globally applied to all posts.', 'admin', 'breek-lite' ),
    'section'     => $prefix . 'blog_single_post',
    'type'        => 'radio',
    'choices'     => array(
        'closed' => esc_html_x( 'Closed', 'admin', 'breek-lite' ),
        'open'   => esc_html_x( 'Open', 'admin', 'breek-lite' ),
    ),
) );


$wp_customize->add_setting( $prefix . 'enable_featured_image', array(
    'default'           => '1',
    'sanitize_callback' => 'sanitize_text_field',
));    
$wp_customize->add_control( $prefix . 'enable_featured_image', array(
    'label'       => esc_html_x( 'Display Featured image globally', 'admin', 'breek-lite' ),
    'description' => esc_html_x( 'If is OFF, all featured images from all posts will be hidden.', 'admin', 'breek-lite' ),
    'section'     => $prefix . 'blog_single_post',
    'type'        => 'radio',
    'choices'     => array(
        '1' => esc_html_x( 'ON', 'admin', 'breek-lite' ),
        '0' => esc_html_x( 'OFF', 'admin', 'breek-lite' ),
    ),
));        
// Display Category
$wp_customize->add_setting( $prefix . 'enable_single_category', array(
    'default'           => '1',
    'sanitize_callback' => 'sanitize_text_field',
));    
$wp_customize->add_control( $prefix . 'enable_single_category', array(
    'label'       => esc_html_x( 'Display Category', 'admin', 'breek-lite' ),
    'description' => esc_html_x( 'If is OFF, it will disable categories only for single post.', 'admin', 'breek-lite' ),
    'section'     => $prefix . 'blog_single_post',
    'type'        => 'radio',
    'choices'     => array(
        '1' => esc_html_x( 'ON', 'admin', 'breek-lite' ),
        '0' => esc_html_x( 'OFF', 'admin', 'breek-lite' ),
    ),
));    
// Display Author of Article
$wp_customize->add_setting( $prefix . 'enable_single_author', array(
    'default'           => '1',
    'sanitize_callback' => 'sanitize_text_field',
));

$wp_customize->add_control( $prefix . 'enable_single_author', array(
    'label'       => esc_html_x( 'Display Author of Article', 'admin', 'breek-lite' ),
    'description' => esc_html_x( 'This option only affects posts.', 'admin', 'breek-lite' ),
    'section'     => $prefix . 'blog_single_post',
    'type'        => 'radio',
    'choices'     => array(
        '1' => esc_html_x( 'ON', 'admin', 'breek-lite' ),
        '0' => esc_html_x( 'OFF', 'admin', 'breek-lite' ),
    ),
));    
// Display Next/Prev Posts
$wp_customize->add_setting( $prefix . 'siblings_posts', array(
    'default'           => '1',
    'sanitize_callback' => 'sanitize_text_field',
));    
$wp_customize->add_control( $prefix . 'siblings_posts', array(
    'label'       => esc_html_x( 'Display next/prev posts', 'admin', 'breek-lite' ),
    'description' => esc_html_x( 'This option will enable siblings posts after the author information.', 'admin', 'breek-lite' ),
    'section'     => $prefix . 'blog_single_post',
    'type'        => 'radio',
    'choices'     => array(
        '1' => esc_html_x( 'ON', 'admin', 'breek-lite' ),
        '0' => esc_html_x( 'OFF', 'admin', 'breek-lite' ),
    ),
));

/* Section: Blog -> Share Buttons */

$wp_customize->add_section( $prefix . 'blog_share_buttons', array(
    'title'    => esc_html_x( 'Share buttons', 'admin', 'breek-lite' ),
    'priority' => 30,
    'panel'    => $prefix . 'blog_panel',
));

// Display Share Buttons
$wp_customize->add_setting( $prefix . 'enable_share_buttons', array(
    'default'           => '1',
    'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control( $prefix . 'enable_share_buttons', array(
    'label'       => esc_html_x( 'Display Share Buttons', 'admin', 'breek-lite' ),
    'description' => esc_html_x( 'Show share buttons on the bottom of the post.', 'admin', 'breek-lite' ),
    'section'     => $prefix . 'blog_share_buttons',
    'type'        => 'radio',
    'choices'     => array(
        '1' => esc_html_x( 'ON', 'admin', 'breek-lite' ),
        '0' => esc_html_x( 'OFF', 'admin', 'breek-lite' ),
    ),
));

// Display Facebook
$wp_customize->add_setting( $prefix . 'enable_single_facebook', array(
    'default'           => '1',
    'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control( $prefix . 'enable_single_facebook', array(
    'label'       => esc_html_x( 'Display Facebook', 'admin', 'breek-lite' ),
    'description' => esc_html_x( 'Enable or disable this specific network.', 'admin', 'breek-lite' ),
    'section'     => $prefix . 'blog_share_buttons',
    'type'        => 'radio',
    'choices'     => array(
        '1' => esc_html_x( 'ON', 'admin', 'breek-lite' ),
        '0' => esc_html_x( 'OFF', 'admin', 'breek-lite' ),
    ),
));
// Display Twitter
$wp_customize->add_setting( $prefix . 'enable_single_twitter', array(
    'default'           => '1',
    'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control( $prefix . 'enable_single_twitter', array(
    'label'       => esc_html_x( 'Display Twitter', 'admin', 'breek-lite' ),
    'description' => esc_html_x( 'Enable or disable this specific network.', 'admin', 'breek-lite' ),
    'section'     => $prefix . 'blog_share_buttons',
    'type'        => 'radio',
    'choices'     => array(
        '1' => esc_html_x( 'ON', 'admin', 'breek-lite' ),
        '0' => esc_html_x( 'OFF', 'admin', 'breek-lite' ),
    ),
));
// Display WhatsApp
$wp_customize->add_setting( $prefix . 'enable_single_whatsapp', array(
    'default'           => '1',
    'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control( $prefix . 'enable_single_whatsapp', array(
    'label'       => esc_html_x( 'Display WhatsApp', 'admin', 'breek-lite' ),
    'description' => esc_html_x( 'Enable or disable this specific network (only visible on mobile).', 'admin', 'breek-lite' ),
    'section'     => $prefix . 'blog_share_buttons',
    'type'        => 'radio',
    'choices'     => array(
        '1' => esc_html_x( 'ON', 'admin', 'breek-lite' ),
        '0' => esc_html_x( 'OFF', 'admin', 'breek-lite' ),
    ),
));
// Display Email
$wp_customize->add_setting( $prefix . 'enable_single_email', array(
    'default'           => '1',
    'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control( $prefix . 'enable_single_email', array(
    'label'       => esc_html_x( 'Display Email', 'admin', 'breek-lite' ),
    'description' => esc_html_x( 'Enable or disable share by email.', 'admin', 'breek-lite' ),
    'section'     => $prefix . 'blog_share_buttons',
    'type'        => 'radio',
    'choices'     => array(
        '1' => esc_html_x( 'ON', 'admin', 'breek-lite' ),
        '0' => esc_html_x( 'OFF', 'admin', 'breek-lite' ),
    ),
));