<?php
/**
 * Typography Customizer panel
 */

Wpazure_Kirki::add_panel( 'azure_panel_typography', array(
    'priority'    => 41,
    'title'       => __( 'Typography', 'wpazure' ),
) );


/**
 * Font families
 */
Wpazure_Kirki::add_section( 'azure_section_fonts', array(
    'title'       	 => __( 'Base Typography', 'wpazure' ),
    'panel'          => 'azure_panel_typography',
) );


//Headings family
Wpazure_Kirki::add_field( 'wpazure', array(
	'type'        => 'typography',
	'settings'    => 'headings_font',
	'label'       => esc_attr__( 'Headings', 'wpazure' ),
	'section'     => 'azure_section_fonts',
	'default'     => array(
		'font-family'    => 'Work Sans',
		'variant'        => '600',
		'line-height'    => '1.5',
		'letter-spacing' => '0',
	),
	'priority'    => 10,
	'output'      => array(
		array(
			'element' => 'h1,h2,h3,h4,h5,h6',
		),
		array(
			'element'  => '',
			'context'  => array( 'editor' ),
		),		
	),
) );

//Body family
Wpazure_Kirki::add_field( 'wpazure', array(
	'type'        => 'typography',
	'settings'    => 'body_font',
	'label'       => esc_attr__( 'Body', 'wpazure' ),
	'section'     => 'azure_section_fonts',
	'default'     => [
		'font-family'    => 'Work Sans',
		'variant'        => 'regular',
		'font-size'      => '15px',
		'text-transform' => 'none',
		'line-height'    => '1.5',
		'letter-spacing' => '0',
		
	],
	'priority'    => 10,
	'output'      => array(
		array(
			'element' => 'body',
		),
		array(
			'element'  => '.editor-block-list__layout,.editor-block-list__layout .editor-block-list__block',
			'context'  => array( 'editor' ),
		),		
	),
) );


Wpazure_Kirki::add_field( 'wpazure', array(
	'type'     	  => 'slider',
	'settings'    => 'font_size_body',
	'label'       =>  esc_attr__( 'Paragraph Margin Bottom', 'wpazure' ),
	'section'     => 'azure_section_fonts',
	'default'     => '0',
	'choices'   => array(
		'min'  => 0,
		'max'  => 5,
		'step' => .1,
	),
	'transport'	  => 'auto',
	'output'      => array(
		array(
			'element'  => 'p',
			'property' => 'margin-bottom',
			'units'    => 'em',
			'suffix'   => '!important',
		),
		array(
			'element'  => '.editor-styles-wrapper p',
			'context'  => array( 'editor' ),
		),
	),	
) );



/**
 * Primary Header
 */
Wpazure_Kirki::add_section( 'azure_primary_header', array(
    'title'       	 => __( 'Primary Header', 'wpazure' ),
    'panel'          => 'azure_panel_typography',
) );


//Headings family
Wpazure_Kirki::add_field( 'wpazure', array(
	'type'        => 'typography',
	'settings'    => 'azure_primary_header_site_title',
	'label'       => esc_attr__( 'Site Title', 'wpazure' ),
	'section'     => 'azure_primary_header',
	'default'     => array(
		'font-size'      => '32px',
	),

	'output'      => array(
		array(
			'element' => '.site-title',
		),
		array(
			'element'  => '',
			'context'  => array( 'editor' ),
		),		
	),
) );


/*upgrade to pro*/
Wpazure_Kirki::add_field( 'wpazure', array(
	'type'        => 'custom',
	'settings'    => 'update_pro_section_typo_primary_header',
	'section'     => 'azure_primary_header',
	'default'     => '<div class="pro-vesrion"><P>' . esc_html__( 'Want to use more typography?Then upgrade to Wpazure Pro', 'wpazure' ) . '<P></div> <div class="pro-box"><a target="_blank" class="more-button" href="https://www.wpazure.com/pro/"> '. esc_html__('upgrade to pro','wpazure').'</a></div>',
) );


