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

if ( defined( 'FW' ) ) {
    $topbar_style ='';
    $body_bg_url = '';
    $general_box_bg_image_url = '';
    $page_box_bg_image_url = '';
    $topbar_padding_top = '';
    $topbar_padding_bottom = '';
    $topbat_bg_color = '';
    $topbar_color = '';

    $typography = digiqole_option( 'typography' );
    $body_bg = digiqole_option( 'style_body_bg', '#fff' );
    $style_primary = digiqole_option( 'style_primary', '#fc4a00');
    $body_color = digiqole_option( 'body_color', '#333333');
    $title_color = digiqole_option( 'title_color', '#222222');
    $style_primary_dark = digiqole_option( 'style_primary_dark','#333');
    $secondary_color = digiqole_option( 'secondary_color','#e74907');

    // topbar
    $theme_header_settings = digiqole_option('theme_header_default_settings');
    if(isset($theme_header_settings['no']['topbar_style'])){
      $topbar_style = $theme_header_settings['no']['topbar_style'];
      $topbar_padding_top = $topbar_style['topbar_padding_top'];
      $topbar_padding_bottom = $topbar_style['topbar_padding_bottom'];
      $topbat_bg_color = $topbar_style['topbat_bg_color'];
      $topbar_color = $topbar_style['topbar_color'];
   }

    // menu style
    $menu_height = digiqole_option('navmenu_height');
    $menu_bg_color = digiqole_option('menu_bg_color');
    $menu_bg_primary= $menu_bg_color['primary'];
    $menu_bg_secondary= $menu_bg_color['secondary'];

    $menu_color = digiqole_option('menu_color');
    $menu_hover_color = digiqole_option('menu_hover_color');
    $submenu_color = digiqole_option('submenu_color');
    $submenu_hover_color = digiqole_option('submenu_hover_color');

    $menu_font = digiqole_option( 'menu_font' );
    digiqole_Unyson_Google_Fonts::add_typography_v2( $menu_font );
    $menu_font = digiqole_advanced_font_styles( $menu_font );

    $submenu_font = digiqole_option( 'submenu_font' );
   

    // logo 
    $logo_style = digiqole_option( 'logo_style');
    $logo_width = $logo_style['logo_width'];
    $logo_padding_top = $logo_style['Padding_top'];
    $logo_padding_bottom = $logo_style['Padding_bottom'];



    // tranding bg color
    $newsticker_bg_color = digiqole_option( 'newsticker_bg_color');
    $newsticker_title_bg_color = digiqole_option( 'newsticker_title_bg_color','#e74907');
 
    $general_body_box_layout = digiqole_option("general_body_box_layout");
    $page_body_box_layout = digiqole_meta_option(get_the_ID(),"page_body_box_layout");

    $page_override_header_item     = digiqole_meta_option(get_the_ID(),'page_header_override');
    $page_header_layout_style_item = digiqole_meta_option(get_the_ID(),'page_header_layout_style');
  
  
    if(isset($general_body_box_layout["yes"])) {
       $box_bg_image = $general_body_box_layout["yes"];
       if(isset($box_bg_image["general_body_box_bg_image"])){
          
           if(is_array($box_bg_image["general_body_box_bg_image"])){
                $general_box_bg_image_url = $box_bg_image["general_body_box_bg_image"]["url"];
           }
        
       }
    }

 

    $body_bg_url = 'background-image:url('. $general_box_bg_image_url .');'; 
    

    $global_body_font = digiqole_option( 'body_font' );
    
    digiqole_Unyson_Google_Fonts::add_typography_v2( $global_body_font );
    $body_font = digiqole_advanced_font_styles( $global_body_font );
    $body_font = digiqole_array_elements_remove($body_font,2);
    
    $heading_font_one = digiqole_option( 'heading_font_one' );
    digiqole_Unyson_Google_Fonts::add_typography_v2( $heading_font_one );
    $heading_font_one = digiqole_advanced_font_styles( $heading_font_one );
   
    $heading_font_two = digiqole_option( 'heading_font_two' );
    digiqole_Unyson_Google_Fonts::add_typography_v2( $heading_font_two );
    $heading_font_two = digiqole_advanced_font_styles( $heading_font_two );

    $heading_font_three = digiqole_option( 'heading_font_three' );
    digiqole_Unyson_Google_Fonts::add_typography_v2( $heading_font_three );
    $heading_font_three = digiqole_advanced_font_styles( $heading_font_three );





    // init custom css
    $custom_css	 = digiqole_option( 'custom_css' );
    $output = $custom_css;

    // global style
    $output	.= "
        body{ $body_font }
        .body-box-layout{ 
            $body_bg_url;
            background-repeat: no-repeat;
            background-position: center;
            background-size: cover;
            background-attachment: fixed;
         }
        body,
        .post-navigation .post-previous a p, .post-navigation .post-next a p,
        .dark-mode .blog-single .post-meta li,
        .dark-mode .wp-block-quote p,
        .dark-mode .wp-block-quote::before,
        .dark-mode .wp-block-quote cite,
        .dark-mode .view-review-list .xs-review-date,
        .dark-mode .view-review-list .xs-reviewer-author,
        .dark-mode .breadcrumb li,
        .dark-mode .post-meta span,
        .dark-mode .post-meta span a,
        .dark-mode .tranding-bg-white .tranding-bar .trending-slide-bg.trending-slide .post-title a,
        .dark-mode .blog-single .post-meta li.post-author a{
           color:  $body_color;
        }
        h1, h2, h3, h4, h5, h6,
        .post-title,
        .post-navigation span,
        .post-title a,
        .dark-mode .error-page .error-code,
        .dark-mode.archive .entry-blog-summery .readmore-btn,
        .dark-mode .entry-blog-summery.ts-post .readmore-btn,
        .dark-mode .apsc-icons-wrapper.apsc-theme-2 .apsc-each-profile a,
        .dark-mode .ts-author-content .comment a{
            color:  $title_color;
        }


     .dark-mode .apsc-icons-wrapper.apsc-theme-2 .apsc-each-profile a{
        color: $title_color !important;
        }
        .dark-mode .blog-single .post .post-body{
            background: transparent;
        }




        h1,h2{
            $heading_font_one
        }
        h3{ 
            $heading_font_two 
        }

        h4{ 
            $heading_font_three
        }

        a,  .entry-header .entry-title a:hover, .sidebar ul li a:hover{
            color: $style_primary;
            transition: all ease 500ms;
        }
      
        .btn-primary:hover,
        .header .navbar-light .elementskit-menu-hamburger,
        .header .navbar-light .navbar-toggler-icon{
         background: $secondary_color;
         border-color: $secondary_color;;
        }
        .tag-lists a:hover, .tagcloud a:hover,
        .owl-carousel .owl-dots .owl-dot.active span{
            border-color: $style_primary;;
        }
        blockquote.wp-block-quote, .wp-block-quote, .wp-block-quote:not(.is-large):not(.is-style-large), .wp-block-pullquote blockquote,
         blockquote.wp-block-pullquote, .wp-block-quote.is-large, .wp-block-quote.is-style-large{
            border-left-color: $style_primary;;
        }

        
        .post .post-footer .readmore,
        .post .post-media .video-link-btn a,
        .post-list-item .recen-tab-menu.nav-tabs li a:before, 
        .post-list-item .recen-tab-menu.nav-tabs li a:after,
        .blog-single .xs-review-box .xs-review .xs-btn:hover,
        .blog-single .tag-lists span,
        .tag-lists a:hover, .tagcloud a:hover,
        .heading-style3 .block-title .title-angle-shap:before, 
        .heading-style3 .block-title .title-angle-shap:after,
         .heading-style3 .widget-title .title-angle-shap:before, 
         .heading-style3 .widget-title .title-angle-shap:after, 
         .sidebar .widget .block-title .title-angle-shap:before,
          .sidebar .widget .block-title .title-angle-shap:after, 
          .sidebar .widget .widget-title .title-angle-shap:before, 
        .sidebar .widget .widget-title .title-angle-shap:after,
        .pagination li.active a, .pagination li:hover a,
        .owl-carousel .owl-dots .owl-dot.active span,
        .header .navbar-light .ekit-wid-con .digiqole-elementskit-menu
         .elementskit-navbar-nav > li.active > a:before,
         .trending-light .tranding-bar .trending-slide .trending-title,
        .post-list-item .post-thumb .tab-post-count, .post-list-item .post-thumb .post-index,
        .woocommerce ul.products li.product .button,.woocommerce ul.products li.product .added_to_cart,
        .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,
        .not-found .input-group-btn,
        .btn,
        .BackTo,
        .sidebar .widget.widget_search .input-group-btn,
        .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, 
        .footer-social ul li a,
        .digiqole-video-post .video-item .post-video .ts-play-btn,
        .blog-single .post-meta .social-share i.fa-share,
        .woocommerce input.button.alt:hover,.woocommerce .widget_price_filter .ui-slider .ui-slider-handle{
            background: $style_primary;
        }
        .owl-carousel.owl-loaded .owl-nav .owl-next.disabled, 
        .owl-carousel.owl-loaded .owl-nav .owl-prev.disabled,
        .ts-about-image-wrapper.owl-carousel.owl-theme .owl-nav [class*=owl-]:hover{
            background: $style_primary !important;

        }

        .ts-footer .recent-posts-widget .post-content .post-title a:hover,
        .post-list-item .recen-tab-menu.nav-tabs li a.active,
        .ts-footer .footer-left-widget .footer-social li a:hover,
         .ts-footer .footer-widget .footer-social li a:hover,
         .heading-style3 .block-title, .heading-style3 .widget-title,
         .topbar.topbar-gray .tranding-bg-white .tranding-bar .trending-slide-bg .trending-title i,
         .sidebar .widget .block-title, .sidebar .widget .widget-title,
         .header .navbar-light .ekit-wid-con .digiqole-elementskit-menu .elementskit-navbar-nav .dropdown-item.active,
         .header .navbar-light .ekit-wid-con .digiqole-elementskit-menu .elementskit-navbar-nav li a:hover,
         .social-links li a:hover,
         .post-title a:hover,
         .video-tab-list .post-tab-list li a.active h4.post-title, .video-tab-list .post-tab-list li a:hover h4.post-title,
         .featured-tab-item .nav-tabs .nav-link.active .tab-head > span.tab-text-title,
         .woocommerce ul.products li.product .price, 
         .woocommerce ul.products li.product .woocommerce-loop-product__title:hover{
            color: $style_primary;
        }

        

       
      
        ";
       

        if($topbat_bg_color !=''){
            $output .= "
            .topbar.topbar-gray,
            .topbar-dark .top-dark-info{
                background: $topbat_bg_color;
            }
        ";
        }
        if($topbar_color !=''){
            $output .= "
            .topbar .top-nav li a,
            .topbar .social-links li a,
            .topbar.topbar-gray .top-info li,
            .tranding-bg-dark .tranding-bar .trending-slide-bg .trending-title,
            .tranding-bg-dark .tranding-bar .trending-slide-bg .post-title a,
            .topbar-dark .top-dark-info .top-info li,
            .tranding-bar .trending-slide .post-title a,
            .header-gradient-area .topbar .tranding-bar .trending-slide .trending-title,
            .header-gradient-area .topbar .top-info li a, .header-gradient-area .topbar .social-links li a,
            .header-gradient-area .topbar .top-info li, .header-gradient-area .topbar .social-links li,
            .topbar.topbar-gray .tranding-bg-white .tranding-bar .trending-slide-bg .trending-title,
            .topbar.topbar-gray .tranding-bg-white .tranding-bar .trending-slide-bg .post-title a,
            .topbar .social-links .header-date-info{
                color: $topbar_color;
            }
        ";
        }
        if($topbar_padding_top !='' || $topbar_padding_bottom !=''){
            $output .= "
            .topbar.topbar-gray,
            .header-gradient-area .topbar.b-bottom,
            .topbar.topbar-gray, .topbar-dark .top-dark-info{
                padding-top: {$topbar_padding_top}px;
            }
            .topbar.topbar-gray,
            .header-gradient-area .topbar.b-bottom,
            .topbar.topbar-gray, .topbar-dark .top-dark-info{
                padding-bottom: {$topbar_padding_bottom}px;
            }
        ";
        }


        if($logo_width !=''){
            $output .= "
            .logo img{
                max-width: {$logo_width}px;
            }
        ";
        }
        if($logo_padding_top !='' || $logo_padding_bottom !=''){
            $output .= "
            .logo{
                padding-top:  {$logo_padding_top}px;
                padding-bottom:  {$logo_padding_bottom}px;
            }
        ";
        }


        if($menu_height !=''){
            $output .= "
            .header .navbar-light .ekit-wid-con .digiqole-elementskit-menu{
               height: {$menu_height}px;
            }
            @media(min-width: 1024px){
                .header-gradient-area .navbar-light .ekit-wid-con .digiqole-elementskit-menu .elementskit-navbar-nav > li > a,
                .header.header-gradient .navbar-light .ekit-wid-con .digiqole-elementskit-menu .elementskit-navbar-nav > li > a, 
                .header .navbar-light .ekit-wid-con .digiqole-elementskit-menu .elementskit-navbar-nav > li > a,
                 .header .navbar-light .nav-search-area a, .header-gradient .navbar-light .social-links li a, 
                 .header .navbar-light .navbar-nav > li > a, 
               .header-gradient .navbar-light .nav-search-area .header-search-icon a{
                   line-height: {$menu_height}px;
               }
            }
        ";
        }
       

        if($menu_bg_primary !=''){
            $output .= "
                .header-gradient,
                .header-dark .navbar-light,
                .header-gradient .navbar-sticky.sticky,
                .header-bg-dark .navbar-sticky.sticky,
                .header-bg-dark,
                .header-middle-gradent{
                    background-image: linear-gradient(20deg, $menu_bg_primary 0%, $menu_bg_secondary 100%);
                }
            ";
        }
        if($menu_color !=''){
            $output .= "
                @media(min-width: 1024px){
                    .header-gradient-area .navbar-light .ekit-wid-con .digiqole-elementskit-menu .elementskit-navbar-nav > li > a,
                    .header.header-gradient .navbar-light .ekit-wid-con .digiqole-elementskit-menu .elementskit-navbar-nav > li > a,
                    .header .navbar-light .ekit-wid-con .digiqole-elementskit-menu .elementskit-navbar-nav > li > a,
                    .header .navbar-light .nav-search-area a,
                    .header-gradient .navbar-light .social-links li a,
                    .header .navbar-light .navbar-nav > li > a{
                           color: $menu_color;
                    }
                }
            ";
        }
        if($menu_hover_color !=''){
            $output .= "
                @media(min-width: 1024px){
                    .header-gradient-area .navbar-light .ekit-wid-con .digiqole-elementskit-menu .elementskit-navbar-nav > li > a:hover,
                    .header.header-gradient .navbar-light .ekit-wid-con .digiqole-elementskit-menu .elementskit-navbar-nav > li > a:hover,
                    .header .navbar-light .navbar-nav > li > a:hover,
                    .header-gradient-area .header .navbar-light .navbar-nav > li.active > a, 
                    .header-gradient-area .header .navbar-light .navbar-nav > li:hover > a,
                    .navbar-solid.header .navbar-light .navbar-nav li.active > a,
                    .header.header-dark .navbar-light .navbar-nav li.active > a,
                    .header .navbar-light .navbar-nav li.active > a,
                    .header.header-gradient .navbar-light .ekit-wid-con .digiqole-elementskit-menu .elementskit-navbar-nav > li.active > a,
                    .header .navbar-light .ekit-wid-con .digiqole-elementskit-menu .elementskit-navbar-nav > li:hover > a{
                        color: $menu_hover_color;
                    }


                    
                }
                .header .navbar-light .ekit-wid-con .digiqole-elementskit-menu .elementskit-navbar-nav > li.active > a:before,
                .header .navbar-light .navbar-nav > li.active > a:before{
                    background: $menu_hover_color;
                }
            ";
        }
   

        if($submenu_color !='' || $submenu_font !=''){
            $output .= "
     
            .header .navbar-light .navbar-nav li ul.dropdown-menu li a,
            .header .navbar-light .ekit-wid-con .digiqole-elementskit-menu .elementskit-navbar-nav li ul li a,
            .header .navbar-light .ekit-wid-con .digiqole-elementskit-menu .elementskit-navbar-nav li .elementskit-dropdown li a{
                   color: $submenu_color;
                   font-size: {$submenu_font}px;
                }
            ";
        }
        if($submenu_hover_color !=''){
            $output .= "
     
            .header .navbar-light .navbar-nav li ul.dropdown-menu li a:hover,
            .header .navbar-light .ekit-wid-con .digiqole-elementskit-menu .elementskit-navbar-nav .dropdown-item.active,
            .header .navbar-light .ekit-wid-con .digiqole-elementskit-menu .elementskit-navbar-nav li ul li a:hover,
            .header .navbar-light .navbar-nav li ul.dropdown-menu li.active a{
                   color: $submenu_hover_color;
                   
                }
            ";
        }

        if(isset($menu_font) && $menu_font !=''){
            $output .= "
            .header-gradient-area .navbar-light .ekit-wid-con .digiqole-elementskit-menu .elementskit-navbar-nav > li > a,
            .header.header-gradient .navbar-light .ekit-wid-con .digiqole-elementskit-menu .elementskit-navbar-nav > li > a,
            .header .navbar-light .ekit-wid-con .digiqole-elementskit-menu .elementskit-navbar-nav > li > a,
            .header .navbar-light .nav-search-area a,
            .header-gradient .navbar-light .social-links li a,
            .header .navbar-light .navbar-nav > li > a,
            .header-gradient .navbar-light .nav-search-area .header-search-icon a{
                $menu_font
                }
            ";
        }







      if($newsticker_bg_color!=''){
         $output .= "
               .tranding-bar .trending-slide-bg,
                .tranding-bg-dark .tranding-bar,
                 .tranding-gradient .tranding-bar{
                  background-color: $newsticker_bg_color;
               }
         ";
      }   


    






    // footer style
    $footer_top_bg_color = digiqole_option('footer_top_bg_color');

    $footer_top_bg_primary = $footer_top_bg_color['primary'];
    $footer_top_bg_secondary = $footer_top_bg_color['secondary'];
      if($footer_top_bg_primary !=''){
        $output .= "
        .newsletter-area{
                background-image: linear-gradient(20deg, $footer_top_bg_primary 0%, $footer_top_bg_secondary 100%);
            }
        ";
        }
        
      $footer_bg_color = digiqole_option( 'footer_bg_color', '##222222' );
      $footer_padding_top = digiqole_option( 'footer_padding_top');
      $footer_padding_bottom = digiqole_option( 'footer_padding_bottom');
      $footer_copyright_color = digiqole_option('footer_copyright_color', '#fff');
     
      $footer_bg              = digiqole_option("footer_bg_color");
      $footer_bg_img = digiqole_option("footer_bg_url");
      $footer_bg_url = '';
      if(is_array($footer_bg_img) && isset($footer_bg_img['url'])):
         $footer_bg_url = $footer_bg_img['url'];  
         $footer_bg_url = 'background-image:url('.$footer_bg_url.');';
     endif;
      $ts_footer_widget_title_color = digiqole_option("ts_footer_widget_title_color",'#ffff');
      $footer_text_color  = digiqole_option("footer_text_color","#ffff");
    
     
       
      
       if($footer_padding_top!='' || $footer_padding_bottom!=''){

         $footer_padding_top =  'padding-top:'.digiqole_style_unit($footer_padding_top);
         $footer_padding_bottom =  'padding-bottom:'.digiqole_style_unit($footer_padding_bottom);
         $output .= ".ts-footer{
            $footer_padding_top;
            $footer_padding_bottom;
         }"; 
         
       } 

     
    

      $output	.= "
      body,
      .dark-mode .ts-author-media,
      .dark-mode .ts-author-content::before,
      .dark-mode .ts-author-content::after,
      .dark-mode .post-layout-style4 .post-single .entry-header{
         background-color: $body_bg;
      }
     
      .ts-footer{
          background-color: $footer_bg_color;
          background-repeat:no-repeat;
          background-size: cover;
          $footer_bg_url
          
      }
      .newsletter-form span,
      .ts-footer .widget-title span{
        background-color: $footer_bg_color;
      }

      .ts-footer-classic .widget-title,
      .ts-footer-classic h3,
      .ts-footer-classic h4,
      .ts-footer .widget-title,
      .ts-footer-classic .contact h3{
          color: $ts_footer_widget_title_color;
      }
      .ts-footer p,
      .ts-footer .list-arrow li a,
      .ts-footer .menu li a,
      .ts-footer .service-time li,
      .ts-footer .list-arrow li::before, 
      .ts-footer .footer-info li,
      .ts-footer .footer-left-widget .footer-social li a, .ts-footer .footer-widget .footer-social li a,
      .ts-footer .footer-left-widget p, .ts-footer .footer-widget p,
      .ts-footer .recent-posts-widget .post-content .post-title a,
      .ts-footer .menu li::before{
        color: $footer_text_color;
      }

     
     
      .copy-right .copyright-text p{
         color: $footer_copyright_color;
      }
      ";


      $general_container_width = digiqole_option('general_container_width','no');
      if($general_container_width == 'yes'):
       
         $general_container_width_settings =  digiqole_option('general_container_width_settings');  
         $general_container_width_laptop   =  $general_container_width_settings['yes']['container_width_laptop']; 
         $general_container_width_desktop  =  $general_container_width_settings['yes']['container_width_desktop']; 
        
         $output	.= "
         
         @media (min-width: 992px){
            .container,
            .body-box-layout .body-inner-content,
            .body-box-layout .body-inner-content .navbar-sticky.sticky,
            .body-box-layout .body-inner-content .header-bg-dark .container,
            .elementor-section.elementor-section-boxed>.elementor-container {
               max-width: {$general_container_width_laptop}px;
            }   
         } 
         @media (min-width: 1200px) {
            .container,
            .body-box-layout .body-inner-content,
            .body-box-layout .body-inner-content .navbar-sticky.sticky,
            .body-box-layout .body-inner-content .header-bg-dark .container,
            .elementor-section.elementor-section-boxed>.elementor-container {
               max-width: {$general_container_width_desktop}px;
            }
         }
        
         ";
        
      endif;

    wp_add_inline_style( 'digiqole-master', $output );


}

