<?php
/** 
 * @package WordPress
 * @subpackage Campoal
 */

/**
 * Add custom typography css to enqueue style theme
 *
 * @since Campoal 1.9.9
 */
if( !function_exists('conikal_custom_typography_css') ): 
    function conikal_custom_typography_css() {
        global $campoal_options;
    
        /**
         * Custom typography css
         */
        $default_font = isset($campoal_options['conikal_default_font_field']) ? $campoal_options['conikal_default_font_field'] : 0;
        $theme_font_family 		= isset($campoal_options['conikal_theme_font_family_field']) && $campoal_options['conikal_theme_font_family_field'] != '' ? $campoal_options['conikal_theme_font_family_field'] : 'Sen';
        $default_font_family    = isset($campoal_options['conikal_default_font_family_field']) && $campoal_options['conikal_default_font_family_field'] != '' ? $campoal_options['conikal_default_font_family_field'] : 'Sen';
        if ($theme_font_family != 'system' && $theme_font_family != 'custom') {
            $default_font_family = $theme_font_family;
        } else if ($theme_font_family == 'system') {
            $default_font_family = 'Segoe UI';
        }

        $body_font_family    = isset($campoal_options['conikal_body_font_field']['font-family']) && $default_font == 0 ? $campoal_options['conikal_body_font_field']['font-family'] : $default_font_family;
        $body_font_weight    = isset($campoal_options['conikal_body_font_field']['font-weight']) ? $campoal_options['conikal_body_font_field']['font-weight'] : '400';
        $body_font_line      = isset($campoal_options['conikal_body_font_field']['line-height']) ? $campoal_options['conikal_body_font_field']['line-height'] : '24px';
        $body_font_size      = isset($campoal_options['conikal_body_font_field']['font-size']) ? $campoal_options['conikal_body_font_field']['font-size'] : '16px';
        $body_font_word      = isset($campoal_options['conikal_body_font_field']['word-spacing']) && !empty($campoal_options['conikal_body_font_field']['word-spacing']) ? $campoal_options['conikal_body_font_field']['word-spacing'] : 'inherit';
        $body_font_letter    = isset($campoal_options['conikal_body_font_field']['letter-spacing']) && !empty($campoal_options['conikal_body_font_field']['letter-spacing']) ? $campoal_options['conikal_body_font_field']['letter-spacing'] : '-0.2px';
        $body_font_transform = isset($campoal_options['conikal_body_font_field']['text-transform']) && !empty($campoal_options['conikal_body_font_field']['text-transform']) ? $campoal_options['conikal_body_font_field']['text-transform'] : 'inherit';

        $home_heading_font_family       = isset($campoal_options['conikal_home_heading_font_field']['font-family']) && $default_font == 0 ? $campoal_options['conikal_home_heading_font_field']['font-family'] : $default_font_family;
        $home_heading_font_weight       = isset($campoal_options['conikal_home_heading_font_field']['font-weight']) ? $campoal_options['conikal_home_heading_font_field']['font-weight'] : '700';
        $home_heading_font_line         = isset($campoal_options['conikal_home_heading_font_field']['line-height']) ? $campoal_options['conikal_home_heading_font_field']['line-height'] : '64px';
        $home_heading_font_size         = isset($campoal_options['conikal_home_heading_font_field']['font-size']) ? $campoal_options['conikal_home_heading_font_field']['font-size'] : '56px';
        $home_heading_font_word         = isset($campoal_options['conikal_home_heading_font_field']['word-spacing']) && !empty($campoal_options['conikal_home_heading_font_field']['word-spacing']) ? $campoal_options['conikal_home_heading_font_field']['word-spacing'] : 'inherit';
        $home_heading_font_letter       = isset($campoal_options['conikal_home_heading_font_field']['letter-spacing']) && !empty($campoal_options['conikal_home_heading_font_field']['letter-spacing']) ? $campoal_options['conikal_home_heading_font_field']['letter-spacing'] : '-2.6px';
        $home_heading_font_transform    = isset($campoal_options['conikal_home_heading_font_field']['text-transform']) && !empty($campoal_options['conikal_home_heading_font_field']['text-transform']) ? $campoal_options['conikal_home_heading_font_field']['text-transform'] : 'inherit';

        $home_subheading_font_family    = isset($campoal_options['conikal_home_subheading_font_field']['font-family']) && $default_font == 0 ? $campoal_options['conikal_home_subheading_font_field']['font-family'] : $default_font_family;
        $home_subheading_font_weight    = isset($campoal_options['conikal_home_subheading_font_field']['font-weight']) ? $campoal_options['conikal_home_subheading_font_field']['font-weight'] : '400';
        $home_subheading_font_line      = isset($campoal_options['conikal_home_subheading_font_field']['line-height']) ? $campoal_options['conikal_home_subheading_font_field']['line-height'] : '28px';
        $home_subheading_font_size      = isset($campoal_options['conikal_home_subheading_font_field']['font-size']) ? $campoal_options['conikal_home_subheading_font_field']['font-size'] : '24px';
        $home_subheading_font_word      = isset($campoal_options['conikal_home_subheading_font_field']['word-spacing']) && !empty($campoal_options['conikal_home_subheading_font_field']['word-spacing']) ? $campoal_options['conikal_home_subheading_font_field']['word-spacing'] : 'inherit';
        $home_subheading_font_letter    = isset($campoal_options['conikal_home_subheading_font_field']['letter-spacing']) && !empty($campoal_options['conikal_home_subheading_font_field']['letter-spacing']) ? $campoal_options['conikal_home_subheading_font_field']['letter-spacing'] : '-1px';
        $home_subheading_font_transform = isset($campoal_options['conikal_home_subheading_font_field']['text-transform']) && !empty($campoal_options['conikal_home_subheading_font_field']['text-transform']) ? $campoal_options['conikal_home_subheading_font_field']['text-transform'] : 'inherit';

        $heading_font_family            = isset($campoal_options['conikal_heading_font_field']['font-family']) && $default_font == 0 ? $campoal_options['conikal_heading_font_field']['font-family'] : $default_font_family;
        $heading_font_weight            = isset($campoal_options['conikal_heading_font_field']['font-weight']) ? $campoal_options['conikal_heading_font_field']['font-weight'] : '600';
        $heading_font_line              = isset($campoal_options['conikal_heading_font_field']['line-height']) ? $campoal_options['conikal_heading_font_field']['line-height'] : '28px';
        $heading_font_size              = isset($campoal_options['conikal_heading_font_field']['font-size']) ? $campoal_options['conikal_heading_font_field']['font-size'] : '24px';
        $heading_font_word              = isset($campoal_options['conikal_heading_font_field']['word-spacing']) && !empty($campoal_options['conikal_heading_font_field']['word-spacing']) ? $campoal_options['conikal_heading_font_field']['word-spacing'] : 'inherit';
        $heading_font_letter            = isset($campoal_options['conikal_heading_font_field']['letter-spacing']) && !empty($campoal_options['conikal_heading_font_field']['letter-spacing']) ? $campoal_options['conikal_heading_font_field']['letter-spacing'] : '-1px';
        $heading_font_transform         = isset($campoal_options['conikal_heading_font_field']['text-transform']) && !empty($campoal_options['conikal_heading_font_field']['text-transform']) ? $campoal_options['conikal_heading_font_field']['text-transform'] : 'inherit';

        $subheading_font_family         = isset($campoal_options['conikal_subheading_font_field']['font-family']) && $default_font == 0 ? $campoal_options['conikal_subheading_font_field']['font-family'] : $default_font_family;
        $subheading_font_weight         = isset($campoal_options['conikal_subheading_font_field']['font-weight']) ? $campoal_options['conikal_subheading_font_field']['font-weight'] : '400';
        $subheading_font_line           = isset($campoal_options['conikal_subheading_font_field']['line-height']) ? $campoal_options['conikal_subheading_font_field']['line-height'] : '18px';
        $subheading_font_size           = isset($campoal_options['conikal_subheading_font_field']['font-size']) ? $campoal_options['conikal_subheading_font_field']['font-size'] : '16px';
        $subheading_font_word           = isset($campoal_options['conikal_subheading_font_field']['word-spacing']) && !empty($campoal_options['conikal_subheading_font_field']['word-spacing']) ? $campoal_options['conikal_subheading_font_field']['word-spacing'] : 'inherit';
        $subheading_font_letter         = isset($campoal_options['conikal_subheading_font_field']['letter-spacing']) && !empty($campoal_options['conikal_subheading_font_field']['letter-spacing']) ? $campoal_options['conikal_subheading_font_field']['letter-spacing'] : '-0.2px';
        $subheading_font_transform      = isset($campoal_options['conikal_subheading_font_field']['text-transform']) && !empty($campoal_options['conikal_subheading_font_field']['text-transform']) ? $campoal_options['conikal_subheading_font_field']['text-transform'] : 'inherit';

        $page_heading_font_family       = isset($campoal_options['conikal_page_heading_font_field']['font-family']) && $default_font == 0 ? $campoal_options['conikal_page_heading_font_field']['font-family'] : $default_font_family;
        $page_heading_font_weight       = isset($campoal_options['conikal_page_heading_font_field']['font-weight']) ? $campoal_options['conikal_page_heading_font_field']['font-weight'] : '700';
        $page_heading_font_line         = isset($campoal_options['conikal_page_heading_font_field']['line-height']) ? $campoal_options['conikal_page_heading_font_field']['line-height'] : '48px';
        $page_heading_font_size         = isset($campoal_options['conikal_page_heading_font_field']['font-size']) ? $campoal_options['conikal_page_heading_font_field']['font-size'] : '42px';
        $page_heading_font_word         = isset($campoal_options['conikal_page_heading_font_field']['word-spacing']) && !empty($campoal_options['conikal_page_heading_font_field']['word-spacing']) ? $campoal_options['conikal_page_heading_font_field']['word-spacing'] : 'inherit';
        $page_heading_font_letter       = isset($campoal_options['conikal_page_heading_font_field']['letter-spacing']) && !empty($campoal_options['conikal_page_heading_font_field']['letter-spacing']) ? $campoal_options['conikal_page_heading_font_field']['letter-spacing'] : '-2px';
        $page_heading_font_transform    = isset($campoal_options['conikal_page_heading_font_field']['text-transform']) && !empty($campoal_options['conikal_page_heading_font_field']['text-transform']) ? $campoal_options['conikal_page_heading_font_field']['text-transform'] : 'inherit';

        $widget_title_font_family       = isset($campoal_options['conikal_widget_title_font_field']['font-family']) && $default_font == 0 ? $campoal_options['conikal_widget_title_font_field']['font-family'] : $default_font_family;
        $widget_title_font_weight       = isset($campoal_options['conikal_widget_title_font_field']['font-weight']) ? $campoal_options['conikal_widget_title_font_field']['font-weight'] : '700';
        $widget_title_font_line         = isset($campoal_options['conikal_widget_title_font_field']['line-height']) ? $campoal_options['conikal_widget_title_font_field']['line-height'] : '38px';
        $widget_title_font_size         = isset($campoal_options['conikal_widget_title_font_field']['font-size']) ? $campoal_options['conikal_widget_title_font_field']['font-size'] : '24px';
        $widget_title_font_word         = isset($campoal_options['conikal_widget_title_font_field']['word-spacing']) && !empty($campoal_options['conikal_widget_title_font_field']['word-spacing']) ? $campoal_options['conikal_widget_title_font_field']['word-spacing'] : 'inherit';
        $widget_title_font_letter       = isset($campoal_options['conikal_widget_title_font_field']['letter-spacing']) && !empty($campoal_options['conikal_widget_title_font_field']['letter-spacing']) ? $campoal_options['conikal_widget_title_font_field']['letter-spacing'] : '-0.8px';
        $widget_title_font_transform    = isset($campoal_options['conikal_widget_title_font_field']['text-transform']) && !empty($campoal_options['conikal_widget_title_font_field']['text-transform']) ? $campoal_options['conikal_widget_title_font_field']['text-transform'] : 'inherit';

        $title_font_family          = isset($campoal_options['conikal_title_font_field']['font-family']) && $default_font == 0 ? $campoal_options['conikal_title_font_field']['font-family'] : $default_font_family;
        $title_font_weight          = isset($campoal_options['conikal_title_font_field']['font-weight']) ? $campoal_options['conikal_title_font_field']['font-weight'] : '800';
        $title_font_line            = isset($campoal_options['conikal_title_font_field']['line-height']) ? $campoal_options['conikal_title_font_field']['line-height'] : '26px';
        $title_font_size            = isset($campoal_options['conikal_title_font_field']['font-size']) ? $campoal_options['conikal_title_font_field']['font-size'] : '20px';
        $title_font_word            = isset($campoal_options['conikal_title_font_field']['word-spacing']) && !empty($campoal_options['conikal_title_font_field']['word-spacing']) ? $campoal_options['conikal_title_font_field']['word-spacing'] : 'inherit';
        $title_font_letter          = isset($campoal_options['conikal_title_font_field']['letter-spacing']) && !empty($campoal_options['conikal_title_font_field']['letter-spacing']) ? $campoal_options['conikal_title_font_field']['letter-spacing'] : '-0.6px';
        $title_font_transform       = isset($campoal_options['conikal_title_font_field']['text-transform']) && !empty($campoal_options['conikal_title_font_field']['text-transform']) ? $campoal_options['conikal_title_font_field']['text-transform'] : 'inherit';

        $content_font_family        = isset($campoal_options['conikal_content_font_field']['font-family']) && $default_font == 0 ? $campoal_options['conikal_content_font_field']['font-family'] : $default_font_family;
        $content_font_weight        = isset($campoal_options['conikal_content_font_field']['font-weight']) ? $campoal_options['conikal_content_font_field']['font-weight'] : '400';
        $content_font_line          = isset($campoal_options['conikal_content_font_field']['line-height']) ? $campoal_options['conikal_content_font_field']['line-height'] : '32px';
        $content_font_size          = isset($campoal_options['conikal_content_font_field']['font-size']) ? $campoal_options['conikal_content_font_field']['font-size'] : '18px';
        $content_font_word          = isset($campoal_options['conikal_content_font_field']['word-spacing']) && !empty($campoal_options['conikal_content_font_field']['word-spacing']) ? $campoal_options['conikal_content_font_field']['word-spacing'] : 'inherit';
        $content_font_letter        = isset($campoal_options['conikal_content_font_field']['letter-spacing']) && !empty($campoal_options['conikal_content_font_field']['letter-spacing']) ? $campoal_options['conikal_content_font_field']['letter-spacing'] : '0';
        $content_font_transform     = isset($campoal_options['conikal_content_font_field']['text-transform']) && !empty($campoal_options['conikal_content_font_field']['text-transform']) ? $campoal_options['conikal_content_font_field']['text-transform'] : 'inherit';

        $letter_font_family         = isset($campoal_options['conikal_letter_font_field']['font-family']) && $default_font == 0 ? $campoal_options['conikal_letter_font_field']['font-family'] : $default_font_family;
        $letter_font_weight         = isset($campoal_options['conikal_letter_font_field']['font-weight']) ? $campoal_options['conikal_letter_font_field']['font-weight'] : '400';
        $letter_font_line           = isset($campoal_options['conikal_letter_font_field']['line-height']) ? $campoal_options['conikal_letter_font_field']['line-height'] : '24px';
        $letter_font_size           = isset($campoal_options['conikal_letter_font_field']['font-size']) ? $campoal_options['conikal_letter_font_field']['font-size'] : '14px';
        $letter_font_word           = isset($campoal_options['conikal_letter_font_field']['word-spacing']) && !empty($campoal_options['conikal_letter_font_field']['word-spacing']) ? $campoal_options['conikal_letter_font_field']['word-spacing'] : 'inherit';
        $letter_font_letter         = isset($campoal_options['conikal_letter_font_field']['letter-spacing']) && !empty($campoal_options['conikal_letter_font_field']['letter-spacing']) ? $campoal_options['conikal_letter_font_field']['letter-spacing'] : 'inherit';
        $letter_font_transform      = isset($campoal_options['conikal_letter_font_field']['text-transform']) && !empty($campoal_options['conikal_letter_font_field']['text-transform']) ? $campoal_options['conikal_letter_font_field']['text-transform'] : 'inherit';

        $button_font_family         = isset($campoal_options['conikal_button_font_field']['font-family']) && $default_font == 0 ? $campoal_options['conikal_button_font_field']['font-family'] : $default_font_family;
        $button_font_weight         = isset($campoal_options['conikal_button_font_field']['font-weight']) ? $campoal_options['conikal_button_font_field']['font-weight'] : '700';
        $button_font_line           = isset($campoal_options['conikal_button_font_field']['line-height']) ? $campoal_options['conikal_button_font_field']['line-height'] : '18px';
        $button_font_size           = isset($campoal_options['conikal_button_font_field']['font-size']) ? $campoal_options['conikal_button_font_field']['font-size'] : '16px';
        $button_font_word           = isset($campoal_options['conikal_button_font_field']['word-spacing']) && !empty($campoal_options['conikal_button_font_field']['word-spacing']) ? $campoal_options['conikal_button_font_field']['word-spacing'] : 'inherit';
        $button_font_letter         = isset($campoal_options['conikal_button_font_field']['letter-spacing']) && !empty($campoal_options['conikal_button_font_field']['letter-spacing']) ? $campoal_options['conikal_button_font_field']['letter-spacing'] : '-0.4px';
        $button_font_transform      = isset($campoal_options['conikal_button_font_field']['text-transform']) && !empty($campoal_options['conikal_button_font_field']['text-transform']) ? $campoal_options['conikal_button_font_field']['text-transform'] : 'inherit';

        $custom_style = '';

        if (is_admin() && $body_font_family != '' && !function_exists('conikal_register_petition_type')) :
            $custom_style .= '
            .editor-styles-wrapper *:not(pre, i) {
                font-family: "' . esc_attr($body_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important; }
            .editor-styles-wrapper {
                font-family: "' . esc_attr($body_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                font-weight: ' . esc_attr($body_font_weight) . ';
                line-height: ' . esc_attr($body_font_line) . ';
                font-size: ' . esc_attr($body_font_size) . ';
                word-spacing: ' . esc_attr($body_font_word) . ';
                letter-spacing: ' . esc_attr($body_font_letter) . ';
                text-transform: ' . esc_attr($body_font_transform) . '; }
            .editor-styles-wrapper > p, 
            .editor-styles-wrapper > p *,
            .editor-styles-wrapper ui li, 
            .editor-styles-wrapper ol li {
                font-family: "' . esc_attr($content_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                font-weight: ' . esc_attr($content_font_weight) . ' !important;
                line-height: ' . esc_attr($content_font_line) . ' !important;
                font-size: ' . esc_attr($content_font_size) . ' !important;
                word-spacing: ' . esc_attr($content_font_word) . ' !important;
                letter-spacing: ' . esc_attr($content_font_letter) . ' !important;
                text-transform: ' . esc_attr($content_font_transform) . ' !important; }';
        else :
        if ($body_font_family != '') {
            if (is_admin()) {
                $custom_style .= '
                    .wp-block {
                        max-width: 100%; }
                    .editor-styles-wrapper *:not(pre, i) {
                        font-family: "' . esc_attr($body_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important; }
                    .editor-styles-wrapper, 
                    .editor-styles-wrapper > p, 
                    .editor-styles-wrapper > p *, 
                    .editor-styles-wrapper ui li, 
                    .editor-styles-wrapper ol li,';
            } else {
                $custom_style .= '
                    body,
                    p:not(*),';
            }
            $custom_style .= '
                .widget_archive, 
                .widget_categories, 
                .widget_nav_menu, 
                .widget_rss, 
                .widget_pages, 
                .widget_meta, 
                .widget_recent_comments, 
                .widget_recent_entries, 
                .widget_recent_entries ul a, 
                .widget_nav_menu .menu-item, 
                .widget_pages .menu-item, 
                .widget_recent_comments ul span, 
                .widget_recent_comments ul a, 
                .woocommerce ul.product_list_widget li a
                .widget_text,
                .theme-twentytwenty 
                .wc-block-grid.has-4-columns:not(.alignwide):not(.alignfull) 
                .wc-block-grid__product,
                .wc-block-grid__product, 
                .wc-block-grid.has-4-columns:not(.alignwide):not(.alignfull) 
                .wc-block-grid__product, 
                .wc-block-grid.has-5-columns.alignfull 
                .wc-block-grid__product {
                    font-family: "' . esc_attr($body_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                    font-weight: ' . esc_attr($body_font_weight) . ';
                    line-height: ' . esc_attr($body_font_line) . ';
                    font-size: ' . esc_attr($body_font_size) . ';
                    word-spacing: ' . esc_attr($body_font_word) . ';
                    letter-spacing: ' . esc_attr($body_font_letter) . ';
                    text-transform: ' . esc_attr($body_font_transform) . '; }
                
                ul li,
                ol li,
                table, 
                label, 
                figcaption, 
                div.gutentor-text, 
                span.gutentor-text, 
                p.gutentor-text {
                    font-family: "' . esc_attr($body_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important; }

                .wp2fa-modal,
                .wp2fa-modal .modal__content, 
                .wp2fa-modal .modal__content p {
                    font-family: "' . esc_attr($body_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                    font-weight: ' . esc_attr($body_font_weight) . ' !important;
                    line-height: ' . esc_attr($body_font_line) . ' !important;
                    font-size: ' . esc_attr($body_font_size) . ' !important;
                    word-spacing: ' . esc_attr($body_font_word) . ';
                    letter-spacing: ' . esc_attr($body_font_letter) . ';
                    text-transform: ' . esc_attr($body_font_transform) . '; }

                input, 
                textarea, 
                select, 
                .ui.form input:not([type]), 
                .ui.form input[type=date], 
                .ui.form input[type=datetime-local], 
                .ui.form input[type=email], 
                .ui.form input[type=file], 
                .ui.form input[type=number], 
                .ui.form input[type=password], 
                .ui.form input[type=search], 
                .ui.form input[type=tel], 
                .ui.form input[type=text], 
                .ui.form input[type=time], 
                .ui.form input[type=url], 
                .ui.input>input {
                    font-family: "' . esc_attr($body_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                    word-spacing: ' . esc_attr($body_font_word) . ';
                    letter-spacing: ' . esc_attr($body_font_letter) . ';
                    text-transform: ' . esc_attr($body_font_transform) . '; }

                .woocommerce-breadcrumb,
                .ui.menu, 
                .ui.inline.dropdown>.text {
                    font-family: "' . esc_attr($body_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                    font-weight: ' . esc_attr($body_font_weight) . ';
                    word-spacing: ' . esc_attr($body_font_word) . ';
                    letter-spacing: ' . esc_attr($body_font_letter) . ';
                    text-transform: ' . esc_attr($body_font_transform) . '; }

                #leftside-menu, 
                #leftside-menu .item, 
                #leftside-menu .mobile-menu-item .item .title {
                    font-family: "' . esc_attr($body_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                    font-weight: ' . esc_attr($body_font_weight) . ' !important;
                    line-height: ' . esc_attr($body_font_line) . ' !important;
                    font-size: ' . esc_attr($body_font_size) . ' !important;
                    word-spacing: ' . esc_attr($body_font_word) . ';
                    letter-spacing: ' . esc_attr($body_font_letter) . ';
                    text-transform: ' . esc_attr($body_font_transform) . '; }

                .ui.segment, 
                .ui.segments .segment {
                    font-family: "' . esc_attr($body_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif;
                    line-height: ' . esc_attr($body_font_line) . ';
                    font-size: ' . esc_attr($body_font_size) . ';
                    word-spacing: ' . esc_attr($body_font_word) . ';
                    letter-spacing: ' . esc_attr($body_font_letter) . ';
                    text-transform: ' . esc_attr($body_font_transform) . '; }';
        }

        if ($home_heading_font_family != '') {
            $custom_style .= '
            .home-caption .home-title {
                font-family: "' . esc_attr($home_heading_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                font-weight: ' . esc_attr($home_heading_font_weight) . ' !important;
                line-height: ' . esc_attr($home_heading_font_line) . ' !important;
                font-size: ' . esc_attr($home_heading_font_size) . ' !important;
                word-spacing: ' . esc_attr($home_heading_font_word) . ';
                letter-spacing: ' . esc_attr($home_heading_font_letter) . ';
                text-transform: ' . esc_attr($home_heading_font_transform) . '; }';
        }

        if ($home_subheading_font_family != '') {
            $custom_style .= '
            .home-subtitle {
                font-family: "' . esc_attr($home_subheading_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                font-weight: ' . esc_attr($home_subheading_font_weight) . ' !important;
                line-height: ' . esc_attr($home_subheading_font_line) . ' !important;
                font-size: ' . esc_attr($home_subheading_font_size) . ' !important;
                word-spacing: ' . esc_attr($home_subheading_font_word) . ';
                letter-spacing: ' . esc_attr($home_subheading_font_letter) . ';
                text-transform: ' . esc_attr($home_subheading_font_transform ) . '; }';
        }

        if ($heading_font_family != '') {
            $custom_style .= '
            .ui.header:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6), 
            .ui.items>.item>.content>.header {
                font-family: "' . esc_attr($heading_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                font-weight: ' . esc_attr($heading_font_weight) . ';
                font-size: ' . esc_attr($heading_font_size) . '; 
                word-spacing: ' . esc_attr($heading_font_word) . ';
                letter-spacing: ' . esc_attr($heading_font_letter) . ';
                text-transform: ' . esc_attr($heading_font_transform) . '; }

            h1, h2, h3, h4, h5, h6, 
            h1.ui.header, 
            h2.ui.header, 
            h3.ui.header, 
            h4.ui.header, 
            h5.ui.header, 
            h6.ui.header, 
            .wp2fa-modal .modal__content label, 
            .ui.toast>.content>.header {
                font-family: "' . esc_attr($heading_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif;
                font-weight: ' . esc_attr($heading_font_weight) . '; 
                word-spacing: ' . esc_attr($heading_font_word) . ';
                letter-spacing: ' . esc_attr($heading_font_letter) . ';
                text-transform: ' . esc_attr($heading_font_transform) . '; }

            .ui.accordion .title:not(.ui), 
            .ui.accordion.menu .item .title, 
            .ui.modal>.header, 
            .ui.popup, .ui.popup .header, 
            .ui.steps .step .title, 
            .give-goal-progress .income, 
            .give-goal-progress .raised, 
            .not-found-title, 
            .ui.card>.content>.header, 
            .ui.cards>.card>.content>.header, 
            .ui.card>.content>.header:not(.ui), 
            .ui.cards>.card>.content>.header:not(.ui), 
            .ui.statistic>.value, 
            .ui.statistics .statistic>.value, 
            .ui.search>.results .result .title, 
            .ui.category.search>.results .category>.name, 
            .ui.list .list>.item .header, 
            .ui.list>.item .header, .ui.statistic>.label, 
            .ui.statistics .statistic>.label, 
            .ui.message .header {
                font-family: "' . esc_attr($heading_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif;
                font-weight: ' . esc_attr($heading_font_weight) . ';
                word-spacing: ' . esc_attr($heading_font_word) . ';
                letter-spacing: ' . esc_attr($heading_font_letter) . ';
                text-transform: ' . esc_attr($heading_font_transform) . '; }
                
            .sign-section-title .icon {
                font-size: ' . esc_attr($heading_font_size) . ' !important; }';
        }

        if ($subheading_font_family != '') {
            $custom_style .= '
            .ui.header:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(.tiny, .small, .large, .big, .massive) .content .sub.header, 
            h2.ui.header .content .sub.header, 
            h3.ui.header .content .sub.header, 
            .petition-content .meta {
                font-family: "' . esc_attr($subheading_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                font-size: ' . esc_attr($subheading_font_size) . ';
                line-height: ' . esc_attr($subheading_font_line) . ';
                font-weight: ' . esc_attr($subheading_font_weight) . ';
                word-spacing: ' . esc_attr($subheading_font_word) . ';
                letter-spacing: ' . esc_attr($subheading_font_letter) . ';
                text-transform: ' . esc_attr($subheading_font_transform) . '; }
            .ui.header .sub.header, 
            h1.ui.header .sub.header, 
            h4.ui.header .sub.header, 
            h5.ui.header .sub.header, 
            h6.ui.header .sub.header, blockquote > p, blockquote::before {
                font-family: "' . esc_attr($subheading_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                font-weight: ' . esc_attr($subheading_font_weight) . ';
                word-spacing: ' . esc_attr($subheading_font_word) . ';
                letter-spacing: ' . esc_attr($subheading_font_letter) . ';
                text-transform: ' . esc_attr($subheading_font_transform) . '; }
            
            @media only screen and (min-width: 992px) {
                .petition-title-block .petition-title .sub.header, 
                .victory-title .sub.header {
                    line-height: ' . esc_attr((int)$subheading_font_line + ((int)$subheading_font_line / 2)) . 'px !important; 
                    font-size: ' . esc_attr((int)$subheading_font_size + ((int)$subheading_font_size / 6)) . 'px !important;
                    word-spacing: ' . esc_attr($subheading_font_word) . ';
                    letter-spacing: ' . esc_attr($subheading_font_letter) . ';
                    text-transform: ' . esc_attr($subheading_font_transform) . '; }
            }';
        }

        if ($page_heading_font_family != '') {
            $custom_style .= '
            .petition-title .content h1.entry-title, 
            .update-title .content h1.entry-title, 
            .page-title, .shop-title, 
            .post-title, 
            .profile-title, 
            .post-center-title .post-single-title, 
            .post-simple-title h1 {
                font-family: "' . esc_attr($page_heading_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                font-weight: ' . esc_attr($page_heading_font_weight) . ' !important;
                line-height: ' . esc_attr($page_heading_font_line) . ';
                font-size: ' . esc_attr($page_heading_font_size) . ';
                word-spacing: ' . esc_attr($page_heading_font_word) . ';
                letter-spacing: ' . esc_attr($page_heading_font_letter) . ';
                text-transform: ' . esc_attr($page_heading_font_transform) . '; }';
        }

        if ($widget_title_font_family != '') {
            $custom_style .= '
            .widget-title,
            h3.widget-title {
                font-family: "' . esc_attr($widget_title_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                font-weight: ' . esc_attr($widget_title_font_weight) . ' !important;
                line-height: ' . esc_attr($widget_title_font_line) . ' !important;
                font-size: ' . esc_attr($widget_title_font_size) . ' !important;
                word-spacing: ' . esc_attr($widget_title_font_word) . ';
                letter-spacing: ' . esc_attr($widget_title_font_letter) . ';
                text-transform: ' . esc_attr($widget_title_font_transform) . '; }';
        }

        if ($title_font_family != '') {
            $custom_style .= '
            .list-petition-title,
            .edit-post-visual-editor .editor-block-list__block .wc-block-grid__product-title, .editor-styles-wrapper .wc-block-grid__product-title, .wc-block-grid__product-title {
                font-family: "' . esc_attr($title_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                font-weight: ' . esc_attr($title_font_weight) . ' !important;
                line-height: ' . esc_attr((int)$title_font_line + 2) . 'px !important;
                font-size: ' . esc_attr((int)$title_font_size + 2) . 'px !important;
                word-spacing: ' . esc_attr($title_font_word) . ';
                letter-spacing: ' . esc_attr($title_font_letter) . ';
                text-transform: ' . esc_attr($title_font_transform) . '; }
            .card-post-title, 
            .card-petition-title, 
            .card-product-title, 
            .card-post-title .ui.header {
                font-family: "' . esc_attr($title_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                font-weight: ' . esc_attr($title_font_weight) . ' !important;
                line-height: ' . esc_attr($title_font_line) . ' !important;
                font-size: ' . esc_attr($title_font_size) . ' !important;
                word-spacing: ' . esc_attr($title_font_word) . ';
                letter-spacing: ' . esc_attr($title_font_letter) . ';
                text-transform: ' . esc_attr($title_font_transform) . '; }
            .blog_featured .grid .card .card__title, 
            .blog-feature .feature-item > .ui.grid > .column > .feature-title > .ui.segment > h1.ui.header,  
            .list-post-title, .list-post-title .content {
                font-family: "' . esc_attr($title_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                font-weight: ' . esc_attr($title_font_weight) . ' !important;
                word-spacing: ' . esc_attr($title_font_word) . ';
                letter-spacing: ' . esc_attr($title_font_letter) . ';
                text-transform: ' . esc_attr($title_font_transform) . '; }
            .victory-title, .victory-update-title, .overlay-header .ui.header {
                font-family: "' . esc_attr($title_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                font-weight: ' . esc_attr($title_font_weight) . ' !important;
                word-spacing: ' . esc_attr($title_font_word) . ';
                letter-spacing: ' . esc_attr($title_font_letter) . ';
                text-transform: ' . esc_attr($title_font_transform) . '; }';
        }

        if ($content_font_family != '') {
            $custom_style .= '
            .entry-content:not(.ui, .wpas-btnwpas-btn), 
            .entry-content .wp-block-archives > .ui.dropdown .menu>.item, 
            .entry-content .wp-block-categories > .ui.dropdown .menu>.item, 
            .entry-content > p, 
            .entry-content > ui li, 
            .entry-content > ol li, 
            .entry-content > ol > li > p, 
            .entry-content > ul > li > p {
                font-family: "' . esc_attr($content_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                font-weight: ' . esc_attr($content_font_weight) . ' !important;
                line-height: ' . esc_attr($content_font_line) . ' !important;
                font-size: ' . esc_attr($content_font_size) . ' !important;
                word-spacing: ' . esc_attr($content_font_word) . ';
                letter-spacing: ' . esc_attr($content_font_letter) . ';
                text-transform: ' . esc_attr($content_font_transform) . '; }
            .entry-content strong {
                font-family: "' . esc_attr($content_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                font-weight: bold !important; }';
        }

        if ($letter_font_family != '') {
            $custom_style .= '
            .content-letter, 
            .content-letter p, 
            .letter-receiver {
                font-family: "' . esc_attr($letter_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                font-weight: ' . esc_attr($content_font_weight) . ' !important;
                line-height: ' . esc_attr($letter_font_line) . ' !important;
                font-size: ' . esc_attr($letter_font_size) . ' !important;
                word-spacing: ' . esc_attr($letter_font_word) . ';
                letter-spacing: ' . esc_attr($letter_font_letter) . ';
                text-transform: ' . esc_attr($letter_font_transform) . '; }';
        }

        if ($button_font_family != '') {
            $custom_style .= '
            button, 
            .ui.button, 
            .ui.label, 
            .vc_btn1, 
            .vc_btn2, 
            .vc_btn3, 
            .wpas-btn.wpas-btn-default,
            .woocommerce #respond input#submit, 
            .woocommerce a.button, 
            .woocommerce button.button, 
            .woocommerce input.button, 
            .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link, 
            input[type="submit"] {
                font-family: "' . esc_attr($button_font_family) . '", -apple-system, system-ui, BlinkMacSystemFont, Roboto, Helvetica Neue, Arial, sans-serif !important;
                font-weight: ' . esc_attr($button_font_weight) . ';
                word-spacing: ' . esc_attr($button_font_word) . ';
                letter-spacing: ' . esc_attr($button_font_letter) . ';
                text-transform: ' . esc_attr($button_font_transform) . '; }';
        }
        endif;

        return $custom_style;
    }
endif;

?>