<?php
$slice_url = dirname(__FILE__);
if ( preg_match('#wp-content#isU', $slice_url) ) {
	require_once '../../../../wp-load.php';  
}
else {
	require_once '../../../../../wp-load.php';  
}  
header("Content-type: text/css");

// Custom Skins
$style_custom = st_option('style_custom');
if ( $style_custom )
{
	$style_custom_color = st_option('style_custom_color');
	if ( $style_custom_color ) {
		echo "#wp-calendar td#today, .btn, button, html input[type=\"button\"], input[type=\"reset\"], input[type=\"submit\"], .widget_rss .rss-date,
.widget-title:before, .st-blog .post-meta, .portfolio-list:hover .portfolio-inner, .portfolio-container:hover .portfolio-inner,
.portfolio-container .post-category, .portfolio-list .post-category, blockquote, blockquote.pull-left, blockquote.pull-right, 
.st-dropcap, .st-dropcap2, .st-highlight, .table th, div.ctabox-button a, .st-icon.circle, .st-icon.rounded, .style-1 .header-call.inline li:hover,
.st-icon.box, .scrollTop a, .st-heading span:after,
.iconbox-top:hover .iconbox-icon, .portfolio-single .portfolio-meta div, .st-button, .progress .color-default, .progress .bar,
.st-ctabox{
	background-color:$style_custom_color;
}

.st-tabs .tab-title li.active a, .st-tabs .tab-title li.active a:after {background-color:#f26522;}

#sticky-header .primary-menu li.current_page_item a, 
#sticky-header .primary-menu li.current_page_item a:hover, 
#sticky-header .primary-menu li.current_page_ancestor > a,
#header .primary-menu li.current_page_item a, 
#header .primary-menu li.current_page_item a:hover, 
#header .primary-menu li.current_page_ancestor > a{
	background-color:$style_custom_color !important;  
}
a:hover, a:focus, #footer a:hover, .st-pricing .plan-content ul li span, a.more-link:hover, .post-meta span a:hover, #top-wrapper a:hover,
.blog-list .post-title a:hover, .widget_nav_menu ul li.current-menu-item a, .accordion-title:hover, .iconbox-top .iconbox-icon{ 
	color:$style_custom_color;
}
.widget_tag_cloud a:hover, #footer .widget_tag_cloud a:hover, 
.portfolio-filter li a:hover, .st-heading span, a.more-link:hover{
	border-color:$style_custom_color;
}\n";
	}	
	//font
	if ( $style_custom_font_color_heading = st_option('style_custom_font_color_heading') ) {
		echo "#content-wrapper h1, #content-wrapper h2, #content-wrapper h3, #content-wrapper h4, #content-wrapper h5, #content-wrapper h6, #content-wrapper .post-title { color: $style_custom_font_color_heading; }\n";
	}
	if ( $style_custom_font_color_text = st_option('style_custom_font_color_text') ) {
		echo "body, #st-wrapper { color: $style_custom_font_color_text; }\n";
	}
	//link
	if ( $style_custom_link_color_heading = st_option('style_custom_link_color_heading') ) {
		echo "#content-wrapper h1 a, #content-wrapper h2 a, #content-wrapper h3 a, #content-wrapper h4 a, #content-wrapper h5 a, #content-wrapper h6 a, #content-wrapper .post-title a { color: $style_custom_link_color_heading; }\n";
	}
	if ( $style_custom_link_color_heading_hover = st_option('style_custom_link_color_heading_hover') ) {
		echo "#content-wrapper h1 a:hover, #content-wrapper h2 a:hover, #content-wrapper h3 a:hover, #content-wrapper h4 a:hover, #content-wrapper h5 a:hover, #content-wrapper h6 a:hover, #content-wrapper .post-title a:hover { color: $style_custom_link_color_heading_hover; }\n";
	}
	if ( $style_custom_link_color_text = st_option('style_custom_link_color_text') ) {
		echo "#content-wrapper a { color: $style_custom_link_color_text; }\n";
	}
	if ( $style_custom_link_color_text_hover = st_option('style_custom_link_color_text_hover') ) {
		echo "#content-wrapper a:hover { color: $style_custom_link_color_text_hover; }\n";
	}
}

