/*
Theme Name: Enfold
Description: <strong>A superflexible and responsive Business Theme by Kriesi</strong> - <br/> Update notifications available on Facebook and via newsletter:<br/> - <a href='http://www.facebook.com/pages/Kriesi/333648177216'>Join the Facebook Group</a> - <a href='http://www.kriesi.at/newsletter'>Subscribe to our Newsletter</a>
Version: 7.1.2
Author: Kriesi
Author URI: https://kriesi.at
License: Themeforest Split Licence
License URI: -
Theme URI: www.kriesi.at/themes/enfold/
Envato_ID: 4519990
*/


/*
* PLEASE DO NOT EDIT THIS FILE!
*
* This file is only in your themefolder for WordPress to recognize basic theme data like name and version
* CSS Rules in this file will not be used by the theme.
* Instead use the custom.css file that is located in your themes /css/ folder to add your styles.
* You can copy a style rule from any of your css files and paste it in custom.css and
* it will override the original style. If you just want to add small css snippets you might also
* want to consider to add it to the designated CSS option field in your themes backend at: Theme Options->General Styling
*/
.avia-slideshow { min-height: 350px !important;  } .avia-slideshow-inner { height: 350px !important;  }
.avia-slideshow-slide img { display: block !important; width: 100% !important; height: auto !important; position: relative !important; opacity: 1 !important; }
.avia-slideshow-slide { position: relative !important; overflow: visible !important; } .avia-slide-wrap { position: relative !important; display: block !important; }
.avia-slideshow li { position: relative !important; display: block !important; } .avia-slideshow li:first-child { position: relative !important; opacity: 1 !important; z-index: 1 !important; }

/* Force slider visibility */
#top .av-default-height-applied .avia-slideshow-inner { 
    height: 350px !important; 
    min-height: 350px !important; 
}

.avia-slideshow li:first-child { 
    visibility: visible !important; 
    opacity: 1 !important; 
    position: relative !important; 
    z-index: 10 !important; 
}

.avia-slideshow { 
    height: 350px !important; 
    overflow: visible !important; 
}

/* Fix slider translation positioning */
.avia-slideshow li.avia-slideshow-slide {
    transform: translate3d(0px, 0px, 0px) !important;
    left: 0px !important;
    top: 0px !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    z-index: 1 !important;
}

.avia-slideshow li.avia-slideshow-slide:first-child {
    z-index: 10 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.avia-slideshow-inner {
    transform: none !important;
    left: 0px !important;
    top: 0px !important;
}

/* Ensure slideshow container is proper size */
.avia-slideshow {
    height: 350px !important;
    min-height: 350px !important;
    position: relative !important;
    overflow: hidden !important;
}

.avia-slideshow .avia-slideshow-inner {
    height: 350px !important;
    position: relative !important;
}


/* Custom Slider JavaScript Fix */
<script>
document.addEventListener('DOMContentLoaded', function() {
    const slider = document.querySelector('.avia-slideshow');
    if (!slider) return;
    
    const slides = slider.querySelectorAll('.avia-slideshow-slide');
    const navButtons = slider.querySelectorAll('a[href^="#"]');
    const prevButton = slider.querySelector('a[href="#prev"]');
    const nextButton = slider.querySelector('a[href="#next"]');
    const numberButtons = slider.querySelectorAll('a[href^="#"]:not([href="#prev"]):not([href="#next"])');
    
    let currentSlide = 0;
    let autoAdvanceTimer;
    
    function showSlide(index) {
        slides.forEach((slide, i) => {
            slide.style.visibility = i === index ? 'visible' : 'hidden';
            slide.style.opacity = i === index ? '1' : '0';
            slide.style.zIndex = i === index ? '10' : '1';
            slide.style.transform = 'translate3d(0px, 0px, 0px)';
            slide.style.left = '0px';
            slide.style.top = '0px';
        });
        currentSlide = index;
    }
    
    function nextSlide() {
        const nextIndex = (currentSlide + 1) % slides.length;
        showSlide(nextIndex);
    }
    
    function prevSlide() {
        const prevIndex = (currentSlide - 1 + slides.length) % slides.length;
        showSlide(prevIndex);
    }
    
    function startAutoAdvance() {
        autoAdvanceTimer = setInterval(nextSlide, 4000);
    }
    
    function stopAutoAdvance() {
        clearInterval(autoAdvanceTimer);
    }
    
    // Initialize
    showSlide(0);
    startAutoAdvance();
    
    // Add navigation event listeners
    if (nextButton) {
        nextButton.addEventListener('click', function(e) {
            e.preventDefault();
            stopAutoAdvance();
            nextSlide();
            startAutoAdvance();
        });
    }
    
    if (prevButton) {
        prevButton.addEventListener('click', function(e) {
            e.preventDefault();
            stopAutoAdvance();
            prevSlide();
            startAutoAdvance();
        });
    }
    
    // Add number button listeners
    numberButtons.forEach((button, index) => {
        button.addEventListener('click', function(e) {
            e.preventDefault();
            stopAutoAdvance();
            showSlide(index);
            startAutoAdvance();
        });
    });
    
    // Pause on hover
    slider.addEventListener('mouseenter', stopAutoAdvance);
    slider.addEventListener('mouseleave', startAutoAdvance);
});
</script>

