<?php
/**
 * CSS related hooks.
 *
 * This file contains hook functions which are related to CSS.
 *
 * @package University_Hub
 */

if ( ! function_exists( 'university_hub_trigger_custom_css_action' ) ) :

	/**
	 * Do action theme custom CSS.
	 *
	 * @since 1.0.0
	 */
	function university_hub_trigger_custom_css_action() {

		/**
		 * Hook - university_hub_action_theme_custom_css.
		 */
		do_action( 'university_hub_action_theme_custom_css' );

	}

endif;

add_action( 'wp_head', 'university_hub_trigger_custom_css_action', 99 );

if ( ! function_exists( 'university_hub_add_theme_custom_font_css' ) ) :

	/**
	 * Inject theme custom font CSS.
	 *
	 * @since 1.0.0
	 */
	function university_hub_add_theme_custom_font_css() {

		$custom_css = '';

		$font_settings = university_hub_get_font_family_theme_settings_options();

		$required_fonts = array();

		if ( ! empty( $font_settings ) ) {
			foreach ( $font_settings as $key => $val ) {
				$option_value = university_hub_get_option( $key );
				if ( ! empty( $option_value ) && $val['default'] !== $option_value ) {
					$required_fonts[ $key ] = $option_value;
				}
			}
		}
		if ( empty( $required_fonts ) ) {
			// We do not need extra CSS.
			return;
		}

		foreach ( $required_fonts as $key => $font ) {

			$family = university_hub_get_font_family_from_key( $font );

			if ( ! empty( $family ) ) {

				switch ( $key ) {
					case 'font_site_default':
						$custom_css .= 'body{font-family:' . $family . '}' . "\n";
					break;

					case 'font_site_title':
						$custom_css .= '.site-title{font-family:' . $family . '}' . "\n";
					break;

					case 'font_site_tagline':
						$custom_css .= '.site-description{font-family:' . $family . '}' . "\n";
					break;

					case 'font_heading_tags':
						$custom_css .= 'h1,h2,h3,h4,h5,h6{font-family:' . $family . '}' . "\n";
					break;

					case 'font_content_title':
						$custom_css .= '.entry-header .entry-title{font-family:' . $family . '}' . "\n";
					break;

					case 'font_content_body':
						$custom_css .= '#content{font-family:' . $family . '}' . "\n";
					break;

					case 'font_navigation':
						$custom_css .= '#site-navigation ul li a{font-family:' . $family . '}' . "\n";
					break;

					default:
					break;
				}
			}
		}

		// Render style.
		if ( ! empty( $custom_css ) ) {
			echo '<style type="text/css">';
			echo $custom_css;
			echo '</style>';
		}

	}

endif;

add_action( 'university_hub_action_theme_custom_css', 'university_hub_add_theme_custom_font_css' );


