<?php
if( ! function_exists( 'flossy_dynamic_style' ) ):
    function flossy_dynamic_style() {
		$output_css = '';
		 /**
		 *  Breadcrumb Style
		 */
		
		$breadcrumb_bg_img			= get_theme_mod('breadcrumb_bg_img',get_template_directory_uri() .'/assets/images/breadcrumb.png'); 
		$breadcrumb_overlay_color	= get_theme_mod('breadcrumb_overlay_color','#181818');

		if($breadcrumb_bg_img !== '') { 
			$output_css .=".breadcrumb-area {
					background-image: url(" .esc_url($breadcrumb_bg_img). ");
				}\n";
		}else{
			$output_css .=".breadcrumb-area {
				 background: var(--bs-primary-light);
			}\n";
		}
		
		if($breadcrumb_bg_img !== '') { 
			$output_css .=".breadcrumb-area:before {
					    content: '';
						position: absolute;
						top: 0;
						right: 0;
						bottom: 0;
						left: 0;
						z-index: -1;
						background-color: " .esc_attr($breadcrumb_overlay_color). ";
						opacity: 90%;
				}\n";
		}
		
		
		$footer_bg_img	= get_theme_mod('footer_bg_img',esc_url(get_template_directory_uri() .'/assets/images/footer_bg.png'));
		$footer_bg_attach		= get_theme_mod('footer_bg_attach','scroll');
		
			if(!empty($footer_bg_img)):
				 $output_css .=".footer{ 
					background:url(" .esc_url($footer_bg_img). ") no-repeat " .esc_attr($footer_bg_attach). " center center / cover ;
				}\n";
			endif;
		
		
        wp_add_inline_style( 'flossy-style', $output_css );
    }
endif;
add_action( 'wp_enqueue_scripts', 'flossy_dynamic_style' );