<?php get_header('employment'); ?>
<main>
    <?php include('template/bottom.php'); ?>
    <?php include('template/breadcrumb.php'); ?>
    <section class="p-career">
        <div class="p-career__heading">
            <div class="p-career__inner l-inner">
                <?php
                if(have_rows('section01')) :
                while (have_rows('section01')) : the_row();
                ?>
                    <p class="p-career__entitle c-entitle"><?php the_sub_field('section01-entitle'); ?></p>
                    <h2 class="p-career__title c-title"><?php the_sub_field('section01-title'); ?></h2>
                    <div class="p-career__headingBlock">
                        <?php
                        $acf_row_image = get_sub_field('section01-img');
                        $url = $acf_row_image['url'];
                        $alt = $acf_row_image['alt'];
                        if ($url) :
                        ?>
                            <div class="p-career__headingImg c-img">
                                <img src="<?php echo $url; ?>" alt="<?php echo $alt; ?>">
                            </div>
                        <?php endif; ?>
                        <p class="p-career__headingText c-text"><?php the_sub_field('section01-text'); ?></p>
                    </div>
                <?php
                endwhile;
                endif;
                if(have_rows('section01-blocks')) :
                ?>
                    <div class="p-career__headingItems">
                        <?php
                        while (have_rows('section01-blocks')) : the_row();
                            $group = get_sub_field('section01-block');
                            if ($group) :
                            ?>
                                <div class="p-career__headingItem">
                                    <h3 class="p-career__headingTitle"><?php echo $group['section01-block-theme']; ?></h3>
                                    <div class="p-career__headingBody">
                                        <h4 class="p-career__headingTheme"><?php echo $group['section01-block-title']; ?></h4>
                                        <p class="p-career__headingItemText c-text"><?php echo $group['section01-block-text']; ?></p>
                                    </div>
                                </div>
                            <?php
                            endif;
                        endwhile;
                        ?>
                    </div>
                <?php endif; ?>
            </div>
        </div>
        <div class="p-career__training">
            <div class="p-career__inner l-inner">
                <?php
                if(have_rows('section02')) :
                while (have_rows('section02')) : the_row();
                ?>
                    <p class="p-career__entitle c-entitle"><?php the_sub_field('section02-entitle'); ?></p>
                    <h2 class="p-career__title c-title"><?php the_sub_field('section02-title'); ?></h2>
                    <div class="p-career__trainingContainer">
                        <div class="p-career__trainingWrap">
                            <?php
                            $acf_row_image = get_sub_field('section02-img');
                            $url = $acf_row_image['url'];
                            $alt = $acf_row_image['alt'];
                            $acf_row_image_sp = get_sub_field('section02-img-sp');
                            $url_sp = $acf_row_image_sp['url'];
                            if ($url) :
                            ?>
                                <div class="p-career__trainingImg">
                                    <picture>
                                        <source srcset="<?php echo $url; ?>" media="(min-width: 768px)">
                                        <img src="<?php echo $url_sp; ?>" alt="<?php echo $alt; ?>">
                                    </picture>
                                </div>
                            <?php endif; ?>
                        </div>
                        <div class="p-career__trainingInfo">
                            <?php
                            $group = get_sub_field('basic');
                            if($group) :
                            ?>
                                <div class="p-career__trainingBlock">
                                    <div class="p-career__trainingBlockHeading">
                                        <h3 class="p-career__trainingTheme"><?php echo $group['basic-subject']; ?></h3>
                                        <h4 class="p-career__trainingTitle"><?php echo $group['basic-title']; ?></h4>
                                    </div>
                                    <div class="p-career__trainingBottom">
                                        <?php
                                        $contents = $group['basic-contents'];
                                        foreach($contents as $field) :
                                        ?>
                                            <p><?php echo $field['basic-block']['basic-theme']; ?><span><?php echo $field['basic-block']['basic-text']; ?></span></p>
                                        <?php endforeach; ?>
                                    </div>
                                </div>
                            <?php endif; ?>
                            <?php
                            $group = get_sub_field('practical');
                            if($group) :
                            ?>
                                <div class="p-career__trainingBlock">
                                    <div class="p-career__trainingBlockHeading">
                                        <h3 class="p-career__trainingTheme"><?php echo $group['practical-subject']; ?></h3>
                                        <h4 class="p-career__trainingTitle"><?php echo $group['practical-title']; ?></h4>
                                    </div>
                                    <div class="p-career__trainingBottom">
                                        <?php
                                        $contents = $group['practical-contents'];
                                        foreach($contents as $field) :
                                        ?>
                                            <p><?php echo $field['practical-block']['practical-theme']; ?><span><?php echo $field['practical-block']['practical-text']; ?></span></p>
                                        <?php endforeach; ?>
                                    </div>
                                </div>
                            <?php endif; ?>
                        </div>
                    </div>
                <?php
                endwhile;
                endif;
                ?>
            </div>
        </div>
        <div class="p-career__system">
            <div class="p-career__inner l-inner">
                <?php
                if(have_rows('section03')) :
                while (have_rows('section03')) : the_row();
                ?>
                    <p class="p-career__entitle c-entitle"><?php the_sub_field('section03-entitle'); ?></p>
                    <h2 class="p-career__title c-title"><?php the_sub_field('section03-title'); ?></h2>
                    <div class="p-career__systemContents">
                        <?php
                        $group = get_sub_field('section03-item');
                        if($group) :
                            foreach($group as $field) :
                            ?>
                                <div class="p-career__systemItem">
                                    <h3 class="p-career__systemItemLocation"><?php echo $field['section02-block']['section02-block-title']; ?></h3>
                                    <div class="p-career__systemItemBlock">
                                        <h3 class="p-career__systemItemTheme"><?php echo $field['section02-block']['section02-block-title']; ?></h3>
                                        <p class="p-career__systemItemText"><?php echo $field['section02-block']['section02-block-description']; ?></p>
                                    </div>
                                </div>
                            <?php
                            endforeach;
                        endif;
                        ?>
                    </div>
                    <p class="p-career__theme u-desktop c-theme"><?php the_sub_field('section03-text'); ?></p>
                    <p class="p-career__text u-desktop c-text"><?php the_sub_field('section03-description'); ?></p>
                <?php
                endwhile;
                endif;
                ?>
            </div>
        </div>
    </section>
    <?php include('template/related.php'); ?>
</main>
<?php get_footer('employment');