<?php

function aurora_lite_enqueue_google_fonts() {
    $fonts = [];
    $fonts[] = get_theme_mod('aurora_lite_fonts_h1_font_family');
    $fonts[] = get_theme_mod('aurora_lite_fonts_h2_font_family');
    $fonts[] = get_theme_mod('aurora_lite_fonts_h3_font_family');
    $fonts[] = get_theme_mod('aurora_lite_fonts_h4_font_family');
    $fonts[] = get_theme_mod('aurora_lite_fonts_h5_font_family');
    $fonts[] = get_theme_mod('aurora_lite_fonts_h6_font_family');
    $fonts[] = get_theme_mod('aurora_lite_fonts_body_font_family');
    $fonts[] = get_theme_mod('aurora_lite_fonts_buttons_font_family');
    $fonts[] = get_theme_mod('aurora_lite_fonts_menu_font_family');

    $fonts = array_filter(array_unique($fonts));

    if (empty($fonts)) {
        return;
    }

    $alias_map = ['normal' => '400', 'bold' => '700'];

    $raw_weights = array_filter([
        get_theme_mod('aurora_lite_fonts_body_font_weight'),
        get_theme_mod('aurora_lite_fonts_h1_font_weight'),
        get_theme_mod('aurora_lite_fonts_h2_font_weight'),
        get_theme_mod('aurora_lite_fonts_h3_font_weight'),
        get_theme_mod('aurora_lite_fonts_h4_font_weight'),
        get_theme_mod('aurora_lite_fonts_h5_font_weight'),
        get_theme_mod('aurora_lite_fonts_h6_font_weight'),
        get_theme_mod('aurora_lite_fonts_buttons_font_weight'),
        get_theme_mod('aurora_lite_fonts_menu_font_weight'),
    ]);

    if (empty($raw_weights)) {
        $raw_weights = ['400', '600'];
    }

    $weights = array_unique(array_map(function($w) use ($alias_map) {
        $w = strtolower(trim($w));
        return $alias_map[$w] ?? $w;
    }, $raw_weights));

    sort($weights);
    $weight_string = 'wght@' . implode(';', $weights);
    $base_url = 'https://fonts.googleapis.com/css2?';
    $query_params = [];

    foreach ($fonts as $font) {
        $query_params[] = 'family=' . urlencode($font) . ':' . $weight_string;
    }

    $query_params[] = 'display=swap';
    $google_fonts_url = $base_url . implode('&', $query_params);

    wp_enqueue_style('aurora-lite-google-fonts', $google_fonts_url, [], null);
}
add_action('wp_enqueue_scripts', 'aurora_lite_enqueue_google_fonts');


