<?php

$ott_vlogger_custom_css = "";

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

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

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

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

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

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

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

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

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

	$ott_vlogger_global_color = get_theme_mod('ott_vlogger_global_color', '#6A4EE9'); // Add a fallback if the color isn't set

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

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

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

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

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

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

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

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

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

	// FOOTER

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

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

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

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

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

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

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

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

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

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