<?php

$education_reform_custom_css = "";

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

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

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

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

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

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

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

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

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

	$education_reform_global_color = get_theme_mod('education_reform_global_color', '#1a4d8c'); // Add a fallback if the color isn't set

	if ($education_reform_global_color) {
		$education_reform_custom_css .= ':root {';
		$education_reform_custom_css .= '--global-color: ' . esc_attr($education_reform_global_color) . ';';
		$education_reform_custom_css .= '}';
	}	
	
	/*-------------------- Content Font -------------------*/

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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