<?php

$training_institute_academy_custom_css = "";

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

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

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

	$training_institute_academy_single_page_content_alignment = get_theme_mod('training_institute_academy_single_page_content_alignment', 'left');
	if ($training_institute_academy_single_page_content_alignment == 'left') {
	    $training_institute_academy_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{';
	    $training_institute_academy_custom_css .= 'text-align: left !important;';
	    $training_institute_academy_custom_css .= '}';
	} else if ($training_institute_academy_single_page_content_alignment == 'center') {
	    $training_institute_academy_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{';
	    $training_institute_academy_custom_css .= 'text-align: center !important;';
	    $training_institute_academy_custom_css .= '}';
	} else if ($training_institute_academy_single_page_content_alignment == 'right') {
	    $training_institute_academy_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{';
	    $training_institute_academy_custom_css .= 'text-align: right !important;';
	    $training_institute_academy_custom_css .= '}';
	}

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

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

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

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

	$training_institute_academy_sticky_sidebar = get_theme_mod('training_institute_academy_sticky_sidebar',true);
    if($training_institute_academy_sticky_sidebar != true){
        $training_institute_academy_custom_css .='.widget-area-wrapper{';
            $training_institute_academy_custom_css .='position: relative !important;';
        $training_institute_academy_custom_css .='}';
    }

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

	$training_institute_academy_global_color = get_theme_mod('training_institute_academy_global_color', '#93BD4F'); // Add a fallback if the color isn't set

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

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

    $training_institute_academy_global_second_color = get_theme_mod('training_institute_academy_global_second_color');

    if($training_institute_academy_global_second_color != false){
        $training_institute_academy_custom_css .='.contact-box, .slider-box:before{';
            $training_institute_academy_custom_css .='background-color: '.esc_attr($training_institute_academy_global_second_color).';';
        $training_institute_academy_custom_css .='}';
    }


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

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

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

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

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

	if ($training_institute_academy_heading_typography_font) {
		$training_institute_academy_custom_css .= ':root {';
		$training_institute_academy_custom_css .= '--font-head: ' . esc_attr($training_institute_academy_heading_typography_font) . ';';
		$training_institute_academy_custom_css .= '}';
	}

	$training_institute_academy_columns = get_theme_mod('training_institute_academy_posts_per_columns', 3);
	$training_institute_academy_columns = absint($training_institute_academy_columns);
	if ( $training_institute_academy_columns < 1 || $training_institute_academy_columns > 6 ) {
		$training_institute_academy_columns = 3;
	}
	$training_institute_academy_custom_css .= "
		.site-content .article-wraper-archive {
			grid-template-columns: repeat({$training_institute_academy_columns}, 1fr);
		}
	";

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

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

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

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

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

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

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

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

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

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

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