<?php
/**
 *  For Displaying Partners Achieve 
 *
 *
 * @package Felicityhealth
 * @since Felicityhealth 1.0
 */
?>
<?php get_header(); ?>
<style>
     #investors-page{
        background-color: #0d333e;
        background-color: #442081;
        color: #fff;
        min-height: 663px;
        font-size: 20px;
        line-height: 28px;
    }
</style>
<div id="investors-page">
<style>
    .row_sm__BpJMS {
        max-width: 960px;
        text-align: center;
    }
    .spacer_spacer {
        padding: 20px;
    }
    .row_wrap__PYUmC {
        padding: 0 20px;
        margin-left: auto;
        margin-right: auto;
    }
    .heading_heading {
        font-size: 48px; 
        line-height: 60px;
    }
    @media (min-width: 1024px){
    .row_wrap__PYUmC {
        padding: 0 40px;
    }
    .spacer_spacer {
        padding-top: 40px;
        padding-bottom: 40px;
    }
    }
</style>
<section class="row spacer_spacer pt-5">
    <div class="row_wrap__PYUmC row_sm__BpJMS ">
        <div class="prose_prose__r5u4D">
            <h2 class="heading_heading heading_h3__BDSlS"><?= the_archive_title() ?></h2>
            <p class="text_text__ySj__">
                Felicity is committed to being strongly aligned with its investors; as such it continues to be the single largest investor across its funds.
            </p>
        </div>
    </div>
</section>


<style>
        .sponsors-list .row--by6 {
            max-width: 255px;
        }
        .sponsors-list .row--by6 {
            height: 158px;
        }
        .sponsors-list .row--by6 {
            padding: 10px;
        }
        .sponsors-list .sponsor-item {
            background-color: #eee;
            border-radius: 20px;
            display: -webkit-box;
            display: -ms-flexbox;
            display: flex;
            -webkit-box-align: center;
            -ms-flex-align: center;
            align-items: center;
            -webkit-box-pack: center;
            -ms-flex-pack: center;
            justify-content: center;
            width: 100%;
            height: 100%;
        }
        .sponsors-list .row--by6 .sponsor-item {
            padding: 29px 45px;
        }
        .sponsors-list .sponsor-item img {
            max-height: 100%;
            max-width: 100%;
            -o-object-fit: contain;
            object-fit: contain;
            width: 100%;
        }

       .sponsors-list .row--by5 .sponsor-item {
            padding: 67px 40px;
        }


       

        @media (min-width: 768px) and (max-width: 1199.98px){
            .sponsors-list .row--by4, .sponsors-list .row--by5, .sponsors-list .row--by6 {
                height: 168px;
            }
           .sponsors-list .row--by4 .sponsor-item,.sponsors-list .row--by5 .sponsor-item,.sponsors-list .row--by6 .sponsor-item {
                padding: 35px 40px;
            }
        }

        @media (min-width: 480px) and (max-width: 1023.98px){
           .sponsors-list .row--by4,  .sponsors-list .row--by5, .sponsors-list .row--by6 {
                height: 150px;
            }
            .sponsors-list .row--by4 .sponsor-item,.sponsors-list .row--by5 .sponsor-item,.sponsors-list .row--by6 .sponsor-item {
                padding: 35px 25px;
            }

        }

        @media (max-width: 1439px){
            .sponsors-list{
                padding: 0 20px;
            }
        }

        @media (max-width: 767.98px){
           .sponsors-list .row--by4,.sponsors-list .row--by5,.sponsors-list .row--by6 {
                height: 110px;
            }
           .sponsors-list .row--by4 .sponsor-item,.sponsors-list .row--by5 .sponsor-item,.sponsors-list .row--by6 .sponsor-item {
                padding: 25px 20px;
            }
        }


</style>

<style>
    .sponsors.modal {
        padding: 2.5rem;
        max-height: 90vh;
    }

    .sponsors.modal .modal-dialog {
        max-width: 1010px;
    }

    .sponsors.modal .modal-content {
        border-radius: 8px;
    }
   
    .sponsors.modal .modal-body {
        padding: 0;
        height: 100%;
        overflow-x: hidden;
    }
    .sponsors.modal .modal-body .bg-light-gray-partner {
        background-color: #f4f5f8;
    }
    .sponsors.modal .modal-body .logo-box {
        padding: 120px 70px;
    }
    .sponsors.modal .modal-body .logo-box img {
        -o-object-fit: contain;
        object-fit: contain;
        max-height: 200px;
    }

    .sponsors.modal .modal-body h2 {
        font-size: 20px;
        line-height: 28px;
        color: #393a3d;
        font-weight: 700;
    }

    .sponsors.modal .modal-body .partner-copy p {
        color: #0d333e!important;
        font-size: 1rem;
    }
    .text-dark {
        color: #343a40!important;
    }
    .sponsors.modal .modal-social {
        vertical-align: middle;
    }
    .social-icons img {
        height: 32px;
    }
    .sponsors.modal .modal-social img {
        max-height: 20px;
        -webkit-transition: all .09s ease-in-out;
        transition: all .09s ease-in-out;
    }
    .sponsors.modal .social-icons li:not(:first-child) {
        margin-left: 0.5rem;
    }
    .social-icons .list-inline-item:not(:last-child) {
        margin-right: 0.125rem;
    }
    .body-01 {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }

    .modal .close {
        font-size: 1.3rem;
        position: absolute;
        z-index: 999;
        top: 10px;
        right: 15px;
        width: 2rem;
    }

    @media (min-width: 1024px){
        .sponsors.modal {
            top: 210px!important;
        }
    }

   


