<?php

/**
 * All the theme css modification area here
 * @pakage Clearex
 * */

    function Clearex_custom_css_mods(){
	    wp_enqueue_style( 'clearex-inline-style-css', get_template_directory_uri() .'/assets/css/clearex-inline-style.css', null,'1.0.3','all');
        $custom_css = '';
        
        if(get_theme_mod( 'clearex_header_titlecolor', '#eee' )):
             $custom_css .= '.clearex-header-area .site-branding .logo-title-wrapper .site-title a{color:'.esc_attr(get_theme_mod('clearex_header_titlecolor','#eee')).'}';
        endif;    
        if(get_theme_mod( 'clearex_tagline_color', '#bfbfbf' )):
             $custom_css .= '.clearex-header-area .site-branding .logo-title-wrapper .site-description{color:'.esc_attr(get_theme_mod('clearex_tagline_color','#bfbfbf')).'}';
        endif;  
        if(get_theme_mod( 'clearex_hide_title_tagline')):
             $custom_css .= '.clearex-header-area .site-branding .logo-title-wrapper{display:none !important}';
        endif;  
        if( get_theme_mod( 'clearex_logo_below_title_tagline')):
             $custom_css .= '.clearex-header-area .site-branding .logo-title-wrapper{display:block !important;margin-top:20px;}';
        endif;  
        if(has_custom_logo()):
             $custom_css .= '.clearex-header-area .site-branding .logo-image {margin-top: 54px; margin-left:0 !important}';
        endif;  
        if( get_theme_mod( 'clearex_logo_below_title_tagline') && get_theme_mod( 'clearex_hide_title_tagline')):
             $custom_css .= '.clearex-header-area .site-branding .logo-title-wrapper{display:none !important;}.clearex-header-area .site-branding{padding-bottom:84px;}';
        endif;  
        if( get_theme_mod( 'disabled_realated_post' )):
             $custom_css .= '.clearex-related-post{display:none !important;}';
        endif;  
        if( get_theme_mod( 'disabled_post_navigation' )):
             $custom_css .= '.navigation.post-navigation{display:none !important;}';
        endif;  

        if(!get_theme_mod('clearex_support_search')):
            $custom_css .= '.right-content-area{display:none;}';
        endif;    
        if(!get_theme_mod('clearex_support_bar')):
            $custom_css .= '.support-bar-area{display:none;}';
        endif;
	    wp_add_inline_style('clearex-inline-style-css',$custom_css);
    }
    add_action('wp_enqueue_scripts', 'Clearex_custom_css_mods' );

