<?php

/**
 * Add CSS in <head> for styles handled by the theme customizer
 *
 */
/**
* Apply Color Scheme
*/

function thefashblog_apply_color() {

  if( get_header_textcolor() ){
    $header_text_color  =  esc_html( '#' . get_header_textcolor() );
  }else{
    $header_text_color  =  '#000000';
  }

  if( get_theme_mod('thefashblog_color_settings') ){
    $top_color          =   esc_html( get_theme_mod('thefashblog_color_settings') );
  }else{
    $top_color  =  '#ffffff';
  }

  if( get_theme_mod('thefashblog_color_settings1') ){
    $top_bg_color       =   esc_html( get_theme_mod('thefashblog_color_settings1') );
  }else{
    $top_bg_color  =  '#000000';
  }

  if( get_theme_mod('thefashblog_color_settings1_2') ){
    $footer_color       =   esc_html( get_theme_mod('thefashblog_color_settings1_2') );
  }else{
    $footer_color       =  '#ffffff';
  }

  if( get_theme_mod('thefashblog_color_settings1_3') ){
    $footer_bg_color       =   esc_html( get_theme_mod('thefashblog_color_settings1_3') );
  }else{
    $footer_bg_color       =  '#000000';
  }

  if( get_theme_mod('thefashblog_color_settings_1') ){
    $primary_color_1       =   esc_html( get_theme_mod('thefashblog_color_settings_1') );
  }else{
    $primary_color_1       =  '#000000';
  }

  if( get_theme_mod('thefashblog_color_settings_2') ){
    $primary_color_2       =   esc_html( get_theme_mod('thefashblog_color_settings_2') );
  }else{
    $primary_color_2       =  '#ef2673';
  }

    $custom_css = "
    .right-area a.social-tw,
    .top-search-form input[type='text'],
    .top-search-form button[type='submit']{
      color: {$top_color};
    }
    .top-area ::-webkit-input-placeholder {
      color: {$top_color};
    }

    .top-area :-moz-placeholder { /* Firefox 18- */
      color: {$top_color};
    }

    .top-area ::-moz-placeholder {  /* Firefox 19+ */
      color: {$top_color};
    }

    .top-area :-ms-input-placeholder {  
      color: {$top_color};
    } 

    .top-area{
      background-color: {$top_bg_color};
    }

    footer.footer[role='contentinfo'] p, 
    footer.footer[role='contentinfo'] a{
      color: {$footer_color};
    }

    footer.footer[role='contentinfo']{
      background-color: {$footer_bg_color};
    }

    #logo a,
    .nav li a{
      color: {$header_text_color};
    } 
   
    body{
      color: {$primary_color_1};
    }
    #submit:active, 
    #submit:focus, 
    #submit:hover, 
    .blue-btn:active, 
    .blue-btn:focus, 
    .blue-btn:hover, 
    .comment-reply-link:active, 
    .comment-reply-link:focus, 
    .comment-reply-link:hover{
      background-color: {$primary_color_1};
    }

    .nav li.current-menu-item a,
    .nav li a:hover,
    .nav li a:focus,
    #logo a:hover,
    #logo a:focus,
    .scrollToTop span,
    .comment-reply-link,
    .entry-content p a,
    a{
      color: {$primary_color_2};
    }
    #submit, 
    .blue-btn,
    .wp-caption{
      background-color: {$primary_color_2};
    }
    .entry-content blockquote{
      border-color: {$primary_color_2};
    } 
    ";

    wp_enqueue_style( 'thefashblog-stylesheet', get_template_directory_uri() . '/library/css/style.min.css', array(), '', 'all' );
    wp_enqueue_style( 'thefashblog-main-stylesheet', get_stylesheet_uri() , array(), '', 'all' );
    wp_add_inline_style( 'thefashblog-main-stylesheet', $custom_css );
  }
  
add_action( 'wp_enqueue_scripts', 'thefashblog_apply_color', 999 );