<?php
function theme_options_color() {

	// /*=================== Blog Post Color ===================*/	
	?>
<style type="text/css"> 
	:root {
		--wrap-color: <?php echo esc_attr(blogdata_get_option('body_background_color')); ?>;
	}
/*==================== Site title and tagline ====================*/
.site-title a, .site-description{
  color: <?php echo esc_attr(get_theme_mod('header_text_color', "000")); ?>;
}
body.dark .site-title a, body.dark .site-description{
  color: <?php echo esc_attr(get_theme_mod('header_text_dark_color', "#fff")); ?>;
}
/*=================== Blog Post Color ===================*/
.header-six .header-middle{
	background: <?php echo esc_attr(get_theme_support( 'custom-header', 'default-image' ))?>;
}
.header-six .header-middle .overlay{
	background-color: <?php echo esc_attr(get_theme_mod('blogdata_header_overlay_color'))?>;
}
.site-branding-text .site-title a:hover{
  color: <?php echo esc_attr(get_theme_mod('header_text_color_on_hover','#a90e6d'))?> !important;
}
body.dark .site-branding-text .site-title a:hover{
  color: <?php echo esc_attr(get_theme_mod('header_text_dark_color_on_hover','#a90e6d'))?> !important;
}
/* Footer Color*/
footer .bs-footer-copyright {
  background: <?php echo blogdata_get_option('blogdata_footer_copy_bg'); ?>;
}
footer .bs-widget p, footer .site-title a, footer .site-title a:hover , footer .site-description, footer .site-description:hover, footer .bs-widget h6, footer .mg_contact_widget .bs-widget h6 {
  color: <?php echo blogdata_get_option('blogdata_footer_text_color'); ?>;
}
footer .bs-footer-copyright p, footer .bs-footer-copyright a {
  color: <?php echo blogdata_get_option('blogdata_footer_copy_text'); ?>;
}
@media (min-width: 992px) {
    
    .archive-class .sidebar-right, .archive-class .sidebar-left , .index-class .sidebar-right, .index-class .sidebar-left{
      flex: 100;
      max-width:<?php echo esc_attr(get_theme_mod('blogdata_archive_page_sidebar_width')); ?>% !important;
    }
    .archive-class .content-right , .index-class .content-right {
      max-width: calc((100% - <?php echo esc_attr(get_theme_mod('blogdata_archive_page_sidebar_width')); ?>%)) !important;
    }
  }
</style>
<?php
}

function blogdata_customize_options() {

  // Initialize string
  $blogdata_custom_css = '';

  if ( get_theme_mod('enable_blogdata_typo', false) == true) {
    /* Headings Typography*/
    $blogdata_custom_css .= 'h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6, .wp-block-search__label { 
                              font-family:'. esc_attr(blogdata_get_option('heading_fontfamily')).' !important;
                              font-weight:'. esc_attr(blogdata_get_option('heading_fontweight')).' !important;
                            }';
      /* Menus Font Family*/
    $blogdata_custom_css .= '.navbar-wp .sm-clean > li > a, .navbar-wp .dropdown-menu > li > a { 
                              font-family:'. esc_attr(get_theme_mod('blogdata_menu_fontfamily','Inter')).' !important; 
                            }';
  }
		
  $blogdata_custom_css   .= blogdata_customizer_value( 'site_title_font_size', '.site-branding-text .site-title a', array( 'font-size' ), array( 40, 35, 30 ), 'px' );
  $blogdata_custom_css   .= blogdata_customizer_value( 'side_main_logo_width', '.bs-menu-full .navbar-brand img', array( 'width' ), array( 250, 200, 150 ), 'px' );
  
  $blogdata_custom_css   .= blogdata_customizer_value( 'header_image_height', '.header-image-section .overlay', array( 'height' ), array( 200, 150, 130 ), 'px' );
  
  $blogdata_custom_css   .= blogdata_customizer_value( 'blogdata_slider_title_font_size', '.bs-slide .inner .title', array( 'font-size' ), array( 38, 32, 24 ), 'px !important' );
  $blogdata_custom_css   .= blogdata_customizer_value( 'blogdata_tren_edit_title_font_size', '.multi-post-widget .bs-blog-post.three.bsm .title', array( 'font-size' ), array( 22, 20, 16 ), 'px !important' );
  $blogdata_custom_css   .= blogdata_customizer_value( 'blogdata_footer_main_logo_width', 'footer .bs-footer-bottom-area .custom-logo, footer .bs-footer-copyright .custom-logo', array( 'width' ), array( 210, 170, 130 ), 'px' );
  $blogdata_custom_css   .= blogdata_customizer_value( 'blogdata_footer_main_logo_height', 'footer .bs-footer-bottom-area .custom-logo, footer .bs-footer-copyright .custom-logo', array( 'height' ), array( 70, 50, 40 ), 'px' );
    
  // Attach to the handle
  if ( ! empty( $blogdata_custom_css ) ) {
    wp_add_inline_style( 'blogdata-style', $blogdata_custom_css );
  }
}