<?php

/**
 * Hooks custom css into the head.
 */
function hitmag_pro_custom_styles() {
	
	$hitmag_pro_custom_styles = "";

	$primary_color = get_theme_mod( 'hitmag_pro_primary_color', '#E74C3C' );

	$primary_color = esc_attr( $primary_color );

	if ( $primary_color != '#E74C3C' ) {

		$hitmag_pro_custom_styles .= '

            .post-navigation .post-title:hover {
                color: '. $primary_color .';
            }

            .responsive-mainnav li a:hover,
            .responsive-topnav li a:hover {
                background: '. $primary_color .';
            }

            .nav-links .current {
                background: '. $primary_color .';
            }

            .widget-title {
                border-bottom: 2px solid '. $primary_color .';
            }

            .footer-widget-title {
                border-bottom: 2px solid '. $primary_color .';
            }

            .widget-area a:hover {
                color: '. $primary_color .';
            }

            .footer-widget-area a:hover {
                color: '. $primary_color .';
            }

            .site-info a:hover {
                color: '. $primary_color .';
            }

            .hmb-entry-title a:hover {
                color: '. $primary_color .';
            }

            .hmb-entry-meta a:hover,
            .hms-meta a:hover {
                color: '. $primary_color .';
            }

            .hms-title a:hover {
                color: '. $primary_color .';
            }

            .hmw-grid-post .post-title a:hover {
                color: '. $primary_color .';
            }

            .hm-tabs-wdt .ui-state-active {
                border-bottom: 2px solid '. $primary_color .';
            }

            #hitmag-tags a,
            .widget_tag_cloud .tagcloud a {
                background: '. $primary_color .';
            }

            .site-title a {
                color: '. $primary_color .';
            }

            .hitmag-post .entry-title a:hover {
                color: '. $primary_color .';
            }

            .hitmag-post .entry-meta a:hover {
                color: '. $primary_color .';
            }

            .cat-links a {
                color: '. $primary_color .';
            }

            .hitmag-single .entry-meta a:hover {
                color: '. $primary_color .';
            }

            .hitmag-single .author a:hover {
                color: '. $primary_color .';
            }

            .hm-author-content .author-posts-link {
                color: '. $primary_color .';
            }

            .hm-tags-links a:hover {
                background: '. $primary_color .';
            }

            .hm-tagged {
                background: '. $primary_color .';
            }

            .hm-edit-link a.post-edit-link {
                background: '. $primary_color .';
            }

            .arc-page-title {
                border-bottom: 2px solid '. $primary_color .';
            }

            .srch-page-title {
                border-bottom: 2px solid '. $primary_color .';
            }

            .hm-post-style-2.th-hero-container .cat-links,
            .hmig-post .cat-links,
            .hm-slider-details .cat-links {
                background: '. $primary_color .';
            }

            .hm-rel-post .post-title a:hover {
                color: '. $primary_color .';
            }

            .comment-author a {
                color: '. $primary_color .';
            }

            .comment-metadata a:hover,
            .comment-metadata a:focus,
            .pingback .comment-edit-link:hover,
            .pingback .comment-edit-link:focus {
                color: '. $primary_color .';
            }

            .comment-reply-link:hover,
            .comment-reply-link:focus {
                background: '. $primary_color .';
            }

            .required {
                color: '. $primary_color .';
            }

            blockquote {
                border-left: 3px solid '. $primary_color .';
            }

            .hmajax-btn:hover {
                background: '. $primary_color .';
                border: 1px solid '. $primary_color .';
            }

            .hmw-spinner > div {
                 background: '. $primary_color .';
            }

            .comment-reply-title small a:before {
                color: '. $primary_color .';
            }';

	}

	if ( ! empty( $hitmag_pro_custom_styles ) ) { ?>
		<style type="text/css">
			<?php echo $hitmag_pro_custom_styles; ?>
		</style>
	<?php }

}
add_action( 'wp_head', 'hitmag_pro_custom_styles' );