<?php

Kirki::add_section( 'theme_color_options', array(
	'title' => esc_html__( 'Color Options', 'newshit' ),
	'panel' => 'newshit_theme_options',
) );

new \Kirki\Field\Checkbox_Switch(
	[
		'settings' => 'primary_color_enable',
		'label'    => esc_html__( 'Enable Primary Color', 'newshit' ),
		'section'  => 'theme_color_options',
		'default'  => 'off',
		'choices'  => [
			'on'  => esc_html__( 'Enable', 'newshit' ),
			'off' => esc_html__( 'Disable', 'newshit' ),
		],
	]
);
new \Kirki\Field\Color(
	[
		'settings'        => 'theme_primary_color',
		'label'           => __( 'Primary Color', 'newshit' ),
		'section'         => 'theme_color_options',
		'choices'         => [
			'alpha' => true,
		],
		'default'         => '#2816F8',
		'active_callback' => [
			[
				'setting'  => 'primary_color_enable',
				'operator' => '===',
				'value'    => true,
			],
		],
	]
);

new \Kirki\Field\Checkbox_Switch(
	[
		'settings' => 'secondary_color_enable',
		'label'    => esc_html__( 'Enable Secondary Color', 'newshit' ),
		'section'  => 'theme_color_options',
		'default'  => 'off',
		'choices'  => [
			'on'  => esc_html__( 'Enable', 'newshit' ),
			'off' => esc_html__( 'Disable', 'newshit' ),
		],
	]
);
new \Kirki\Field\Color(
	[
		'settings'        => 'theme_secondary_color',
		'label'           => __( 'Secondary Color', 'newshit' ),
		'section'         => 'theme_color_options',
		'choices'         => [
			'alpha' => true,
		],
		'default'         => '#18181B',
		'active_callback' => [
			[
				'setting'  => 'secondary_color_enable',
				'operator' => '===',
				'value'    => true,
			],
		],
	]
);

new \Kirki\Field\Checkbox_Switch(
	[
		'settings' => 'body_background_enable',
		'label'    => esc_html__( 'Enable Body Color', 'newshit' ),
		'section'  => 'theme_color_options',
		'default'  => 'off',
		'choices'  => [
			'on'  => esc_html__( 'Enable', 'newshit' ),
			'off' => esc_html__( 'Disable', 'newshit' ),
		],
	]
);
new \Kirki\Field\Background(
	[
		'settings'        => 'body_bg_color',
		'label'           => esc_html__( 'Background Color', 'newshit' ),
		'section'         => 'theme_color_options',
		'transport'       => 'auto',
		'active_callback' => [
			[
				'setting'  => 'body_background_enable',
				'operator' => '===',
				'value'    => true,
			],
		],
		'default'         => '#ffffff',
		'output'          => [
			[
				'element' => 'body',
			],
		],
	]
);

new \Kirki\Field\Color(
	[
		'settings'        => 'sidebar_body_color',
		'label'           => __( 'Body/Text Color', 'newshit' ),
		'section'         => 'theme_color_options',
		'choices'         => [
			'alpha' => true,
		],
		'active_callback' => [
			[
				'setting'  => 'body_background_enable',
				'operator' => '===',
				'value'    => true,
			],
		],
		'output'          => [
			[
				'element' => 'body,p',
			],
		],
	]
);

new \Kirki\Field\Checkbox_Switch(
	[
		'settings' => 'sidebar_bg_enalbe',
		'label'    => esc_html__( 'Enable Sidebar Background', 'newshit' ),
		'section'  => 'theme_color_options',
		'default'  => 'off',
		'choices'  => [
			'on'  => esc_html__( 'Enable', 'newshit' ),
			'off' => esc_html__( 'Disable', 'newshit' ),
		],
	]
);
new \Kirki\Field\Color(
	[
		'settings'        => 'sidebar_bg_color',
		'label'           => __( 'Sidebar Background', 'newshit' ),
		'section'         => 'theme_color_options',
		'choices'         => [
			'alpha' => true,
		],
		'default'         => '#F1EFFC',
		'active_callback' => [
			[
				'setting'  => 'sidebar_bg_enalbe',
				'operator' => '===',
				'value'    => true,
			],
		],
		'output'          => [
			[
				'element' => '.sidebar-widget-area .widget',
			],
		],
	]
);


new \Kirki\Field\Multicolor(
	[
		'settings'  => 'post_image_bg_color',
		'label'     => esc_html__( 'Post Image Gradient Color', 'newshit' ),
		'section'   => 'theme_color_options',
		'choices'   => [
			'start'     => esc_html__( 'Start Color', 'newshit' ),
			'end'    => esc_html__( 'End Color', 'newshit' ),
		],
		'alpha'     => true,
		'default'   => [
			'start'   => 'rgba(0, 0, 0, 0)',
			'end'  => 'rgba(0, 0, 0, 0.7)',
		],
	]
);