<?php
require_once( '../../../../wp-load.php' );
Header("Content-type: text/css");

$theme_imagepath =  get_template_directory_uri() . '/images/';

//Background Overlay
$background_overlay=of_get_option('general_background_overlay');
if ( $background_overlay ) { echo '.background-fill { background: transparent url('.$theme_imagepath. 'overlays/'.$background_overlay.'.png) repeat; } '; } else { echo ' .background-fill {background:none;}'; }


function ApplyFont ( $fontName , $fontClasses ) {

	$got_font=of_get_option($fontName, $fontClasses);
	
	if ($got_font && $got_font !="Default Font") {
		$font_pieces = explode(":", $got_font);
		$font_name = $font_pieces[0];
		echo $fontClasses . "{ font-family:'" . $font_name . "'; }";
	}

}

$heading_classes='
h1,
h2,
h3,
h4,
h5,
h6,
.entry-post-title h2 a,
.sidebar h3';

$page_heading_classes='
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6,
ul.portfolio-four h4,
ul.portfolio-three h4,
ul.portfolio-two h4,
ul.portfolio-one h4,
ul.portfolio-list h4,
.entry-post-title h2
';
//Font
if ( !of_get_option('disable_googlefonts') ) {
	echo "
	h1,h2,h3,h4,h5,h6,
	.recentpost_title,
	.sidebar h3,
	.homemenu ul li .menu-title,
	.homemenu ul li .menu-desc,
	.entry-post-title h2 a,
	.slideshow_title,
	.slideshow_caption
	{
	font-family: 'Lato', sans-serif;
	}";

	ApplyFont ( "heading_font" , $heading_classes );
	ApplyFont ( "page_headings" , $page_heading_classes );
	ApplyFont ( "menu_font" , ".homemenu ul li .menu-title,.homemenu ul li" );
	ApplyFont ( "super_title" , ".slideshow_title" );
}


$accent_color=of_get_option('accent_color');
if ($accent_color) {
echo "
.bigsaywrap,
ul.portfolio-filter li.current a,
ul.portfolio-filter a:hover,
a.ajax-navigation-arrow,
.footer-container,
.entry-title h1,
.pagination span.current,
.portfolio-tags a:hover,
.wp-tag-cloud a:hover,
#prevslide, #nextslide,
#progress-bar,
div.jp-volume-bar-value,
.flexslider-container-page .flex-direction-nav li a
{
background-color: ".$accent_color.";
}";

echo "
ul#thumb-list li.current-thumb {
	border-color:".$accent_color.";
}";

echo "
ul.portfolio-four h4 a:hover,
ul.portfolio-three h4 a:hover,
ul.portfolio-two h4 a:hover,
ul.portfolio-one h4 a:hover,
.entry-post-title h2 a:hover,
ul.portfolio-metainfo li a
{
color: ".$accent_color.";
}";

echo "
ol.commentlist li.bypostauthor .avatar
{
border-top-color:".$accent_color.";
}";

echo "
.portfolio-tags a:hover:before,
.wp-tag-cloud a:hover:before
{
border-color:transparent ".$accent_color." transparent transparent;
}";
}




$general_background_color=of_get_option('general_background_color');
if ($general_background_color) {
echo 'body{ background-color:'.$general_background_color.'; }';
}

//Photomenu color
$photomenu_color=of_get_option('photomenu_color');
$photomenu_rgb=hex2RGB($photomenu_color,true);

if ($photomenu_color) {
echo "
.sf-menu li { 
	background: ".$photomenu_color.";
	background: rgba(".$photomenu_rgb.",0.7);
	}
";
}

$photomenu_parentcolor=of_get_option('photomenu_parentcolor');
if ($photomenu_parentcolor) {
echo "
li.current-menu-item, li.current-menu-parent, li.current-menu-ancestor { 
	background: ".$photomenu_parentcolor.";
	}
";
}


$photomenu_parentcolortext=of_get_option('photomenu_parentcolortext');
if ($photomenu_parentcolortext) {
echo "
.sf-menu li.current-menu-item .menu-title, .sf-menu li.current-menu-parent .menu-title, .sf-menu li.current-menu-ancestor .menu-title { 
	color: ".$photomenu_parentcolortext." !important;
	}
";
}

$photomenusubcat_color=of_get_option('photomenusubcat_color');
if ($photomenusubcat_color) {
echo '.homemenu ul ul li { background:'.$photomenusubcat_color.'; }';
}

$slideshow_arrowbg=of_get_option('slideshow_arrowbg');
if ($slideshow_arrowbg) {
echo '#prevslide, #nextslide { background-color:'.$slideshow_arrowbg.'; }';
}

	$flexislideshow_arrowbg=of_get_option('flexislideshow_arrowbg');
	if ($flexislideshow_arrowbg) {
	echo '.flexslider-container-page .flex-direction-nav li a { background-color:'.$flexislideshow_arrowbg.'; }';
	}

