<?php
/**
 * Theme Options.
 *
 * @package business_office
 */

//-------------------------------------------------------//

// ===============================
// Our Services Section
// ===============================
$wp_customize->add_section('business_office_our_services_section', array(
    'title'       => __('Our Services', 'business-office'),
    'priority'    => 200,
    'panel'       => 'home_option_panel',
));

// SHOW / HIDE
$wp_customize->add_setting('business_office_our_services_hide', array(
    'default' => false,
    'sanitize_callback' => 'business_office_sanitize_checkbox',
));
$wp_customize->add_control('business_office_our_services_hide', array(
    'section' => 'business_office_our_services_section',
    'label'   => __('Enable Section', 'business-office'),
    'type'    => 'checkbox',
));

// TITLE
$wp_customize->add_setting('business_office_our_services_title', array(
    'default' => '',
    'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('business_office_our_services_title', array(
    'section' => 'business_office_our_services_section',
    'label'   => __('Section Title', 'business-office'),
    'type'    => 'text',
));


// POST COUNT
$wp_customize->add_setting('business_office_our_services_count', array(
    'default' => 6,
    'sanitize_callback' => 'absint',
));
$wp_customize->add_control('business_office_our_services_count', array(
    'label'   => __('Number of Service Cards (Max 6)', 'business-office'),
    'section' => 'business_office_our_services_section',
    'type'    => 'number',
    'input_attrs' => array(
        'min' => 1,
        'max' => 6,
    ),
));

// LEFT PANEL BACKGROUND IMAGE
$wp_customize->add_setting('business_office_our_services_left_bg_image', array(
    'default' => '',
    'sanitize_callback' => 'business_office_sanitize_image',
));

$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'business_office_our_services_left_bg_image', array(
    'label' => __('Left Panel Background Image', 'business-office'),
    'section' => 'business_office_our_services_section',
)));

// LEFT PANEL DESCRIPTION
$wp_customize->add_setting('business_office_our_services_left_description', array(
    'default' => '',
    'sanitize_callback' => 'sanitize_textarea_field',
));
$wp_customize->add_control('business_office_our_services_left_description', array(
    'label'   => __('Left Panel Description', 'business-office'),
    'section' => 'business_office_our_services_section',
    'type'    => 'textarea',
));

$business_office_service_cards_defaults = array(
    1 => array(
        'icon'    => 'fa-solid fa-briefcase',
        'title'   => __('Business Strategy', 'business-office'),
        'text'    => __('Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry', 'business-office'),
        'url'     => '',
    ),
    2 => array(
        'icon'    => 'fa-solid fa-shield-halved',
        'title'   => __('Audit & Compliance', 'business-office'),
        'text'    => __('Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry', 'business-office'),
        'url'     => '',
    ),
    3 => array(
        'icon'    => 'fa-solid fa-comment',
        'title'   => __('Advisory Services', 'business-office'),
        'text'    => __('Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry', 'business-office'),
        'url'     => '',
    ),
    4 => array(
        'icon'    => 'fa-solid fa-comments',
        'title'   => __('Consultancy', 'business-office'),
        'text'    => __('Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry', 'business-office'),
        'url'     => '',
    ),
    5 => array(
        'icon'    => 'fa-solid fa-chart-line',
        'title'   => __('Growth Strategies', 'business-office'),
        'text'    => __('Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry', 'business-office'),
        'url'     => '',
    ),
    6 => array(
        'icon'    => 'fa-solid fa-percent',
        'title'   => __('Tax & Legal Services', 'business-office'),
        'text'    => __('Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry', 'business-office'),
        'url'     => '',
    ),
);