// Background Pattern/Image
$style_bg_type = st_option('style_bg_type');
if ( $style_bg_type == 1 ) {
	$style_bg_pattern = st_option('style_bg_pattern');
	echo "body { background-image: url('". SLICETHEME_IMAGES ."/pattern/". $style_bg_pattern ."'); }\n";
}
elseif ( $style_bg_type == 2 ) {
	$style_bg_image = st_option('style_bg_image');
	if ( !empty($style_bg_image['image']) ) {
		echo "body { background: ". $style_bg_image['color'] ." url('". $style_bg_image['image'] ."') ". $style_bg_image['repeat'] ." ". $style_bg_image['position'] ." fixed; }\n";
	}
	elseif ( !empty($style_bg_image['color']) ) {
		echo "body { background-color: ". $style_bg_image['color'] ."; }\n";
	}
}

// Font Size
$style_heading_fz = st_option('style_heading_fz');
$style_menu_fz = st_option('style_menu_fz');
$style_body_fz = st_option('style_body_fz');

if ( !empty($style_heading_fz['h1']) ) {
	echo "h1 { font-size: ". $style_heading_fz['h1'] ."; }\n";
}
if ( !empty($style_heading_fz['h2']) ) {
	echo "h2 { font-size: ". $style_heading_fz['h2'] ."; }\n";
}
if ( !empty($style_heading_fz['h3']) ) {
	echo "h3 { font-size: ". $style_heading_fz['h3'] ."; }\n";
}
if ( !empty($style_heading_fz['h4']) ) {
	echo "h4 { font-size: ". $style_heading_fz['h4'] ."; }\n";
}
if ( !empty($style_heading_fz['h5']) ) {
	echo "h5 { font-size: ". $style_heading_fz['h5'] ."; }\n";
}
if ( !empty($style_heading_fz['h6']) ) {
	echo "h6 { font-size: ". $style_heading_fz['h6'] ."; }\n";
}
if ( !empty($style_menu_fz) ) {
	echo "#header .primary-menu li a { font-size: $style_menu_fz; }\n";
}
if ( !empty($style_body_fz) ) {
	echo "body { font-size: $style_body_fz; }\n";
}

// Heading Font Family
$style_heading_ft = st_option('style_heading_ft'); //print_r($style_heading_ft);

if ( $style_heading_ft['type'] == 1 ) {
	$font_family = $style_heading_ft['webfont'];
	echo "h1,h2,h3,h4,h5,h6 { font-family: '$font_family', Arial, serif; }\n";
}
elseif ( $style_heading_ft['type'] == 2 ) {
	$font_family = $style_heading_ft['google'];
	if ( false !== ($p = strpos($font_family, ':')) ) $font_family = substr($font_family, 0, $p);
	echo "h1,h2,h3,h4,h5,h6 { font-family: '$font_family', Arial, serif; }\n";
}

// Menu Font Family
$style_menu_ft = st_option('style_menu_ft'); //print_r($style_menu_ft);

if ( $style_menu_ft['type'] == 1 ) {
	$font_family = $style_menu_ft['webfont'];
	echo "#header .primary-menu li a { font-family: '$font_family', Arial, serif; }\n";
}
elseif ( $style_menu_ft['type'] == 2 ) {
	$font_family = $style_menu_ft['google'];
	if ( false !== ($p = strpos($font_family, ':')) ) $font_family = substr($font_family, 0, $p);
	echo "#header .primary-menu li a { font-family: '$font_family', Arial, serif; }\n";
}

// Body Font Family
$style_body_ft = st_option('style_body_ft'); //print_r($style_body_ft);

if ( $style_body_ft['type'] == 1 ) {
	$font_family = $style_body_ft['webfont'];
	echo "body { font-family: '$font_family', Arial, serif; }\n";
}
elseif ( $style_body_ft['type'] == 2 ) {
	$font_family = $style_body_ft['google'];
	if ( false !== ($p = strpos($font_family, ':')) ) $font_family = substr($font_family, 0, $p);
	echo "body { font-family: '$font_family', Arial, serif; }\n";
}

// Custom CSS
if ( $style_css = st_option('style_css') ) {
	echo $style_css."\n";
}

?>