<?php 
/**
 * Trending news live-style
**/ 
?>
<?php 

function trendingnews_head() {
	$bloginfo = get_template_directory_uri();
	$menu_background = get_option('tn_menu_background');
	$header_color = get_option('tn_header_color');
	$menucolor = get_option('tn_menu_color');
	$footer_color = get_option('tn_footer_color');
	$footer_background = get_option('tn_footer_background');
	$border_color = get_option('tn_border_color');
	$hovercolor = get_option('tn_hover_color');
	$slide_picker = get_option('tn_slider_picker');
	$layout = get_option('tn_layout');
	$font = get_option('tn_fonts');
	$menu_font = get_option('tn_menu_font');
	$ticker_color = get_option('tn_ticker_color');
	$sign_before_link = get_option('tn_sign_before_link');
	$social_color = get_option('tn_social_color');
	$menu_symbol_color = get_option('tn_menu_symbol_color');
	
	

//Css
	echo "

<style type='text/css'>
#site-logo, #content-social {background: $header_color;}
body{font-family:$font;}
.magic-line, .square-review-score, .total-score, .score-width, .newest-posts-thumb:hover .play-icon, .carousel-image:hover .play-icon, .square-image:hover .play-icon, .category-name h1{background: $hovercolor;}
.menu-item .menu-link, #mob-menu{color:$menucolor;}
.sub-menu-wrapper{border-color:$menu_background}
.flex-active .wide-slider-thumb:after{border-color:$hovercolor;}
.home-widget h3, .sidebar-title-line, ul.tabs li.active, ul.tabs li{border-color:$border_color;}
.tv-featured{background:$border_color;}
ul.tabs li.active{background:$border_color;}
#footer-widgets{background:$footer_background;}
.menu-item-object-category.menu-item-has-children:after{content:\"$sign_before_link\";color:$menu_symbol_color;}
.submit-button{background:$menu_symbol_color url($bloginfo/images/search-icon$social_color.png) no-repeat 3px;}
.fb-social-icon, .twitter-social-icon, .pinterest-social-icon, .google-social-icon, .instagram-social-icon, .rss-social-icon, .youtube-social-icon{background-image:url($bloginfo/images/social-buttons-header$social_color.png);}
.about-social .fb-social-icon, .about-social .twitter-social-icon, .about-social .pinterest-social-icon, .about-social .google-social-icon, .about-social .instagram-social-icon, .about-social .rss-social-icon, .about-social .youtube-social-icon{background-image:url($bloginfo/images/social-buttons-footer$social_color.png);}
#searchform input{background-image:url($bloginfo/images/search-icon$social_color.png);}
#footer, #footer .widget-title, #footer .post-date, #footer a, #footer a:visited, #footer .big-featured-posts-content, #footer .medium-featured-posts-content, #footer .big-featured-posts-text, #submit{color:$footer_color;}
#footer .tagcloud a{border-color:$footer_color;}
#submit{background:$header_color;}
#ticker-today-date, .ticker-heading, .ticker-star{color:$ticker_color;}
::selection{background:$header_color;color:$footer_color;}
::-moz-selection{background:$header_color;color:$footer_color;}
#post-content a, ul.tabs li.active h4 a:hover, .mosaic-title h2 a:hover, .slide-title a:hover, .big-featured-posts-title h2 a:hover, #ticker a:hover, #top-menu ul li a:hover, .category-tv-icon a, #top-menu-today-date{color:$hovercolor;}
#primary{float:$layout;}
#wide-containter .flex-control-paging li a:hover, #navigation{background:$menu_background;}
.page-numbers.current, .sticky h2 a, #author-desc h2 a, .previous-article a, .next-article a, .slide-info .slide-author a, #cancel-comment-reply-link, .medium-featured-posts-title h2 a:hover, .three-posts-title a:hover, .required, .tagcloud a:hover, .post-tags a:hover, .slider-text-box .category-icon a:hover, #main-nav .menu-text a:hover, .carousel-text a:hover, #main-nav #menu-links li:hover .menu-text a:hover, .bypostauthor a, .post-author a, .three-posts-read-more a:hover, .post-author a:visited, a:hover, .feat-cat-categories a, .tv-featured-post-title a:hover, .tv-featured-text .category-icon a, .carousel-category a, .category-sidebar-news a, .ticker-cat a, #main-nav ul .category-sidebar-news a, .post-arrow, .good-title, .bad-title {color:$hovercolor;}
#main-nav ul li a, #mob-menu{font-family: $menu_font;}
#post-content blockquote{border-left: 4px solid $menu_background;}
.mosaic-posts-image:hover .mosaic-title h2:after{border-bottom: 2px solid $ticker_color;}
@media screen and (max-width: 708px) {#main-nav ul li {background:$menu_background;}#main-nav ul li:hover a{color:$hovercolor;}}
</style>";

//Slider

	echo
	"<script type='text/javascript'>
	var slide_picker = '$slide_picker';
	</script>";

}

function customizer_css() {
	echo "
	
	<style type='text/css'>
.customize-section .customize-control-image .preview-thumbnail img {max-width:100% !important;max-height:100% !important;}
#customize-control-tn_logo img{width:222px;max-width:222px;}
#customize-control-tn_apple_touch_icon img{width:98px;}
#customize-control-tn_apple_touch_icon .customize-control-title{line-height:16px;margin-bottom:5px;}
#customize-section-tn_images .customize-control{padding-bottom:20px;}
 
    </style>";
}

//Fonts

function google_font() {
	$font = get_option('tn_fonts');
	$fontmenu = get_option('tn_menu_font');
	$tn_customfont = str_replace( ' ', '+', $font ) . ':400,600,700,800|' . $font;
	$tn_customfontmenu = str_replace( ' ', '+', $fontmenu ) . ':400,600,700,800|' . $fontmenu;
	$protocol = is_ssl() ? 'https' : 'http';
	wp_enqueue_style( 'google-fonts', "$protocol://fonts.googleapis.com/css?subset=latin,latin-ext,cyrillic,cyrillic-ext&family=".$tn_customfont . " rel='stylesheet' type='text/css" );
	wp_enqueue_style( 'google-menu-fonts', "$protocol://fonts.googleapis.com/css?subset=latin,latin-ext,cyrillic,cyrillic-ext&family=".$tn_customfontmenu . " rel='stylesheet' type='text/css" );
}

add_action( 'wp_enqueue_scripts', 'google_font' );
add_action( 'wp_head', 'trendingnews_head');
add_action( 'customize_controls_print_styles', 'customizer_css' );
?>