jQuery(document).ready(function ($) {
    var nova_photography_portfolio_owl = $('.slider-section.owl-carousel');
    nova_photography_portfolio_owl.owlCarousel({
        margin: 25,
        nav: true,
        autoplay: true,
        lazyLoad: true,
        autoplayTimeout: 3000,
        loop: true,
        dots: true,
        navText: [
            '<span class="dashicons dashicons-arrow-left-alt"></span>',
            '<span class="dashicons dashicons-arrow-right-alt"></span>'
        ],

        responsive: {
            0: {
                items: 1
            },
            600: {
                items: 1
            },
            1000: {
                items: 1
            }
        },

        autoplayHoverPause: true,
        mouseDrag: true,

        onInitialized: addNumbers,
        onTranslated: addNumbers
    });

    function addNumbers() {

        $('.owl-dot').each(function(index) {

            let nova_photography_portfolio_number = (index + 1).toString().padStart(2, '0');

            $(this).find('span').html(nova_photography_portfolio_number);

        });

    }

});

// Scroll to Top
window.onscroll = function() {
  const nova_photography_portfolio_button = document.querySelector('.scroll-top-btn');
  if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
    nova_photography_portfolio_button.style.display = "block";
  } else {
    nova_photography_portfolio_button.style.display = "none";
  }
};

document.querySelector('.scroll-top-btn a').onclick = function(event) {
  event.preventDefault();
  window.scrollTo({top: 0, behavior: 'smooth'});
};