<?php 
/**
 * Template part for displaying Featured About Section
 *
 * @package Prime Spa Center
 */
$prime_spa_center_featured_services_section_title = prime_spa_center_get_option('featured_services_section_title');
$prime_spa_center_featured_services_page[] = prime_spa_center_get_option('featured_services_page');
?>    
<div id="service-section" class="section-content">
    <?php 
    $args = array(
        'post_type' => 'page',
        'post__in' => $prime_spa_center_featured_services_page,
        'orderby' => 'post__in',
        'ignore_sticky_posts' => true,
    );
    $loop = new WP_Query($args);
    if ($loop->have_posts()) :
        while ($loop->have_posts()) : $loop->the_post();
            $default_image_url = get_template_directory_uri() . '/assets/images/default-header.png'; // Replace with the actual path to your default image
            ?>
            <article style="padding: 0 15px;">
                <div class="featured-service-item">
                    <div class="entry-container">
                        <div class="content-image wow zoomInUp" data-wow-duration="2s">
                            <?php if (has_post_thumbnail($post->ID)): ?>
                                <div class="image-container">
                                    <?php the_post_thumbnail($post->ID); ?>
                                </div>
                            <?php else: ?>
                                <div class="image-container">
                                    <img src="<?php echo esc_url($default_image_url); ?>" alt="<?php the_title(); ?>">
                                </div>
                            <?php endif; ?>
                        </div>
                        <div class="content-details">
                            <header class="entry-header">
                                <?php if (!empty($prime_spa_center_featured_services_section_title)): ?>
                                    <div class="section-short-title">
                                        <h4><?php echo esc_html($prime_spa_center_featured_services_section_title); ?></h4>
                                    </div>
                                <?php endif; ?>
                                <h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
                            </header>
                            <div class="entry-content">
                                <?php
                                $prime_spa_center_excerpt = prime_spa_center_the_excerpt(100);
                                echo wp_kses_post(wpautop($prime_spa_center_excerpt));
                                ?>
                            </div><!-- .entry-content -->
                            <div class="button-content">
                                <a href="<?php the_permalink(); ?>" class="btn">
                                    <?php esc_html_e('More About Us', 'prime-spa-center'); ?><i class="<?php echo esc_attr(get_theme_mod('prime_spa_center_slider_sevice_icon', 'fas fa-arrow-right')); ?>"></i> 
                                </a>
                            </div><!-- .button-content -->
                        </div>
                    </div><!-- .entry-container -->
                </div><!-- .featured-service-item -->
            </article>
        <?php endwhile; ?>
    <?php endif; ?>
    <?php wp_reset_postdata(); ?>
</div><!-- .section-content -->