for ($business_office_service_i = 1; $business_office_service_i <= 6; $business_office_service_i++) {

    $wp_customize->add_setting('business_office_our_services_service_' . $business_office_service_i . '_icon', array(
        'default' => $business_office_service_cards_defaults[$business_office_service_i]['icon'],
        'sanitize_callback' => 'sanitize_text_field',
    ));
    $wp_customize->add_control('business_office_our_services_service_' . $business_office_service_i . '_icon', array(
        'label'   => sprintf(__('Service %d Icon Class', 'business-office'), $business_office_service_i),
        'description' => __('Example: fa-solid fa-briefcase', 'business-office'),
        'section' => 'business_office_our_services_section',
        'type'    => 'text',
    ));

    $wp_customize->add_setting('business_office_our_services_service_' . $business_office_service_i . '_title', array(
        'default' => $business_office_service_cards_defaults[$business_office_service_i]['title'],
        'sanitize_callback' => 'sanitize_text_field',
    ));
    $wp_customize->add_control('business_office_our_services_service_' . $business_office_service_i . '_title', array(
        'label'   => sprintf(__('Service %d Title', 'business-office'), $business_office_service_i),
        'section' => 'business_office_our_services_section',
        'type'    => 'text',
    ));

    $wp_customize->add_setting('business_office_our_services_service_' . $business_office_service_i . '_text', array(
        'default' => $business_office_service_cards_defaults[$business_office_service_i]['text'],
        'sanitize_callback' => 'sanitize_textarea_field',
    ));
    $wp_customize->add_control('business_office_our_services_service_' . $business_office_service_i . '_text', array(
        'label'   => sprintf(__('Service %d Description', 'business-office'), $business_office_service_i),
        'section' => 'business_office_our_services_section',
        'type'    => 'textarea',
    ));

    $wp_customize->add_setting('business_office_our_services_service_' . $business_office_service_i . '_url', array(
        'default' => $business_office_service_cards_defaults[$business_office_service_i]['url'],
        'sanitize_callback' => 'esc_url_raw',
    ));
    $wp_customize->add_control('business_office_our_services_service_' . $business_office_service_i . '_url', array(
        'label'   => sprintf(__('Service %d Link', 'business-office'), $business_office_service_i),
        'section' => 'business_office_our_services_section',
        'type'    => 'url',
    ));
}

// ================= BUSINESS BANNER SECTION =================
$wp_customize->add_section('business_office_blog_hero_section', array(
    'title' => __('Business Banner Section', 'business-office'),
    'panel' => 'home_option_panel',
));

// Show/Hide
$wp_customize->add_setting('business_office_blog_hero_hide', array(
    'default' => false,
    'sanitize_callback' => 'business_office_sanitize_checkbox',
));

$wp_customize->add_control('business_office_blog_hero_hide', array(
    'label' => __('Enable Banner Section', 'business-office'),
    'section' => 'business_office_blog_hero_section',
    'type' => 'checkbox',
));

// Banner Background Image
$wp_customize->add_setting('business_office_business_banner_bg_image', array(
    'default' => '',
    'sanitize_callback' => 'business_office_sanitize_image',
));

$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'business_office_business_banner_bg_image', array(
    'label'   => __('Banner Background Image', 'business-office'),
    'section' => 'business_office_blog_hero_section',
)));

// Small Heading
$wp_customize->add_setting('business_office_business_banner_kicker', array(
    'default' => 'Your Trusted Business Growth Partner',
    'sanitize_callback' => 'sanitize_text_field',
));

$wp_customize->add_control('business_office_business_banner_kicker', array(
    'label' => __('Small Heading', 'business-office'),
    'section' => 'business_office_blog_hero_section',
    'type' => 'text',
));

// Main Heading (Accent Word)
$wp_customize->add_setting('business_office_business_banner_heading_accent', array(
    'default' => 'BUSINESS',
    'sanitize_callback' => 'sanitize_text_field',
));

$wp_customize->add_control('business_office_business_banner_heading_accent', array(
    'section' => 'business_office_blog_hero_section',
    'label'   => __('Heading Accent Word', 'business-office'),
    'type'    => 'text',
));

// Main Heading (Second Line)
$wp_customize->add_setting('business_office_business_banner_heading_main', array(
    'default' => 'SOLUTIONS',
    'sanitize_callback' => 'sanitize_text_field',
));

$wp_customize->add_control('business_office_business_banner_heading_main', array(
    'section' => 'business_office_blog_hero_section',
    'label'   => __('Heading Second Line', 'business-office'),
    'type'    => 'text',
));

// Description
$wp_customize->add_setting('business_office_business_banner_description', array(
    'default' => 'We provide strategic consulting, financial planning, and operational solutions to help businesses scale efficiently and achieve long-term success.',
    'sanitize_callback' => 'sanitize_textarea_field',
));

$wp_customize->add_control('business_office_business_banner_description', array(
    'section' => 'business_office_blog_hero_section',
    'label'   => __('Description', 'business-office'),
    'type'    => 'textarea',
));

// Button Text
$wp_customize->add_setting('business_office_business_banner_button_text', array(
    'default' => 'GET CONSULTATION',
    'sanitize_callback' => 'sanitize_text_field',
));

$wp_customize->add_control('business_office_business_banner_button_text', array(
    'section' => 'business_office_blog_hero_section',
    'label'   => __('Button Text', 'business-office'),
    'type'    => 'text',
));

// Button URL
$wp_customize->add_setting('business_office_business_banner_button_url', array(
    'default' => '#',
    'sanitize_callback' => 'esc_url_raw',
));

$wp_customize->add_control('business_office_business_banner_button_url', array(
    'section' => 'business_office_blog_hero_section',
    'label'   => __('Button URL', 'business-office'),
    'type'    => 'url',
));