<?php
/**
 * @package Smallbiz Startup
 * Setup the WordPress core custom header feature.
 *
 * @uses smallbiz_startup_header_style()
 */
function smallbiz_startup_custom_header_setup() {
	add_theme_support( 'custom-header', apply_filters( 'smallbiz_startup_custom_header_args', array(		
		'default-text-color'     => 'fff',
		'width'                  => 1400,
		'height'                 => 280,
		'wp-head-callback'       => 'smallbiz_startup_header_style',		
	) ) );
}
add_action( 'after_setup_theme', 'smallbiz_startup_custom_header_setup' );

if ( ! function_exists( 'smallbiz_startup_header_style' ) ) :
/**
 * Styles the header image and text displayed on the blog
 *
 * @see smallbiz_startup_custom_header_setup().
 */
function smallbiz_startup_header_style() {
	$header_text_color = get_header_textcolor();
	?>
	<style type="text/css">
	<?php
		//Check if user has defined any header image.
		if ( get_header_image() || get_header_textcolor() ) :
	?>
		.header {
			background: url(<?php echo esc_url( get_header_image() ); ?>) no-repeat !important;
			background-position: center top;
			background-size: cover !important;
		}
	<?php endif; ?>	
	

	.site-branding-text h1.site-title, .site-branding-text p.site-title {
		color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_sitetitle_color')); ?>;
	}

	span.site-description {
		color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_sitetagline_color')); ?>;
	}

	.header-top {
	    background: rgba(0, 0, 0, 0) linear-gradient(90deg, <?php echo esc_attr(get_theme_mod('smallbiz_startup_bg1_color')); ?> 20%, <?php echo esc_attr(get_theme_mod('smallbiz_startup_bg2_color')); ?> 15%) repeat scroll 0 0;
	}

	.site-branding-text {
		background: <?php echo esc_attr(get_theme_mod('smallbiz_startup_logobg_color')); ?>;
	}

	.logo {
	    background-image: linear-gradient(to right, <?php echo esc_attr(get_theme_mod('smallbiz_startup_logoborder1_color')); ?> 0%, <?php echo esc_attr(get_theme_mod('smallbiz_startup_logoborder2_color')); ?> 100%), linear-gradient(to right, <?php echo esc_attr(get_theme_mod('smallbiz_startup_logoborder1_color')); ?> 0%, <?php echo esc_attr(get_theme_mod('smallbiz_startup_logoborder2_color')); ?> 100%);
	}

	a.mailaddress {
		color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_email_color')); ?>;
	}

	.social-icons i {
		color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_socialicons_color')); ?>;
	}

	.social-icons i:hover {
		color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_socialiconshover_color')); ?>;
	}

	.contact-us a {
		color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_buttontext_color')); ?>;
	}

	.contact-us a {
	    background-image: linear-gradient(to right, <?php echo esc_attr(get_theme_mod('smallbiz_startup_buttonbg1_color')); ?> , <?php echo esc_attr(get_theme_mod('smallbiz_startup_buttonbg2_color')); ?>);
	}

	.contact-us a:hover {
	    background: <?php echo esc_attr(get_theme_mod('smallbiz_startup_buttonhover_color')); ?>;
	}

	.main-nav a {
		color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_meuns_color')); ?>;
	}

	.main-nav a a:hover {
		color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_meunshover_color')); ?> !important;
	}

	.main-nav ul ul a {
		color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_submeuns_color')); ?>;
	} 

	.main-nav ul ul.sub-menu a:hover {
		color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_submeunshover_color')); ?>;
	}

	.main-nav ul ul {
		background: <?php echo esc_attr(get_theme_mod('smallbiz_startup_submeunsbg_color')); ?>;
	}

	.main-nav ul ul li {
		border-color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_submeunsborder_color')); ?>;
	}

	.content-inner-box span {
		color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_bannertitle_color')); ?>;
	}

	.content-inner-box h1 a {
		color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_bannersubtitle_color')); ?> !important;
	}

	.content-inner-box p {
		color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_bannerdescription_color')); ?>;
	}

	.content-inner-box .pagemore a {
    	background-image: linear-gradient(to right, <?php echo esc_attr(get_theme_mod('smallbiz_startup_bannerbtnbg1_color')); ?> , <?php echo esc_attr(get_theme_mod('smallbiz_startup_bannerbtnbg2_color')); ?>);
	}

	.content-inner-box .pagemore a {
		color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_bannerbtntext_color')); ?>;
	}

	.content-inner-box .pagemore a:hover {
		background: <?php echo esc_attr(get_theme_mod('smallbiz_startup_bannerbtnhover_color')); ?>;
	}

	#head-banner .img-box {
	    background-image: linear-gradient(to right, <?php echo esc_attr(get_theme_mod('smallbiz_startup_bannerrightboxbg1_color')); ?>, <?php echo esc_attr(get_theme_mod('smallbiz_startup_bannerrightboxbg2_color')); ?>);
	}

	#head-banner span.color-inner-box img {
		background: <?php echo esc_attr(get_theme_mod('smallbiz_startup_bannerimgborder_color')); ?>;
	}

	#head-banner span.design-box {
    	background-image: linear-gradient(to right, <?php echo esc_attr(get_theme_mod('smallbiz_startup_bannerbox1_color')); ?> , <?php echo esc_attr(get_theme_mod('smallbiz_startup_bannerbox2_color')); ?>);
	}

	.copywrap, .copywrap p, .copywrap p a, #footer .copywrap a{
		color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_footer_coypright_col')); ?> !important;
	}

	#footer .copywrap a:hover, .copywrap p:hover, .copywrap:hover{
		color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_footer_coyprighthover_col')); ?> !important;
	}

	#footer .copywrap {
		background-color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_footer_coyprightbg_col')); ?>;
	}

	#footer {
		background-color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_footer_bg_col')); ?>;
	}

	#footer h1,#footer h2,#footer h3,#footer h4,#footer h5,#footer h6,  #footer .widget-title {
		color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_footer_heading_col')); ?>;
	}

	#footer p {
		color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_footer_text_col')); ?>;
	}

	#footer li a {
		color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_footer_list_col')); ?>;
	}

	#footer li a:hover {
		color: <?php echo esc_attr(get_theme_mod('smallbiz_startup_footer_listhover_col')); ?>;
	}

	</style>
	<?php 
}
endif;