<?php

    $magazine_express_theme_css= "";

    /*-------------------- Global First Color -------------------*/

    $magazine_express_global_color = get_theme_mod('magazine_express_global_color');
    $magazine_express_first_global_color = get_theme_mod('magazine_express_first_global_color');

    if ($magazine_express_global_color) {
        $magazine_express_theme_css .= ':root {';
        $magazine_express_theme_css .= '--first-color: ' . esc_attr($magazine_express_global_color) . ' !important;';
        $magazine_express_theme_css .= '} ';
    }

    if ($magazine_express_first_global_color) {
        $magazine_express_theme_css .= ':root {';
        $magazine_express_theme_css .= '--second-color: ' . esc_attr($magazine_express_first_global_color) . ' !important;';
        $magazine_express_theme_css .= '} ';
    }

    /*--------------------------- Scroll to top positions -------------------*/

    $magazine_express_scroll_position = get_theme_mod( 'magazine_express_scroll_top_position','Right');
    if($magazine_express_scroll_position == 'Right'){
        $magazine_express_theme_css .='#button{';
            $magazine_express_theme_css .='right: 20px;';
        $magazine_express_theme_css .='}';
    }else if($magazine_express_scroll_position == 'Left'){
        $magazine_express_theme_css .='#button{';
            $magazine_express_theme_css .='left: 20px;';
        $magazine_express_theme_css .='}';
    }else if($magazine_express_scroll_position == 'Center'){
        $magazine_express_theme_css .='#button{';
            $magazine_express_theme_css .='right: 50%;left: 50%;';
        $magazine_express_theme_css .='}';
    }

    /*--------------------------- Scroll To Top Border Radius -------------------*/

    $magazine_express_scroll_to_top_border_radius = get_theme_mod('magazine_express_scroll_to_top_border_radius');
    $magazine_express_scroll_bg_color = get_theme_mod('magazine_express_scroll_bg_color');
    $magazine_express_scroll_color = get_theme_mod('magazine_express_scroll_color');
    $magazine_express_scroll_font_size = get_theme_mod('magazine_express_scroll_font_size');
    if($magazine_express_scroll_to_top_border_radius != false || $magazine_express_scroll_bg_color != false || $magazine_express_scroll_color != false || $magazine_express_scroll_font_size != false){
        $magazine_express_theme_css .='#colophon a#button{';
            $magazine_express_theme_css .='border-radius: '.esc_attr($magazine_express_scroll_to_top_border_radius).'px; background-color: '.esc_attr($magazine_express_scroll_bg_color).'; color: '.esc_attr($magazine_express_scroll_color).' !important; font-size: '.esc_attr($magazine_express_scroll_font_size).'px;';
        $magazine_express_theme_css .='}';
    }

    /*--------------------------- Slider Opacity -------------------*/

    $magazine_express_theme_lay = get_theme_mod( 'magazine_express_slider_opacity_color','');
    if($magazine_express_theme_lay == '0'){
        $magazine_express_theme_css .='.slider-imagebox img{';
            $magazine_express_theme_css .='opacity:0';
        $magazine_express_theme_css .='}';
        }else if($magazine_express_theme_lay == '0.1'){
        $magazine_express_theme_css .='.slider-imagebox img{';
            $magazine_express_theme_css .='opacity:0.1';
        $magazine_express_theme_css .='}';
        }else if($magazine_express_theme_lay == '0.2'){
        $magazine_express_theme_css .='.slider-imagebox img{';
            $magazine_express_theme_css .='opacity:0.2';
        $magazine_express_theme_css .='}';
        }else if($magazine_express_theme_lay == '0.3'){
        $magazine_express_theme_css .='.slider-imagebox img{';
            $magazine_express_theme_css .='opacity:0.3';
        $magazine_express_theme_css .='}';
        }else if($magazine_express_theme_lay == '0.4'){
        $magazine_express_theme_css .='.slider-imagebox img{';
            $magazine_express_theme_css .='opacity:0.4';
        $magazine_express_theme_css .='}';
        }else if($magazine_express_theme_lay == '0.5'){
        $magazine_express_theme_css .='.slider-imagebox img{';
            $magazine_express_theme_css .='opacity:0.5';
        $magazine_express_theme_css .='}';
        }else if($magazine_express_theme_lay == '0.6'){
        $magazine_express_theme_css .='.slider-imagebox img{';
            $magazine_express_theme_css .='opacity:0.6';
        $magazine_express_theme_css .='}';
        }else if($magazine_express_theme_lay == '0.7'){
        $magazine_express_theme_css .='.slider-imagebox img{';
            $magazine_express_theme_css .='opacity:0.7';
        $magazine_express_theme_css .='}';
        }else if($magazine_express_theme_lay == '0.8'){
        $magazine_express_theme_css .='.slider-imagebox img{';
            $magazine_express_theme_css .='opacity:0.8';
        $magazine_express_theme_css .='}';
        }else if($magazine_express_theme_lay == '0.9'){
        $magazine_express_theme_css .='.slider-imagebox img{';
            $magazine_express_theme_css .='opacity:0.9';
        $magazine_express_theme_css .='}';
        }

    /*---------------- Single post Settings ------------------*/

    $magazine_express_single_post_navigation_show_hide = get_theme_mod('magazine_express_single_post_navigation_show_hide',true);
    if($magazine_express_single_post_navigation_show_hide != true){
        $magazine_express_theme_css .='.nav-links{';
            $magazine_express_theme_css .='display: none;';
        $magazine_express_theme_css .='}';
    }

    /*--------------------------- Woocommerce Product Sale Positions -------------------*/

    $magazine_express_product_sale = get_theme_mod( 'magazine_express_woocommerce_product_sale','Right');
    if($magazine_express_product_sale == 'Right'){
        $magazine_express_theme_css .='.woocommerce ul.products li.product .onsale{';
            $magazine_express_theme_css .='left: auto; right: 15px;';
        $magazine_express_theme_css .='}';
    }else if($magazine_express_product_sale == 'Left'){
        $magazine_express_theme_css .='.woocommerce ul.products li.product .onsale{';
            $magazine_express_theme_css .='left: 15px; right: auto;';
        $magazine_express_theme_css .='}';
    }else if($magazine_express_product_sale == 'Center'){
        $magazine_express_theme_css .='.woocommerce ul.products li.product .onsale{';
            $magazine_express_theme_css .='right: 50%;left: 50%;';
        $magazine_express_theme_css .='}';
    }

    /*--------------------------- Woocommerce Product Sale Border Radius -------------------*/

    $magazine_express_woo_product_sale_border_radius = get_theme_mod('magazine_express_woo_product_sale_border_radius');
    if($magazine_express_woo_product_sale_border_radius != false){
        $magazine_express_theme_css .='.woocommerce ul.products li.product .onsale{';
            $magazine_express_theme_css .='border-radius: '.esc_attr($magazine_express_woo_product_sale_border_radius).'px;';
        $magazine_express_theme_css .='}';
    }

    /*--------------------------- Woocommerce Related Products -------------------*/

    $magazine_express_woocommerce_related_product_show_hide = get_theme_mod('magazine_express_woocommerce_related_product_show_hide',true);
    if($magazine_express_woocommerce_related_product_show_hide != true){
        $magazine_express_theme_css .='.related.products{';
            $magazine_express_theme_css .='display: none;';
        $magazine_express_theme_css .='}';
    }

    /*--------------------------- Footer background image -------------------*/

    $magazine_express_footer_bg_image = get_theme_mod('magazine_express_footer_bg_image');
    if($magazine_express_footer_bg_image != false){
        $magazine_express_theme_css .='#colophon{';
            $magazine_express_theme_css .='background: url('.esc_attr($magazine_express_footer_bg_image).')!important;';
        $magazine_express_theme_css .='}';
    }

     /*--------------------------- Single Post Page Image Box Shadow -------------------*/

    $magazine_express_single_post_page_image_box_shadow = get_theme_mod('magazine_express_single_post_page_image_box_shadow',0);
    if($magazine_express_single_post_page_image_box_shadow != false){
        $magazine_express_theme_css .='.single-post .entry-header img{';
            $magazine_express_theme_css .='box-shadow: '.esc_attr($magazine_express_single_post_page_image_box_shadow).'px '.esc_attr($magazine_express_single_post_page_image_box_shadow).'px '.esc_attr($magazine_express_single_post_page_image_box_shadow).'px #cccccc;';
        $magazine_express_theme_css .='}';
    }

     /*--------------------------- Single Post Page Image Border Radius -------------------*/

    $magazine_express_single_post_page_image_border_radius = get_theme_mod('magazine_express_single_post_page_image_border_radius', 0);
    if($magazine_express_single_post_page_image_border_radius != false){
        $magazine_express_theme_css .='.single-post .entry-header img{';
            $magazine_express_theme_css .='border-radius: '.esc_attr($magazine_express_single_post_page_image_border_radius).'px;';
        $magazine_express_theme_css .='}';
    }

    /*--------------------------- Footer Background Image Position -------------------*/

    $magazine_express_footer_bg_image_position = get_theme_mod( 'magazine_express_footer_bg_image_position','scroll');
    if($magazine_express_footer_bg_image_position == 'fixed'){
        $magazine_express_theme_css .='#colophon{';
            $magazine_express_theme_css .='background-attachment: fixed !important; background-position: center !important;';
        $magazine_express_theme_css .='}';
    }elseif ($magazine_express_footer_bg_image_position == 'scroll'){
        $magazine_express_theme_css .='#colophon{';
            $magazine_express_theme_css .='background-attachment: scroll !important; background-position: center !important;';
        $magazine_express_theme_css .='}';
    }

    /*--------------------------- Footer Widget Heading Alignment -------------------*/

    $magazine_express_footer_widget_heading_alignment = get_theme_mod( 'magazine_express_footer_widget_heading_alignment','Left');
    if($magazine_express_footer_widget_heading_alignment == 'Left'){
        $magazine_express_theme_css .='#colophon h5, h5.footer-column-widget-title{';
        $magazine_express_theme_css .='text-align: left;';
        $magazine_express_theme_css .='}';
    }else if($magazine_express_footer_widget_heading_alignment == 'Center'){
        $magazine_express_theme_css .='#colophon h5, h5.footer-column-widget-title{';
            $magazine_express_theme_css .='text-align: center;';
        $magazine_express_theme_css .='}';
    }else if($magazine_express_footer_widget_heading_alignment == 'Right'){
        $magazine_express_theme_css .='#colophon h5, h5.footer-column-widget-title{';
            $magazine_express_theme_css .='text-align: right;';
        $magazine_express_theme_css .='}';
    }

    /*--------------------------- Copyright Background Color -------------------*/

    $magazine_express_copyright_background_color = get_theme_mod('magazine_express_copyright_background_color');
    if($magazine_express_copyright_background_color != false){
        $magazine_express_theme_css .='.footer_info{';
            $magazine_express_theme_css .='background-color: '.esc_attr($magazine_express_copyright_background_color).' !important;';
        $magazine_express_theme_css .='}';
    }

    /*--------------------------- Featured Image Border Radius -------------------*/

    $magazine_express_post_page_image_border_radius = get_theme_mod('magazine_express_post_page_image_border_radius', 0);
    if($magazine_express_post_page_image_border_radius != false){
        $magazine_express_theme_css .='.article-box img{';
            $magazine_express_theme_css .='border-radius: '.esc_attr($magazine_express_post_page_image_border_radius).'px;';
        $magazine_express_theme_css .='}';
    }

    /*--------------------------- Site Title And Tagline Color -------------------*/

    $magazine_express_logo_title_color = get_theme_mod('magazine_express_logo_title_color');
    if($magazine_express_logo_title_color != false){
        $magazine_express_theme_css .='p.site-title a, .navbar-brand a{';
            $magazine_express_theme_css .='color: '.esc_attr($magazine_express_logo_title_color).' !important;';
        $magazine_express_theme_css .='}';
    }

    $magazine_express_logo_tagline_color = get_theme_mod('magazine_express_logo_tagline_color');
    if($magazine_express_logo_tagline_color != false){
        $magazine_express_theme_css .='.logo p.site-description, .navbar-brand p{';
            $magazine_express_theme_css .='color: '.esc_attr($magazine_express_logo_tagline_color).'  !important;';
        $magazine_express_theme_css .='}';
    }

    /*--------------------------- Footer Widget Content Alignment -------------------*/

    $magazine_express_footer_widget_content_alignment = get_theme_mod( 'magazine_express_footer_widget_content_alignment','Left');
    if($magazine_express_footer_widget_content_alignment == 'Left'){
        $magazine_express_theme_css .='#colophon ul, #colophon p, .tagcloud, .widget{';
        $magazine_express_theme_css .='text-align: left;';
        $magazine_express_theme_css .='}';
    }else if($magazine_express_footer_widget_content_alignment == 'Center'){
        $magazine_express_theme_css .='#colophon ul, #colophon p, .tagcloud, .widget{';
            $magazine_express_theme_css .='text-align: center;';
        $magazine_express_theme_css .='}';
    }else if($magazine_express_footer_widget_content_alignment == 'Right'){
        $magazine_express_theme_css .='#colophon ul, #colophon p, .tagcloud, .widget{';
            $magazine_express_theme_css .='text-align: right;';
        $magazine_express_theme_css .='}';
    }

    /*--------------------------- Copyright Content Alignment -------------------*/

    $magazine_express_copyright_content_alignment = get_theme_mod( 'magazine_express_copyright_content_alignment','Right');
    if($magazine_express_copyright_content_alignment == 'Left'){
        $magazine_express_theme_css .='.footer-menu-left{';
        $magazine_express_theme_css .='text-align: left;';
        $magazine_express_theme_css .='}';
    }else if($magazine_express_copyright_content_alignment == 'Center'){
        $magazine_express_theme_css .='.footer-menu-left{';
            $magazine_express_theme_css .='text-align: center;';
        $magazine_express_theme_css .='}';
    }else if($magazine_express_copyright_content_alignment == 'Right'){
        $magazine_express_theme_css .='.footer-menu-left{';
            $magazine_express_theme_css .='text-align: right;';
        $magazine_express_theme_css .='}';
    }

    /*------------------ Nav Menus -------------------*/

    $magazine_express_nav_menu = get_theme_mod( 'magazine_express_nav_menu_text_transform','Uppercase');
    if($magazine_express_nav_menu == 'Capitalize'){
        $magazine_express_theme_css .='.main-navigation .menu > li > a{';
            $magazine_express_theme_css .='text-transform:Capitalize;';
        $magazine_express_theme_css .='}';
    }
    if($magazine_express_nav_menu == 'Lowercase'){
        $magazine_express_theme_css .='.main-navigation .menu > li > a{';
            $magazine_express_theme_css .='text-transform:Lowercase;';
        $magazine_express_theme_css .='}';
    }
    if($magazine_express_nav_menu == 'Uppercase'){
        $magazine_express_theme_css .='.main-navigation .menu > li > a{';
            $magazine_express_theme_css .='text-transform:Uppercase;';
        $magazine_express_theme_css .='}';
    }

    $magazine_express_menu_font_size = get_theme_mod( 'magazine_express_menu_font_size');
    if($magazine_express_menu_font_size != ''){
        $magazine_express_theme_css .='.main-navigation .menu > li > a{';
            $magazine_express_theme_css .='font-size: '.esc_attr($magazine_express_menu_font_size).'px;';
        $magazine_express_theme_css .='}';
    }

    $magazine_express_nav_menu_font_weight = get_theme_mod( 'magazine_express_nav_menu_font_weight',600);
    if($magazine_express_menu_font_size != ''){
        $magazine_express_theme_css .='.main-navigation .menu > li > a{';
            $magazine_express_theme_css .='font-weight: '.esc_attr($magazine_express_nav_menu_font_weight).';';
        $magazine_express_theme_css .='}';
    }

    /*------------------ Footer CSS -------------------*/
    $magazine_express_footer_bg_color = get_theme_mod( 'magazine_express_footer_bg_color');
    if($magazine_express_footer_bg_color != '' ){
        $magazine_express_theme_css .='#colophon {';
            $magazine_express_theme_css .='background-color: '.esc_attr($magazine_express_footer_bg_color).'; ';
        $magazine_express_theme_css .='}';
    }

    $magazine_express_footer_content_color = get_theme_mod( 'magazine_express_footer_content_color');
    if($magazine_express_footer_content_color != ''){
        $magazine_express_theme_css .='#colophon, #colophon a, #colophon h5, #colophon .widget #wp-calendar caption,#colophon .widget #wp-calendar thead,#colophon .widget #wp-calendar tbody,#colophon .widget #wp-calendar tfoot,#colophon .widget #wp-calendar tr,#colophon .widget #wp-calendar td, #colophon .widget #wp-calendar th {';
            $magazine_express_theme_css .='color: '.esc_attr($magazine_express_footer_content_color).';';
        $magazine_express_theme_css .='}';
    }

    /*------------------ Copyright CSS -------------------*/
    $magazine_express_copyright_text_color = get_theme_mod( 'magazine_express_copyright_text_color');
    if($magazine_express_copyright_text_color != ''){
        $magazine_express_theme_css .='#colophon .site-info a, #colophon .site-info span {';
            $magazine_express_theme_css .='color: '.esc_attr($magazine_express_copyright_text_color).';';
        $magazine_express_theme_css .='}';
    }