<?php /*Template Name: universityeducation */ ?>
<?php get_header(); ?>
<h1 class="pagetit text-center">
    <?php the_title(); ?>
</h1>
<section class="content">
    <div class="container"
        <?php if (!empty(get_the_content()) || (has_post_thumbnail())): ?>
            <div class="page-main mb-5">
                <div class="container">
                    <?php if (has_post_thumbnail()) : ?>
                        <div class="page-thumb text-center mb-2">
                            <?php the_post_thumbnail('full', ['class' => 'img-fluid mx-auto d-block']); ?>
                        </div>
                    <?php endif; ?>

                    <?php while (have_posts()) : the_post(); ?>
                        <div class="page-editor">
                            <?php the_content(); ?>
                        </div>
                    <?php endwhile; ?>
                </div>
            </div>
        <?php endif; ?>
    </div>

    <div class="page-form">
        <div class="container">
            <div class="row position-relative justify-content-center mt-5">
                <div class="col-md-8 ">
                    <div class="form wow fadeInUp" data-wow-delay=".4s">

                        <?php echo do_shortcode('[contact-form-7 id="' . get_field('forms') . '" ]'); ?>
                    </div>
                </div>
            </div>
        </div>
    </div>

</section>
<script>
    jQuery(document).ready(function($) {

        var totalHeight = 0;

        $('.form-focused.form-group').each(function () {

            var $el = $(this);

            var h = $el.outerHeight();                        // height + padding + border
            var mt = parseFloat($el.css('margin-top')) || 0;  // margin-top
            var mb = parseFloat($el.css('margin-bottom')) || 0; // margin-bottom

            totalHeight += (h + mt + mb);
        });

        // ضع ارتفاع للـ iframe
        $('iframe , .lincont').height(totalHeight - 20 );
    });

</script>
<?php get_footer(); ?>
