<?php
/**
 * Page Settings Section
 *
 * @package Blog_Over
 */

// ---------------------------------------------
// Section: Page Settings
// ---------------------------------------------
Kirki::add_section('blog_over_page_section', array(
    'title' => esc_html__('Page Settings', 'blog-over'),
    'panel' => 'blog_over_theme_panel',
    'priority' => 16, // After Breadcrumb Settings
));

// =============================================
// TABS CONTROL
// =============================================
// Tabs Control Removed per user request

// =============================================
// Page Layout (Sidebar Position)
// =============================================
Kirki::add_field('Blog_Over_config', array(
    'type' => 'radio-image',
    'settings' => 'blog_over_page_layout',
    'label' => esc_html__('Page Layout', 'blog-over'),
    'section' => 'blog_over_page_section',
    'default' => 'right-sidebar',
    'priority' => 5,
    'choices' => array(
        'right-sidebar' => get_template_directory_uri() . '/assets/images/layout-right-sidebar.svg',
        'left-sidebar' => get_template_directory_uri() . '/assets/images/layout-left-sidebar.svg',
        'full-width' => get_template_directory_uri() . '/assets/images/layout-fullwidth.svg',
    ),
    // Layout changes affect structure significantly, so full refresh is safer
    'transport' => 'refresh',
));

// =============================================
// Page Content Width
// =============================================
Kirki::add_field('Blog_Over_config', array(
    'type' => 'radio-buttonset',
    'settings' => 'blog_over_page_content_width',
    'label' => esc_html__('Page Content Width', 'blog-over'),
    'description' => esc_html__('Set the maximum width for page content area.', 'blog-over'),
    'section' => 'blog_over_page_section',
    'default' => 'default',
    'priority' => 6,
    'choices' => array(
        'narrow' => esc_html__('Narrow', 'blog-over'),
        'default' => esc_html__('Default', 'blog-over'),
        'wide' => esc_html__('Wide', 'blog-over'),
        'full' => esc_html__('Full', 'blog-over'),
    ),
    'transport' => 'refresh',
));

// =============================================
// Container Style
// =============================================
Kirki::add_field('Blog_Over_config', array(
    'type' => 'radio-buttonset',
    'settings' => 'blog_over_page_container_style',
    'label' => esc_html__('Container Style', 'blog-over'),
    'description' => esc_html__('Choose the style for page content container.', 'blog-over'),
    'section' => 'blog_over_page_section',
    'default' => 'default',
    'priority' => 7,
    'choices' => array(
        'default' => esc_html__('Default', 'blog-over'),
        'unboxed' => esc_html__('Unboxed', 'blog-over'),
        'boxed' => esc_html__('Boxed', 'blog-over'),
    ),
    'transport' => 'refresh',
));

// =============================================
// Show Featured Image
// =============================================
Kirki::add_field('Blog_Over_config', array(
    'type' => 'toggle',
    'settings' => 'blog_over_page_show_featured',
    'label' => esc_html__('Show Featured Image on Pages', 'blog-over'),
    'description' => esc_html__('Display featured image inside page content.', 'blog-over'),
    'section' => 'blog_over_page_section',
    'default' => true,
    'priority' => 30,
    'partial_refresh' => array(
        'blog_over_page_show_featured' => array(
            'selector' => '.blog-over-page-content',
            'render_callback' => function () {
                get_template_part('template-parts/content', 'page');
            },
        ),
    ),
));