//Progress Bar
$slideshow_transbar=of_get_option('slideshow_transbar');

if ($slideshow_transbar) {
echo "
#progress-bar {
	background:".$slideshow_transbar.";
}
";
}

$slideshow_titlecolor=of_get_option('slideshow_titlecolor');
if ($slideshow_titlecolor) {
echo '.slideshow_title { color:'.$slideshow_titlecolor.'; }';
}

$slideshow_captiontext=of_get_option('slideshow_captiontext');
if ($slideshow_captiontext) {
echo '.slideshow_caption { color:'.$slideshow_captiontext.'; }';
}

$slideshow_captionbg=of_get_option('slideshow_captionbg');
if ($slideshow_captionbg) {
echo '.slideshow_caption { background-color:'.$slideshow_captionbg.'; }';
}

$photomenu_hover_color=of_get_option('photomenu_hover_color');
if ($photomenu_hover_color) echo '.sf-menu li:hover,.homemenu ul ul li:hover>a {background:'.$photomenu_hover_color.';}';

$photomenu_link_color=of_get_option('photomenu_link_color');
if ($photomenu_link_color) echo '.homemenu a,.homemenu ul li .menu-title {color:'.$photomenu_link_color.' !important;}';

$photomenu_desc_color=of_get_option('photomenu_desc_color');
if ($photomenu_desc_color) echo '.homemenu ul li .menu-desc {color:'.$photomenu_desc_color.';}';

$photomenu_subcat_hover_color=of_get_option('photomenu_subcat_hover_color');
if ($photomenu_subcat_hover_color) echo '.homemenu ul ul li {background:'.$photomenu_subcat_hover_color.';}';

$content_pagebg=of_get_option('content_pagebg');
if ($content_pagebg) {
echo '.contents-wrap, .fullpage-contents-wrap, .page-contents-wrap, ul.portfolio-filter li.filter-tag-icon { background-color:'.$content_pagebg.'; }';
}

$page_title=of_get_option('page_title');
if ($page_title) {
echo 'h1.entry-title { color:'.$page_title.'; }';
}

$content_titlelinks=of_get_option('content_titlelinks');
if ($content_titlelinks) {
echo '
ul.portfolio-four h4 a,
ul.portfolio-three h4 a,
ul.portfolio-two h4 a,
ul.portfolio-one h4 a,
ul.portfolio-list h4 a,
.entry-post-title h2 a { color:'.$content_titlelinks.'; }';
}

$content_titlehover=of_get_option('content_titlehover');
if ($content_titlehover) {
echo '
ul.portfolio-four h4 a:hover,
ul.portfolio-three h4 a:hover,
ul.portfolio-two h4 a:hover,
ul.portfolio-one h4 a:hover,
ul.portfolio-list h4 a:hover,
.entry-post-title h2 a:hover { color:'.$content_titlehover.'; }';
}

$content_titles=of_get_option('content_titles');
if ($content_titles) {
echo '
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6,
.mcycletextwrap h3,
ul.tabs li a
{ color:'.$content_titles.'; }';
}

$content_text=of_get_option('content_text');
if ($content_text) {
echo '
.entry-content,
.entry-content .pullquote-left,
.entry-content .pullquote-right,
.entry-content .pullquote-center,
.work-details p
{ color:'.$content_text.'; }';
}


$sidebar_bg=of_get_option('sidebar_bg');
if ($sidebar_bg) {
echo '.sidebar-widget { background-color:'.$sidebar_bg.'; }';
}

$sidebar_title=of_get_option('sidebar_title');
if ($sidebar_title) {
echo '.sidebar h3 { color:'.$sidebar_title.'; }';
}

$pagination_bg=of_get_option('pagination_bg');
if ($pagination_bg) {
echo '.pagenavi { background-color:'.$pagination_bg.'; }';
}

$blog_allowedtags=of_get_option('blog_allowedtags');
if ($blog_allowedtags) {
echo '.form-allowed-tags { display:none; }';
}

$footer_copyrightbg=of_get_option('footer_copyrightbg');
if ($footer_copyrightbg) {
echo '#fullscr-copyright li { background-color:'.$footer_copyrightbg.'; }';
}

$footer_copyrighttext=of_get_option('footer_copyrighttext');
if ($footer_copyrighttext) {
echo '#fullscr-copyright li { color:'.$footer_copyrighttext.'; text-shadow:none; }';
}

$menudescriptions_off=of_get_option('menudescriptions_off');
if ($menudescriptions_off) {
echo '.homemenu ul li .menu-desc { display:none; }';
}
?>