<?php

$event_decorations_custom_css = "";

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

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

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

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

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

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

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

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

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

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

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

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

	$event_decorations_content_typography_font = get_theme_mod('event_decorations_content_typography_font', 'Be Vietnam Pro'); // Add a fallback if the color isn't set

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

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

	$event_decorations_heading_typography_font = get_theme_mod('event_decorations_heading_typography_font', 'Be Vietnam Pro'); // Add a fallback if the color isn't set

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

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

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

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

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

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

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

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

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

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

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

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