<?php
/**
 * Custom Header Settings
 */

if (!defined('ABSPATH')) {
    exit;
}

// Ensure Kirki is loaded
if (!class_exists('Kirki')) {
    return;
}

Kirki::add_field('Blog_Over_config', array(
    'type'        => 'custom',
    'settings'    => 'blog_over_custom_header_divider_1',
    'section'     => 'header_image',
    'default'     => '<hr><h3 style="margin-bottom:0;">' . esc_html__('Pro Settings', 'blog-over') . '</h3>',
    'priority'    => 20,
));

Kirki::add_field('Blog_Over_config', array(
    'type'        => 'toggle',
    'settings'    => 'blog_over_custom_header_show_title',
    'label'       => esc_html__('Show Site Title/Description', 'blog-over'),
    'description' => esc_html__('Display site title and tagline over the header image.', 'blog-over'),
    'section'     => 'header_image',
    'default'     => true,
    'priority'    => 21,
    'partial_refresh' => array(
        'blog_over_custom_header_show_title' => array(
            'selector' => '.blog-over-custom-header',
            'render_callback' => 'blog_over_render_custom_header_partial',
        ),
    ),
));

Kirki::add_field('Blog_Over_config', array(
    'type'        => 'radio-buttonset',
    'settings'    => 'blog_over_custom_header_align',
    'label'       => esc_html__('Text Alignment', 'blog-over'),
    'section'     => 'header_image',
    'default'     => 'center',
    'priority'    => 22,
    'choices'     => array(
        'left'   => esc_html__('Left', 'blog-over'),
        'center' => esc_html__('Center', 'blog-over'),
        'right'  => esc_html__('Right', 'blog-over'),
    ),
    'active_callback' => array(
        array(
            'setting'  => 'blog_over_custom_header_show_title',
            'operator' => '==',
            'value'    => true,
        ),
    ),
    'transport'   => 'auto',
    'output'      => array(
        array(
            'element'  => '.blog-over-custom-header-content',
            'property' => 'text-align',
        ),
    ),
));

Kirki::add_field('Blog_Over_config', array(
    'type'        => 'color',
    'settings'    => 'blog_over_custom_header_overlay_color',
    'label'       => esc_html__('Overlay Color', 'blog-over'),
    'section'     => 'header_image',
    'default'     => 'rgba(0,0,0,0.5)',
    'priority'    => 23,
    'choices'     => array(
        'alpha' => true,
    ),
    'transport'   => 'auto',
    'output'      => array(
        array(
            'element'  => '.blog-over-custom-header-overlay',
            'property' => 'background-color',
        ),
    ),
));

Kirki::add_field('Blog_Over_config', array(
    'type'        => 'slider',
    'settings'    => 'blog_over_custom_header_padding_top',
    'label'       => esc_html__('Padding Top (px)', 'blog-over'),
    'section'     => 'header_image',
    'default'     => 100,
    'priority'    => 24,
    'choices'     => array(
        'min'  => 0,
        'max'  => 400,
        'step' => 5,
    ),
    'transport'   => 'auto',
    'output'      => array(
        array(
            'element'  => '.blog-over-custom-header-content',
            'property' => 'padding-top',
            'units'    => 'px',
        ),
    ),
));

Kirki::add_field('Blog_Over_config', array(
    'type'        => 'slider',
    'settings'    => 'blog_over_custom_header_padding_bottom',
    'label'       => esc_html__('Padding Bottom (px)', 'blog-over'),
    'section'     => 'header_image',
    'default'     => 100,
    'priority'    => 25,
    'choices'     => array(
        'min'  => 0,
        'max'  => 400,
        'step' => 5,
    ),
    'transport'   => 'auto',
    'output'      => array(
        array(
            'element'  => '.blog-over-custom-header-content',
            'property' => 'padding-bottom',
            'units'    => 'px',
        ),
    ),
));

