<?php
get_header();
include get_template_directory() . '/inc/menus/menu.php';
?>

<main role="main">
<?php 
if (has_post_thumbnail()) {
    $backgroundImg = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full');
    $bg_url = $backgroundImg[0];
} else {
    // fallback image (IMPORTANT)
    $bg_url = get_template_directory_uri() . '/assets/images/default-hero.jpg';
}
?>

<!-- HERO SECTION -->
<section class="hero-section" style="background-image: url('<?php echo esc_url($bg_url); ?>');">
    
    <div class="hero-overlay">
        <div class="hero-content">

            <!-- TITLE -->
            <h1 class="hero-title">
                <?php the_title(); ?>
            </h1>

            <!-- BREADCRUMB -->
            <div class="hero-breadcrumb">
                <a href="<?php echo esc_url(home_url()); ?>">
                    <i class="fas fa-home"></i> 
                </a>
                <span class="separator"> > </span>
                <span><?php the_title(); ?></span>
            </div>

        </div>
    </div>

</section>


<!-- PAGE CONTENT -->
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
        <div class="">
            <?php the_content(); ?>
        </div>
    </article>
<?php endwhile; endif; ?>

</main>

<?php get_footer(); ?>