<?php
/* body, html */
$body_bg = get_theme_mod( 'body_bg',less_body_bg);
if (!empty( $body_bg )) {echo 'body { background-color:' .$body_bg.';}';}

/* #page, content including side bars */
$content_bg = get_theme_mod( 'content_bg',less_content_bg);
if (!empty( $content_bg )) {echo '#page { background-color:' .$content_bg.';}';}

/* fonts */
$navbar_font = get_theme_mod('navbar_font_family',less_navbar_default_font_family);
if(!empty($navbar_font)) {
	
	echo '.navbar-default {font-family: '.((preg_match('/ +/',$navbar_font))?'"'.$navbar_font.'"':$navbar_font).';}';
}
$logo_font = get_theme_mod('logo_font_family',logo_font_family);
if($logo_font) {
	
	echo '.navbar-default a.navbar-brand {font-family: '.((preg_match('/ +/',$logo_font))?'"'.$logo_font.'"':$logo_font).';}';
}
$logo_font_color = get_theme_mod('navbar-default-brand-color',less_navbar_default_brand_color);
if(!empty($logo_font_color)) {
	
	echo '.navbar-default a.navbar-brand {color: '.$logo_font_color.';}';
}
$logo_font_hover_color = get_theme_mod('navbar-default-brand-hover-color',less_navbar_default_brand_hover_color);
if(!empty($logo_font_hover_color)) {
	
	echo 'a.navbar-brand:hover {color: '.$logo_font_hover_color.';}';
}

$body_font = get_theme_mod('body_font_family',body_font_family);
if($body_font) {
	
	echo 'body {font-family: '.((preg_match('/ +/',$body_font))?'"'.$body_font.'"':$body_font).';}';
}
$heading_font = get_theme_mod('heading_font_family',heading_font_family);
if($heading_font) {
	
	echo 'h1,h2,h3 {font-family: '.((preg_match('/ +/',$heading_font))?'"'.$heading_font.'"':$heading_font).';}';
}


/*
 * navbar postion
*/

	if(get_theme_mod( 'navbar_style', navbar_style) == 'default') { //default
	echo '
	body { padding-top: 30px; }
        .navbar { margin-bottom: 30px; margin-left: -15px;
    margin-right: -15px;}
	';
	}
	elseif(get_theme_mod( 'navbar_style', navbar_style) == 'navbar-static-top') {
	echo '
	.navbar-static-top {  margin-bottom: 19px; }
	';
	}
	elseif(get_theme_mod( 'navbar_style', navbar_style) == 'navbar-fixed-top') {
	echo '
	body {  padding-top: 70px; }
	';
	}
	elseif(get_theme_mod( 'navbar_style', navbar_style) == 'navbar-fixed-bottom') {
	echo '
	body {  padding-padding-bottom: 70px; }
	';
	}
/*
 * navbar colors
*/

	$navbar_background_color = get_theme_mod( 'navbar_default_bg');
	if(!empty($navbar_background_color))
	{
		echo '.navbar {background-color: '.$navbar_background_color.';}';
	}	
    
    $navbar_border_color = get_theme_mod( 'navbar_border_color');
	if(!empty($navbar_border_color))
	{
		echo '.navbar {border-color: '.$navbar_border_color.';}';
    }
    
    $navbar_link_color = get_theme_mod( 'navbar_link_color');
	if(!empty($navbar_link_color))
	{
		echo '.navbar .navbar-nav > li > a {
    color: '.$navbar_link_color.';
}';
    }
    
    $navbar_linkhover_color = get_theme_mod( 'navbar_linkhover_color');
	if(!empty($navbar_linkhover_color))
	{
		echo '.navbar .navbar-nav > li > a:hover {
    color: '.$navbar_linkhover_color.';
}';
    }	
    
    $navbar_linkhoverbackground_color = get_theme_mod( 'navbar_linkhoverbackground_color');
	if(!empty($navbar_linkhoverbackground_color))
	{
		echo '.navbar .navbar-nav > li > a:hover {
    background-color: '.$navbar_linkhoverbackground_color.';
}';
    }
    
    $navbar_activelink_color = get_theme_mod( 'navbar_activelink_color');
	if(!empty($navbar_activelink_color))
	{
		echo '.navbar .navbar-nav > .active > a, .nav .navbar-nav > .active > a:hover {
    color: '.$navbar_activelink_color.';
}';
    }	
    
    $navbar_activebackground_color = get_theme_mod( 'navbar_activebackground_color');
	if(!empty($navbar_activebackground_color))
	{
		echo '.navbar .navbar-nav > .active > a, .nav .navbar-nav > .active > a:hover {
    background-color: '.$navbar_activebackground_color.';
}';
    }
    
/* Link Color */
$link_color=get_theme_mod( 'link-color');
if(!empty($link_color)) {
	echo 'a, a:hover {color:'.$link_color.';}'; 
	echo '.nav-tabs > .active > a, .nav-tabs > .active > a:hover,.nav-pills > .active > a, .nav-pills > .active > a:hover {background:'.$link_color.'}';
    echo 'a.thumbnail:hover {border-color:'.$link_color.';}';
    }

/* Footer */
$footer_bg_color = get_theme_mod( 'footer_bg_color'); 
$footer_top_border_color = get_theme_mod('footer_top_border_color'); 
$footer_bottom_border_color = get_theme_mod( 'footer_bottom_border_color'); 
$footer_widget_border_color = get_theme_mod( 'footer_widget_border_color');
$footer_text_color=get_theme_mod( 'footer_text_color');
$footer_link_color=get_theme_mod( 'footer_link_color');
$footer_link_hover_color=get_theme_mod( 'footer_link_hover_color');
$footer_background_image=get_theme_mod( 'footer_background_image','');

if(get_theme_mod( 'footer_width', footer_width ) == 'cont-width'){echo 'footer#colophon {background:transparent;}';}
else {echo 'footer#colophon .container {background:transparent;}';}	
echo 'footer#colophon '.((get_theme_mod( 'footer_width', footer_width ) == 'cont-width')?' .container':'').' {';
	
	if(!empty($footer_top_border_color))	{echo 'border-top:1px solid ' .$footer_top_border_color.';';}
	if(!empty($footer_bg_color))echo 'background-color:'.$footer_bg_color.';';
	else echo 'background-color:\'\';';
	if(!empty($footer_background_image)){echo 'background-image:url("' .$footer_background_image.'");';}
	else {echo 'background-image:none;';}
echo'}'; 
   

if(!empty($footer_bottom_border_color)) {
	echo 'footer#colophon .site-info {border-color:'.$footer_bottom_border_color.';}';
} 
else if(!empty($footer_top_border_color)) {
	echo 'footer#colophon .site-info {border-color:'.$footer_top_border_color.';}';
}  

if(!empty($footer_widget_border_color)) {
	echo 'footer#colophon div.widget { border: 1px solid '.$footer_widget_border_color.';';
}   

if(!empty($footer_text_color)) {
	echo 'footer#colophon {color:'.$footer_text_color.';}';
}    
if(!empty($footer_link_color)) {
	echo 'footer#colophon a {color:'.$footer_link_color.';}';
} 
if(!empty($footer_link_hover_color)) {
	echo 'footer#colophon a:hover {color:'.$footer_link_hover_color.';}';
} 
