<?php
Kirki::add_section( 'book_review_blog_container_settings_section', array(
    'title'          => esc_html__( 'Container Settings.', 'book-review-blog' ),
    'panel'          => 'book_review_blog_global_panel',
    'capability'     => 'edit_theme_options',
    'priority'      => 1
) );
Kirki::add_field( 'blog_author_blog_config', [
    'type'        => 'select',
    'settings'    => 'book_review_blog_container_size',
    'label'       => esc_html__( 'Container Width', 'book-review-blog' ),
    'section'     => 'book_review_blog_container_settings_section',
    'default'     => 'container',
    'choices'     => [
        'container'   => esc_html__( 'Container Default', 'book-review-blog' ),
        'container-fluid'   => esc_html__( 'Container Full Width', 'book-review-blog' ),
        'custom-width'   => esc_html__( 'Custom Width', 'book-review-blog' ),
    ],
] );
Kirki::add_field( 'blog_author_blog_config', [
    'type'        => 'number',
    'settings'    => 'container_custom_width',
    'label'       => esc_html__( 'Container Custom Width', 'book-review-blog' ),
    'label'       => esc_html__( 'The width will be applied to the entire website container on larger screens, while retaining its default size on mobile and tablet screens.', 'book-review-blog' ),
    'section'     => 'book_review_blog_container_settings_section',
    'default'     => '1200',
    'transport'		=> 'postMessage',
    'active_callback'	=> function(){
    	$containerWidthType = get_theme_mod('book_review_blog_container_size', 'container');
    	if ('custom-width' == $containerWidthType) {
    		return true;
    	}
    	return false;
    }
] );