/**
 * Content
 */
Wpazure_Kirki::add_section( 'azure_content_typo', array(
    'title'       	 => __( 'Content', 'wpazure' ),
    'panel'          => 'azure_panel_typography',
) );


//Heading one size
Wpazure_Kirki::add_field( 'wpazure', array(
	'type'        => 'typography',
	'settings'    => 'azure_content_typo_h1',
	'label'       => esc_attr__( 'Heading 1 (H1) ', 'wpazure' ),
	'section'     => 'azure_content_typo',
	'default'     => array(
		'font-size'      => '32px',
	),

	'output'      => array(
		array(
			'element' => 'h1',
		),
		array(
			'element'  => '',
			'context'  => array( 'editor' ),
		),		
	),
) );

//Heading two size
Wpazure_Kirki::add_field( 'wpazure', array(
	'type'        => 'typography',
	'settings'    => 'azure_content_typo_h2',
	'label'       => esc_attr__( 'Heading 2 (H2) ', 'wpazure' ),
	'section'     => 'azure_content_typo',
	'default'     => array(
		'font-size'      => '24px',
	),

	'output'      => array(
		array(
			'element' => 'h2',
		),
		array(
			'element'  => '',
			'context'  => array( 'editor' ),
		),		
	),
) );

//Heading three size
Wpazure_Kirki::add_field( 'wpazure', array(
	'type'        => 'typography',
	'settings'    => 'azure_content_typo_h3',
	'label'       => esc_attr__( 'Heading 3 (H3) ', 'wpazure' ),
	'section'     => 'azure_content_typo',
	'default'     => array(
		'font-size'      => '18px',
	),

	'output'      => array(
		array(
			'element' => 'h3',
		),
		array(
			'element'  => '',
			'context'  => array( 'editor' ),
		),		
	),
) );

//Heading Four size
Wpazure_Kirki::add_field( 'wpazure', array(
	'type'        => 'typography',
	'settings'    => 'azure_content_typo_h4',
	'label'       => esc_attr__( 'Heading 4 (H4) ', 'wpazure' ),
	'section'     => 'azure_content_typo',
	'default'     => array(
		'font-size'      => '16px',
	),

	'output'      => array(
		array(
			'element' => 'h4',
		),
		array(
			'element'  => '',
			'context'  => array( 'editor' ),
		),		
	),
) );

//Heading Five size
Wpazure_Kirki::add_field( 'wpazure', array(
	'type'        => 'typography',
	'settings'    => 'azure_content_typo_h5',
	'label'       => esc_attr__( 'Heading 5 (H5) ', 'wpazure' ),
	'section'     => 'azure_content_typo',
	'default'     => array(
		'font-size'      => '14px',
	),

	'output'      => array(
		array(
			'element' => 'h5',
		),
		array(
			'element'  => '',
			'context'  => array( 'editor' ),
		),		
	),
) );

//Heading Six size
Wpazure_Kirki::add_field( 'wpazure', array(
	'type'        => 'typography',
	'settings'    => 'azure_content_typo_h6',
	'label'       => esc_attr__( 'Heading 6 (H6) ', 'wpazure' ),
	'section'     => 'azure_content_typo',
	'default'     => array(
		'font-size'      => '12px',
	),

	'output'      => array(
		array(
			'element' => 'h5',
		),
		array(
			'element'  => '',
			'context'  => array( 'editor' ),
		),		
	),
) );


/*upgrade to pro*/
Wpazure_Kirki::add_field( 'wpazure', array(
	'type'        => 'custom',
	'settings'    => 'update_pro_section_typo_headding',
	'section'     => 'azure_content_typo',
	'default'     => '<div class="pro-vesrion"><P>' . esc_html__( 'Want to use more typography?Then upgrade to Wpazure Pro', 'wpazure' ) . '<P></div> <div class="pro-box"><a target="_blank" class="more-button" href="https://www.wpazure.com/pro/"> '. esc_html__('upgrade to pro','wpazure').'</a></div>',
) );


