<?php

$modern_art_gallery_custom_css = "";

	$modern_art_gallery_theme_pagination_options_alignment = get_theme_mod('modern_art_gallery_theme_pagination_options_alignment', 'Center');
	if ($modern_art_gallery_theme_pagination_options_alignment == 'Center') {
		$modern_art_gallery_custom_css .= '.navigation.pagination,.navigation.posts-navigation .nav-links{';
		$modern_art_gallery_custom_css .= 'justify-content: center;margin: 0 auto;';
		$modern_art_gallery_custom_css .= '}';
	} else if ($modern_art_gallery_theme_pagination_options_alignment == 'Right') {
		$modern_art_gallery_custom_css .= '.navigation.pagination,.navigation.posts-navigation .nav-links{';
		$modern_art_gallery_custom_css .= 'justify-content: right;margin: 0 0 0 auto;';
		$modern_art_gallery_custom_css .= '}';
	} else if ($modern_art_gallery_theme_pagination_options_alignment == 'Left') {
		$modern_art_gallery_custom_css .= '.navigation.pagination,.navigation.posts-navigation .nav-links{';
		$modern_art_gallery_custom_css .= 'justify-content: left;margin: 0 auto 0 0;';
		$modern_art_gallery_custom_css .= '}';
	}

	$modern_art_gallery_theme_breadcrumb_enable = get_theme_mod('modern_art_gallery_theme_breadcrumb_enable',true);
    if($modern_art_gallery_theme_breadcrumb_enable != true){
        $modern_art_gallery_custom_css .='nav.breadcrumb-trail.breadcrumbs,nav.woocommerce-breadcrumb{';
            $modern_art_gallery_custom_css .='display: none;';
        $modern_art_gallery_custom_css .='}';
    }

	$modern_art_gallery_theme_breadcrumb_options_alignment = get_theme_mod('modern_art_gallery_theme_breadcrumb_options_alignment', 'Left');
	if ($modern_art_gallery_theme_breadcrumb_options_alignment == 'Center') {
	    $modern_art_gallery_custom_css .= '.breadcrumbs ul,nav.woocommerce-breadcrumb{';
	    $modern_art_gallery_custom_css .= 'text-align: center !important;';
	    $modern_art_gallery_custom_css .= '}';
	} else if ($modern_art_gallery_theme_breadcrumb_options_alignment == 'Right') {
	    $modern_art_gallery_custom_css .= '.breadcrumbs ul,nav.woocommerce-breadcrumb{';
	    $modern_art_gallery_custom_css .= 'text-align: Right !important;';
	    $modern_art_gallery_custom_css .= '}';
	} else if ($modern_art_gallery_theme_breadcrumb_options_alignment == 'Left') {
	    $modern_art_gallery_custom_css .= '.breadcrumbs ul,nav.woocommerce-breadcrumb{';
	    $modern_art_gallery_custom_css .= 'text-align: Left !important;';
	    $modern_art_gallery_custom_css .= '}';
	}

	$modern_art_gallery_single_page_content_alignment = get_theme_mod('modern_art_gallery_single_page_content_alignment', 'left');
	if ($modern_art_gallery_single_page_content_alignment == 'left') {
	    $modern_art_gallery_custom_css .= '#single-page .type-page,section.theme-custom-block.theme-error-sectiontheme-error-section.error-block-middle,section.theme-custom-block.theme-error-section.error-block-heading .theme-area-header{';
	    $modern_art_gallery_custom_css .= 'text-align: left !important;';
	    $modern_art_gallery_custom_css .= '}';
	} else if ($modern_art_gallery_single_page_content_alignment == 'center') {
	    $modern_art_gallery_custom_css .= '#single-page .type-page,section.theme-custom-block.theme-error-sectiontheme-error-section.error-block-middle,section.theme-custom-block.theme-error-section.error-block-heading .theme-area-header{';
	    $modern_art_gallery_custom_css .= 'text-align: center !important;';
	    $modern_art_gallery_custom_css .= '}';
	} else if ($modern_art_gallery_single_page_content_alignment == 'right') {
	    $modern_art_gallery_custom_css .= '#single-page .type-page,section.theme-custom-block.theme-error-sectiontheme-error-section.error-block-middle,section.theme-custom-block.theme-error-section.error-block-heading .theme-area-header{';
	    $modern_art_gallery_custom_css .= 'text-align: right !important;';
	    $modern_art_gallery_custom_css .= '}';
	}

	$modern_art_gallery_single_post_content_alignment = get_theme_mod('modern_art_gallery_single_post_content_alignment', 'left');
	if ($modern_art_gallery_single_post_content_alignment == 'left') {
	    $modern_art_gallery_custom_css .= '#single-page .type-post,#single-page .type-post .entry-meta,#single-page .type-post .is-layout-flex{';
	    $modern_art_gallery_custom_css .= 'text-align: left !important;justify-content: left;';
	    $modern_art_gallery_custom_css .= '}';
	} else if ($modern_art_gallery_single_post_content_alignment == 'center') {
	    $modern_art_gallery_custom_css .= '#single-page .type-post,#single-page .type-post .entry-meta,#single-page .type-post .is-layout-flex{';
	    $modern_art_gallery_custom_css .= 'text-align: center !important;justify-content: center;';
	    $modern_art_gallery_custom_css .= '}';
	} else if ($modern_art_gallery_single_post_content_alignment == 'right') {
	    $modern_art_gallery_custom_css .= '#single-page .type-post,#single-page .type-post .entry-meta,#single-page .type-post .is-layout-flex{';
	    $modern_art_gallery_custom_css .= 'text-align: right !important;justify-content: right;';
	    $modern_art_gallery_custom_css .= '}';
	}

	$modern_art_gallery_menu_text_transform = get_theme_mod('modern_art_gallery_menu_text_transform', 'Capitalize');
	if ($modern_art_gallery_menu_text_transform == 'Capitalize') {
	    $modern_art_gallery_custom_css .= '.site-navigation .primary-menu > li a{';
	    $modern_art_gallery_custom_css .= 'text-transform: Capitalize !important;';
	    $modern_art_gallery_custom_css .= '}';
	} else if ($modern_art_gallery_menu_text_transform == 'uppercase') {
	    $modern_art_gallery_custom_css .= '.site-navigation .primary-menu > li a{';
	    $modern_art_gallery_custom_css .= 'text-transform: uppercase !important;';
	    $modern_art_gallery_custom_css .= '}';
	} else if ($modern_art_gallery_menu_text_transform == 'lowercase') {
	    $modern_art_gallery_custom_css .= '.site-navigation .primary-menu > li a{';
	    $modern_art_gallery_custom_css .= 'text-transform: lowercase !important;';
	    $modern_art_gallery_custom_css .= '}';
	}

	$modern_art_gallery_footer_widget_title_alignment = get_theme_mod('modern_art_gallery_footer_widget_title_alignment', 'left');
	if ($modern_art_gallery_footer_widget_title_alignment == 'left') {
	    $modern_art_gallery_custom_css .= 'h2.widget-title{';
	    $modern_art_gallery_custom_css .= 'text-align: left !important;';
	    $modern_art_gallery_custom_css .= '}';
	} else if ($modern_art_gallery_footer_widget_title_alignment == 'center') {
	    $modern_art_gallery_custom_css .= 'h2.widget-title{';
	    $modern_art_gallery_custom_css .= 'text-align: center !important;';
	    $modern_art_gallery_custom_css .= '}';
	} else if ($modern_art_gallery_footer_widget_title_alignment == 'right') {
	    $modern_art_gallery_custom_css .= 'h2.widget-title{';
	    $modern_art_gallery_custom_css .= 'text-align: right !important;';
	    $modern_art_gallery_custom_css .= '}';
	}

    $modern_art_gallery_show_hide_related_product = get_theme_mod('modern_art_gallery_show_hide_related_product',true);
    if($modern_art_gallery_show_hide_related_product != true){
        $modern_art_gallery_custom_css .='.related.products{';
            $modern_art_gallery_custom_css .='display: none;';
        $modern_art_gallery_custom_css .='}';
    }

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

	$modern_art_gallery_global_color = get_theme_mod('modern_art_gallery_global_color', '#FF8E39'); // Add a fallback if the color isn't set

	if ($modern_art_gallery_global_color) {
		$modern_art_gallery_custom_css .= ':root {';
		$modern_art_gallery_custom_css .= '--global-colorr: ' . esc_attr($modern_art_gallery_global_color) . ';';
		$modern_art_gallery_custom_css .= '}';
	}
	
	/*-------------------- Global Second Color -------------------*/

	$modern_art_gallery_secondary_color = get_theme_mod('modern_art_gallery_secondary_color', '#151515'); // Add a fallback if the color isn't set

	if ($modern_art_gallery_secondary_color) {
		$modern_art_gallery_custom_css .= ':root {';
		$modern_art_gallery_custom_css .= '--secondary-color: ' . esc_attr($modern_art_gallery_secondary_color) . ';';
		$modern_art_gallery_custom_css .= '}';
	}


	/*-------------------- Content Font -------------------*/

	$modern_art_gallery_content_typography_font = get_theme_mod('modern_art_gallery_content_typography_font', 'mulish'); // Add a fallback if the color isn't set

	if ($modern_art_gallery_content_typography_font) {
		$modern_art_gallery_custom_css .= ':root {';
		$modern_art_gallery_custom_css .= '--font-main: ' . esc_attr($modern_art_gallery_content_typography_font) . ';';
		$modern_art_gallery_custom_css .= '}';
	}

	/*-------------------- Heading Font -------------------*/

	$modern_art_gallery_heading_typography_font = get_theme_mod('modern_art_gallery_heading_typography_font', 'mulish'); // Add a fallback if the color isn't set

	if ($modern_art_gallery_heading_typography_font) {
		$modern_art_gallery_custom_css .= ':root {';
		$modern_art_gallery_custom_css .= '--font-head: ' . esc_attr($modern_art_gallery_heading_typography_font) . ';';
		$modern_art_gallery_custom_css .= '}';
	}

	/*-------------------- FOOTER -------------------*/

	$modern_art_gallery_footer_widget_background_color = get_theme_mod('modern_art_gallery_footer_widget_background_color');
    if ($modern_art_gallery_footer_widget_background_color) {

        $modern_art_gallery_custom_css .= "
            .footer-widgetarea {
                background-color: ". esc_attr($modern_art_gallery_footer_widget_background_color) .";
            }
        ";
    }

    $modern_art_gallery_footer_widget_background_image = get_theme_mod('modern_art_gallery_footer_widget_background_image');
	if ($modern_art_gallery_footer_widget_background_image) {
		$modern_art_gallery_custom_css .= "
			.footer-widgetarea {
				background-image: url(" . esc_url($modern_art_gallery_footer_widget_background_image) . ");
			}
		";
	}

    $modern_art_gallery_copyright_font_size = get_theme_mod('modern_art_gallery_copyright_font_size');
    if ($modern_art_gallery_copyright_font_size) {

        $modern_art_gallery_custom_css .= "
            .footer-copyright {
                font-size: ". esc_attr($modern_art_gallery_copyright_font_size) ."px;
            }
        ";
    }

	$modern_art_gallery_columns = get_theme_mod('modern_art_gallery_posts_per_columns', 3);
	$modern_art_gallery_columns = absint($modern_art_gallery_columns);
	if ( $modern_art_gallery_columns < 1 || $modern_art_gallery_columns > 6 ) {
		$modern_art_gallery_columns = 3;
	}
	$modern_art_gallery_custom_css .= "
		.site-content .article-wraper-archive {
			grid-template-columns: repeat({$modern_art_gallery_columns}, 1fr);
		}
	";

	/*-------------------- Menu Color CSS -------------------*/

	$modern_art_gallery_header_menus_color = get_theme_mod('modern_art_gallery_header_menus_color');
	if($modern_art_gallery_header_menus_color != false){
		$modern_art_gallery_custom_css .='.site-navigation .primary-menu a{';
			$modern_art_gallery_custom_css .='color: '.esc_attr($modern_art_gallery_header_menus_color).'!important;';
		$modern_art_gallery_custom_css .='}';
	}

	$modern_art_gallery_header_menus_hover_color = get_theme_mod('modern_art_gallery_header_menus_hover_color');
	if($modern_art_gallery_header_menus_hover_color != false){
		$modern_art_gallery_custom_css .='.site-navigation .primary-menu a:hover{';
			$modern_art_gallery_custom_css .='color: '.esc_attr($modern_art_gallery_header_menus_hover_color).'!important;';
		$modern_art_gallery_custom_css .='}';
	}

	$modern_art_gallery_header_submenus_color = get_theme_mod('modern_art_gallery_header_submenus_color');
	if($modern_art_gallery_header_submenus_color != false){
		$modern_art_gallery_custom_css .='.site-navigation .primary-menu li ul li a{';
			$modern_art_gallery_custom_css .='color: '.esc_attr($modern_art_gallery_header_submenus_color).'!important;';
		$modern_art_gallery_custom_css .='}';
	}

	$modern_art_gallery_header_submenus_hover_color = get_theme_mod('modern_art_gallery_header_submenus_hover_color');
	if($modern_art_gallery_header_submenus_hover_color != false){
		$modern_art_gallery_custom_css .='.site-navigation .primary-menu li ul li a:hover{';
			$modern_art_gallery_custom_css .='color: '.esc_attr($modern_art_gallery_header_submenus_hover_color).'!important;';
		$modern_art_gallery_custom_css .='}';
	}