<?php
/**
 * Template Name: Home Page
 */

get_header();
?>

<main id="primary">

    <?php 
        $legal_services_firm_main_slider_wrap = absint(get_theme_mod('legal_services_firm_enable_slider', 0));

        if ($legal_services_firm_main_slider_wrap == 1): 
    ?>
        <section id="main-slider-wrap" style="background-image: url('<?php echo get_stylesheet_directory_uri(); ?>/revolution/assets/images/sliderbg.png');">
            <div class="slider-main">
                <div class="owl-carousel">
                    <?php for ($legal_services_firm_main_i = 1; $legal_services_firm_main_i <= 3; $legal_services_firm_main_i++): ?>
                        <?php 
                        $legal_services_firm_slider_image = get_theme_mod('legal_services_firm_slider_image' . $legal_services_firm_main_i);
                        if ($legal_services_firm_slider_image): 
                        ?>
                            <div class="main-slider-inner-box">
                                <div class="container">
                                    <div class="flex-row">
                                        <div class="slider-left">
                                            <div class="main-slider-content-box">
                                                <?php if ($legal_services_firm_top_text = get_theme_mod('legal_services_firm_slider_top_text' . $legal_services_firm_main_i)): ?>
                                                    <p class="slider-top"><?php echo esc_html($legal_services_firm_top_text); ?></p>
                                                <?php endif; ?>

                                                <?php if ($legal_services_firm_heading = get_theme_mod('legal_services_firm_slider_heading' . $legal_services_firm_main_i)): ?>
                                                    <h1><?php echo esc_html($legal_services_firm_heading); ?></h1>
                                                <?php endif; ?>

                                                <?php if ($legal_services_firm_text = get_theme_mod('legal_services_firm_slider_text' . $legal_services_firm_main_i)): ?>
                                                    <p class="slider-para"><?php echo wp_kses_post($legal_services_firm_text); ?></p>
                                                <?php endif; ?>

                                                <div class="main-slider-button">
                                                    <?php 
                                                    $legal_services_firm_button1_link = get_theme_mod('legal_services_firm_slider_button1_link' . $legal_services_firm_main_i);
                                                    $legal_services_firm_button1_text = get_theme_mod('legal_services_firm_slider_button1_text' . $legal_services_firm_main_i);
                                                    if ($legal_services_firm_button1_link && $legal_services_firm_button1_text): 
                                                    ?>
                                                        <a class="slide-btn-1" href="<?php echo esc_url($legal_services_firm_button1_link); ?>">
                                                            <?php echo esc_html($legal_services_firm_button1_text); ?>
                                                        </a>
                                                    <?php endif; ?>

                                                    <?php 
                                                    $legal_services_firm_button2_link = get_theme_mod('legal_services_firm_slider_button2_link' . $legal_services_firm_main_i);
                                                    $legal_services_firm_button2_text = get_theme_mod('legal_services_firm_slider_button2_text' . $legal_services_firm_main_i);
                                                    if ($legal_services_firm_button2_link && $legal_services_firm_button2_text): 
                                                    ?>
                                                        <a class="slide-btn-2" href="<?php echo esc_url($legal_services_firm_button2_link); ?>">
                                                            <?php echo esc_html($legal_services_firm_button2_text); ?>
                                                        </a>
                                                    <?php endif; ?>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="slider-right">
                                            <img src="<?php echo esc_url($legal_services_firm_slider_image); ?>" alt="<?php echo esc_attr($legal_services_firm_heading); ?>">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        <?php endif; ?>
                    <?php endfor; ?>
                </div>
            </div>
        </section>
    <?php endif; ?>

   <?php 
    $legal_services_firm_main_expert_wrap = absint(get_theme_mod('legal_services_firm_enable_project', 0));
    if($legal_services_firm_main_expert_wrap == 1){ 
    ?>
    <div id="primary">
        <section id="main-expert-wrap">
            <div class="main-expert-heading">
                <?php if ( get_theme_mod('legal_services_firm_project_short_heading') ) : ?><p class="abt-title-top"><?php echo esc_html( get_theme_mod('legal_services_firm_project_short_heading') ); ?></p><?php endif; ?>
                <?php if ( get_theme_mod('legal_services_firm_project_heading') ) : ?><h3><?php echo esc_html( get_theme_mod('legal_services_firm_project_heading') ); ?></h3><?php endif; ?>
            </div>
            <div class="container">
                <div class="flex-row">
                    <div class="tabs">
                        <?php for ( $legal_services_firm_i = 1; $legal_services_firm_i <= 4; $legal_services_firm_i++ ) :
                            $legal_services_firm_tab_image = get_theme_mod( "legal_services_firm_add_team_lawyer_image{$legal_services_firm_i}" );
                            if ( $legal_services_firm_tab_image ) : ?>
                                <div class="tab text-green-600" data-tab="tab<?php echo esc_attr( $legal_services_firm_i ); ?>">
                                    <img src="<?php echo esc_url( $legal_services_firm_tab_image ); ?>" alt="">
                                </div>
                            <?php endif;
                        endfor; ?>
                    </div>
                    <div class="content-box">
                        <?php for ( $legal_services_firm_i = 1; $legal_services_firm_i <= 4; $legal_services_firm_i++ ) :
                            $legal_services_firm_image = get_theme_mod( "legal_services_firm_add_team_lawyer_image$legal_services_firm_i" );
                            if ( $legal_services_firm_image ) : ?>
                                <div id="tab<?php echo esc_attr( $legal_services_firm_i ); ?>" class="content">
                                    <div class="tab-content mt-4">
                                        <div class="rel-post-tab">
                                            <div class="box rel-card-item">
                                                <div class="box-content">
                                                    <?php if ( get_theme_mod( 'legal_services_firm_add_lawyer_name' .$legal_services_firm_i ) ) : ?>
                                                        <h4><?php echo esc_html( get_theme_mod( 'legal_services_firm_add_lawyer_name' . $legal_services_firm_i) ); ?></h4>
                                                    <?php endif; ?>
                                                    
                                                    <?php if ( get_theme_mod( 'legal_services_firm_add_lawyer_designation' . $legal_services_firm_i ) ) : ?>
                                                        <p class="lawyer-designation"><?php echo esc_html( get_theme_mod( 'legal_services_firm_add_lawyer_designation' . $legal_services_firm_i ) ); ?></p>
                                                    <?php endif; ?>

                                                    <?php if ( get_theme_mod( 'legal_services_firm_add_lawyer_details' . $legal_services_firm_i ) ) : ?>
                                                        <p class="lawyer-details"><?php echo esc_html( get_theme_mod( 'legal_services_firm_add_lawyer_details' . $legal_services_firm_i ) ); ?></p>
                                                    <?php endif; ?>
                                                    <div class="lawyer-contact">
                                                        <?php if ( get_theme_mod( 'legal_services_firm_lawyer_contact_phone' . $legal_services_firm_i ) ) : ?>
                                                            <span class="contact-info phone">
                                                                <a href="tel:<?php echo esc_attr( get_theme_mod( 'legal_services_firm_lawyer_contact_phone' . $legal_services_firm_i ) ); ?>">
                                                                    <i class="fas fa-phone"></i><span class="contact-text"><?php echo esc_html( get_theme_mod( 'legal_services_firm_lawyer_contact_phone' . $legal_services_firm_i ) ); ?></span>
                                                                </a>
                                                            </span>
                                                        <?php endif; ?>
                                                        <?php if ( get_theme_mod( 'legal_services_firm_lawyer_contact_email' . $legal_services_firm_i ) ) : ?>
                                                            <span class="contact-info">
                                                                <a href="mailto:<?php echo esc_attr( get_theme_mod( 'legal_services_firm_lawyer_contact_email' . $legal_services_firm_i ) ); ?>">
                                                                    <i class="fas fa-envelope-open-text"></i><span class="contact-text"><?php echo esc_html( get_theme_mod( 'legal_services_firm_lawyer_contact_email' . $legal_services_firm_i ) ); ?></span>
                                                                </a>
                                                            </span>
                                                        <?php endif; ?>
                                                    </div>
                                                    <?php
                                                        $legal_services_firm_case_percentage = get_theme_mod( 'legal_services_firm_case_solve_percentage' . $legal_services_firm_i, '' );
                                                        if ( $legal_services_firm_case_percentage !== '' ) : ?>
                                                            <div class="progress-bar-box">
                                                                <div class="progress-label">
                                                                    <span class="case-solve-text"><?php esc_html_e( 'Case Solve', 'legal-services-firm' ); ?></span>
                                                                    <span class="progress-percent"><?php echo esc_html( $legal_services_firm_case_percentage ) . '%'; ?></span>
                                                                </div>
                                                                <div class="progress-bar-wrapper">
                                                                    <div class="progress-bar-fill" style="width: <?php echo esc_attr( $legal_services_firm_case_percentage . '%' ); ?>;"></div>
                                                                </div>
                                                            </div>
                                                    <?php endif; ?>
                                                    <div class="bottom-information">
                                                        <span class="book-lawyer">
                                                            <?php
                                                            $legal_services_firm_btn_link = get_theme_mod( 'legal_services_firm_book_appointement_btn_link' . $legal_services_firm_i, '' );
                                                            $legal_services_firm_btn_text = get_theme_mod( 'legal_services_firm_book_appointement_btn_text' . $legal_services_firm_i, __( 'Book An Appointment', 'legal-services-firm' ) );

                                                            if ( $legal_services_firm_btn_link ) : ?>
                                                                <a href="<?php echo esc_url( $legal_services_firm_btn_link ); ?>"><?php echo esc_html( $legal_services_firm_btn_text ); ?></a>
                                                            <?php endif; ?>
                                                        </span>
                                                        <span class="lawyer-social-media">
                                                            <?php 
                                                                $legal_services_firm_serv_facebook_url = get_theme_mod('legal_services_firm_serv_facebook_url' . $legal_services_firm_i);
                                                                      if ($legal_services_firm_serv_facebook_url != '') { ?>
                                                                    <a target="_blank" href="<?php echo esc_url($legal_services_firm_serv_facebook_url); ?>">
                                                                        <i class="fab fa-facebook-f"></i>
                                                                    </a>
                                                            <?php } ?>
                                                            <?php 
                                                                $legal_services_firm_serv_twitter_url = get_theme_mod('legal_services_firm_serv_twitter_url' . $legal_services_firm_i);
                                                                      if ($legal_services_firm_serv_twitter_url != '') { ?>
                                                                    <a target="_blank" href="<?php echo esc_url($legal_services_firm_serv_twitter_url); ?>">
                                                                        <i class="fab fa-twitter"></i>
                                                                    </a>
                                                            <?php } ?>
                                                            <?php 
                                                                $legal_services_firm_serv_youtube_url = get_theme_mod('legal_services_firm_serv_youtube_url' . $legal_services_firm_i);
                                                                      if ($legal_services_firm_serv_youtube_url != '') { ?>
                                                                    <a target="_blank" href="<?php echo esc_url($legal_services_firm_serv_youtube_url); ?>">
                                                                        <i class="fab fa-youtube"></i>
                                                                    </a>
                                                            <?php } ?>
                                                            <?php 
                                                                $legal_services_firm_serv_insta_url = get_theme_mod('legal_services_firm_serv_insta_url' . $legal_services_firm_i);
                                                                      if ($legal_services_firm_serv_insta_url != '') { ?>
                                                                    <a target="_blank" href="<?php echo esc_url($legal_services_firm_serv_insta_url); ?>">
                                                                        <i class="fab fa-instagram"></i>
                                                                    </a>
                                                            <?php } ?>
                                                            <?php 
                                                                $legal_services_firm_serv_linkedin_url = get_theme_mod('legal_services_firm_serv_linkedin_url' . $legal_services_firm_i);
                                                                      if ($legal_services_firm_serv_linkedin_url != '') { ?>
                                                                    <a target="_blank" href="<?php echo esc_url($legal_services_firm_serv_linkedin_url); ?>">
                                                                        <i class="fab fa-linkedin-in"></i>
                                                                    </a>
                                                            <?php } ?>
                                                        </span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            <?php endif;
                        endfor; ?>
                    </div>
                </div>
            </div>
        </section>
    </div>
    <?php } ?>
</main>
<?php
get_footer();
?>