</style>
<?php
    $args = array(
        'post_type' => 'investors',
        'order' => 'ASC',
        'orderby' => 'ID',
    );
    $investors = new WP_Query($args);
   
?>
           
    <div class="container p-0 mb-5">
        <?php  if ( $investors->have_posts() ) : ?>
            <div class="sponsors-list row pb-8 pt-3 justify-content-center">
                <?php $post_idx = 0; while ( $investors->have_posts() )  : $investors->the_post();  ?>
                     <div data-bs-toggle="modal" data-bs-target="#myModal-<?= $post_idx ?>" class="col-4 col-sm-3 row--by6">
                        <div class="sponsor-item">
                            <img
                                src="<?= the_field('company_logo'); ?>" alt="<?php the_title()?>" class="img-fluid"
                            />
                        </div>
                    </div>  
                    <div class="sponsors modal fade" id="myModal-<?= $post_idx ?>" aria-modal="true">
                        <div class="modal-dialog modal-dialog-scrollable mx-auto">
                            <div class="modal-content border-0">
                                <button type="button" class="close btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                                <!-- Modal body -->
                                <div class="modal-body">
                                    <div class="container-fluid">
                                    <div class="row">
                                        <div class="col-12 col-md-4 bg-light-gray-partner logo-box">
                                            <div class="d-flex h-100 justify-content-center align-items-center">
                                                <img src="<?= the_field('company_logo'); ?>" alt="<?php the_title()?>" class="img-fluid">
                                            </div>
                                        </div>
                                        <div class="col-12 col-md-8 d-flex justify-content-center align-items-center px-4 px-md-6 py-6">
                                            <div>
                                                <div class="d-block mb-4 partner-copy">
                                                    <h2><?php the_title()?></h2>
                                                    <p></p>
                                                    <p style="color: rgb(0,0,0);">
                                                         <?= the_field('description'); ?>
                                                    </p>
                                                    <p></p>
                                                </div>
                                                <div>
                                                <span class="d-block mt-2">
                                                    <a href="<?= the_field('website_link'); ?>" target="_blank" rel="noopener" noreferrer="" class="btn btn-sm btn-secondary"><?php echo __( 'Visit Investor', 'felicityhealth' );?> </a>
                                                </span>
                                                <?php  if ( get_field('social_handles')  != NULL ) : ?>
                                                    <ul class="social-icons list-inline  body-01 mt-3 mb-0 p-0">
                                                        <?php foreach (get_field('social_handles') as $key => $handle):?>
                                                            <li class="list-inline-item">
                                                                <a href="<?= $handle['social_handle_link'] ?>" target="_blank" rel="”noopener" noreferrer”="" class="modal-social text-dark">
                                                                    <?php if( $handle['platform'] == 'facebook' ):?>
                                                                        <img src="<?php echo site_url('/wp-content/uploads/2022/10/facebook-f-brands.svg') ?>">
                                                                    <?php elseif( $handle['platform'] == 'instagram' ):?>
                                                                        <img src="<?php echo site_url('/wp-content/uploads/2022/10/instagram-brands.svg') ?>">
                                                                    <?php elseif( $handle['platform'] == 'linkedin' ):?>
                                                                        <img src="<?php echo site_url('/wp-content/uploads/2022/10/linkedin-in-brands.svg') ?>">
                                                                    <?php elseif( $handle['platform'] == 'twitter' ):?>
                                                                        <img src="<?php echo site_url('/wp-content/uploads/2022/10/twitter-brands.svg') ?>">
                                                                    <?php endif ?>   
                                                                </a>
                                                            </li> 
                                                        <?php endforeach ?>                   
                                                    </ul>
                                                <?php endif; ?>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    </div>
                                    
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php $post_idx++; ?>
                <?php endwhile; ?>
            </div>
        <?php endif; ?>
        <!-- sponsors list end -->
    </div>
</div>


<?php get_footer(); ?>