<?php
defined('ABSPATH') || exit;

get_header();

$is_elementor = false;
if (did_action('elementor/loaded')) {
    $doc = \Elementor\Plugin::$instance->documents->get(get_the_ID(), false);
    $is_elementor = ($doc && $doc->is_built_with_elementor());
}

if ($is_elementor) {
    while (have_posts()) :
        the_post();
        the_content();
    endwhile;
} else {
    while (have_posts()) :
        the_post();
        ?>
        <main class="container-main mt-6 md:mt-8 lg:mt-10">
            <?php if (get_the_content()): ?>
                <div class="mb-8">
                    <h1 class="text-2xl md:text-3xl font-bold text-gray-800 mb-4"><?php the_title(); ?></h1>
                    <div class="prose max-w-none text-gray-600">
                        <?php the_content(); ?>
                    </div>
                </div>
            <?php endif; ?>
            <?php get_template_part('template-parts/contact', 'page'); ?>
        </main>
        <?php
    endwhile;
}

get_footer();

