<?php get_header(); ?>
<?php $categories = get_the_terms(get_the_ID(), 'trip_cat'); ?>

<section class="site-wrapper is-layout-flow">


    <?php if (have_posts()) : ?>
        <?php while (have_posts()) : the_post(); ?>

            <div class="wp-block-group has-global-padding is-layout-constrained md:mt-60">
                <div class="alignwide">

                    <div class="wp-block-columns is-layout-flex is-stacked-on-tablet md:gap-60">
                        <div class="wp-block-column is-layout-flow">

                            <?php if ($categories && !is_wp_error($categories) && rt_get_option('single_trip_element_category', true)) : ?>
                                <div class="wp-block-post-terms is-style-colored has-x-small-font-size">
                                    <?php foreach ($categories as $term) : ?>
                                        <a class="<?php echo 'trip-category-' . esc_attr($term->slug) ?>" href="<?php echo esc_url(get_tag_link($term->term_id)) ?>">
                                            <?php echo $term->name ?>
                                        </a>
                                    <?php endforeach; ?>
                                </div>
                            <?php endif ?>

                            <?php echo rt_get_breadrumbs() ?>

                            <h1 class="wp-block-post-title mt-20"><?php echo get_the_title() ?></h1>

                            <?php rt_get_template_part('single-trip/gallery') ?>

                            <div class="wp-block-post-content">
                                <h2 class="wp-block-heading"><?php echo __('Overview', 'jelajah-text') ?></h2>
                                <?php the_content() ?>
                                <?php wp_link_pages(); ?>
                            </div>

                            <?php rt_get_template_part('single-trip/itenerary') ?>
                            <?php rt_get_template_part('single-trip/packages-price') ?>
                            <?php rt_get_template_part('single-trip/tag') ?>
                        </div>
                        <div class="wp-block-column is-layout-flow" style="flex-basis:340px">
                            <div class="site-aside__inner is-layout-flow is-aside-sticky">
                                <?php rt_get_template_part('single-trip/info') ?>
                                <?php rt_get_template_part('single-trip/share') ?>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
            
            <?php rt_get_template_part('single-trip/related-trip') ?>

        <?php endwhile; ?>
    <?php endif ?>


</section>

<?php get_footer(); ?>