<?php if (!defined('ABSPATH')) die('Direct access forbidden.');
/**
 * dynamic css, generated by customizer options
 */

if ( defined( 'FW' ) ) {
    $typography = vinkmag_option( 'typography' );
    $body_bg = vinkmag_option( 'style_body_bg', '#f0f1f4' );
    $style_primary = vinkmag_option( 'style_primary');
    $style_primary_dark = vinkmag_option( 'style_primary_dark');
    $title_color = vinkmag_option( 'title_color');
    $global_body_font = vinkmag_option( 'body_font' );
    if ( $global_body_font[ 'family' ] != 'Arimo' ) {
        Vinkmag_Unyson_Google_Fonts::add_typography( vinkmag_option( 'body_font' ) );
    }
    $body_font = vinkmag_advanced_font_styles( vinkmag_option( 'body_font' ), 'font-style' );
    $cat_font = vinkmag_advanced_font_styles( vinkmag_option( 'heading_font' ), 'font-family' );

    $heading_font = vinkmag_option( 'heading_font' );
    if ( $heading_font[ 'family' ] != 'Heebo' ) {
        Vinkmag_Unyson_Google_Fonts::add_typography( vinkmag_option( 'heading_font' ) );
    }
    $global_heading_font = vinkmag_advanced_font_styles( vinkmag_option( 'heading_font' ) );

    $custom_css	 = vinkmag_option( 'custom_css' );
    $output		 = 
        $custom_css."
        body{ $body_font }
        h1,h2,h3,h4,h5 { 
            $global_heading_font 
        }

        .nav-menu li a,.post-cat,.post-list-item .nav-tabs li a,.ts-social-list li b,
        .widgets.ts-social-list-item ul li a b,.footer-social li a,.ts-cat-title span,
        .view-link-btn span { 
            $cat_font
        }
        .body-inner-content{
          background-color:$body_bg 
        }

        /* primary background color*/
        .top-bar .top-social li.ts-date,
        .view-link-btn,
        .logo,
        .navbar-style1.navbar-container .navbar .nav-item a.active, 
        .navbar-style1.navbar-container .navbar .nav-item a:hover, 
        .navbar-style1.navbar-container .navbar .nav-item a:focus,
        .navbar-style1.navbar-container .nav-search-button,
        .ts-title .title-before,
        .owl-dots .owl-dot span,
        #breaking_slider .owl-nav .owl-prev:hover, #breaking_slider .owl-nav .owl-next:hover,
        .navbar-container.navbar-style5 .nav-item a.active:before, 
        .navbar-container.navbar-style5 .nav-item a:hover:before,
         .navbar-container.navbar-style5 .nav-item a:focus:before,
        .ts-newslatter .newsletter-form .ts-submit-btn .btn:hover,
        .top-bar .ts-date-item,
        .header-middle.v2,
        .video-slider .post-video .ts-play-btn,
        .top-social li.ts-subscribe,
        .ts-title.title-bg .title-text,
        .ts-title.title-bg .title-after,
        .ts-widget-newsletter,
        .ts-widget-newsletter .newsletter-form .btn:hover,
        .header-standerd,
        .navbar-container.navbar-style2,
        .navbar-container.navbar-style2 .navbar,
        .navbar-style2.navbar-container .nav-search-button,
        .navbar-container.navbar-style3.navbar-dark .nav-item a.active, .navbar-container.navbar-style3.navbar-dark .nav-item a:hover,
        .navbar-container.navbar-style3.navbar-dark .nav-item a:focus,
        .navbar-standerd.navbar-darks .navbar-style5 .xs-navbar .main-menu > li:hover > a, .navbar-standerd.navbar-darks .navbar-style5 .xs-navbar .main-menu > li.active > a,
        .navbar-standerd.navbar-darks .navbar-style5 .xs-navbar .main-menu > li:before,
        .single-post-wrapper .post-meta-info li.share-post a i,
        .widget-title:before,
        .tagcloud a:hover,
         blockquote cite:after,
        .error-page .error-body a,
        .accordion-post-style .card .btn,
        .navbar-container.navbar-style1 .navbar-nav > .current-menu-parent,
        .widgets-newsletter-form .btn.btn-primary,
        .pagination li.active a, .pagination li:hover a,
        .blog-navbar .navbar-container .navbar .main-menu .nav-item > a.active,
        .blog-navbar .navbar-container.navbar-style5 .main-menu > li.current-menu-item > a:before,
        .blog-navbar .navbar-container .navbar .main-menu .nav-item > a:hover,
        .btn.btn-primary,
        .navbar-standerd.nav-bg-white .navbar-style5 .navbar .main-menu .nav-item > a.active,
        .navbar-standerd.nav-bg-white .navbar-style5 .navbar .main-menu > .nav-item > a:hover,

        .ts-search-form .vinkmag-serach:before,
        .featured-tab-item .featured-tab-post > li a.active .post-content,
        .featured-tab-item .featured-tab-post > li a.active:before,
        .woocommerce ul.products li.product .button,.woocommerce ul.products li.product .added_to_cart,
        .post-meta-info .share-post,
        .woocommerce nav.woocommerce-pagination ul li a:focus, .woocommerce nav.woocommerce-pagination ul li a:hover, .woocommerce nav.woocommerce-pagination ul li span.current,
        .woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt,.sponsor-web-link a:hover i, .woocommerce .widget_price_filter .ui-slider .ui-slider-range, .woocommerce span.onsale{
            background-color: $style_primary;
        }

        /* primary color*/
        .breaking-title,
        .ts-top-nav li a:hover,
        .post-title a:hover,
        .owl-next,
        .owl-prev,
        .watch-post .post-list-box .post-title:hover,
        a:hover,
        .navbar-container .navbar .nav-item .dropdown-menu .dropdown-item.active, .navbar-container .navbar .nav-item .dropdown-menu .dropdown-item:hover, .navbar-container .navbar .nav-item .dropdown-menu .dropdown-item:focus,
        .ts-overlay-style .overlay-post-content .post-meta-info li.active,
        .navbar-container.navbar-style5 .nav-item a.active, .navbar-container.navbar-style5 .nav-item a:hover, .navbar-container.navbar-style5 .nav-item a:focus,
        .post-meta-info li.active, .post-video .post-video-content .post-meta-info li.active, .navbar-container.navbar-style3 .nav-item a.active, .navbar-container.navbar-style3 .nav-item a:hover, .navbar-container.navbar-style3 .nav-item a:focus, .post-navigation .post-previous:hover span, .post-navigation .post-next:hover span, .breadcrumb li, 
         .woocommerce ul.products li.product .price, .woocommerce ul.products li.product .woocommerce-loop-product__title,
         .single-post a,
         .navbar-container .navbar .main-menu .nav-item .dropdown-menu > li > .dropdown-item:hover{
           color: $style_primary;
        }

        /* primary dark color*/
        .top-bar.v2,
        .ts-widget-newsletter .newsletter-form .btn,.navbar-container.navbar-style2 .nav-item a.active, .navbar-container.navbar-style2 .nav-item a:hover,
         .navbar-container.navbar-style2 .nav-item a:focus,.widgets-newsletter-form .btn.btn-primary:hover, 
         .woocommerce ul.products li.product .added_to_cart:hover, .woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover,.woocommerce .widget_price_filter .ui-slider .ui-slider-handle{
           background-color: $style_primary_dark;
        }
        .woocommerce ul.products li.product .woocommerce-loop-product__title:hover{
                   color: $style_primary_dark;

        }
        .menu-toggler{
            background-color: $style_primary_dark !important;

        }
        /* border color*/
        .tagcloud a:hover{
           border-color:$style_primary;
        }


        /*--------------- title color----------------*/
        .post-title,
        .post-title a,
        .entry-title,
        .entry-title a,
        .elementor-widget-wp-widget-archives ul li a,
        .recent-posts-widget ul li .post-info,
        .ts-title,
        .widget-title{
            color: $title_color;
        }
    
        ";

    if(is_category()){
        $category = get_category( get_query_var( 'cat' ) );
        $body_bg = vinkmag_term_option($category->cat_ID, 'block_style_body_bg', '#f0f1f4');
        $output .= "
        .body-inner-content{
            background-color: $body_bg !important;
        }";
    }

    wp_add_inline_style( 'vinkmag-style', $output );
}