<?php
/**
 * Zenvy Theme Customizer Footer HTML settings.
 *
 * @package Zenvy
 */

/**
 * Class Zenvy_Customize_Footer_Html_Fields
 *
 * Registers customizer fields for the footer HTML.
 */
class Zenvy_Customize_Footer_Html_Fields extends Zenvy_Customize_Base_Field {

	/**
	 * Arguments for fields.
	 *
	 * @return void
	 */
	public function init() {
		$this->args = [
			// Grouping Settings.
			'zenvy_footer_html_group_settings'  => [
				'type'     => 'group',
				'section'  => 'footer_html',
				'priority' => 10,
				'choices'  => [
					'normal' => [
						'tab-title' => esc_html__( 'General', 'zenvy' ),
						'controls'  => [
							'custom_logo',
							'zenvy_footer_html_text',
						],
					],
					'hover'  => [
						'tab-title' => esc_html__( 'Style', 'zenvy' ),
						'controls'  => [
							'zenvy_footer_html_text_link_color',
							'zenvy_footer_html_text_typo',
							'zenvy_footer_html_padding',
							'zenvy_footer_html_margin',
						],
					],
				],
			],
			// Textarea.
			'zenvy_footer_html_text'            => [
				'type'              => 'editor',
				'default'           => '',
				'sanitize_callback' => 'wp_kses_post',
				'label'             => esc_html__( 'HTML', 'zenvy' ),
				'description'       => esc_html__( 'Enter Text/Simple HTML Code', 'zenvy' ),
				'section'           => 'footer_html',
				'priority'          => 15,
			],
			// Text Typo.
			'zenvy_footer_html_text_typo'       => [
				'type'              => 'typography',
				'default'           => [
					'colors' => [ 'color_1' => 'var(--color-white)' ],
				],
				'sanitize_callback' => [ 'Zenvy_Customizer_Sanitize_Callback', 'sanitize_typography' ],
				'label'             => esc_html__( 'Text Color', 'zenvy' ),
				'section'           => 'footer_html',
				'priority'          => 20,
				'inherits'          => [
					'color_1' => 'var(--color-white)',
				],
				'fields'            => [ 'colors' => true ],
			],
			// Link Color.
			'zenvy_footer_html_text_link_color' => [
				'type'              => 'color',
				'default'           => '',
				'sanitize_callback' => [ 'Zenvy_Customizer_Sanitize_Callback', 'sanitize_color' ],
				'label'             => esc_html__( 'Link Color', 'zenvy' ),
				'section'           => 'footer_html',
				'colors'            => [
					'color_1' => esc_html__( 'Normal', 'zenvy' ),
					'color_2' => esc_html__( 'Hover', 'zenvy' ),
				],
				'priority'          => 25,
				'inherits'          => [
					'color_1' => 'var(--color-white)',
					'color_2' => 'var(--color-gray-600)',
				],
			],
			// Padding.
			'zenvy_footer_html_padding'         => [
				'type'              => 'dimensions',
				'default'           => [
					'desktop' => [
						'side_1' => '10px',
						'side_3' => '10px',
						'linked' => 'off',
					],
				],
				'sanitize_callback' => [ 'Zenvy_Customizer_Sanitize_Callback', 'sanitize_dimensions' ],
				'label'             => esc_html__( 'Padding', 'zenvy' ),
				'description'       => esc_html__( 'Set HTML container padding.', 'zenvy' ),
				'section'           => 'footer_html',
				'priority'          => 55,
				'responsive'        => [ 'desktop', 'tablet', 'mobile' ],
			],
			// Margin.
			'zenvy_footer_html_margin'          => [
				'type'              => 'dimensions',
				'default'           => '',
				'sanitize_callback' => [ 'Zenvy_Customizer_Sanitize_Callback', 'sanitize_dimensions' ],
				'label'             => esc_html__( 'Margin', 'zenvy' ),
				'description'       => esc_html__( 'Set HTML container margin.', 'zenvy' ),
				'section'           => 'footer_html',
				'priority'          => 60,
				'responsive'        => [ 'desktop', 'tablet', 'mobile' ],
			],
		];
	}
}

new Zenvy_Customize_Footer_Html_Fields();