if ( ! function_exists( 'university_hub_add_theme_custom_color_css' ) ) :

	/**
	 * Inject theme custom color CSS.
	 *
	 * @since 1.0.0
	 */
	function university_hub_add_theme_custom_color_css() {

		$custom_css = '';

		$color_settings = university_hub_get_color_theme_settings_options();

		$default = university_hub_get_default_colors();

		$required_colors = array();

		if ( ! empty( $color_settings ) ) {
		  foreach ($color_settings as $key => $val ) {
		    $option_value = university_hub_get_option( $key );
		    if ( ! empty( $option_value ) && $default[$key] != $option_value ) {
		      $required_colors[ $key ] = $option_value;
		    }
		  }
		}
		if ( empty( $required_colors ) ) {
		  // We do not need extra CSS.
		  return;
		}

		foreach ( $required_colors as $key => $color ) {

			switch ( $key ) {

				// Basic.
				case 'color_basic_text':
				  $custom_css .= 'body,#content p{color:' . $color . '}' . "\n";
				  break;
				case 'color_basic_link':
				  $custom_css .= 'a,a:visited{color:' . $color . '}' . "\n";
				  $custom_css .= '#mobile-trigger i,#mobile-trigger2 i{background-color:' . $color . '}' . "\n";
				   $custom_css .= '#front-page-home-sections .section-title, #university-hub-front-page-widgets .widget-title{border-color:' . $color . '}' . "\n";
				  break;
				case 'color_basic_link_hover':
				  $custom_css .= 'a:hover{color:' . $color . '}' . "\n";
				  break;
				case 'color_basic_heading':
				  $custom_css .= 'h1,h2,h3,h4,h5,h6{color:' . $color . '}' . "\n";
				  break;
				case 'color_basic_page_title':
				  $custom_css .= '.page-title,#custom-header .page-title{color:' . $color . '}' . "\n";
				  break;
				case 'color_basic_button_text':
				$custom_css .= '#infinite-handle span,.search-box > a,a.button,.search-form .search-submit,.nav-links a,a.cta-button-primary,button, input[type="button"], input[type="reset"], input[type="submit"],#infinite-handle span button, #infinite-handle span button{color:' . $color . '}' . "\n";
				$custom_css .= '.woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button{color:' . $color . '}' . "\n";
				 break;
				case 'color_basic_button_text_hover':
				  $custom_css .= '#infinite-handle span:hover.search-box > a:hover,a.button:hover,.search-form .search-submit:hover,a.cta-button-primary:hover,.nav-links a:hover,button:hover, input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover, #infinite-handle span button:hover{color:' . $color . '}' . "\n";
				  $custom_css .= '.woocommerce #respond input#submit.alt:hover,.woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover, .woocommerce #respond input#submit:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button.woocommerce:hover #respond input#submit.alt.disabled, .woocommerce #respond input#submit.alt.disabled:hover, .woocommerce #respond input#submit.alt:disabled, .woocommerce #respond input#submit.alt:disabled:hover, .woocommerce #respond input#submit.alt[disabled]:disabled, .woocommerce #respond input#submit.alt[disabled]:disabled:hover, .woocommerce a.button.alt.disabled, .woocommerce a.button.alt.disabled:hover, .woocommerce a.button.alt:disabled, .woocommerce a.button.alt:disabled:hover, .woocommerce a.button.alt[disabled]:disabled, .woocommerce a.button.alt[disabled]:disabled:hover, .woocommerce button.button.alt.disabled, .woocommerce button.button.alt.disabled:hover, .woocommerce button.button.alt:disabled, .woocommerce button.button.alt:disabled:hover, .woocommerce button.button.alt[disabled]:disabled, .woocommerce button.button.alt[disabled]:disabled:hover, .woocommerce input.button.alt.disabled, .woocommerce input.button.alt.disabled:hover, .woocommerce input.button.alt:disabled, .woocommerce input.button.alt:disabled:hover, .woocommerce input.button.alt[disabled]:disabled, .woocommerce input.button.alt[disabled]:disabled:hover, .woocommerce #respond input#submit:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover:hover{color:' . $color . '}' . "\n";
				  break;
				case 'color_basic_button_background':
				  $custom_css .= '#infinite-handle span,.search-box > a,a.button,a.links-btn::after,.search-form .search-submit,.woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button{background-color:' . $color . '}' . "\n";
				  $custom_css .= 'a.cta-button-primary,button, input[type="button"], input[type="reset"], input[type="submit"],#infinite-handle span button{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_basic_button_background_hover':
				  $custom_css .= '#infinite-handle span:hover,.search-box > a:hover,a.button:hover,a.links-btn:hover::after,.search-form .search-submit:hover,a.cta-button-primary:hover,.nav-links a:hover,button:hover, input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover,#infinite-handle span button{background-color:' . $color . '}' . "\n";
				  $custom_css .= '.woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover, .woocommerce #respond input#submit:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button.woocommerce:hover #respond input#submit.alt.disabled, .woocommerce #respond input#submit.alt.disabled:hover, .woocommerce #respond input#submit.alt:disabled, .woocommerce #respond input#submit.alt:disabled:hover, .woocommerce #respond input#submit.alt[disabled]:disabled, .woocommerce #respond input#submit.alt[disabled]:disabled:hover, .woocommerce a.button.alt.disabled, .woocommerce a.button.alt.disabled:hover, .woocommerce a.button.alt:disabled, .woocommerce a.button.alt:disabled:hover, .woocommerce a.button.alt[disabled]:disabled, .woocommerce a.button.alt[disabled]:disabled:hover, .woocommerce button.button.alt.disabled, .woocommerce button.button.alt.disabled:hover, .woocommerce button.button.alt:disabled, .woocommerce button.button.alt:disabled:hover, .woocommerce button.button.alt[disabled]:disabled, .woocommerce button.button.alt[disabled]:disabled:hover, .woocommerce input.button.alt.disabled, .woocommerce input.button.alt.disabled:hover, .woocommerce input.button.alt:disabled, .woocommerce input.button.alt:disabled:hover, .woocommerce input.button.alt[disabled]:disabled, .woocommerce input.button.alt[disabled]:disabled:hover, .woocommerce #respond input#submit:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover{background-color:' . $color . '}' . "\n";
				  break;

				 // Top Header.
				case 'color_top_header_background':
				  $custom_css .= '#tophead{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_top_header_news_title_background':
				  $custom_css .= '.top-news-title{background-color:' . $color . '}' . "\n";
				  $custom_css .= '.top-news-title::after{border-left-color:' . $color . '}' . "\n"; 
		        break;
				case 'color_top_header_news_title':
				  $custom_css .= '.top-news-title{color:' . $color . '}' . "\n";
		        break;
				case 'color_top_header_link':
				  $custom_css .= '#tophead a,#top-nav ul li a{color:' . $color . '}' . "\n";
				  break;
				case 'color_top_header_link_hover':
				  $custom_css .= '#tophead a:hover,#top-nav ul li a:hover{color:' . $color . '}' . "\n";
				  break;


				// Header.
				case 'color_header_background':
				  $custom_css .= '#masthead,.site-header.fixed #main-nav{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_header_title':
				  $custom_css .= '#site-identity .site-title > a{color:' . $color . '}' . "\n";
		          break;
				case 'color_header_title_hover':
				  $custom_css .= '#site-identity .site-title > a:hover{color:' . $color . '}' . "\n";
				  break;
				case 'color_header_tagline':
				  $custom_css .= '.site-description{color:' . $color . '}' . "\n";
				  break;
				case 'color_header_contact_icon':
				  $custom_css .= '#quick-contact li::before{color:' . $color . '}' . "\n";
		          break;
				case 'color_header_contact-title':
				  $custom_css .= '#quick-contact a, #quick-contact span{color:' . $color . '}' . "\n";
				  break;
				case 'color_header_contact-sub-title':
				  $custom_css .= '#quick-contact a.quick-email,#quick-contact .sub-address{color:' . $color . '}' . "\n";
				  break;


			   // Primary Menu.
				case 'color_primary_menu_backgorund':
				  $custom_css .= '#main-nav{background-color:' . $color . '}' . "\n";
				  break;

				case 'color_primary_menu_link':
				  $custom_css .= '#main-nav ul li a,.dropdown-toggle::after{color:' . $color . '}' . "\n";
				  break;

				case 'color_primary_menu_link_hover':
				  $custom_css .= '#main-nav ul li a:hover,#main-nav li.current-menu-item > a,
				  #main-nav li.current_page_item > a,#main-nav ul li:hover > a{color:' . $color . '}' . "\n";
				  break;

				case 'color_primary_menu_link_background_hover':
				    $custom_css .= '.main-navigation li a:hover, .main-navigation li.current-menu-item a, .main-navigation li.current_page_item a, .main-navigation li:hover > a,#main-nav ul ul{background-color:' . $color . '}' . "\n";
					break;
				case 'color_primary_submenu_link':
				  $custom_css .= '#main-nav ul ul li a{color:' . $color . '}' . "\n";
					break;

				case 'color_primary_submenu_link_hover':
				  $custom_css .= '#main-nav ul ul li a:hover,#main-nav ul ul li.current-menu-item > a,
				  #main-nav ul ul li.current_page_item > a{color:' . $color . '}' . "\n";
				 	break;

				// Slider.

				case 'color_slider_caption_title_background':
				  $custom_css .= '#main-slider h3{background-color:' . $color . '}' . "\n";
				  break;
				  case 'color_slider_caption_text_background':
				  $custom_css .= '#main-slider p{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_slider_caption_text':
				  $custom_css .= '#main-slider p{color:' . $color . '}' . "\n";
				  break;
				case 'color_slider_caption_link':
				  $custom_css .= '#main-slider h3 a{color:' . $color . '}' . "\n";
				  break;
				case 'color_slider_caption_link_hover':
				  $custom_css .= '#main-slider  h3 a:hover{color:' . $color . '}' . "\n";
				  break;
				case 'color_slider_icon':
				  $custom_css .= '#main-slider .cycle-prev, #main-slider .cycle-next{color:' . $color . '}' . "\n";
				  break;
				case 'color_slider_icon_hover':
				  $custom_css .= '#main-slider .cycle-prev:hover, #main-slider .cycle-next:hover{color:' . $color . '}' . "\n";
				  break;
				case 'color_slider_icon_background':
				  $custom_css .= '#main-slider .cycle-prev, #main-slider .cycle-next{background-color:' . $color . '}' . "\n";
				   $custom_css .= '#main-slider .cycle-prev, #main-slider .cycle-next{border-color:' . $color . '}' . "\n";
				  break;
				case 'color_slider_icon_background_hover':
				  $custom_css .= '#main-slider .cycle-prev:hover, #main-slider .cycle-next:hover{background-color:' . $color . '}' . "\n";
				   $custom_css .= '#main-slider .cycle-prev:hover, #main-slider .cycle-next:hover{border-color:' . $color . '}' . "\n";
				  break;

				case 'color_slider_pager':
				  $custom_css .= '#main-slider .pager-box{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_slider_pager_active':
				  $custom_css .= '#main-slider .pager-box:hover,#main-slider .pager-box.cycle-pager-active{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_slider_primary_button':
				  $custom_css .= '#main-slider .slider-buttons .button-primary{color:' . $color . '}' . "\n";
				  break;
				case 'color_slider_secondary_button':
				  $custom_css .= '#main-slider .slider-buttons .button-secondary{color:' . $color . '}' . "\n";
				break;
				case 'color_slider_primary_button_background':
				  $custom_css .= '#main-slider .slider-buttons .button-primary{background-color:' . $color . '}' . "\n";
				break;
				case 'color_slider_secondary_button_background':
				  $custom_css .= '#main-slider .slider-buttons .button-secondary{background-color:' . $color . '}' . "\n";
				break;
				// Content.
				case 'color_content_background':
				  $custom_css .= '#content{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_primary_content_background':
				  $custom_css .= '#primary article.hentry{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_content_title':
				  $custom_css .= '#primary .entry-title,#primary .entry-title a{color:' . $color . '}' . "\n";
				  break;
				case 'color_content_text':
				  $custom_css .= '#primary , #primary  p {color:' . $color . '}' . "\n";
				  break;
				case 'color_content_link':
				  $custom_css .= '#primary article a{color:' . $color . '}' . "\n";
				  break;
				case 'color_content_link_hover':
				  $custom_css .= '#primary article a:hover{color:' . $color . '}' . "\n";
				  break;
				case 'color_content_meta_link':
				  $custom_css .= '#primary .entry-meta > span a,#primary .entry-footer > span a{color:' . $color . '}' . "\n";
				  break;
				case 'color_content_meta_link_hover':
				  $custom_css .= '#primary .entry-meta > span a:hover,#primary  .entry-footer > span a:hover{color:' . $color . '}' . "\n";
				  break;
				case 'color_content_meta_icon':
				  $custom_css .= '#primary .entry-meta > span::before,#primary  .entry-footer > span::before{color:' . $color . '}' . "\n";
				  break;
				case 'color_content_meta_date':
				  $custom_css .= '#primary .custom-entry-date span.entry-month,#primary .custom-entry-date span.entry-day{color:' . $color . '}' . "\n";
				  break;
				case 'color_content_meta_date_month_background':
				  $custom_css .= '#primary .custom-entry-date span.entry-month{background-color:' . $color . '}' . "\n";
				  $custom_css .= '#primary .custom-entry-date span.entry-day{  
				  				text-shadow:' . $color . ' 1px 1px,   ' . $color . ' 2px 2px,   ' . $color . ' 3px 3px,
				                ' . $color . ' 4px 4px,   ' . $color . ' 5px 5px,   ' . $color . ' 6px 6px,
				                ' . $color . ' 7px 7px,   ' . $color . ' 8px 8px,   ' . $color . ' 9px 9px,
				                ' . $color . ' 10px 10px, ' . $color . ' 11px 11px, ' . $color . ' 12px 12px,
				                ' . $color . ' 13px 13px, ' . $color . ' 14px 14px, ' . $color . ' 15px 15px,
				                ' . $color . ' 16px 16px, ' . $color . ' 17px 17px, ' . $color . ' 18px 18px,
				                ' . $color . ' 19px 19px, ' . $color . ' 20px 20px, ' . $color . ' 21px 21px,
				                ' . $color . ' 22px 22px, ' . $color . ' 23px 23px, ' . $color . ' 24px 24px,
				                ' . $color . ' 25px 25px, ' . $color . ' 26px 26px, ' . $color . ' 27px 27px,
				                ' . $color . ' 28px 28px, ' . $color . ' 29px 29px, ' . $color . ' 30px 30px,
				                ' . $color . ' 31px 31px, ' . $color . ' 32px 32px, ' . $color . ' 33px 33px,
				                ' . $color . ' 34px 34px, ' . $color . ' 35px 35px, ' . $color . ' 36px 36px,
				                ' . $color . ' 37px 37px, ' . $color . ' 38px 38px, ' . $color . ' 39px 39px,
				                ' . $color . ' 40px 40px, ' . $color . ' 41px 41px, ' . $color . ' 42px 42px,
				                ' . $color . ' 43px 43px, ' . $color . ' 44px 44px, ' . $color . ' 45px 45px,
				                ' . $color . ' 46px 46px, ' . $color . ' 47px 47px, ' . $color . ' 48px 48px,
				                ' . $color . ' 49px 49px, ' . $color . ' 50px 50px, ' . $color . ' 51px 51px,
				                ' . $color . ' 52px 52px, ' . $color . ' 53px 53px, ' . $color . ' 54px 54px,
				                ' . $color . ' 55px 55px, ' . $color . ' 56px 56px, ' . $color . ' 57px 57px,
				                ' . $color . ' 58px 58px;

				}' . "\n";
				break;
				case 'color_content_meta_date_day_background':
				  $custom_css .= '#primary .custom-entry-date span.entry-day{background-color:' . $color . '}' . "\n";
				break;

				// Sidebar.
				 case 'color_sidebar_widget_background':
				  $custom_css .= '.sidebar .widget{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_sidebar_title':
				  $custom_css .= '.sidebar .widget-title{color:' . $color . '}' . "\n";
				  break;
				case 'color_sidebar_text':
				  $custom_css .= '.sidebar{color:' . $color . '}' . "\n";
				  break;
				case 'color_sidebar_link':
				  $custom_css .= '.sidebar .widget a, .sidebar .widget a:visited{color:' . $color . '}' . "\n";
				  break;
				case 'color_sidebar_link_hover':
				  $custom_css .= '.sidebar .widget a:hover{color:' . $color . '}' . "\n";
				  break;
				case 'color_sidebar_list_icon':
				  $custom_css .= '.sidebar ul li::before{color:' . $color . '}' . "\n";
				  break;

				// Footer area.
				case 'color_footer_area_background':
				  $custom_css .= '#colophon{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_footer_area_text':
				  $custom_css .= '#colophon{color:' . $color . '}' . "\n";
				  break;
				case 'color_footer_area_link':
				  $custom_css .= '#colophon a{color:' . $color . '}' . "\n";
				  break;
				case 'color_footer_area_link_hover':
				  $custom_css .= '#colophon a:hover{color:' . $color . '}' . "\n";
				  break;

				// Go To Top.
			    case 'color_goto_top_icon':
				  $custom_css .= '#btn-scrollup i.fa{color:' . $color . '}' . "\n";
				  break;
				case 'color_goto_top_icon_hover':
				  $custom_css .= '#btn-scrollup i.fa:hover{color:' . $color . '}' . "\n";
				  break;
				case 'color_goto_top_background':
				  $custom_css .= '#btn-scrollup{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_goto_top_background_hover':
				  $custom_css .= '#btn-scrollup:hover{background-color:' . $color . '}' . "\n";
				  break;


				// Pagination.
				case 'color_pagination_link':
				  $custom_css .= '.navigation .nav-links a,#infinite-handle span{color:' . $color . '}' . "\n";
				  break;
				case 'color_pagination_link_hover':
				  $custom_css .= '.navigation .nav-links .page-numbers.current,  .navigation .nav-links a:hover,#infinite-handle span:hover{color:' . $color . '}' . "\n";
				  break;
				case 'color_pagination_link_background':
				  $custom_css .= '.navigation .nav-links a,#infinite-handle span{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_pagination_link_background_hover':
				  $custom_css .= '.navigation .nav-links .page-numbers.current,  .navigation .nav-links a:hover,#infinite-handle span:hover{background-color:' . $color . '}' . "\n";
				  break;

				// Breadcrumb.
				 case 'color_breadcrumb_background':
				  $custom_css .= '#breadcrumb{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_breadcrumb_link':
				  $custom_css .= '#crumbs a,#breadcrumb a,#breadcrumb .breadcrumb-trail li::after{color:' . $color . '}' . "\n";
				  break;
				case 'color_breadcrumb_link_hover':
				  $custom_css .= '#crumbs a:hover,#breadcrumb a:hover,#breadcrumb .breadcrumb-trail li:hover::after{color:' . $color . '}' . "\n";
				  break;
				case 'color_breadcrumb_text':
				  $custom_css .= '#breadcrumb{color:' . $color . '}' . "\n";
				  break;

				// Footer Widgets.
				case 'color_footer_widgets_background':
				  $custom_css .= '#footer-widgets{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_footer_widgets_title':
				  $custom_css .= '#footer-widgets .widget-title{color:' . $color . '}' . "\n";
				  break;
				case 'color_footer_widgets_text':
				  $custom_css .= '#footer-widgets {color:' . $color . '}' . "\n";
				  break;
				case 'color_footer_widgets_link':
				  $custom_css .= '#footer-widgets a,#footer-widgets ul li::before{color:' . $color . '}' . "\n";
				break;

				case 'color_footer_widgets_link_hover':
				  $custom_css .= '#footer-widgets a:hover,#footer-widgets ul li:hover::before{color:' . $color . '}' . "\n";
				  break;

				// Home Page widget.
				case 'color_home_widgets_background':
				  $custom_css .= '#university-hub-front-page-widgets .widget{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_home_widgets_title':
				  $custom_css .= '#university-hub-front-page-widgets .widget-title{color:' . $color . '}' . "\n";
				  break;
				case 'color_home_widgets_text':
				  $custom_css .= '#university-hub-front-page-widgets,#university-hub-front-page-widgets p{color:' . $color . '}' . "\n";
				  break;
				case 'color_home_widgets_link':
				  $custom_css .= '#university-hub-front-page-widgets a{color:' . $color . '}' . "\n";
				  break;
				case 'color_home_widgets_link_hover':
				  $custom_css .= '#university-hub-front-page-widgets a:hover{color:' . $color . '}' . "\n";
				  break;


				// Specific section CTA.
				case 'color_cta_section_background':
				  $custom_css .= '#front-page-home-sections .home-section-call-to-action{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_cta_main_section_title':
				  $custom_css .= '#front-page-home-sections .home-section-call-to-action .section-title{color:' . $color . '}' . "\n";
				  break;
				case 'color_cta_section_text':
				  $custom_css .= '#front-page-home-sections .home-section-call-to-action .cta-content-text p{color:' . $color . '}' . "\n";
				  break;
				case 'color_cta_section_button':
				  $custom_css .= '#front-page-home-sections .home-section-call-to-action .cta-buttons a{color:' . $color . '}' . "\n";
				  break;
				case 'color_cta_section_button_hover':
				  $custom_css .= '#front-page-home-sections .home-section-call-to-action .cta-buttons a:hover{color:' . $color . '}' . "\n";
				  break;
				case 'color_cta_section_button_background':
				  $custom_css .= '#front-page-home-sections .home-section-call-to-action .cta-buttons a{background-color:' . $color . '}' . "\n";
				  $custom_css .= '#front-page-home-sections .home-section-call-to-action .cta-buttons a{border-color:' . $color . '}' . "\n";
				  break;  
				case 'color_cta_section_button_background_hover':
				  $custom_css .= '#front-page-home-sections .home-section-call-to-action .cta-buttons a:hover{background-color:' . $color . '}' . "\n";
				  $custom_css .= '#front-page-home-sections .home-section-call-to-action .cta-buttons a:hover{border-color:' . $color . '}' . "\n";
				  break;

				// Specific Section News and Events.
				case 'color_news_events_section_background':
				  $custom_css .= '#front-page-home-sections .home-section-news-and-events{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_news_events_main_section_title':
				  $custom_css .= '#front-page-home-sections .home-section-news-and-events h2 {color:' . $color . '}' . "\n";
				  break;
				case 'color_news_events_section_text':
				  $custom_css .= '#front-page-home-sections .home-section-news-and-events p  {color:' . $color . '}' . "\n";
				  break;  
				case 'color_news_events_section_title':
				  $custom_css .= '#front-page-home-sections .home-section-news-and-events h3 a{color:' . $color . '}' . "\n";
				  break;
				case 'color_news_events_section_title_hover':
				  $custom_css .= '#front-page-home-sections  .home-section-news-and-events h3 a:hover{color:' . $color . '}' . "\n";
				  break;
				case 'color_news_events_section_content_background':
				  $custom_css .= '#front-page-home-sections .home-section-news-and-events .news-content,#front-page-home-sections .home-section-news-and-events .event-post{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_news_events_section_meta_color':
				  $custom_css .= '#front-page-home-sections  .home-section-news-and-events .block-meta span,.home-section-news-and-events .block-meta span::before,.home-section-news-and-events .block-meta a {color:' . $color . '}' . "\n";
				  break;

				case 'color_news_events_section_meta_date_color':
				  $custom_css .= '#front-page-home-sections .custom-entry-date span.entry-month,#front-page-home-sections .custom-entry-date span.entry-day{color:' . $color . '}' . "\n";
				  break;
				case 'color_news_events_section_meta_date_month_background_color':
				  $custom_css .= '#front-page-home-sections .home-section-news-and-events .custom-entry-date span.entry-month{background-color:' . $color . '}' . "\n";
				  $custom_css .= '#front-page-home-sections .custom-entry-date span.entry-day{  
				  				text-shadow:' . $color . ' 1px 1px,   ' . $color . ' 2px 2px,   ' . $color . ' 3px 3px,
				                ' . $color . ' 4px 4px,   ' . $color . ' 5px 5px,   ' . $color . ' 6px 6px,
				                ' . $color . ' 7px 7px,   ' . $color . ' 8px 8px,   ' . $color . ' 9px 9px,
				                ' . $color . ' 10px 10px, ' . $color . ' 11px 11px, ' . $color . ' 12px 12px,
				                ' . $color . ' 13px 13px, ' . $color . ' 14px 14px, ' . $color . ' 15px 15px,
				                ' . $color . ' 16px 16px, ' . $color . ' 17px 17px, ' . $color . ' 18px 18px,
				                ' . $color . ' 19px 19px, ' . $color . ' 20px 20px, ' . $color . ' 21px 21px,
				                ' . $color . ' 22px 22px, ' . $color . ' 23px 23px, ' . $color . ' 24px 24px,
				                ' . $color . ' 25px 25px, ' . $color . ' 26px 26px, ' . $color . ' 27px 27px,
				                ' . $color . ' 28px 28px, ' . $color . ' 29px 29px, ' . $color . ' 30px 30px,
				                ' . $color . ' 31px 31px, ' . $color . ' 32px 32px, ' . $color . ' 33px 33px,
				                ' . $color . ' 34px 34px, ' . $color . ' 35px 35px, ' . $color . ' 36px 36px,
				                ' . $color . ' 37px 37px, ' . $color . ' 38px 38px, ' . $color . ' 39px 39px,
				                ' . $color . ' 40px 40px, ' . $color . ' 41px 41px, ' . $color . ' 42px 42px,
				                ' . $color . ' 43px 43px, ' . $color . ' 44px 44px, ' . $color . ' 45px 45px,
				                ' . $color . ' 46px 46px, ' . $color . ' 47px 47px, ' . $color . ' 48px 48px,
				                ' . $color . ' 49px 49px, ' . $color . ' 50px 50px, ' . $color . ' 51px 51px,
				                ' . $color . ' 52px 52px, ' . $color . ' 53px 53px, ' . $color . ' 54px 54px,
				                ' . $color . ' 55px 55px, ' . $color . ' 56px 56px, ' . $color . ' 57px 57px,
				                ' . $color . ' 58px 58px;

				}' . "\n";
				break;
				case 'color_news_events_section_meta_date_day_background_color':
				  $custom_css .= '#front-page-home-sections .home-section-news-and-events .custom-entry-date span.entry-day{background-color:' . $color . '}' . "\n";
				break;
  
		

				// Specific Section Latest News.
				case 'color_latest_news_section_background':
				  $custom_css .= '#front-page-home-sections .home-section-latest-news{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_latest_news_main_section_title':
				  $custom_css .= '#front-page-home-sections .home-section-latest-news .section-title {color:' . $color . '}' . "\n";
				  break;
				case 'color_latest_news_main_section_text':
				  $custom_css .= '#front-page-home-sections .home-section-latest-news p {color:' . $color . '}' . "\n";
				  break;  
				case 'color_latest_news_section_title':
				  $custom_css .= '#front-page-home-sections .home-section-latest-news .latest-news-text-wrap .latest-news-title a{color:' . $color . '}' . "\n";
				  break;
				case 'color_latest_news_section_title_hover':
				  $custom_css .= '#front-page-home-sections  .home-section-latest-news .latest-news-text-wrap .latest-news-title a:hover{color:' . $color . '}' . "\n";
				  break;
				case 'color_latest_news_section_content_background':
				  $custom_css .= '#front-page-home-sections  .home-section-latest-news .latest-news-text-wrap{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_latest_news_section_meta':
				  $custom_css .= '#front-page-home-sections  .home-section-latest-news .latest-news-meta span,.home-section-latest-news .latest-news-thumb a::before {color:' . $color . '}' . "\n";
				  break;
				case 'color_latest_news_section_button':
				  $custom_css .= '#front-page-home-sections  .home-section-latest-news a.more{color:' . $color . '}' . "\n";
				  break;
				  	case 'color_latest_news_section_button_hover':
				  $custom_css .= '#front-page-home-sections  .home-section-latest-news a.more:hover{color:' . $color . '}' . "\n";
				  break;
				case 'color_latest_news_section_button_background':
				  $custom_css .= '#front-page-home-sections  .home-section-latest-news a.more{background-color:' . $color . '}' . "\n";
				  $custom_css .= '#front-page-home-sections  .home-section-latest-news a.more{border-color:' . $color . '}' . "\n";
				  break;  
				case 'color_latest_news_section_button_background_hover':
				  $custom_css .= '#front-page-home-sections  .home-section-latest-news a.more:hover{background-color:' . $color . '}' . "\n";
				  $custom_css .= '#front-page-home-sections  .home-section-latest-news a.more:hover{border-color:' . $color . '}' . "\n";
				  break;
				case 'color_latest_news_section_overlay':
				  $custom_css .= '#front-page-home-sections  .home-section-latest-news .read-more-button::after{background-color:' . $color . '}' . "\n";
				
				  break;  
				// Specific Section Featured Blocks.
				case 'color_featured_blocks_section_background':
				  $custom_css .= '#front-page-home-sections .home-section-featured-blocks{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_featured_blocks_section_text':
				  $custom_css .= '#front-page-home-sections .home-section-featured-blocks p {color:' . $color . '}' . "\n";
				  break;  
				case 'color_featured_blocks_section_title':
				  $custom_css .= '#front-page-home-sections .home-section-featured-blocks .block-title a{color:' . $color . '}' . "\n";
				  break;
				case 'color_featured_blocks_section_title_hover':
				  $custom_css .= '#front-page-home-sections  .home-section-featured-blocks .block-title a:hover{color:' . $color . '}' . "\n";
				  break;

				case 'color_featured_blocks_section_button':
				  $custom_css .= '#front-page-home-sections  .home-section-featured-blocks a.more{color:' . $color . '}' . "\n";
				  break;
				  	case 'color_featured_blocks_section_button_hover':
				  $custom_css .= '#front-page-home-sections  .home-section-featured-blocks a.more:hover{color:' . $color . '}' . "\n";
				  break;
				case 'color_featured_blocks_section_button_background':
				  $custom_css .= '#front-page-home-sections  .home-section-featured-blocks a.more{background-color:' . $color . '}' . "\n";
				  $custom_css .= '#front-page-home-sections  .home-section-featured-blocks a.more{border-color:' . $color . '}' . "\n";
				  break;  
				case 'color_featured_blocks_section_button_background_hover':
				  $custom_css .= '#front-page-home-sections  .home-section-featured-blocks a.more:hover{background-color:' . $color . '}' . "\n";
				  $custom_css .= '#front-page-home-sections  .home-section-featured-blocks a.more:hover{border-color:' . $color . '}' . "\n";
				  break;	  

				
				// Specific section Testimonial.
				case 'color_testimonial_section_background':
				  $custom_css .= '#front-page-home-sections  .home-section-testimonials{background-color:' . $color . '}' . "\n";
				  break;
				case 'color_testimonial_main_section_title':
				  $custom_css .= '#front-page-home-sections  .home-section-testimonials .section-title{color:' . $color . '}' . "\n";
				  break;
				case 'color_testimonial_section_title':
				  $custom_css .= '.home-section-testimonials h3 a{color:' . $color . '}' . "\n";
				  break;

				case 'color_testimonial_section_content':
				  $custom_css .= '.home-section-testimonials .testimonials-content-area p,.home-section-testimonials .testimonials-content-area p::before{color:' . $color . '}' . "\n";
				   $custom_css .= '.home-section-testimonials .testimonials-thumb img{border-color:' . $color . '}' . "\n";

				  break;
				case 'color_testimonial_pager':
				  $custom_css .= '.home-section-testimonials .cycle-pager span {color:' . $color . '}' . "\n";
				  break;
				case 'color_testimonial_section_pager_active':
				  $custom_css .= '.home-section-testimonials .cycle-pager span.cycle-pager-active,.home-section-testimonials .cycle-pager span:hover{color:' . $color . '}' . "\n";
				  break;

				// Specific section Team.
				case 'color_team_section_background':
				  $custom_css .= '#front-page-home-sections .home-section-team {background-color:' . $color . '}' . "\n";
				  break;
				case 'color_team_main_section_title':
				  $custom_css .= '#front-page-home-sections .home-section-team  .section-title {color:' . $color . '}' . "\n";
				  break;
				case 'color_team_section_title':
				  $custom_css .= '#front-page-home-sections .home-section-team .team-title a{color:' . $color . '}' . "\n";
				  break;

				case 'color_team_section_title_background':
				  $custom_css .= '#front-page-home-sections .home-section-team .team-text-wrap{background-color:' . $color . '}' . "\n";
				case 'color_team_section_icon':
				  $custom_css .= '#front-page-home-sections .home-section-team .team-item .team-thumb a::before{color:' . $color . '}' . "\n";

				  break;

				// Specific  Service Section.
				case 'color_service_section_background':
				  $custom_css .= '#front-page-home-sections .home-section-services { background-color:' . $color . '}' . "\n";
				  break;
				case 'color_service_main_section_title':
				  $custom_css .= '#front-page-home-sections .home-section-services .section-title {color:' . $color . '}' . "\n";
				  break;
				case 'color_service_section_title':
				  $custom_css .= '#front-page-home-sections .home-section-services .services-item-inner h3 a{color:' . $color . '}' . "\n";
	
				  case 'color_service_section_title_background':
				  $custom_css .= '#front-page-home-sections .home-section-services .services-item-inner h3 {background-color:' . $color . '}' . "\n";
				  break;


			  default:
			    break;

			}

		}

		// Render style.
		if ( ! empty( $custom_css ) ) {
		  echo '<style type="text/css">';
		  echo $custom_css;
		  echo '</style>';
		}

	}

endif;

add_action( 'university_hub_action_theme_custom_css', 'university_hub_add_theme_custom_color_css', 25 );
