/* Minification failed. Returning unminified contents.
(1,1): run-time error CSS1019: Unexpected token, found '$'
(1,2): run-time error CSS1019: Unexpected token, found '('
(1,12): run-time error CSS1031: Expected selector, found '('
(1,12): run-time error CSS1025: Expected comma or open brace, found '('
(44,2): run-time error CSS1019: Unexpected token, found ')'
 */
$(function () {
    function equalHeights() {
        var height = 0;
        var $wrapper = $('#poz-grid-wrapper');
        var $cardHolders = $wrapper.find('.card-holder');

        $cardHolders.each(function () {
            var $this = $(this);
            var currentHeight = $this.find('.card-body').outerHeight();

            height = Math.max(height, currentHeight);
        });

        $cardHolders.find('.card-body').css('height', height);
    }

    function addStyleToIframe() {
        if ($('section').hasClass('event-detail-wrapper')) {
            $('iframe[src*="spotify"]').css({
                width: 'auto',
                height: '380px'
            });
        }
    }

    function fitSliderItems() {
        var $slider = $('#slider');
        if ($slider && $slider.length) {
            var imgWidth = 1920;
            var imgHeight = 540;

            var ratio = $(window).innerWidth() / imgWidth;
            var widthToSet = imgWidth * ratio;
            var heightToSet = imgHeight * ratio;
            
            $slider.find('.swiper-slide').css({ width: widthToSet + 'px', height: heightToSet + 'px' });
            $slider.css('height', heightToSet + 'px');
        }
    }

    equalHeights();
    addStyleToIframe();
    fitSliderItems();
});
