<?php

if ( ! function_exists( 'guj_content_styles' ) ) :
/**
 * Styles the content text color
 *
 * @package guj
 */
function guj_content_styles() {
        
        $content_links_color = get_theme_mod('content_links_color');
	$content_text_color = get_theme_mod('content_text_color');
        
        /*
	 * Do we have a custom text color?
	 */
                
        if ( '#000' != $content_text_color ) { ?>
            
            <style type="text/css">
                
                body {
                    color: <?php echo esc_attr($content_text_color) ;?>
                }
            </style>

        <?php }
        
	/*
	 * Do we have a custom links color?
	 */
        
	if ( '#D64933' != $content_links_color ) { ?>
		<style type="text/css">
			a:hover,
			a:focus, 
			a:active,
			.page-content a:focus, .page-content a:hover,
			.entry-content a:focus,
			.entry-content a:hover,
			.entry-summary a:focus,
			.entry-summary a:hover,
			.comment-content a:focus,
			.comment-content a:hover,
			.cat-links a {
				color: <?php echo esc_attr( $content_links_color ); ?>;
			}
			
			.page-content a,
			.entry-content a,
			.entry-summary a,
			.comment-content a,
			.post-navigation .post-title,
			.comment-navigation a:hover, 
			.comment-navigation a:focus,
			.posts-navigation a:hover,
			.posts-navigation a:focus,
			.post-navigation a:hover,
			.post-navigation a:focus,
			.paging-navigation a:hover,
			.paging-navigation a:focus,
			.entry-title a:hover, 
			.entry-title a:focus,
			.entry-meta a:focus, 
			.entry-meta a:hover,
			.entry-footer a:focus,
			.entry-footer a:hover,
			.reply a:hover, 
			.reply a:focus,
			.comment-form .form-submit input:hover, 
			.comment-form .form-submit input:focus,
			.widget a:hover, 
			.widget a:focus {
				border-color: <?php echo esc_attr( $content_links_color ); ?>;
			}
			
			.comment-navigation a:hover, 
			.comment-navigation a:focus,
			.posts-navigation a:hover,
			.posts-navigation a:focus,
			.post-navigation a:hover,
			.post-navigation a:focus,
			.paging-navigation a:hover,
			.paging-navigation a:focus,
			.continue-reading a:focus, 
			.continue-reading a:hover,
			.cat-links a:focus, 
			.cat-links a:hover,
			.reply a:hover, 
			.reply a:focus,
			.comment-form .form-submit input:hover, 
			.comment-form .form-submit input:focus {
				background-color: <?php echo esc_attr( $content_links_color ); ?>;
			}
			
			@media screen and (min-width: 900px) {
				.no-sidebar .post-content__wrap .entry-meta a:hover, 
				.no-sidebar .post-content__wrap .entry-meta a:focus {
					border-color: <?php echo esc_attr( $content_links_color ); ?>;
				}
			}
		</style>
	<?php
	} 
}
endif;

add_action( 'wp_head', 'guj_content_styles' );