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

if ( ! function_exists( 'mediquip_plus_header_style' ) ) :
/**
 * Styles the header image and text displayed on the blog
 *
 * @see mediquip_plus_custom_header_setup().
 */
function mediquip_plus_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-info {
			background: url(<?php echo esc_url( get_header_image() ); ?>) no-repeat;
			background-position: center top;
			background-size:cover;
		}
	<?php endif; ?>	


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

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

	.header-info {
		background: <?php echo esc_attr(get_theme_mod('mediquip_plus_headertopbg_color')); ?>;
	}

	.header {
		background: <?php echo esc_attr(get_theme_mod('mediquip_plus_headerbtmbg_color')); ?>;
	}

	.header-info i {
		color: <?php echo esc_attr(get_theme_mod('mediquip_plus_headericon_color')); ?>;
	}

	.header-info p, .header-info h6 {
		color: <?php echo esc_attr(get_theme_mod('mediquip_plus_headertext_color')); ?>;
	}

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

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

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

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

	.header p, .header a.phn {
		color: <?php echo esc_attr(get_theme_mod('mediquip_plus_phonetxt_color')); ?>;
	}

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

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

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

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

	#footer h1,#footer h2,#footer h3,#footer h4,#footer h5,#footer h6 {
		color: <?php echo esc_attr(get_theme_mod('mediquip_plus_footer_heading_col')); ?> !important;
	}

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

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

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

	</style>
	<?php
}
endif;