// Blog font size
Wpazure_Kirki::add_section( 'azure_blog_typo', array(
    'title'       	 => esc_attr__( 'Blog', 'wpazure' ),
    'panel'          => 'azure_panel_typography',
) );


/*Seprater between control*/
Wpazure_Kirki::add_field( 'wpazure', array(
	'type'        => 'custom',
	'settings'    => 'separator_in_blog_typo',
	'section'     => 'azure_blog_typo',
	'default'     => '',
) );


Wpazure_Kirki::add_section( 'azure_blog_archive_typo', array(
    'title'       	 => esc_attr__( 'Blog / Archive', 'wpazure' ),
	'section'          => 'azure_blog_typo',
    'priority'       => '',
) );


//Blog post title
Wpazure_Kirki::add_field( 'wpazure', array(
	'type'        => 'typography',
	'settings'    => 'azure_blog_typo_heading_font',
	'label'       => esc_attr__( 'Blog Post Title', 'wpazure' ),
	'section'     => 'azure_blog_archive_typo',
	'default'     => array(
		'font-size'      => '24px',
	),

	'output'      => array(
		array(
			'element' => '.blog .post-info .entry-title',
		),
		array(
			'element'  => '',
			'context'  => array( 'editor' ),
		),		
	),
) );

//Archive blog
Wpazure_Kirki::add_field( 'wpazure', array(
	'type'        => 'typography',
	'settings'    => 'azure_blog_archive_typo_heading_font',
	'label'       => esc_attr__( 'Archive Summary Box Title', 'wpazure' ),
	'section'     => 'azure_blog_archive_typo',
	'default'     => array(
		'font-size'      => '24px',
	),

	'output'      => array(
		array(
			'element' => 'archive .page-title',
		),
		array(
			'element'  => '',
			'context'  => array( 'editor' ),
		),		
	),
) );

/*upgrade to pro*/
Wpazure_Kirki::add_field( 'wpazure', array(
	'type'        => 'custom',
	'settings'    => 'update_pro_section_typo_blog',
	'section'     => 'azure_blog_archive_typo',
	'default'     => '<div class="pro-vesrion"><P>' . esc_html__( 'Want to use more typography?Then upgrade to Wpazure Pro', 'wpazure' ) . '<P></div> <div class="pro-box"><a target="_blank" class="more-button" href="https://www.wpazure.com/pro/"> '. esc_html__('upgrade to pro','wpazure').'</a></div>',
) );


// Single pot font size
Wpazure_Kirki::add_section( 'azure_blog_single_typo', array(
    'title'       	 => esc_attr__( 'Single Post', 'wpazure' ),
	'section'          => 'azure_blog_typo',
    'priority'       => '',
) );


//Blog post title
Wpazure_Kirki::add_field( 'wpazure', array(
	'type'        => 'typography',
	'settings'    => 'azure_single_typo_heading_font',
	'label'       => esc_attr__( 'Single Post / Page Title', 'wpazure' ),
	'section'     => 'azure_blog_single_typo',
	'default'     => array(
		'font-size'      => '24px',
	),

	'output'      => array(
		array(
			'element' => '.single .post-info .entry-title',
		),
		array(
			'element'  => '',
			'context'  => array( 'editor' ),
		),		
	),
) );

/*upgrade to pro*/
Wpazure_Kirki::add_field( 'wpazure', array(
	'type'        => 'custom',
	'settings'    => 'update_pro_section_typo_blog_single',
	'section'     => 'azure_blog_single_typo',
	'default'     => '<div class="pro-vesrion"><P>' . esc_html__( 'Want to use more typography?Then upgrade to Wpazure Pro', 'wpazure' ) . '<P></div> <div class="pro-box"><a target="_blank" class="more-button" href="https://www.wpazure.com/pro/"> '. esc_html__('upgrade to pro','wpazure').'</a></div>',
) );