<?php 

$organic_farm_custom_style= "";

//Slider-content-alignment

$agriculture_farming_slider_content_alignment = get_theme_mod( 'agriculture_farming_slider_content_alignment','CENTER-ALIGN');

if($agriculture_farming_slider_content_alignment == 'LEFT-ALIGN'){

$organic_farm_custom_style .='#slider .carousel-caption{';

    $organic_farm_custom_style .='text-align:left;  right: 50%; left: 15%;';

$organic_farm_custom_style .='}';

$organic_farm_custom_style .='@media screen and (max-width:1199px){';

$organic_farm_custom_style .='#slider .carousel-caption{';

    $organic_farm_custom_style .='right: 35%; left: 15%';
    
$organic_farm_custom_style .='} }';

$organic_farm_custom_style .='@media screen and (max-width:991px){';

$organic_farm_custom_style .='#slider .carousel-caption{';

    $organic_farm_custom_style .='right: 20%; left: 15%';
    
$organic_farm_custom_style .='} }';


}else if($agriculture_farming_slider_content_alignment == 'CENTER-ALIGN'){

$organic_farm_custom_style .='#slider .carousel-caption{';

    $organic_farm_custom_style .='text-align:center;   right: 30%; left: 30%;';

$organic_farm_custom_style .='}';

$organic_farm_custom_style .='@media screen and (max-width:1199px){';

$organic_farm_custom_style .='#slider .carousel-caption{';

    $organic_farm_custom_style .='right: 20%; left: 20%';
    
$organic_farm_custom_style .='} }';

$organic_farm_custom_style .='@media screen and (max-width:991px){';

$organic_farm_custom_style .='#slider .carousel-caption{';

    $organic_farm_custom_style .='right: 15%; left: 15%';
    
$organic_farm_custom_style .='} }';


}else if($agriculture_farming_slider_content_alignment == 'RIGHT-ALIGN'){

$organic_farm_custom_style .='#slider .carousel-caption{';

    $organic_farm_custom_style .='text-align:right;  right: 15%; left: 50%;';

$organic_farm_custom_style .='}';

$organic_farm_custom_style .='@media screen and (max-width:1199px){';

$organic_farm_custom_style .='#slider .carousel-caption{';

    $organic_farm_custom_style .='right: 15%; left: 35%';
    
$organic_farm_custom_style .='} }';

$organic_farm_custom_style .='@media screen and (max-width:991px){';

$organic_farm_custom_style .='#slider .carousel-caption{';

    $organic_farm_custom_style .='right: 15%; left: 20%';
    
$organic_farm_custom_style .='} }';

}

if (false === get_option('organic_farm_sticky_header')) {
    add_option('organic_farm_sticky_header', 'off');
}

// Define the custom CSS based on the 'organic_farm_sticky_header' option

if (get_option('organic_farm_sticky_header', 'off') !== 'on') {
    $organic_farm_custom_style .= '.menu_header.fixed {';
    $organic_farm_custom_style .= 'position: static;';
    $organic_farm_custom_style .= '}';
}

if (get_option('organic_farm_sticky_header', 'off') !== 'off') {
    $organic_farm_custom_style .= '.menu_header.fixed {';
    $organic_farm_custom_style .= 'position: fixed; box-shadow: none; background: var(--theme-primary-color); padding: 0px 60px;';
    $organic_farm_custom_style .= '}';

    $organic_farm_custom_style .= '.admin-bar .fixed {';
    $organic_farm_custom_style .= ' margin-top: 32px;';
    $organic_farm_custom_style .= '}';
}

//colors
$color = get_theme_mod('agriculture_farming_primary_color', '#8ec63f');
$color_top_bg = get_theme_mod('agriculture_farming_top_bg_color', '#181a1e');
$color_heading = get_theme_mod('agriculture_farming_heading_color', '#181a1e');
$color_fade = get_theme_mod('agriculture_farming_primary_fade', '#effbdd');
$color_footer_bg = get_theme_mod('agriculture_farming_footer_bg', '#131313');
$slider_overlay = get_theme_mod( 'agriculture_farming_slider_overlay','#181a1e');


