<?php

$aerial_drone_custom_css = "";

	$aerial_drone_theme_pagination_options_alignment = get_theme_mod('aerial_drone_theme_pagination_options_alignment', 'Center');
	if ($aerial_drone_theme_pagination_options_alignment == 'Center') {
		$aerial_drone_custom_css .= '.navigation.pagination,.navigation.posts-navigation .nav-links{';
		$aerial_drone_custom_css .= 'justify-content: center;margin: 0 auto;';
		$aerial_drone_custom_css .= '}';
	} else if ($aerial_drone_theme_pagination_options_alignment == 'Right') {
		$aerial_drone_custom_css .= '.navigation.pagination,.navigation.posts-navigation .nav-links{';
		$aerial_drone_custom_css .= 'justify-content: right;margin: 0 0 0 auto;';
		$aerial_drone_custom_css .= '}';
	} else if ($aerial_drone_theme_pagination_options_alignment == 'Left') {
		$aerial_drone_custom_css .= '.navigation.pagination,.navigation.posts-navigation .nav-links{';
		$aerial_drone_custom_css .= 'justify-content: left;margin: 0 auto 0 0;';
		$aerial_drone_custom_css .= '}';
	}

	$aerial_drone_theme_breadcrumb_enable = get_theme_mod('aerial_drone_theme_breadcrumb_enable',true);
    if($aerial_drone_theme_breadcrumb_enable != true){
        $aerial_drone_custom_css .='nav.breadcrumb-trail.breadcrumbs,nav.woocommerce-breadcrumb{';
            $aerial_drone_custom_css .='display: none;';
        $aerial_drone_custom_css .='}';
    }

	$aerial_drone_theme_breadcrumb_options_alignment = get_theme_mod('aerial_drone_theme_breadcrumb_options_alignment', 'Left');
	if ($aerial_drone_theme_breadcrumb_options_alignment == 'Center') {
	    $aerial_drone_custom_css .= '.breadcrumbs ul,nav.woocommerce-breadcrumb{';
	    $aerial_drone_custom_css .= 'text-align: center !important;';
	    $aerial_drone_custom_css .= '}';
	} else if ($aerial_drone_theme_breadcrumb_options_alignment == 'Right') {
	    $aerial_drone_custom_css .= '.breadcrumbs ul,nav.woocommerce-breadcrumb{';
	    $aerial_drone_custom_css .= 'text-align: Right !important;';
	    $aerial_drone_custom_css .= '}';
	} else if ($aerial_drone_theme_breadcrumb_options_alignment == 'Left') {
	    $aerial_drone_custom_css .= '.breadcrumbs ul,nav.woocommerce-breadcrumb{';
	    $aerial_drone_custom_css .= 'text-align: Left !important;';
	    $aerial_drone_custom_css .= '}';
	}

	$aerial_drone_single_page_content_alignment = get_theme_mod('aerial_drone_single_page_content_alignment', 'left');
	if ($aerial_drone_single_page_content_alignment == 'left') {
	    $aerial_drone_custom_css .= '#single-page .type-page,section.theme-custom-block.theme-error-sectiontheme-error-section.error-block-middle,section.theme-custom-block.theme-error-section.error-block-heading .theme-area-header{';
	    $aerial_drone_custom_css .= 'text-align: left !important;';
	    $aerial_drone_custom_css .= '}';
	} else if ($aerial_drone_single_page_content_alignment == 'center') {
	    $aerial_drone_custom_css .= '#single-page .type-page,section.theme-custom-block.theme-error-sectiontheme-error-section.error-block-middle,section.theme-custom-block.theme-error-section.error-block-heading .theme-area-header{';
	    $aerial_drone_custom_css .= 'text-align: center !important;';
	    $aerial_drone_custom_css .= '}';
	} else if ($aerial_drone_single_page_content_alignment == 'right') {
	    $aerial_drone_custom_css .= '#single-page .type-page,section.theme-custom-block.theme-error-sectiontheme-error-section.error-block-middle,section.theme-custom-block.theme-error-section.error-block-heading .theme-area-header{';
	    $aerial_drone_custom_css .= 'text-align: right !important;';
	    $aerial_drone_custom_css .= '}';
	}

	$aerial_drone_single_post_content_alignment = get_theme_mod('aerial_drone_single_post_content_alignment', 'left');
	if ($aerial_drone_single_post_content_alignment == 'left') {
	    $aerial_drone_custom_css .= '#single-page .type-post,#single-page .type-post .entry-meta,#single-page .type-post .is-layout-flex{';
	    $aerial_drone_custom_css .= 'text-align: left !important;justify-content: left;';
	    $aerial_drone_custom_css .= '}';
	} else if ($aerial_drone_single_post_content_alignment == 'center') {
	    $aerial_drone_custom_css .= '#single-page .type-post,#single-page .type-post .entry-meta,#single-page .type-post .is-layout-flex{';
	    $aerial_drone_custom_css .= 'text-align: center !important;justify-content: center;';
	    $aerial_drone_custom_css .= '}';
	} else if ($aerial_drone_single_post_content_alignment == 'right') {
	    $aerial_drone_custom_css .= '#single-page .type-post,#single-page .type-post .entry-meta,#single-page .type-post .is-layout-flex{';
	    $aerial_drone_custom_css .= 'text-align: right !important;justify-content: right;';
	    $aerial_drone_custom_css .= '}';
	}

	$aerial_drone_footer_widget_title_alignment = get_theme_mod('aerial_drone_footer_widget_title_alignment', 'left');
	if ($aerial_drone_footer_widget_title_alignment == 'left') {
	    $aerial_drone_custom_css .= 'h2.widget-title{';
	    $aerial_drone_custom_css .= 'text-align: left !important;';
	    $aerial_drone_custom_css .= '}';
	} else if ($aerial_drone_footer_widget_title_alignment == 'center') {
	    $aerial_drone_custom_css .= 'h2.widget-title{';
	    $aerial_drone_custom_css .= 'text-align: center !important;';
	    $aerial_drone_custom_css .= '}';
	} else if ($aerial_drone_footer_widget_title_alignment == 'right') {
	    $aerial_drone_custom_css .= 'h2.widget-title{';
	    $aerial_drone_custom_css .= 'text-align: right !important;';
	    $aerial_drone_custom_css .= '}';
	}

	$aerial_drone_menu_text_transform = get_theme_mod('aerial_drone_menu_text_transform', 'capitalize'); 
	if ($aerial_drone_menu_text_transform == 'capitalize') {
	$aerial_drone_custom_css .= '.site-navigation .primary-menu > li a{';
	$aerial_drone_custom_css .= 'text-transform: capitalize !important;';
	$aerial_drone_custom_css .= '}'; 
	} 
	else if ($aerial_drone_menu_text_transform == 'uppercase') {
	$aerial_drone_custom_css .= '.site-navigation .primary-menu > li a{';
	$aerial_drone_custom_css .= 'text-transform: uppercase !important;';
	$aerial_drone_custom_css .= '}'; 
	} 
	else if ($aerial_drone_menu_text_transform == 'lowercase') {
	$aerial_drone_custom_css .= '.site-navigation .primary-menu > li a{';
	$aerial_drone_custom_css .= 'text-transform: lowercase !important;';
	$aerial_drone_custom_css .= '}'; 
	}

	$aerial_drone_show_hide_related_product = get_theme_mod('aerial_drone_show_hide_related_product',true);
    if($aerial_drone_show_hide_related_product != true){
        $aerial_drone_custom_css .='.related.products{';
            $aerial_drone_custom_css .='display: none;';
        $aerial_drone_custom_css .='}';
    }

	/*-------------------- Global First Color -------------------*/

	$aerial_drone_global_color = get_theme_mod('aerial_drone_global_color', '#005CB5'); // Add a fallback if the color isn't set

	if ($aerial_drone_global_color) {
		$aerial_drone_custom_css .= ':root {';
		$aerial_drone_custom_css .= '--global-color: ' . esc_attr($aerial_drone_global_color) . ';';
		$aerial_drone_custom_css .= '}';
	}	

	/*-------------------- Global Second Color -------------------*/

	$aerial_drone_second_color = get_theme_mod('aerial_drone_second_color', '#FF3726'); // Add a fallback if the color isn't set

	if ($aerial_drone_second_color) {
		$aerial_drone_custom_css .= ':root {';
		$aerial_drone_custom_css .= '--second-color: ' . esc_attr($aerial_drone_second_color) . ';';
		$aerial_drone_custom_css .= '}';
	}	


	/*-------------------- Content Font -------------------*/

	$aerial_drone_content_typography_font = get_theme_mod('aerial_drone_content_typography_font', 'WorkSans'); // Add a fallback if the color isn't set

	if ($aerial_drone_content_typography_font) {
		$aerial_drone_custom_css .= ':root {';
		$aerial_drone_custom_css .= '--font-main: ' . esc_attr($aerial_drone_content_typography_font) . ';';
		$aerial_drone_custom_css .= '}';
	}

	/*-------------------- Heading Font -------------------*/

	$aerial_drone_heading_typography_font = get_theme_mod('aerial_drone_heading_typography_font', 'WorkSans'); // Add a fallback if the color isn't set

	if ($aerial_drone_heading_typography_font) {
		$aerial_drone_custom_css .= ':root {';
		$aerial_drone_custom_css .= '--font-head: ' . esc_attr($aerial_drone_heading_typography_font) . ';';
		$aerial_drone_custom_css .= '}';
	}
	
	$aerial_drone_columns = get_theme_mod('aerial_drone_posts_per_columns', 3);
	$aerial_drone_columns = absint($aerial_drone_columns);
	if ( $aerial_drone_columns < 1 || $aerial_drone_columns > 6 ) {
		$aerial_drone_columns = 3;
	}
	$aerial_drone_custom_css .= "
		.site-content .article-wraper-archive {
			grid-template-columns: repeat({$aerial_drone_columns}, 1fr);
		}
	";

	// FOOTER

	$aerial_drone_footer_widget_background_color = get_theme_mod('aerial_drone_footer_widget_background_color');
	if ($aerial_drone_footer_widget_background_color) {

		$aerial_drone_custom_css .= "
			.footer-widgetarea {
				background-color: ". esc_attr($aerial_drone_footer_widget_background_color) .";
			}
		";
	}

	$aerial_drone_footer_widget_background_image = get_theme_mod('aerial_drone_footer_widget_background_image');
	if ($aerial_drone_footer_widget_background_image) {
		$aerial_drone_custom_css .= "
			.footer-widgetarea {
				background-image: url(" . esc_url($aerial_drone_footer_widget_background_image) . ");
			}
		";
	}

	$aerial_drone_copyright_font_size = get_theme_mod('aerial_drone_copyright_font_size');
	if ($aerial_drone_copyright_font_size) {

		$aerial_drone_custom_css .= "
			.footer-copyright {
				font-size: ". esc_attr($aerial_drone_copyright_font_size) ."px;
			}
		";
	}

	$aerial_drone_copyright_alignment = get_theme_mod( 'aerial_drone_copyright_alignment', 'Default' );
	if ( $aerial_drone_copyright_alignment === 'Reverse' ) {
		$aerial_drone_custom_css .= '.site-info .column-row { flex-direction: row-reverse; }';
		$aerial_drone_custom_css .= '.footer-credits { justify-content: flex-end; }';
		$aerial_drone_custom_css .= '.footer-copyright { text-align: right; }';
		$aerial_drone_custom_css .= '.site-info .column.column-3 { text-align: left; }';
	} elseif ( $aerial_drone_copyright_alignment === 'Center' ) {
		$aerial_drone_custom_css .= '.site-info .column-row { flex-direction: column; align-items: center; gap: 15px; }';
		$aerial_drone_custom_css .= '.footer-credits { justify-content: center; }';
		$aerial_drone_custom_css .= '.footer-copyright { text-align: center; }';
		$aerial_drone_custom_css .= '.site-info .column.column-3 { text-align: center; }';
	}

	/*-------------------- Menu Color CSS -------------------*/

	$aerial_drone_header_menus_color = get_theme_mod('aerial_drone_header_menus_color');
	if($aerial_drone_header_menus_color != false){
		$aerial_drone_custom_css .='.site-navigation .primary-menu a{';
			$aerial_drone_custom_css .='color: '.esc_attr($aerial_drone_header_menus_color).'!important;';
		$aerial_drone_custom_css .='}';
	}

	$aerial_drone_header_menus_hover_color = get_theme_mod('aerial_drone_header_menus_hover_color');
	if($aerial_drone_header_menus_hover_color != false){
		$aerial_drone_custom_css .='.site-navigation .primary-menu a:hover{';
			$aerial_drone_custom_css .='color: '.esc_attr($aerial_drone_header_menus_hover_color).'!important;';
		$aerial_drone_custom_css .='}';
	}

	$aerial_drone_header_submenus_color = get_theme_mod('aerial_drone_header_submenus_color');
	if($aerial_drone_header_submenus_color != false){
		$aerial_drone_custom_css .='.site-navigation .primary-menu ul.sub-menu li a,.site-navigation .primary-menu li ul li a{';
			$aerial_drone_custom_css .='color: '.esc_attr($aerial_drone_header_submenus_color).'!important;';
		$aerial_drone_custom_css .='}';
	}

	$aerial_drone_header_submenus_hover_color = get_theme_mod('aerial_drone_header_submenus_hover_color');
	if($aerial_drone_header_submenus_hover_color != false){
		$aerial_drone_custom_css .='.site-navigation .primary-menu > li ul.sub-menu a:hover,.site-navigation .primary-menu li ul li a:hover{';
			$aerial_drone_custom_css .='color: '.esc_attr($aerial_drone_header_submenus_hover_color).'!important;';
		$aerial_drone_custom_css .='}';
	}