<?php

$multi_sports_club_custom_css = "";

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

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

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

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

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

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

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

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

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

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

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

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

	$multi_sports_club_content_typography_font = get_theme_mod('multi_sports_club_content_typography_font', 'IBM Plex Sans", sans-serif'); // Add a fallback if the color isn't set

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

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

	$multi_sports_club_heading_typography_font = get_theme_mod('multi_sports_club_heading_typography_font', 'IBM Plex Sans", sans-serif'); // Add a fallback if the color isn't set

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

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

	// FOOTER

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

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

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

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

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

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

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

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

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

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