<?php
/**
 * Typography
 *
 * @package Cosmic Blog
 */

$wp_customize->add_section(
	'cosmic_blog_typography',
	array(
		'panel' => 'cosmic_blog_theme_options',
		'title' => esc_html__( 'Typography', 'cosmic-blog' ),
	)
);

// Typography - Site Title Font.
$wp_customize->add_setting(
	'cosmic_blog_site_title_font',
	array(
		'default'           => 'Inter',
		'sanitize_callback' => 'cosmic_blog_sanitize_google_fonts',
	)
);

$wp_customize->add_control(
	'cosmic_blog_site_title_font',
	array(
		'label'    => esc_html__( 'Site Title Font Family', 'cosmic-blog' ),
		'section'  => 'cosmic_blog_typography',
		'settings' => 'cosmic_blog_site_title_font',
		'type'     => 'select',
		'choices'  => cosmic_blog_get_all_google_font_families(),
	)
);

// Typography - Site Description Font.
$wp_customize->add_setting(
	'cosmic_blog_site_description_font',
	array(
		'default'           => 'Aleo',
		'sanitize_callback' => 'cosmic_blog_sanitize_google_fonts',
	)
);

$wp_customize->add_control(
	'cosmic_blog_site_description_font',
	array(
		'label'    => esc_html__( 'Site Description Font Family', 'cosmic-blog' ),
		'section'  => 'cosmic_blog_typography',
		'settings' => 'cosmic_blog_site_description_font',
		'type'     => 'select',
		'choices'  => cosmic_blog_get_all_google_font_families(),
	)
);

// Typography - Header Font.
$wp_customize->add_setting(
	'cosmic_blog_header_font',
	array(
		'default'           => 'Roboto',
		'sanitize_callback' => 'cosmic_blog_sanitize_google_fonts',
	)
);

$wp_customize->add_control(
	'cosmic_blog_header_font',
	array(
		'label'    => esc_html__( 'Header Font Family', 'cosmic-blog' ),
		'section'  => 'cosmic_blog_typography',
		'settings' => 'cosmic_blog_header_font',
		'type'     => 'select',
		'choices'  => cosmic_blog_get_all_google_font_families(),
	)
);

// Typography - Body Font.
$wp_customize->add_setting(
	'cosmic_blog_body_font',
	array(
		'default'           => 'Roboto',
		'sanitize_callback' => 'cosmic_blog_sanitize_google_fonts',
	)
);

$wp_customize->add_control(
	'cosmic_blog_body_font',
	array(
		'label'    => esc_html__( 'Body Font Family', 'cosmic-blog' ),
		'section'  => 'cosmic_blog_typography',
		'settings' => 'cosmic_blog_body_font',
		'type'     => 'select',
		'choices'  => cosmic_blog_get_all_google_font_families(),
	)
);
