<?php 
/**
 * Template part for displaying Featured Classes Section
 *
 * @package graphic_design_portfolio
 */

$graphic_design_portfolio_about = get_theme_mod( 'graphic_design_portfolio_about_setting',true );
$graphic_design_portfolio_featured_mission_section_title = get_theme_mod( 'graphic_design_portfolio_featured_mission_section_title' );
$graphic_design_portfolio_featured_mission_posts[] = get_theme_mod( 'graphic_design_portfolio_featured_mission_post_' );

?>
<?php if ( $graphic_design_portfolio_about ){?>
<div id="about-section" class="section-content py-5">
    <div class="container">        
        <?php $args = array (
            'post_type'     => 'page',
            'posts_per_page' => 1,
            'post__in'      => $graphic_design_portfolio_featured_mission_posts,
            'orderby'       =>'post__in',
            'ignore_sticky_posts' => true,
        );?>
        <?php
        $loop = new WP_Query($args);
        if ( $loop->have_posts() ) :
            while ($loop->have_posts()) : $loop->the_post(); ?>
            <div class="featured-mission-box">
                <div class="row">
                    <div class="col-lg-6 col-md-12 align-self-center side-1 position-relative">
                        <div class="entry-header">
                             <?php if ( get_theme_mod('graphic_design_portfolio_about_text_extra') ) : ?>
                                <h5><?php echo esc_html(get_theme_mod('graphic_design_portfolio_about_text_extra'));?></h5>
                              <?php endif; ?>
                            <?php if( !empty($graphic_design_portfolio_featured_mission_section_title) ): ?>
                                <div class="section-title">
                                    <h3><?php echo esc_html($graphic_design_portfolio_featured_mission_section_title); ?></h3>
                                </div>
                            <?php endif; ?>
                        </div>
                        <div class="entry-content">
                            <p class="mb-0 about-para"><?php echo wp_trim_words( get_the_content(), 80 ); ?></p>
                        </div>
                        <div class="row">
                          <?php
                          $graphic_design_portfolio_about_point = get_theme_mod('graphic_design_portfolio_about_points', '');
                          for ( $graphic_design_portfolio_m = 1; $graphic_design_portfolio_m <= $graphic_design_portfolio_about_point; $graphic_design_portfolio_m++ ) {
                            $graphic_design_portfolio_point_text = get_theme_mod('graphic_design_portfolio_about_points_text' . $graphic_design_portfolio_m, '');
                            if ( $graphic_design_portfolio_point_text != '' ) {
                          ?>
                            <div class="col-lg-6 col-md-6">
                              <p class="about-list"><i class="fa-solid fa-square-check me-2"></i><?php echo esc_html($graphic_design_portfolio_point_text); ?></p>
                            </div>
                          <?php
                            }
                          }
                          ?>
                        </div>
                        <div class="sign-in-area my-4">
                            <a href="<?php the_permalink(); ?>"><i class="fas fa-chevron-right"></i><?php esc_html_e('More About','graphic-design-portfolio'); ?></a>
                        </div>  
                    </div>
                    <div class="col-lg-6 col-md-12 align-self-center about-us position-relative">
                        <div class="about-img wow zoomIn delay-1000" data-wow-duration="2s">
                           <?php
                              if ( has_post_thumbnail() ) :
                                the_post_thumbnail();
                              else:
                                ?>
                                <div class="image-container">
                                  <img src="<?php echo get_stylesheet_directory_uri() . '/images/default-header.png'; ?>">
                                </div>
                                <?php
                              endif;
                            ?>
                        </div>
                        <?php if ( get_theme_mod('graphic_design_portfolio_about_expereince_count') != '' ) { ?>
                          <div class="experience-content">
                                  <h4 class="mb-0 ex-count"><?php echo esc_html(get_theme_mod('graphic_design_portfolio_about_expereince_count', '')); ?></h4>
                                  <p class="mb-0 mt-0"><?php echo esc_html(get_theme_mod('graphic_design_portfolio_about_expereince_text', '')); ?></p>
                          </div>
                        <?php } ?>
                </div>
            </div>
        <?php endwhile; ?>
        <?php endif; ?>
        <?php wp_reset_postdata(); ?>
    </div>
</div>
<?php } ?>