$organic_farm_custom_style .= ":root {";
    $organic_farm_custom_style .= "--theme-primary-color: {$color};";
    $organic_farm_custom_style .= "--theme-topbar-bg-color: {$color_top_bg};";
    $organic_farm_custom_style .= "--theme-heading-color: {$color_heading};";
    $organic_farm_custom_style .= "--theme-primary-fade: {$color_fade};";
    $organic_farm_custom_style .= "--theme-footer-color: {$color_footer_bg};";
    $organic_farm_custom_style .= "--slider-overlay: {$slider_overlay};";
$organic_farm_custom_style .= "}";


$agriculture_farming_slider_opacity = get_theme_mod( 'agriculture_farming_slider_opacity','0.3');

if($agriculture_farming_slider_opacity == '0'){
$organic_farm_custom_style .='#slider img {';
    $organic_farm_custom_style .='opacity: 0';
$organic_farm_custom_style .='}';

}else if($agriculture_farming_slider_opacity == '0.1'){
$organic_farm_custom_style .='#slider img {';
    $organic_farm_custom_style .='opacity: 0.1';
$organic_farm_custom_style .='}';

}else if($agriculture_farming_slider_opacity == '0.2'){
$organic_farm_custom_style .='#slider img {';
    $organic_farm_custom_style .='opacity: 0.2';
$organic_farm_custom_style .='}';

}else if($agriculture_farming_slider_opacity == '0.3'){
$organic_farm_custom_style .='#slider img {';
    $organic_farm_custom_style .='opacity: 0.3';
$organic_farm_custom_style .='}';

}else if($agriculture_farming_slider_opacity == '0.4'){
$organic_farm_custom_style .='#slider img {';
    $organic_farm_custom_style .='opacity: 0.4';
$organic_farm_custom_style .='}';

}else if($agriculture_farming_slider_opacity == '0.5'){
$organic_farm_custom_style .='#slider img {';
    $organic_farm_custom_style .='opacity: 0.5';
$organic_farm_custom_style .='}';

}else if($agriculture_farming_slider_opacity == '0.6'){
$organic_farm_custom_style .='#slider img {';
    $organic_farm_custom_style .='opacity: 0.6';
$organic_farm_custom_style .='}';

}else if($agriculture_farming_slider_opacity == '0.7'){
$organic_farm_custom_style .='#slider img {';
    $organic_farm_custom_style .='opacity: 0.7';
$organic_farm_custom_style .='}';

}else if($agriculture_farming_slider_opacity == '0.8'){
$organic_farm_custom_style .='#slider img {';
    $organic_farm_custom_style .='opacity: 0.8';
$organic_farm_custom_style .='}';

}
else if($agriculture_farming_slider_opacity == '0.9'){
$organic_farm_custom_style .='#slider img {';
    $organic_farm_custom_style .='opacity: 0.9';
$organic_farm_custom_style .='}';

}
else if($agriculture_farming_slider_opacity == '1'){
$organic_farm_custom_style .='#slider img {';
    $organic_farm_custom_style .='opacity: 1';
$organic_farm_custom_style .='}';

}

$agriculture_farming_slider_heading_color = get_theme_mod( 'agriculture_farming_slider_heading_color','#ffffff');
$organic_farm_custom_style .='#slider .carousel-caption h2 {';
$organic_farm_custom_style .='color: '.esc_attr($agriculture_farming_slider_heading_color).';';
$organic_farm_custom_style .='}';

$agriculture_farming_slider_excerpt_color = get_theme_mod( 'agriculture_farming_slider_excerpt_color','#ffffff');
$organic_farm_custom_style .='#slider .slider-excerpt {';
$organic_farm_custom_style .='color: '.esc_attr($agriculture_farming_slider_excerpt_color).';';
$organic_farm_custom_style .='}';