<?php
    $crt_builder_with_elementor_enable_slider = get_theme_mod('crt_manage_enable_slider_section');
    if(!$crt_builder_with_elementor_enable_slider) {
        return;
    }
    $crt_builder_with_elementor_slider_list = crt_builder_with_elementor_json_to_array(get_theme_mod('crt_manage_slider_list'));
    if(!empty($crt_builder_with_elementor_slider_list)) :
    wp_enqueue_style( 'crt-builder-with-elementor-slider-1' );
?>
<section class="tse-slider">
    <div class="tse-slider__inner tse-slider__js">
        <?php $c = 0; foreach ($crt_builder_with_elementor_slider_list as $item): $c++;
            $image_url = crt_builder_with_elementor_gtsicrf($item, 'crt-builder-with-elementor-image-medium', 'crt-builder-with-elementor-image-small');
        ?>
            <div class="tse-slider__item tse-slider__item-<?php echo esc_attr($c); ?>">
                <figure class="lazy ratio219" data-src="<?php echo esc_attr($image_url); ?>">
                    <div class="tse-slider__content">
                        <h2 class="tse-slider__title"><a href="<?php echo esc_url($item['link']); ?>"><?php echo esc_html($item['title']); ?></a></h2>
                        <div class="tse-slider__intro"><?php echo esc_html($item['text']); ?></div>
                    </div>
                </figure>
            </div>
        <?php endforeach; ?>
    </div>
</section>
<?php endif; ?>