<?php
/**
 * Customizer fields for footer general settings.
 *
 * @package Eronex
 * @since   0.0.1
 */

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

use Kirki\Field\Background;
use Kirki\Field\Dimension;
use Kirki\Field\Dimensions;
use Kirki\Field\Editor;
use Kirki\Pro\Field\Divider;
use Kirki\Pro\Field\HeadlineToggle;

new HeadlineToggle(
	array(
		'label'    => esc_html__( 'Footer', 'eronex' ),
		'settings' => 'eronex_footer_enable',
		'section'  => 'eronex_footer_general',
		'default'  => true,
	)
);

new Divider(
	array(
		'settings' => 'eronex_footer_textarea_separator',
		'section'  => 'eronex_footer_general',
		'choices'  => array(
			'color' => $separator_color,
		),
	),
);

new Editor(
	array(
		'label'    => esc_html__( 'Text', 'eronex' ),
		'settings' => 'eronex_footer_text',
		'section'  => 'eronex_footer_general',
		'default'  => 'Copyright © [current_year] [site_title] - [theme_author]',
	)
);

new Divider(
	array(
		'settings' => 'eronex_footer_height_separator',
		'section'  => 'eronex_footer_general',
		'choices'  => array(
			'color' => $separator_color,
		),
	),
);

new Dimension(
	array(
		'label'      => esc_html__( 'Height', 'eronex' ),
		'settings'   => 'eronex_footer_height',
		'section'    => 'eronex_footer_general',
		'transport'  => 'auto',
		'responsive' => true,
		'default'    => array(
			'desktop' => '',
			'tablet'  => '',
			'mobile'  => '',
		),
		'output'     => array(
			array(
				'element'     => '.eronex-footer',
				'property'    => 'min-height',
				'media_query' => array(
					'desktop' => $desktop_media_query,
					'tablet'  => $tablet_media_query,
					'mobile'  => $mobile_media_query,
				),
			),
		),
	)
);

new Divider(
	array(
		'settings' => 'eronex_footer_bg_separator',
		'section'  => 'eronex_footer_general',
		'choices'  => array(
			'color' => $separator_color,
		),
	),
);

new Background(
	array(
		'label'     => esc_html__( 'Background', 'eronex' ),
		'settings'  => 'eronex_footer_bg',
		'section'   => 'eronex_footer_general',
		'transport' => 'auto',
		'default'   => array(
			'background-color'      => '',
			'background-image'      => '',
			'background-repeat'     => '',
			'background-position'   => '',
			'background-size'       => '',
			'background-attachment' => '',
		),
		'output'    => array(
			array(
				'element' => '.eronex-footer',
			),
		),
	)
);

new Divider(
	array(
		'settings' => 'eronex_footer_padding_separator',
		'section'  => 'eronex_footer_general',
		'choices'  => array(
			'color' => $separator_color,
		),
	),
);

new Dimensions(
	array(
		'settings'   => 'eronex_footer_padding',
		'label'      => esc_html__( 'Padding', 'eronex' ),
		'section'    => 'eronex_footer_general',
		'default'    => array(
			'mobile'  => array(
				'padding-top'    => '',
				'padding-bottom' => '',
			),
			'tablet'  => array(
				'padding-top'    => '',
				'padding-bottom' => '',
			),
			'desktop' => array(
				'padding-top'    => '',
				'padding-bottom' => '',

			),
		),
		'choices'    => array(
			'labels' => array(
				'padding-top'    => esc_html__( 'Top', 'eronex' ),
				'padding-bottom' => esc_html__( 'Bottom', 'eronex' ),
			),
		),
		'output'     => array(
			array(
				'element'     => '.eronex-footer',
				'media_query' => array(
					'desktop' => $desktop_media_query,
					'tablet'  => $tablet_media_query,
					'mobile'  => $mobile_media_query,
				),
			),
		),
		'transport'  => 'auto',
		'responsive' => true,
	)
);
