<?php

    $timber_work_theme_css= "";

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

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

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

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

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

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

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

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

    /*---------------------------Width Layout -------------------*/

    $timber_work_width_option = get_theme_mod( 'timber_work_width_option','Full Width');
    if($timber_work_width_option == 'Boxed Width'){
        $timber_work_theme_css .='body{';
            $timber_work_theme_css .='max-width: 1140px; width: 100%; padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto;';
        $timber_work_theme_css .='}';
        $timber_work_theme_css .='.scrollup i{';
            $timber_work_theme_css .='right: 100px;';
        $timber_work_theme_css .='}';
        $timber_work_theme_css .='.page-template-custom-home-page .home-page-header{';
            $timber_work_theme_css .='padding: 0px 40px 0 10px;';
        $timber_work_theme_css .='}';
    }else if($timber_work_width_option == 'Wide Width'){
        $timber_work_theme_css .='body{';
            $timber_work_theme_css .='width: 100%;padding-right: 15px;padding-left: 15px;margin-right: auto;margin-left: auto;';
        $timber_work_theme_css .='}';
        $timber_work_theme_css .='.scrollup i{';
            $timber_work_theme_css .='right: 30px;';
        $timber_work_theme_css .='}';
    }else if($timber_work_width_option == 'Full Width'){
        $timber_work_theme_css .='body{';
            $timber_work_theme_css .='max-width: 100%;';
        $timber_work_theme_css .='}';
    }

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

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

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

    $timber_work_first_color = get_theme_mod('timber_work_first_color');

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

    $timber_work_second_color = get_theme_mod('timber_work_second_color');

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

    $timber_work_third_color = get_theme_mod('timber_work_third_color');

    if ($timber_work_third_color) {
        $timber_work_theme_css .= ':root {';
        $timber_work_theme_css .= '--third-color: ' . esc_attr($timber_work_third_color) . ' !important;';
        $timber_work_theme_css .= '} ';
    }

    /*-------------------- Heading typography -------------------*/

    $timber_work_heading_color = get_theme_mod('timber_work_heading_color');
    $timber_work_heading_font_family = get_theme_mod('timber_work_heading_font_family');
    $timber_work_heading_font_size = get_theme_mod('timber_work_heading_font_size');
    if($timber_work_heading_color != false || $timber_work_heading_font_family != false || $timber_work_heading_font_size != false){
        $timber_work_theme_css .='h1, h2, h3, h4, h5, h6, .navbar-brand h1.site-title, h2.entry-title, h1.entry-title, h2.page-title, #latest_post h2, h2.woocommerce-loop-product__title, #top-slider .slider-inner-box h3, .featured h3.main-heading, .article-box h3.entry-title, .featured h4.main-heading, #colophon h5, .sidebar h5{';
            $timber_work_theme_css .='color: '.esc_attr($timber_work_heading_color).'!important; 
            font-family: '.esc_attr($timber_work_heading_font_family).'!important;
            font-size: '.esc_attr($timber_work_heading_font_size).'px !important;';
        $timber_work_theme_css .='}';
    }

    $timber_work_paragraph_color = get_theme_mod('timber_work_paragraph_color');
    $timber_work_paragraph_font_family = get_theme_mod('timber_work_paragraph_font_family');
    $timber_work_paragraph_font_size = get_theme_mod('timber_work_paragraph_font_size');
    if($timber_work_paragraph_color != false || $timber_work_paragraph_font_family != false || $timber_work_paragraph_font_size != false){
        $timber_work_theme_css .='p, p.site-title, span, .article-box p, ul, li{';
            $timber_work_theme_css .='color: '.esc_attr($timber_work_paragraph_color).'!important; 
            font-family: '.esc_attr($timber_work_paragraph_font_family).'!important;
            font-size: '.esc_attr($timber_work_paragraph_font_size).'px !important;';
        $timber_work_theme_css .='}';
    }

    /*---------------- Logo CSS ----------------------*/
    $timber_work_logo_title_font_size = get_theme_mod( 'timber_work_logo_title_font_size');
    $timber_work_logo_tagline_font_size = get_theme_mod( 'timber_work_logo_tagline_font_size');
    if( $timber_work_logo_title_font_size != '') {
        $timber_work_theme_css .='#masthead .navbar-brand a{';
            $timber_work_theme_css .='font-size: '. $timber_work_logo_title_font_size. 'px;';
        $timber_work_theme_css .='}';
    }
    if( $timber_work_logo_tagline_font_size != '') {
        $timber_work_theme_css .='#masthead .navbar-brand p{';
            $timber_work_theme_css .='font-size: '. $timber_work_logo_tagline_font_size. 'px;';
        $timber_work_theme_css .='}';
    }

    /*---------------- Header CSS ----------------------*/
    $timber_work_banner_section_setting = get_theme_mod( 'timber_work_banner_section_setting',false);
    if( $timber_work_banner_section_setting != true) {
        $timber_work_theme_css .='.page-template-home-template .socialmedia{';
            $timber_work_theme_css .='background:linear-gradient(180deg, var(--first-color); 0%, var(--first-color) 100%); position:static;';
        $timber_work_theme_css .='}';
    }