<?php

$travel_destination_custom_css = "";

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

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

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

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

		$travel_destination_single_page_content_alignment = get_theme_mod('travel_destination_single_page_content_alignment', 'left');
		if ($travel_destination_single_page_content_alignment == 'left') {
			$travel_destination_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{';
			$travel_destination_custom_css .= 'text-align: left !important;;justify-content: left;';
			$travel_destination_custom_css .= '}';
		} else if ($travel_destination_single_page_content_alignment == 'center') {
			$travel_destination_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{';
			$travel_destination_custom_css .= 'text-align: center !important;;justify-content: center;';
			$travel_destination_custom_css .= '}';
		} else if ($travel_destination_single_page_content_alignment == 'right') {
			$travel_destination_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{';
			$travel_destination_custom_css .= 'text-align: right !important;;justify-content: right;';
			$travel_destination_custom_css .= '}';
		}

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

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

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

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

	$travel_destination_global_color = get_theme_mod('travel_destination_global_color', '#4263C9'); // Add a fallback if the color isn't set

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

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

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

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

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

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

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

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

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

	// FOOTER

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

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

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

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

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

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

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

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

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

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