function aurora_lite_dynamic_css() {
    
    $heading_color = get_theme_mod('aurora_lite_heading_color', '#006370');
    $body_text_color = get_theme_mod('aurora_lite_body_text_color', '#111111');
    $button_text_color = get_theme_mod('aurora_lite_button_text_color', '#f7f4e8');
    $button_text_hover_color = get_theme_mod('aurora_lite_button_text_hover_color', '#541600');
    $button_background_color = get_theme_mod('aurora_lite_button_background_color', '#d38600');
    $button_background_hover_color = get_theme_mod('aurora_lite_button_background_hover_color', '#fcf4e0');
    $link_color = get_theme_mod('aurora_lite_link_color', '#006be5');
    $link_hover_color = get_theme_mod('aurora_lite_link_hover_color', '#003e75');
    $topbar_background_color = get_theme_mod('aurora_lite_topbar_background_color', '#002930');
    $header_background_color = get_theme_mod('aurora_lite_header_background_color', '#004354');
    $header_icon_color = get_theme_mod('aurora_lite_header_icon_color');
    $menu_text_color = get_theme_mod('aurora_lite_menu_text_color', '#edede1');
    $menu_text_hover_color = get_theme_mod('aurora_lite_menu_text_hover_color', '#5bdeff');
    $menu_text_active_color = get_theme_mod('aurora_lite_menu_text_active_color');
    $sidebar_background_color = get_theme_mod('aurora_lite_sidebar_background_color');
    $footer_background_color = get_theme_mod('aurora_lite_footer_background_color', '#111111');
    $footer_text_color = get_theme_mod('aurora_lite_footer_text_color', '#d3d2c9');
    $footer_link_color = get_theme_mod('aurora_lite_footer_link_color', '#f2b100');
    $site_background_color = get_theme_mod('aurora_lite_site_background_color', '#ffffff');

    $body_font_family = get_theme_mod('aurora_lite_fonts_body_font_family') ?: 'Roboto';
    $body_font_size_desktop = get_theme_mod('aurora_lite_fonts_body_font_size_desktop') ?: '17px';
    $body_font_size_tablet = get_theme_mod('aurora_lite_fonts_body_font_size_tablet') ?: '16px';
    $body_font_size_mobile = get_theme_mod('aurora_lite_fonts_body_font_size_mobile') ?: '16px';
    $body_line_height_desktop = get_theme_mod('aurora_lite_fonts_body_line_height_desktop') ?: '1.6';
    $body_line_height_tablet = get_theme_mod('aurora_lite_fonts_body_line_height_tablet') ?: '1.5';
    $body_line_height_mobile = get_theme_mod('aurora_lite_fonts_body_line_height_mobile') ?: '1.4';
    $body_letter_spacing_desktop = get_theme_mod('aurora_lite_fonts_body_letter_spacing_desktop') ?: '0';
    $body_letter_spacing_tablet = get_theme_mod('aurora_lite_fonts_body_letter_spacing_tablet') ?: '0';
    $body_letter_spacing_mobile = get_theme_mod('aurora_lite_fonts_body_letter_spacing_mobile') ?: '0';
    $body_word_spacing_desktop = get_theme_mod('aurora_lite_fonts_body_word_spacing_desktop') ?: '0';
    $body_word_spacing_tablet = get_theme_mod('aurora_lite_fonts_body_word_spacing_tablet') ?: '0';
    $body_word_spacing_mobile = get_theme_mod('aurora_lite_fonts_body_word_spacing_mobile') ?: '0';
    $body_text_transform = get_theme_mod('aurora_lite_fonts_body_text_transform', 'none');
    $body_font_weight = get_theme_mod('aurora_lite_fonts_body_font_weight', '400');
    $body_font_style = get_theme_mod('aurora_lite_fonts_body_font_style', 'normal');
    $body_text_decoration = get_theme_mod('aurora_lite_fonts_body_text_decoration', 'none');

    $previous_font_family = $body_font_family;

    for ($i = 1; $i <= 6; $i++) {

        ${"h{$i}_font_family"} = get_theme_mod("aurora_lite_fonts_h{$i}_font_family");

        if (!${"h{$i}_font_family"} || ${"h{$i}_font_family"} === 'Default') {
            ${"h{$i}_font_family"} = $previous_font_family;
        }

        $previous_font_family = ${"h{$i}_font_family"};
    }

    $h1_font_size_desktop = get_theme_mod('aurora_lite_fonts_h1_font_size_desktop') ?: '45px';
    $h1_font_size_tablet = get_theme_mod('aurora_lite_fonts_h1_font_size_tablet') ?: '36px';
    $h1_font_size_mobile = get_theme_mod('aurora_lite_fonts_h1_font_size_mobile') ?: '30px';
    $h1_line_height_desktop = get_theme_mod('aurora_lite_fonts_h1_line_height_desktop') ?: '1.2';
    $h1_line_height_tablet = get_theme_mod('aurora_lite_fonts_h1_line_height_tablet') ?: '1.2';
    $h1_line_height_mobile = get_theme_mod('aurora_lite_fonts_h1_line_height_mobile') ?: '1.2';
    $h1_letter_spacing_desktop = get_theme_mod('aurora_lite_fonts_h1_letter_spacing_desktop', '0');
    $h1_letter_spacing_tablet = get_theme_mod('aurora_lite_fonts_h1_letter_spacing_tablet', '0');
    $h1_letter_spacing_mobile = get_theme_mod('aurora_lite_fonts_h1_letter_spacing_mobile', '0');
    $h1_word_spacing_desktop = get_theme_mod('aurora_lite_fonts_h1_word_spacing_desktop', '0');
    $h1_word_spacing_tablet = get_theme_mod('aurora_lite_fonts_h1_word_spacing_tablet', '0');
    $h1_word_spacing_mobile = get_theme_mod('aurora_lite_fonts_h1_word_spacing_mobile', '0');
    $h1_text_transform = get_theme_mod('aurora_lite_fonts_h1_text_transform', 'none');
    $h1_font_weight = get_theme_mod('aurora_lite_fonts_h1_font_weight', '600');
    $h1_font_style = get_theme_mod('aurora_lite_fonts_h1_font_style', 'normal');
    $h1_text_decoration = get_theme_mod('aurora_lite_fonts_h1_text_decoration', 'none');

    $h2_font_size_desktop = get_theme_mod('aurora_lite_fonts_h2_font_size_desktop') ?: '38px';
    $h2_font_size_tablet = get_theme_mod('aurora_lite_fonts_h2_font_size_tablet') ?: '30px';
    $h2_font_size_mobile = get_theme_mod('aurora_lite_fonts_h2_font_size_mobile') ?: '28px';
    $h2_line_height_desktop = get_theme_mod('aurora_lite_fonts_h2_line_height_desktop') ?: '1.3';
    $h2_line_height_tablet = get_theme_mod('aurora_lite_fonts_h2_line_height_tablet') ?: '1.3';
    $h2_line_height_mobile = get_theme_mod('aurora_lite_fonts_h2_line_height_mobile') ?: '1.3';
    $h2_letter_spacing_desktop = get_theme_mod('aurora_lite_fonts_h2_letter_spacing_desktop') ?: '0';
    $h2_letter_spacing_tablet = get_theme_mod('aurora_lite_fonts_h2_letter_spacing_tablet') ?: '0';
    $h2_letter_spacing_mobile = get_theme_mod('aurora_lite_fonts_h2_letter_spacing_mobile') ?: '0';
    $h2_word_spacing_desktop = get_theme_mod('aurora_lite_fonts_h2_word_spacing_desktop') ?: '0';
    $h2_word_spacing_tablet = get_theme_mod('aurora_lite_fonts_h2_word_spacing_tablet') ?: '0';
    $h2_word_spacing_mobile = get_theme_mod('aurora_lite_fonts_h2_word_spacing_mobile') ?: '0';
    $h2_text_transform = get_theme_mod('aurora_lite_fonts_h2_text_transform', 'none');
    $h2_font_weight = get_theme_mod('aurora_lite_fonts_h2_font_weight', '600');
    $h2_font_style = get_theme_mod('aurora_lite_fonts_h2_font_style', 'normal');
    $h2_text_decoration = get_theme_mod('aurora_lite_fonts_h2_text_decoration', 'none');

    $h3_font_size_desktop = get_theme_mod('aurora_lite_fonts_h3_font_size_desktop') ?: '30px';
    $h3_font_size_tablet = get_theme_mod('aurora_lite_fonts_h3_font_size_tablet') ?: '24px';
    $h3_font_size_mobile = get_theme_mod('aurora_lite_fonts_h3_font_size_mobile') ?: '22px';
    $h3_line_height_desktop = get_theme_mod('aurora_lite_fonts_h3_line_height_desktop') ?: '1.3';
    $h3_line_height_tablet = get_theme_mod('aurora_lite_fonts_h3_line_height_tablet') ?: '1.3';
    $h3_line_height_mobile = get_theme_mod('aurora_lite_fonts_h3_line_height_mobile') ?: '1.3';
    $h3_letter_spacing_desktop = get_theme_mod('aurora_lite_fonts_h3_letter_spacing_desktop') ?: '0';
    $h3_letter_spacing_tablet = get_theme_mod('aurora_lite_fonts_h3_letter_spacing_tablet') ?: '0';
    $h3_letter_spacing_mobile = get_theme_mod('aurora_lite_fonts_h3_letter_spacing_mobile') ?: '0';
    $h3_word_spacing_desktop = get_theme_mod('aurora_lite_fonts_h3_word_spacing_desktop') ?: '0';
    $h3_word_spacing_tablet = get_theme_mod('aurora_lite_fonts_h3_word_spacing_tablet') ?: '0';
    $h3_word_spacing_mobile = get_theme_mod('aurora_lite_fonts_h3_word_spacing_mobile') ?: '0';
    $h3_text_transform = get_theme_mod('aurora_lite_fonts_h3_text_transform', 'none');
    $h3_font_weight = get_theme_mod('aurora_lite_fonts_h3_font_weight', '600');
    $h3_font_style = get_theme_mod('aurora_lite_fonts_h3_font_style', 'normal');
    $h3_text_decoration = get_theme_mod('aurora_lite_fonts_h3_text_decoration', 'none');

    $h4_font_size_desktop = get_theme_mod('aurora_lite_fonts_h4_font_size_desktop') ?: '24px';
    $h4_font_size_tablet = get_theme_mod('aurora_lite_fonts_h4_font_size_tablet') ?: '22px';
    $h4_font_size_mobile = get_theme_mod('aurora_lite_fonts_h4_font_size_mobile') ?: '20px';
    $h4_line_height_desktop = get_theme_mod('aurora_lite_fonts_h4_line_height_desktop') ?: '1.3';
    $h4_line_height_tablet = get_theme_mod('aurora_lite_fonts_h4_line_height_tablet') ?: '1.3';
    $h4_line_height_mobile = get_theme_mod('aurora_lite_fonts_h4_line_height_mobile') ?: '1.3';
    $h4_letter_spacing_desktop = get_theme_mod('aurora_lite_fonts_h4_letter_spacing_desktop') ?: '0';
    $h4_letter_spacing_tablet = get_theme_mod('aurora_lite_fonts_h4_letter_spacing_tablet') ?: '0';
    $h4_letter_spacing_mobile = get_theme_mod('aurora_lite_fonts_h4_letter_spacing_mobile') ?: '0';
    $h4_word_spacing_desktop = get_theme_mod('aurora_lite_fonts_h4_word_spacing_desktop') ?: '0';
    $h4_word_spacing_tablet = get_theme_mod('aurora_lite_fonts_h4_word_spacing_tablet') ?: '0';
    $h4_word_spacing_mobile = get_theme_mod('aurora_lite_fonts_h4_word_spacing_mobile') ?: '0';
    $h4_text_transform = get_theme_mod('aurora_lite_fonts_h4_text_transform', 'none');
    $h4_font_weight = get_theme_mod('aurora_lite_fonts_h4_font_weight', '600');
    $h4_font_style = get_theme_mod('aurora_lite_fonts_h4_font_style', 'normal');
    $h4_text_decoration = get_theme_mod('aurora_lite_fonts_h4_text_decoration', 'none');

    $h5_font_size_desktop = get_theme_mod('aurora_lite_fonts_h5_font_size_desktop') ?: '20px';
    $h5_font_size_tablet = get_theme_mod('aurora_lite_fonts_h5_font_size_tablet') ?: '19px';
    $h5_font_size_mobile = get_theme_mod('aurora_lite_fonts_h5_font_size_mobile') ?: '18px';
    $h5_line_height_desktop = get_theme_mod('aurora_lite_fonts_h5_line_height_desktop') ?: '1.3';
    $h5_line_height_tablet = get_theme_mod('aurora_lite_fonts_h5_line_height_tablet') ?: '1.3';
    $h5_line_height_mobile = get_theme_mod('aurora_lite_fonts_h5_line_height_mobile') ?: '1.3';
    $h5_letter_spacing_desktop = get_theme_mod('aurora_lite_fonts_h5_letter_spacing_desktop') ?: '0';
    $h5_letter_spacing_tablet = get_theme_mod('aurora_lite_fonts_h5_letter_spacing_tablet') ?: '0';
    $h5_letter_spacing_mobile = get_theme_mod('aurora_lite_fonts_h5_letter_spacing_mobile') ?: '0';
    $h5_word_spacing_desktop = get_theme_mod('aurora_lite_fonts_h5_word_spacing_desktop') ?: '0';
    $h5_word_spacing_tablet = get_theme_mod('aurora_lite_fonts_h5_word_spacing_tablet') ?: '0';
    $h5_word_spacing_mobile = get_theme_mod('aurora_lite_fonts_h5_word_spacing_mobile') ?: '0';
    $h5_text_transform = get_theme_mod('aurora_lite_fonts_h5_text_transform', 'none');
    $h5_font_weight = get_theme_mod('aurora_lite_fonts_h5_font_weight', '600');
    $h5_font_style = get_theme_mod('aurora_lite_fonts_h5_font_style', 'normal');
    $h5_text_decoration = get_theme_mod('aurora_lite_fonts_h5_text_decoration', 'none');

    $h6_font_size_desktop = get_theme_mod('aurora_lite_fonts_h6_font_size_desktop') ?: '18px';
    $h6_font_size_tablet = get_theme_mod('aurora_lite_fonts_h6_font_size_tablet') ?: '17px';
    $h6_font_size_mobile = get_theme_mod('aurora_lite_fonts_h6_font_size_mobile') ?: '16px';
    $h6_line_height_desktop = get_theme_mod('aurora_lite_fonts_h6_line_height_desktop') ?: '1.3';
    $h6_line_height_tablet = get_theme_mod('aurora_lite_fonts_h6_line_height_tablet') ?: '1.3';
    $h6_line_height_mobile = get_theme_mod('aurora_lite_fonts_h6_line_height_mobile') ?: '1.3';
    $h6_letter_spacing_desktop = get_theme_mod('aurora_lite_fonts_h6_letter_spacing_desktop') ?: '0';
    $h6_letter_spacing_tablet = get_theme_mod('aurora_lite_fonts_h6_letter_spacing_tablet') ?: '0';
    $h6_letter_spacing_mobile = get_theme_mod('aurora_lite_fonts_h6_letter_spacing_mobile') ?: '0';
    $h6_word_spacing_desktop = get_theme_mod('aurora_lite_fonts_h6_word_spacing_desktop') ?: '0';
    $h6_word_spacing_tablet = get_theme_mod('aurora_lite_fonts_h6_word_spacing_tablet') ?: '0';
    $h6_word_spacing_mobile = get_theme_mod('aurora_lite_fonts_h6_word_spacing_mobile') ?: '0';
    $h6_text_transform = get_theme_mod('aurora_lite_fonts_h6_text_transform', 'none');
    $h6_font_weight = get_theme_mod('aurora_lite_fonts_h6_font_weight', '600');
    $h6_font_style = get_theme_mod('aurora_lite_fonts_h6_font_style', 'normal');
    $h6_text_decoration = get_theme_mod('aurora_lite_fonts_h6_text_decoration', 'none');

    $buttons_font_family = get_theme_mod('aurora_lite_fonts_buttons_font_family');
    $buttons_font_size_desktop = get_theme_mod('aurora_lite_fonts_buttons_font_size_desktop') ?: '16px';
    $buttons_font_size_tablet = get_theme_mod('aurora_lite_fonts_buttons_font_size_tablet') ?: '16px';
    $buttons_font_size_mobile = get_theme_mod('aurora_lite_fonts_buttons_font_size_mobile') ?: '15px';
    $buttons_line_height_desktop = get_theme_mod('aurora_lite_fonts_buttons_line_height_desktop') ?: '1';
    $buttons_line_height_tablet = get_theme_mod('aurora_lite_fonts_buttons_line_height_tablet') ?: '1';
    $buttons_line_height_mobile = get_theme_mod('aurora_lite_fonts_buttons_line_height_mobile') ?: '1';
    $buttons_letter_spacing_desktop = get_theme_mod('aurora_lite_fonts_buttons_letter_spacing_desktop') ?: '0';
    $buttons_letter_spacing_tablet = get_theme_mod('aurora_lite_fonts_buttons_letter_spacing_tablet') ?: '0';
    $buttons_letter_spacing_mobile = get_theme_mod('aurora_lite_fonts_buttons_letter_spacing_mobile') ?: '0';
    $buttons_word_spacing_desktop = get_theme_mod('aurora_lite_fonts_buttons_word_spacing_desktop') ?: '0';
    $buttons_word_spacing_tablet = get_theme_mod('aurora_lite_fonts_buttons_word_spacing_tablet') ?: '0';
    $buttons_word_spacing_mobile = get_theme_mod('aurora_lite_fonts_buttons_word_spacing_mobile') ?: '0';
    $buttons_text_transform = get_theme_mod('aurora_lite_fonts_buttons_text_transform', 'none');
    $buttons_font_weight = get_theme_mod('aurora_lite_fonts_buttons_font_weight', '500');
    $buttons_font_style = get_theme_mod('aurora_lite_fonts_buttons_font_style', 'normal');
    $buttons_text_decoration = get_theme_mod('aurora_lite_fonts_buttons_text_decoration', 'none');

    $menu_font_family = get_theme_mod('aurora_lite_fonts_menu_font_family');
    $menu_font_size_desktop = get_theme_mod('aurora_lite_fonts_menu_font_size_desktop') ?: '16px';
    $menu_font_size_tablet = get_theme_mod('aurora_lite_fonts_menu_font_size_tablet') ?: '16px';
    $menu_font_size_mobile = get_theme_mod('aurora_lite_fonts_menu_font_size_mobile') ?: '15px';
    $menu_line_height_desktop = get_theme_mod('aurora_lite_fonts_menu_line_height_desktop') ?: '1';
    $menu_line_height_tablet = get_theme_mod('aurora_lite_fonts_menu_line_height_tablet') ?: '1';
    $menu_line_height_mobile = get_theme_mod('aurora_lite_fonts_menu_line_height_mobile') ?: '1';
    $menu_letter_spacing_desktop = get_theme_mod('aurora_lite_fonts_menu_letter_spacing_desktop') ?: '0';
    $menu_letter_spacing_tablet = get_theme_mod('aurora_lite_fonts_menu_letter_spacing_tablet') ?: '0';
    $menu_letter_spacing_mobile = get_theme_mod('aurora_lite_fonts_menu_letter_spacing_mobile') ?: '0';
    $menu_word_spacing_desktop = get_theme_mod('aurora_lite_fonts_menu_word_spacing_desktop') ?: '0';
    $menu_word_spacing_tablet = get_theme_mod('aurora_lite_fonts_menu_word_spacing_tablet') ?: '0';
    $menu_word_spacing_mobile = get_theme_mod('aurora_lite_fonts_menu_word_spacing_mobile') ?: '0';
    $menu_text_transform = get_theme_mod('aurora_lite_fonts_menu_text_transform', 'none');
    $menu_font_weight = get_theme_mod('aurora_lite_fonts_menu_font_weight', 'normal');
    $menu_font_style = get_theme_mod('aurora_lite_fonts_menu_font_style', 'normal');
    $menu_text_decoration = get_theme_mod('aurora_lite_fonts_menu_text_decoration', 'none');


    $site_width_setting = get_theme_mod('aurora_lite_site_width');
    
    if (empty($site_width_setting) || !is_numeric($site_width_setting)) {
        $site_width = 1300;

    } else {        
        $site_width = absint($site_width_setting);
        
        if ($site_width < 600) {
            $site_width = 600;
        } elseif ($site_width > 1920) {
            $site_width = 1920;
        }
    }
    
    $header_width_desktop = get_theme_mod('aurora_lite_logo_width_desktop') ?: 80;
    $header_width_tablet  = get_theme_mod('aurora_lite_logo_width_tablet')  ?: 70;
    $header_width_mobile  = get_theme_mod('aurora_lite_logo_width_mobile')  ?: 60;

    $footer_width_desktop = get_theme_mod('aurora_lite_footer_logo_width_desktop') ?: 150;
    $footer_width_tablet  = get_theme_mod('aurora_lite_footer_logo_width_tablet')  ?: 150;
    $footer_width_mobile  = get_theme_mod('aurora_lite_footer_logo_width_mobile')  ?: 150;

    $custom_css = "
        :root {
            --heading-color: $heading_color;
            --body-text-color: $body_text_color;
            --button-text-color: $button_text_color;
            --button-text-hover-color: $button_text_hover_color;
            --button-background-color: $button_background_color;
            --button-background-hover-color: $button_background_hover_color;
            --link-color: $link_color;
            --link-hover-color: $link_hover_color;            
            --topbar-background-color: $topbar_background_color;
            --header-background-color: $header_background_color;
            --header-icon-color: $header_icon_color;
            --menu-text-color: $menu_text_color;
            --menu-text-hover-color: $menu_text_hover_color;
            --menu-text-active-color: $menu_text_active_color;
            --sidebar-background-color: $sidebar_background_color;
            --footer-background-color: $footer_background_color;
            --footer-text-color: $footer_text_color;
            --footer-link-color: $footer_link_color;
            --site-background-color: $site_background_color;

            --body-font-family: $body_font_family;
            --body-font-size-desktop: $body_font_size_desktop;
            --body-font-size-tablet: $body_font_size_tablet;
            --body-font-size-mobile: $body_font_size_mobile;
            --body-line-height-desktop: $body_line_height_desktop;
            --body-line-height-tablet: $body_line_height_tablet;
            --body-line-height-mobile: $body_line_height_mobile;
            --body-letter-spacing-desktop: $body_letter_spacing_desktop;
            --body-letter-spacing-tablet: $body_letter_spacing_tablet;
            --body-letter-spacing-mobile: $body_letter_spacing_mobile;
            --body-word-spacing-desktop: $body_word_spacing_desktop;
            --body-word-spacing-tablet: $body_word_spacing_tablet;
            --body-word-spacing-mobile: $body_word_spacing_mobile;
            --body-font-weight: $body_font_weight;
            --body-text-transform: $body_text_transform;
            --body-font-style: $body_font_style;
            --body-text-decoration: $body_text_decoration;

            --h1-font-family: $h1_font_family;
            --h1-font-size-desktop: $h1_font_size_desktop;
            --h1-font-size-tablet: $h1_font_size_tablet;
            --h1-font-size-mobile: $h1_font_size_mobile;
            --h1-line-height-desktop: $h1_line_height_desktop;
            --h1-line-height-tablet: $h1_line_height_tablet;
            --h1-line-height-mobile: $h1_line_height_mobile;
            --h1-letter-spacing-desktop: $h1_letter_spacing_desktop;
            --h1-letter-spacing-tablet: $h1_letter_spacing_tablet;
            --h1-letter-spacing-mobile: $h1_letter_spacing_mobile;
            --h1-word-spacing-desktop: $h1_word_spacing_desktop;
            --h1-word-spacing-tablet: $h1_word_spacing_tablet;
            --h1-word-spacing-mobile: $h1_word_spacing_mobile;
            --h1-font-weight: $h1_font_weight;
            --h1-text-transform: $h1_text_transform;
            --h1-font-style: $h1_font_style;
            --h1-text-decoration: $h1_text_decoration;

            --h2-font-family: $h2_font_family;
            --h2-font-size-desktop: $h2_font_size_desktop;
            --h2-font-size-tablet: $h2_font_size_tablet;
            --h2-font-size-mobile: $h2_font_size_mobile;
            --h2-line-height-desktop: $h2_line_height_desktop;
            --h2-line-height-tablet: $h2_line_height_tablet;
            --h2-line-height-mobile: $h2_line_height_mobile;
            --h2-letter-spacing-desktop: $h2_letter_spacing_desktop;
            --h2-letter-spacing-tablet: $h2_letter_spacing_tablet;
            --h2-letter-spacing-mobile: $h2_letter_spacing_mobile;
            --h2-word-spacing-desktop: $h2_word_spacing_desktop;
            --h2-word-spacing-tablet: $h2_word_spacing_tablet;
            --h2-word-spacing-mobile: $h2_word_spacing_mobile;
            --h2-font-weight: $h2_font_weight;
            --h2-text-transform: $h2_text_transform;
            --h2-font-style: $h2_font_style;
            --h2-text-decoration: $h2_text_decoration;

            --h3-font-family: $h3_font_family;
            --h3-font-size-desktop: $h3_font_size_desktop;
            --h3-font-size-tablet: $h3_font_size_tablet;
            --h3-font-size-mobile: $h3_font_size_mobile;
            --h3-line-height-desktop: $h3_line_height_desktop;
            --h3-line-height-tablet: $h3_line_height_tablet;
            --h3-line-height-mobile: $h3_line_height_mobile;
            --h3-letter-spacing-desktop: $h3_letter_spacing_desktop;
            --h3-letter-spacing-tablet: $h3_letter_spacing_tablet;
            --h3-letter-spacing-mobile: $h3_letter_spacing_mobile;
            --h3-word-spacing-desktop: $h3_word_spacing_desktop;
            --h3-word-spacing-tablet: $h3_word_spacing_tablet;
            --h3-word-spacing-mobile: $h3_word_spacing_mobile;
            --h3-font-weight: $h3_font_weight;
            --h3-text-transform: $h3_text_transform;
            --h3-font-style: $h3_font_style;
            --h3-text-decoration: $h3_text_decoration;

            --h4-font-family: $h4_font_family;
            --h4-font-size-desktop: $h4_font_size_desktop;
            --h4-font-size-tablet: $h4_font_size_tablet;
            --h4-font-size-mobile: $h4_font_size_mobile;
            --h4-line-height-desktop: $h4_line_height_desktop;
            --h4-line-height-tablet: $h4_line_height_tablet;
            --h4-line-height-mobile: $h4_line_height_mobile;
            --h4-letter-spacing-desktop: $h4_letter_spacing_desktop;
            --h4-letter-spacing-tablet: $h4_letter_spacing_tablet;
            --h4-letter-spacing-mobile: $h4_letter_spacing_mobile;
            --h4-word-spacing-desktop: $h4_word_spacing_desktop;
            --h4-word-spacing-tablet: $h4_word_spacing_tablet;
            --h4-word-spacing-mobile: $h4_word_spacing_mobile;
            --h4-font-weight: $h4_font_weight;
            --h4-text-transform: $h4_text_transform;
            --h4-font-style: $h4_font_style;
            --h4-text-decoration: $h4_text_decoration;

            --h5-font-family: $h5_font_family;
            --h5-font-size-desktop: $h5_font_size_desktop;
            --h5-font-size-tablet: $h5_font_size_tablet;
            --h5-font-size-mobile: $h5_font_size_mobile;
            --h5-line-height-desktop: $h5_line_height_desktop;
            --h5-line-height-tablet: $h5_line_height_tablet;
            --h5-line-height-mobile: $h5_line_height_mobile;
            --h5-letter-spacing-desktop: $h5_letter_spacing_desktop;
            --h5-letter-spacing-tablet: $h5_letter_spacing_tablet;
            --h5-letter-spacing-mobile: $h5_letter_spacing_mobile;
            --h5-word-spacing-desktop: $h5_word_spacing_desktop;
            --h5-word-spacing-tablet: $h5_word_spacing_tablet;
            --h5-word-spacing-mobile: $h5_word_spacing_mobile;
            --h5-font-weight: $h5_font_weight;
            --h5-text-transform: $h5_text_transform;
            --h5-font-style: $h5_font_style;
            --h5-text-decoration: $h5_text_decoration;

            --h6-font-family: $h6_font_family;
            --h6-font-size-desktop: $h6_font_size_desktop;
            --h6-font-size-tablet: $h6_font_size_tablet;
            --h6-font-size-mobile: $h6_font_size_mobile;
            --h6-line-height-desktop: $h6_line_height_desktop;
            --h6-line-height-tablet: $h6_line_height_tablet;
            --h6-line-height-mobile: $h6_line_height_mobile;
            --h6-letter-spacing-desktop: $h6_letter_spacing_desktop;
            --h6-letter-spacing-tablet: $h6_letter_spacing_tablet;
            --h6-letter-spacing-mobile: $h6_letter_spacing_mobile;
            --h6-word-spacing-desktop: $h6_word_spacing_desktop;
            --h6-word-spacing-tablet: $h6_word_spacing_tablet;
            --h6-word-spacing-mobile: $h6_word_spacing_mobile;
            --h6-font-weight: $h6_font_weight;
            --h6-text-transform: $h6_text_transform;
            --h6-font-style: $h6_font_style;
            --h6-text-decoration: $h6_text_decoration;

            --button-font-family: $buttons_font_family;
            --button-font-size-desktop: $buttons_font_size_desktop;
            --button-font-size-tablet: $buttons_font_size_tablet;
            --button-font-size-mobile: $buttons_font_size_mobile;
            --button-line-height-desktop: $buttons_line_height_desktop;
            --button-line-height-tablet: $buttons_line_height_tablet;
            --button-line-height-mobile: $buttons_line_height_mobile;
            --button-letter-spacing-desktop: $buttons_letter_spacing_desktop;
            --button-letter-spacing-tablet: $buttons_letter_spacing_tablet;
            --button-letter-spacing-mobile: $buttons_letter_spacing_mobile;
            --button-word-spacing-desktop: $buttons_word_spacing_desktop;
            --button-word-spacing-tablet: $buttons_word_spacing_tablet;
            --button-word-spacing-mobile: $buttons_word_spacing_mobile;
            --button-font-weight: $buttons_font_weight;
            --button-text-transform: $buttons_text_transform;
            --button-font-style: $buttons_font_style;
            --button-text-decoration: $buttons_text_decoration;

            --menu-font-family: $menu_font_family;
            --menu-font-size-desktop: $menu_font_size_desktop;
            --menu-font-size-tablet: $menu_font_size_tablet;
            --menu-font-size-mobile: $menu_font_size_mobile;
            --menu-line-height-desktop: $menu_line_height_desktop;
            --menu-line-height-tablet: $menu_line_height_tablet;
            --menu-line-height-mobile: $menu_line_height_mobile;
            --menu-letter-spacing-desktop: $menu_letter_spacing_desktop;
            --menu-letter-spacing-tablet: $menu_letter_spacing_tablet;
            --menu-letter-spacing-mobile: $menu_letter_spacing_mobile;
            --menu-word-spacing-desktop: $menu_word_spacing_desktop;
            --menu-word-spacing-tablet: $menu_word_spacing_tablet;
            --menu-word-spacing-mobile: $menu_word_spacing_mobile;
            --menu-font-weight: $menu_font_weight;
            --menu-text-transform: $menu_text_transform;
            --menu-font-style: $menu_font_style;
            --menu-text-decoration: $menu_text_decoration;

            --site-width: {$site_width}px;
            
            --header-logo-width-desktop: {$header_width_desktop}px;
            --header-logo-width-tablet: {$header_width_tablet}px;
            --header-logo-width-mobile: {$header_width_mobile}px;
            --footer-logo-width-desktop: {$footer_width_desktop}px;
            --footer-logo-width-tablet: {$footer_width_tablet}px;
            --footer-logo-width-mobile: {$footer_width_mobile}px;
        }

        body {
            background-color: var(--site-background-color);
        }

        .site-logo {
            width: var(--header-logo-width-desktop);
            height: auto;
        }

        @media (max-width: 768px) {
            .site-logo {
                width: var(--header-logo-width-tablet);
            }
        }

        @media (max-width: 480px) {
            .site-logo {
                width: var(--header-logo-width-mobile);
            }
        }

        footer .site-logo, .footer-logo {
            width: var(--footer-logo-width-desktop);
            height: auto;
        }

        @media (max-width: 768px) {
            footer .site-logo, .footer-logo {
                width: var(--footer-logo-width-tablet);
            }
        }

        @media (max-width: 480px) {
            footer .site-logo, .footer-logo {
                width: var(--footer-logo-width-mobile);
            }
        }
    ";

    wp_add_inline_style('aurora-lite-style', $custom_css);
}
add_action('wp_enqueue_scripts', 'aurora_lite_dynamic_css');