<?php
/**
 * celebshine Redux Dynamic CSS
 *
 * @package celebshine
 * @subpackage celebshine
 * @since celebshine 1.0
 */

/**
 * Redux Dynamic CSS
 */
function celebshine_dynamic_css() {
	
	if( class_exists( 'ReduxFramework' ) && function_exists( 'loadmore_postSC' ) ) {

		$celebshine_options = get_option( 'celebshine_options' );

		$dynamic_css = '';

		// Header Transparent.
		$header_tran_bg = '';
		if ( $celebshine_options['header-transparent'] == '1' ) {
			if ( ! empty( $celebshine_options['header_tran_bg']['rgba'] ) ) {
				$header_tran_bg = $celebshine_options['header_tran_bg']['rgba'];
			}
		}

		$container = $celebshine_options['container-width'];
		$dynamic_css .= 
			'@media (min-width: '. $container['width'] .') {
				.container{
					max-width: '. $container['width'] .';
					width:  100%;
				}
			}';
			

		// Footer Color.
		if ( ! empty( $celebshine_options['css-code'] ) ) {
			$celebshine_css    = $celebshine_options['css-code'];
			$dynamic_css .= esc_attr( $celebshine_css );
		}
		wp_add_inline_style( 'celebshine-responsive', $dynamic_css );
	}
}
add_action( 'wp_enqueue_scripts', 'celebshine_dynamic_css', 20 );
