<?php
   if ( ! defined( 'ABSPATH' ) ) {
     exit; // Exit if accessed directly
   }
   ?>
<?php get_header(); ?>
<?php $template_url = get_bloginfo ( 'template_url' ) . '/'; ?>
<?php 
   //to check if there is a post regarding the url access the page
   if (have_posts ()) :
     the_post(); 
   endif;
   $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID), 'thumbnail' );
   if($url != "")
   {
   $img = $url; 
   }else{
   $img = $template_url."assets/images/breadcrumb/career-crumb.png"; 
   }
?>
<!-- breadcrumb start -->
<section class="page_breadcrumb position-relative"
    style="background-image: url(<?php echo $img;?>);">
    <div class="container">
        <div class="row">
            <div class="col-12">
                <div class="breadcrumb_wrapper d-flex flex-column align-items-center justify-content-center">
                    <h2 class="breadcrumb_title text-white"><?php the_title();?></h2>
                    <nav aria-label="breadcrumb">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item"><a href="<?php echo esc_url( home_url( '/' ) ); ?>">Home</a></li>
                            <li class="breadcrumb-item active" aria-current="page"><?php the_title();?></li>
                        </ol>
                    </nav>
                </div>
            </div>
        </div>
    </div>
</section>
<!-- breadcrumb end -->
    <!-- career details start -->


    <section id="career" class="py-5 career_page">
        <div class="container">
            <div class="row align-items-stretch">
                <?php the_content();?>
            </div>
        </div>
    </section>

    <section class="career_open py-5">
        <div class="container">
            <div class="row justify-content-center g-4">
            <?php if(have_rows('careers')): ?>
            <?php $i=0; while(have_rows('careers')): ?>
            <?php the_row(); ?> 
                <div class="col-md-6">
                    <div class="carrer_wrapper d-flex w-100">
                        <div class="career_open_img">
                            <img src="<?php the_sub_field('image'); ?>" class="img-fluid h-100 w-100 object-fit-cover"
                                alt="">
                        </div>
                        <div class="career_open_content p-3">
                            <h4><strong><?php the_sub_field('title'); ?></strong></h4>
                            <hr>
                            <?php the_sub_field('points'); ?>

                            <div class="job_description">
                                <?php the_sub_field('points'); ?>
                            </div>

                            <p class="">
                                <strong><i><?php the_sub_field('description'); ?></i></strong>
                            </p>
                            <div class="d-flex">
                                <a href="<?php the_sub_field('link'); ?>" class="blob-btn blob-btn2 px-3">
                                    Apply Now <i class="fa-solid fa-arrow-right"></i>
                                    <span class="blob-btn__inner">
                                        <span class="blob-btn__blobs">
                                            <span class="blob-btn__blob"></span>
                                            <span class="blob-btn__blob"></span>
                                            <span class="blob-btn__blob"></span>
                                            <span class="blob-btn__blob"></span>
                                        </span>
                                    </span>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            <?php $i++; endwhile; ?>
            <?php endif; ?> 
            </div>
        </div>
    </section>

    <section id="career_form" class="my-5">
        <div class="container">
            <div class="row">
                <div class="col-md-7">
                    <div class="contact_form careerform mb-5">
                        <h2 class="text-center my-4">Apply Form</h2>
                        <hr class="mb-4 text-white">
                        <div>
                            <?php echo do_shortcode('[contact-form-7 id="0956e87" title="Career form"]');?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- career details end -->
<?php get_footer(); ?>