<?php
/**
 * Header Builder Options
 *
 * @package Code4rest
 */

namespace Code4rest;

use Code4rest\Theme_Customizer;
use function Code4rest\code4rest;

Theme_Customizer::add_settings(
	array(
		// 'load_font_pairing' => array(
		// 	'control_type' => 'code4rest_font_pairing',
		// 	'section'      => 'general_typography',
		// 	'label'        => esc_html__( 'Font Pairings', 'code4rest' ),
		// 	'settings'     => false,
		// ),
		'base_font' => array(
			'control_type' => 'code4rest_typography_control',
			'section'      => 'general_typography',
			'label'        => esc_html__( 'Base Font', 'code4rest' ),
			'default'      => code4rest()->default( 'base_font' ),
			'live_method'     => array(
				array(
					'type'     => 'css_typography',
					'selector' => 'body',
					'property' => 'font',
					'key'      => 'typography',
				),
			),
			'input_attrs'  => array(
				'id'         => 'base_font',
				'canInherit' => false,
			),
		),
		'load_base_italic' => array(
			'control_type' => 'code4rest_switch_control',
			'sanitize'     => 'code4rest_sanitize_toggle',
			'section'      => 'general_typography',
			'default'      => code4rest()->default( 'load_base_italic' ),
			'label'        => esc_html__( 'Load Italics Font Styles', 'code4rest' ),
			'context'      => array(
				array(
					'setting' => 'base_font',
					'operator'   => 'load_italic',
					'value'   => 'true',
				),
			),
		),
		'info_heading' => array(
			'control_type' => 'code4rest_title_control',
			'section'      => 'general_typography',
			'label'        => esc_html__( 'Headings', 'code4rest' ),
			'settings'     => false,
		),
		'heading_font' => array(
			'control_type' => 'code4rest_typography_control',
			'section'      => 'general_typography',
			'label'        => esc_html__( 'Heading Font Family', 'code4rest' ),
			'default'      => code4rest()->default( 'heading_font' ),
			'live_method'     => array(
				array(
					'type'     => 'css_typography',
					'selector' => 'h1,h2,h3,h4,h5,h6',
					'property' => 'font',
					'key'      => 'family',
				),
			),
			'input_attrs'  => array(
				'id'      => 'heading_font',
				'options' => 'family',
			),
		),
		'h1_font' => array(
			'control_type' => 'code4rest_typography_control',
			'section'      => 'general_typography',
			'label'        => esc_html__( 'H1 Font', 'code4rest' ),
			'default'      => code4rest()->default( 'h1_font' ),
			'live_method'     => array(
				array(
					'type'     => 'css_typography',
					'selector' => 'h1',
					'property' => 'font',
					'key'      => 'typography',
				),
			),
			'input_attrs'  => array(
				'id'             => 'h1_font',
				'headingInherit' => true,
			),
		),
		'h2_font' => array(
			'control_type' => 'code4rest_typography_control',
			'section'      => 'general_typography',
			'label'        => esc_html__( 'H2 Font', 'code4rest' ),
			'default'      => code4rest()->default( 'h2_font' ),
			'live_method'     => array(
				array(
					'type'     => 'css_typography',
					'selector' => 'h2',
					'property' => 'font',
					'key'      => 'typography',
				),
			),
			'input_attrs'  => array(
				'id'             => 'h2_font',
				'headingInherit' => true,
			),
		),
		'h3_font' => array(
			'control_type' => 'code4rest_typography_control',
			'section'      => 'general_typography',
			'label'        => esc_html__( 'H3 Font', 'code4rest' ),
			'default'      => code4rest()->default( 'h3_font' ),
			'live_method'     => array(
				array(
					'type'     => 'css_typography',
					'selector' => 'h3',
					'property' => 'font',
					'key'      => 'typography',
				),
			),
			'input_attrs'  => array(
				'id'             => 'h3_font',
				'headingInherit' => true,
			),
		),
		'h4_font' => array(
			'control_type' => 'code4rest_typography_control',
			'section'      => 'general_typography',
			'label'        => esc_html__( 'H4 Font', 'code4rest' ),
			'default'      => code4rest()->default( 'h4_font' ),
			'live_method'     => array(
				array(
					'type'     => 'css_typography',
					'selector' => 'h4',
					'property' => 'font',
					'key'      => 'typography',
				),
			),
			'input_attrs'  => array(
				'id'             => 'h4_font',
				'headingInherit' => true,
			),
		),
		'h5_font' => array(
			'control_type' => 'code4rest_typography_control',
			'section'      => 'general_typography',
			'label'        => esc_html__( 'H5 Font', 'code4rest' ),
			'default'      => code4rest()->default( 'h5_font' ),
			'live_method'     => array(
				array(
					'type'     => 'css_typography',
					'selector' => 'h5',
					'property' => 'font',
					'key'      => 'typography',
				),
			),
			'input_attrs'  => array(
				'id'             => 'h5_font',
				'headingInherit' => true,
			),
		),
		'h6_font' => array(
			'control_type' => 'code4rest_typography_control',
			'section'      => 'general_typography',
			'label'        => esc_html__( 'H6 Font', 'code4rest' ),
			'default'      => code4rest()->default( 'h6_font' ),
			'live_method'     => array(
				array(
					'type'     => 'css_typography',
					'selector' => 'h6',
					'property' => 'font',
					'key'      => 'typography',
				),
			),
			'input_attrs'  => array(
				'id'             => 'h6_font',
				'headingInherit' => true,
			),
		),
		'info_above_title_heading' => array(
			'control_type' => 'code4rest_title_control',
			'section'      => 'general_typography',
			'label'        => esc_html__( 'Title Above Content', 'code4rest' ),
			'settings'     => false,
		),
		'title_above_font' => array(
			'control_type' => 'code4rest_typography_control',
			'section'      => 'general_typography',
			'label'        => esc_html__( 'H1 Title', 'code4rest' ),
			'default'      => code4rest()->default( 'title_above_font' ),
			'live_method'     => array(
				array(
					'type'     => 'css_typography',
					'selector' => '.entry-hero h1',
					'property' => 'font',
					'key'      => 'typography',
				),
			),
			'input_attrs'  => array(
				'id'             => 'title_above_font',
				'headingInherit' => true,
			),
		),
		'title_above_breadcrumb_font' => array(
			'control_type' => 'code4rest_typography_control',
			'section'      => 'general_typography',
			'label'        => esc_html__( 'Breadcrumbs', 'code4rest' ),
			'default'      => code4rest()->default( 'title_above_breadcrumb_font' ),
			'live_method'     => array(
				array(
					'type'     => 'css_typography',
					'selector' => '.entry-hero .code4rest-breadcrumbs',
					'property' => 'font',
					'key'      => 'typography',
				),
			),
			'input_attrs'  => array(
				'id'      => 'title_above_breadcrumb_font',
			),
		),
		'font_rendering' => array(
			'control_type' => 'code4rest_switch_control',
			'sanitize'     => 'code4rest_sanitize_toggle',
			'section'      => 'general_typography',
			'transport'    => 'refresh',
			'default'      => code4rest()->default( 'font_rendering' ),
			'label'        => esc_html__( 'Enable Font Smoothing', 'code4rest' ),
		),
		'google_subsets' => array(
			'control_type' => 'code4rest_check_icon_control',
			'section'      => 'general_typography',
			'sanitize'     => 'code4rest_sanitize_google_subsets',
			'priority'     => 20,
			'default'      => array(),
			'label'        => esc_html__( 'Google Font Subsets', 'code4rest' ),
			'input_attrs'  => array(
				'options' => array(
					'latin-ext' => array(
						'name' => __( 'Latin Extended', 'code4rest' ),
					),
					'cyrillic' => array(
						'name' => __( 'Cyrillic', 'code4rest' ),
					),
					'cyrillic-ext' => array(
						'name' => __( 'Cyrillic Extended', 'code4rest' ),
					),
					'greek' => array(
						'name' => __( 'Greek', 'code4rest' ),
					),
					'greek-ext' => array(
						'name' => __( 'Greek Extended', 'code4rest' ),
					),
					'vietnamese' => array(
						'name' => __( 'Vietnamese', 'code4rest' ),
					),
					'arabic' => array(
						'name' => __( 'Arabic', 'code4rest' ),
					),
					'khmer' => array(
						'name' => __( 'Khmer', 'code4rest' ),
					),
					'chinese' => array(
						'name' => __( 'Chinese', 'code4rest' ),
					),
					'chinese-simplified' => array(
						'name' => __( 'Chinese Simplified', 'code4rest' ),
					),
					'tamil' => array(
						'name' => __( 'Tamil', 'code4rest' ),
					),
					'bengali' => array(
						'name' => __( 'Bengali', 'code4rest' ),
					),
					'devanagari' => array(
						'name' => __( 'Devanagari', 'code4rest' ),
					),
					'hebrew' => array(
						'name' => __( 'Hebrew', 'code4rest' ),
					),
					'korean' => array(
						'name' => __( 'Korean', 'code4rest' ),
					),
					'thai' => array(
						'name' => __( 'Thai', 'code4rest' ),
					),
					'telugu' => array(
						'name' => __( 'Telugu', 'code4rest' ),
					),
				),
			),
		),
	)
);
