<?php
get_header();
?>

<?php if ( is_front_page() && is_home() ) : ?>

<main id="primary" class="site-main home">
    <div class="page-hero">
        <div class="container px-5 py-5">
            <h1><?php echo esc_html__( get_theme_mod('go_mechanic_main_text', __('Tips, guides, and shop updates', 'go-mechanic' ))); ?></h1>

            <p>
                <?php echo esc_html__( get_theme_mod('go_mechanic_text', __('Learn simple ways to extend your vehicle’s life, spot problems early, and understand common repairs—straight from our certified mechanics.', 'go-mechanic' ))); ?>
            </p>
        </div>
    </div>
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-md-8 col-12">
                <?php if ( have_posts() ) : ?>
                <?php if ( is_home() && ! is_front_page() ) : ?>
                <header>
                    <h1 class="page-title screen-reader-text">
                        <?php single_post_title(); ?>
                    </h1>
                </header>
                <?php endif; ?>

                <div class="row">
                    <?php while ( have_posts() ) : the_post(); ?>
                    <div class="col-lg-6 col-md-6 col-12">
                        <?php get_template_part( 'template-parts/content', get_post_type() ); ?>
                    </div>
                    <?php endwhile; ?>
                </div>

                <?php the_posts_navigation(); ?>

                <?php else : ?>
                <?php get_template_part( 'template-parts/content', 'none' ); ?>
                <?php endif; ?>

            </div>

            <div class="col-lg-4 col-md-4 col-12">
                <?php get_sidebar(); ?>
            </div>

        </div>
    </div>
</main>

<?php elseif ( is_front_page() && ! is_home() ) : ?>

<main id="primary" class="site-main front">
    <?php
        get_template_part('template-parts/front-section/front', 'section-slider');
        get_template_part('template-parts/front-section/front', 'section-about');
    ?>
</main>

<?php endif; ?>

<?php
get_footer();
?>