<?php

$architect_contractor_custom_css = "";

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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