<?php
// Include configuration
require_once 'includes/config.php';

// Set page title
$page_title = 'Home';

// SEO Meta Tags
$seo_title = 'Home';
$seo_description = 'OHPAG - Oral Health Professionals Association of Ghana. Leading oral health excellence through professional development, advocacy, and community service. Join Ghana\'s premier oral health professional community.';
$seo_keywords = 'oral health Ghana, dental association Ghana, OHPAG, dental therapists, dental hygienists, dental surgery assistants, dental laboratory technicians, physician assistant dental, oral health professionals, dental training Ghana, professional development, oral health advocacy, community outreach Ghana';
$seo_image = BASE_URL . 'assets/images/sliders/slider1.jpeg';
$seo_type = 'website';
$canonical_url = BASE_URL;

// Structured Data for Homepage
$structured_data = '
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "MedicalOrganization",
  "@id": "' . BASE_URL . '#organization",
  "name": "' . htmlspecialchars(SITE_TITLE) . '",
  "alternateName": "' . htmlspecialchars(SITE_NAME) . '",
  "description": "Leading oral health excellence through professional development, advocacy, and community service across Ghana",
  "url": "' . BASE_URL . '",
  "logo": {
    "@type": "ImageObject",
    "url": "' . BASE_URL . 'assets/images/logo.webp",
    "width": 250,
    "height": 100
  },
  "medicalSpecialty": "Dentistry",
  "hasOfferCatalog": {
    "@type": "OfferCatalog",
    "name": "Professional Services",
    "itemListElement": [
      {
        "@type": "Offer",
        "itemOffered": {
          "@type": "Service",
          "name": "Professional Development Training",
          "description": "Comprehensive training programmes for oral health professionals"
        }
      },
      {
        "@type": "Offer",
        "itemOffered": {
          "@type": "Service",
          "name": "Advocacy & Policy Development",
          "description": "Leading oral health policy development and public health advocacy"
        }
      },
      {
        "@type": "Offer",
        "itemOffered": {
          "@type": "Service",
          "name": "Community Outreach Programmes",
          "description": "Oral health education and community engagement initiatives"
        }
      }
    ]
  }
}
</script>
';
?>
<?php include 'includes/header.php'; ?>

<style>
/* Accessible hover effects for team and service cards */
.team-block-one .inner-box,
.service-block-one .inner-box {
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-block-one .inner-box:hover,
.team-block-one .inner-box:focus-within,
.service-block-one:hover,
.service-block-one:focus-within {
    transform: translateY(-10px);
}

.team-block-one .inner-box:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
}

/* Ensure proper focus indicators */
a:focus, button:focus {
    outline: 2px solid #005fcc;
    outline-offset: 2px;
}

/* Video button accessibility */
.video-btn:focus {
    outline: 3px solid #005fcc;
    outline-offset: 3px;
}

/* Improve link accessibility */
.theme-btn-one:focus,
.theme-btn-two:focus {
    outline: 3px solid #fff;
    outline-offset: 2px;
}
</style>

        <!-- banner-section -->
        <section class="banner-section">
            <div class="banner-carousel swiper-container">
                <div class="swiper-wrapper">
                    <div class="swiper-slide">
                        <div class="bg-layer" style="background-image: url(<?php echo BASE_URL; ?>assets/images/sliders/slider1.jpeg);"></div>
                        <div class="large-container">
                            <div class="content-box">
                                <h2>Advancing Oral Health Care <br>Across Ghana</h2>
                                <p>Join the leading professional association dedicated to excellence in oral health.<br>Your Smile, Our Passion - Together for healthier communities.</p>
                                <div class="btn-box">
                                    <a href="<?php echo BASE_URL; ?>about" class="theme-btn-one">discover more</a>
                                </div>
                            </div> 
                        </div>
                    </div>
                    <div class="swiper-slide">
                        <div class="bg-layer" style="background-image: url(<?php echo BASE_URL; ?>assets/images/sliders/slider2.jpeg);"></div>
                        <div class="large-container">
                            <div class="content-box">
                                <h2>Professional Development <br>& Training Excellence</h2>
                                <p>Access world-class training programmes and certification courses.<br>Empowering oral health professionals for better patient care.</p>
                                <div class="btn-box">
                                    <a href="<?php echo BASE_URL; ?>training" class="theme-btn-one">View Training Courses</a>
                                </div>
                            </div>   
                        </div>
                    </div>
                    <div class="swiper-slide">
                        <div class="bg-layer" style="background-image: url(<?php echo BASE_URL; ?>assets/images/sliders/slider3.jpeg);"></div>
                        <div class="large-container">
                            <div class="content-box">
                                <h2>Community Outreach <br>& Public Health Initiatives</h2>
                                <p>Making a difference through education and preventive care.<br>Reaching communities across Ghana with quality oral health services.</p>
                                <div class="btn-box">
                                    <a href="<?php echo BASE_URL; ?>service/community-outreach" class="theme-btn-one">Our Services</a>
                                </div>
                            </div> 
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- banner-section end -->

        <!-- feature-section -->
        <section class="feature-section centred">
            <div class="auto-container">
                <div class="upper-box">
                    <div class="sec-title centred">
                        <span class="sub-title">Welcome to OHPAG</span>
                        <h2>Oral Health Professionals Association of Ghana</h2>
                    </div>
                    <div class="text">
                        <p>We are the leading professional body representing oral health professionals across Ghana, dedicated to advancing the standards of oral health care through professional excellence, education, and advocacy.</p>
                        <p>Our association brings together Dental Surgery Assistants, Dental Surgery Technicians, Dental Laboratory Technicians, Dental Laboratory Technologists, Dental Hygienists, Physician Assistant-Dental, and Dental Therapists committed to improving oral health outcomes for all Ghanaians. Through continuous professional development, research, and community engagement, we strive to set the benchmark for oral health care delivery in Ghana.</p>
                    </div>
                </div>
                <div class="lower-box">
                    <div class="row clearfix">
                        <div class="col-lg-4 col-md-6 col-sm-12 feature-block">
                            <div class="feature-block-one">
                                <div class="inner-box">
                                    <div class="bg-layer" style="background-image: url(<?php echo BASE_URL; ?>assets/images/resource/feature-1.jpg);"></div>
                                    <h2><a href="<?php echo BASE_URL; ?>service/professional-development">Professional Development</a></h2>
                                    <p>Comprehensive training programmes, workshops, and certifications for oral health professionals.</p>
                                    <div class="btn-box">
                                        <a href="<?php echo BASE_URL; ?>service/professional-development"><span>Explore Professional Development</span></a>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-4 col-md-6 col-sm-12 feature-block">
                            <div class="feature-block-one">
                                <div class="inner-box">
                                    <div class="bg-layer" style="background-image: url(<?php echo BASE_URL; ?>assets/images/resource/feature-2.jpg);"></div>
                                    <h2><a href="<?php echo BASE_URL; ?>service/advocacy-policy">Advocacy & Policy</a></h2>
                                    <p>Leading the charge in oral health policy development and public health advocacy.</p>
                                    <div class="btn-box">
                                        <a href="<?php echo BASE_URL; ?>service/advocacy-policy"><span>Our Advocacy</span></a>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-4 col-md-6 col-sm-12 feature-block">
                            <div class="feature-block-one">
                                <div class="inner-box">
                                    <div class="bg-layer" style="background-image: url(<?php echo BASE_URL; ?>assets/images/ohpag/processed-KES IMG_9975.jpeg);"></div>
                                    <h2><a href="<?php echo BASE_URL; ?>service/community-outreach">Community Engagement</a></h2>
                                    <p>Building stronger communities through oral health education and outreach programmes.</p>
                                    <div class="btn-box">
                                        <a href="<?php echo BASE_URL; ?>service/community-outreach"><span>Get Involved</span></a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- feature-section end -->

        <!-- service-section -->
        <section class="service-section sec-pad">
            <div class="auto-container">
                <div class="sec-title small">
                    <span class="sub-title">Our services</span>
                    <h2>What We Offer</h2>
                </div>
                <div class="slider-content">
                    <div class="four-item-carousel owl-carousel owl-theme nav-style-one owl-dots-none">
                        <?php
                        // Fetch services from database for homepage carousel
                        $home_services_query = "SELECT * FROM services WHERE is_active = 1 ORDER BY display_order ASC LIMIT 4";
                        $home_services_result = mysqli_query($conn, $home_services_query);
                        
                        if ($home_services_result && mysqli_num_rows($home_services_result) > 0) {
                            while ($home_service = mysqli_fetch_assoc($home_services_result)) {
                                ?>
                                <div class="service-block-one">
                                    <div class="inner-box">
                                        <figure class="image-box">
                                            <a href="<?php echo BASE_URL; ?>service/<?php echo htmlspecialchars($home_service['slug']); ?>" aria-label="View details about <?php echo htmlspecialchars($home_service['title']); ?>">
                                                <?php if (!empty($home_service['image'])): ?>
                                                <img src="<?php echo BASE_URL . htmlspecialchars($home_service['image']); ?>" 
                                                     alt="<?php echo htmlspecialchars($home_service['title']); ?> service" 
                                                     loading="lazy"
                                                     width="370" 
                                                     height="280">
                                                <?php else: ?>
                                                <img src="<?php echo BASE_URL; ?>assets/images/resource/service-placeholder.jpg" 
                                                     alt="<?php echo htmlspecialchars($home_service['title']); ?> service" 
                                                     loading="lazy"
                                                     width="370" 
                                                     height="280">
                                                <?php endif; ?>
                                            </a>
                                        </figure>
                                        <div class="lower-content">
                                            <h3><a href="<?php echo BASE_URL; ?>service/<?php echo htmlspecialchars($home_service['slug']); ?>" aria-label="Learn more about <?php echo htmlspecialchars($home_service['title']); ?>"><?php echo htmlspecialchars($home_service['title']); ?></a></h3>
                                            <p><?php echo htmlspecialchars(substr($home_service['description'], 0, 80)); ?><?php echo strlen($home_service['description']) > 80 ? '...' : ''; ?></p>
                                        </div>
                                    </div>
                                </div>
                                <?php
                            }
                        } else {
                            // Fallback static services if database is empty
                            ?>
                            <div class="service-block-one">
                                <div class="inner-box">
                                    <figure class="image-box">
                                        <a href="<?php echo BASE_URL; ?>training" aria-label="View Training and Certification programmes">
                                            <img src="<?php echo BASE_URL; ?>assets/images/ohpag/processed-KES IMG_0041.jpeg" 
                                                 alt="Training and Certification programmes" 
                                                 loading="lazy"
                                                 width="370" 
                                                 height="280">
                                        </a>
                                    </figure>
                                    <div class="lower-content">
                                        <h3><a href="<?php echo BASE_URL; ?>training" aria-label="Learn more about Training and Certification">Training & Certification</a></h3>
                                        <p>World-class professional development programmes for oral health practitioners</p>
                                    </div>
                                </div>
                            </div>
                            <div class="service-block-one">
                                <div class="inner-box">
                                    <figure class="image-box">
                                        <a href="<?php echo BASE_URL; ?>service/membership" aria-label="View Membership Benefits">
                                            <img src="<?php echo BASE_URL; ?>assets/images/ohpag/processed-KES IMG_9997.jpeg" 
                                                 alt="Membership Benefits for oral health professionals" 
                                                 loading="lazy"
                                                 width="370" 
                                                 height="280">
                                        </a>
                                    </figure>
                                    <div class="lower-content">
                                        <h3><a href="<?php echo BASE_URL; ?>service/membership" aria-label="Learn more about Membership Benefits">Membership Benefits</a></h3>
                                        <p>Exclusive access to resources, networking, and professional support</p>
                                    </div>
                                </div>
                            </div>
                            <div class="service-block-one">
                                <div class="inner-box">
                                    <figure class="image-box">
                                        <a href="<?php echo BASE_URL; ?>service/research" aria-label="View Research and Publications">
                                            <img src="<?php echo BASE_URL; ?>assets/images/ohpag/processed-KES IMG_0027.jpeg" 
                                                 alt="Research and Publications in oral health" 
                                                 loading="lazy"
                                                 width="370" 
                                                 height="280">
                                        </a>
                                    </figure>
                                    <div class="lower-content">
                                        <h3><a href="<?php echo BASE_URL; ?>service/research" aria-label="Learn more about Research and Publications">Research & Publications</a></h3>
                                        <p>Supporting cutting-edge research in oral health care</p>
                                    </div>
                                </div>
                            </div>
                            <div class="service-block-one">
                                <div class="inner-box">
                                    <figure class="image-box">
                                        <a href="<?php echo BASE_URL; ?>service/community-outreach" aria-label="View Community Outreach programmes">
                                            <img src="<?php echo BASE_URL; ?>assets/images/ohpag/processed-KES IMG_9946.jpeg" 
                                                 alt="Community Outreach and education programmes" 
                                                 loading="lazy"
                                                 width="370" 
                                                 height="280">
                                        </a>
                                    </figure>
                                    <div class="lower-content">
                                        <h3><a href="<?php echo BASE_URL; ?>service/community-outreach" aria-label="Learn more about Community Outreach">Community Outreach</a></h3>
                                        <p>Free dental screenings and oral health education programmes</p>
                                    </div>
                                </div>
                            </div>
                            <?php
                        }
                        ?>
                    </div>
                </div>
            </div>
        </section>
        <!-- service-section end -->

        <!-- about-section -->
        <section class="about-section">
            <div class="outer-container">
                <div class="auto-container">
                    <div class="row clearfix">
                        <div class="col-lg-7 col-md-12 col-sm-12 content-column">
                            <div class="content-box">
                                <div class="sec-title small light">
                                    <span class="sub-title">About OHPAG</span>
                                    <h2>Leading Oral Health Excellence in Ghana</h2>
                                </div>
                                <div class="text">
                                    <p>The Oral Health Professionals Association of Ghana (OHPAG) was formed on 14th March, 2015 and officially registered in July 2018. We are committed to advancing the practice and standards of oral health care across the nation, supporting our members through continuous education, advocacy, and collaborative initiatives.</p>
                                    <ul class="list-style-one clearfix">
                                        <li>Professional Development Programs</li>
                                        <li>Continuing Education & Certification</li>
                                        <li>Policy Advocacy & Public Health Initiatives</li>
                                        <li>Research & Innovation Support</li>
                                        <li>Community Outreach & Education</li>
                                        <li>Networking & Collaboration Opportunities</li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-5 col-md-12 col-sm-12 video-column">
                            <div class="video-inner">
                                <div class="video-content" style="background-image: url(<?php echo BASE_URL; ?>assets/images/background/index-about-sec.jpg);">
                                    <div class="video-btn">
                                        <a href="https://www.youtube.com/watch?v=O45P1eiqt7UU&t=28s" 
                                           class="lightbox-image" 
                                           data-caption=""
                                           aria-label="Play video about OHPAG's mission">
                                            <img src="<?php echo BASE_URL; ?>assets/images/icons/icon-13.png" 
                                                 alt="Play video button" 
                                                 width="80" 
                                                 height="80">
                                        </a>
                                    </div>
                                    <h3>Join us in our mission to ensure<br>healthier smiles across Ghana!</h3>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- about-sectin end -->

        <!-- benefits-section -->
        <section class="benefits-section">
            <div class="auto-container">
                <div class="sec-title small centred">
                    <span class="sub-title">Our Impact</span>
                    <h2>Why Join OHPAG - Benefits for Oral Health Professionals</h2>
                    <p>Become part of Ghana's premier oral health professional community and access exclusive benefits</p>
                </div>
                <div class="inner-container">
                    <div class="row clearfix">
                        <div class="col-lg-4 col-md-6 col-sm-12 single-column">
                            <div class="single-item">
                                <div class="icon-box"><i class="flaticon-comb"></i></div>
                                <h4>Continuous Professional<br>Development</h4>
                            </div>
                        </div>
                        <div class="col-lg-4 col-md-6 col-sm-12 single-column">
                            <div class="single-item">
                                <div class="icon-box"><i class="flaticon-elderly-4"></i></div>
                                <h4>Access to Latest Research and<br>Best Practices</h4>
                            </div>
                        </div>
                        <div class="col-lg-4 col-md-6 col-sm-12 single-column">
                            <div class="single-item">
                                <div class="icon-box"><i class="flaticon-medicine"></i></div>
                                <h4>Professional Networking<br>Opportunities</h4>
                            </div>
                        </div>
                        <div class="col-lg-4 col-md-6 col-sm-12 single-column">
                            <div class="single-item">
                                <div class="icon-box"><i class="flaticon-helping"></i></div>
                                <h4>Advocacy and Policy<br>Representation</h4>
                            </div>
                        </div>
                        <div class="col-lg-4 col-md-6 col-sm-12 single-column">
                            <div class="single-item">
                                <div class="icon-box"><i class="flaticon-groceries"></i></div>
                                <h4>Resources and Publications<br>Access</h4>
                            </div>
                        </div>
                        <div class="col-lg-4 col-md-6 col-sm-12 single-column">
                            <div class="single-item">
                                <div class="icon-box"><i class="flaticon-handshake"></i></div>
                                <h4>Community Service<br>Opportunities</h4>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- benefits-section end -->

        <!-- video-section -->
        <section class="video-section">
            <div class="bg-layer" style="background-image: url(<?php echo BASE_URL; ?>assets/images/background/smile.jpg);"></div>
            <div class="auto-container">
                <div class="inner-box">
                    <h2>Your Smile, Our Passion</h2>
                    <p>Join OHPAG today and be part of the movement to improve<br>oral health care across Ghana.</p>
                    <div class="btn-box">
                        <a href="<?php echo BASE_URL; ?>contact" class="theme-btn-two">Get In Touch</a>
                        <a href="https://www.youtube.com/watch?v=O45P1eiqt7U&t=28s" 
                           class="lightbox-image video-btn" 
                           data-caption=""
                           aria-label="Watch OHPAG video">
                            <img src="<?php echo BASE_URL; ?>assets/images/icons/icon-14.png" 
                                 alt="Play video button" 
                                 width="70" 
                                 height="70">
                        </a>
                    </div>
                </div>
            </div>
        </section>
        <!-- video-section end -->

       

        <!-- team-section -->
        <section class="team-section" style="padding: 100px 0 60px;">
            <div class="bg-layer"></div>
            <div class="auto-container">
                <div class="upper-box">
                    <div class="sec-title small">
                        <span class="sub-title">Our Leadership</span>
                        <h2>Meet Our Executive Team</h2>
                    </div>
                    <div class="text">
                        <p>Dedicated professionals leading OHPAG's mission<br>to advance oral health care in Ghana.</p>
                    </div>
                </div>
                <div class="inner-container" style="padding: 20px 0;">
                    <div class="row clearfix" style="row-gap: 30px;">
                        <?php
                        // Generate slug function
                        if (!function_exists('generateSlug')) {
                            function generateSlug($name) {
                                $slug = strtolower(trim($name));
                                $slug = preg_replace('/[^a-z0-9-]/', '-', $slug);
                                $slug = preg_replace('/-+/', '-', $slug);
                                return trim($slug, '-');
                            }
                        }
                        
                        // Fetch first 4 executives from database
                        $home_executives_query = "SELECT * FROM executives WHERE is_active = 1 ORDER BY display_order ASC LIMIT 4";
                        $home_executives_result = mysqli_query($conn, $home_executives_query);
                        
                        if ($home_executives_result && mysqli_num_rows($home_executives_result) > 0) {
                            while ($executive = mysqli_fetch_assoc($home_executives_result)) {
                                $slug = generateSlug($executive['name']);
                                $photo = !empty($executive['photo']) ? 'assets/images/team/'. htmlspecialchars($executive['photo']) : 'assets/images/team/team-default.jpg';
                                $name = htmlspecialchars($executive['name']);
                                $position = htmlspecialchars($executive['position']);
                                ?>
                                <div class="col-lg-3 col-md-6 col-sm-12 team-block" style="margin-bottom: 50px; padding: 0 15px;">
                                    <article class="team-block-one">
                                        <div class="inner-box team-card" style="height: 100%; box-shadow: 0 5px 20px rgba(0,0,0,0.1); border-radius: 8px; overflow: hidden;">
                                            <figure class="image-box" style="margin-bottom: 0; height: 320px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #f5f5f5;">
                                                <img src="<?php echo BASE_URL . $photo; ?>" 
                                                     alt="Portrait of <?php echo $name; ?>, <?php echo $position; ?>" 
                                                     style="width: 100%; height: 100%; object-fit: cover;"
                                                     loading="lazy"
                                                     width="320"
                                                     height="320">
                                            </figure>
                                            <div class="lower-content" style="padding: 25px 15px; min-height: 100px; display: flex; flex-direction: column; justify-content: center;">
                                                <h3 style="margin-bottom: 8px; font-size: 20px; line-height: 1.3;">
                                                    <a href="<?php echo BASE_URL; ?>executive/<?php echo $slug; ?>" 
                                                       aria-label="View profile of <?php echo $name; ?>, <?php echo $position; ?>">
                                                        <?php echo $name; ?>
                                                    </a>
                                                </h3>
                                                <span class="designation" style="font-size: 15px; line-height: 1.4; display: block;" role="text"><?php echo $position; ?></span>
                                            </div>
                                        </div>
                                    </article>
                                </div>
                                <?php
                            }
                        } else {
                            // Fallback static executives if database is empty
                            ?>
                            <div class="col-lg-3 col-md-6 col-sm-12 team-block" style="margin-bottom: 50px; padding: 0 15px;">
                                <article class="team-block-one">
                                    <div class="inner-box team-card" style="height: 100%; box-shadow: 0 5px 20px rgba(0,0,0,0.1); border-radius: 8px; overflow: hidden;">
                                        <figure class="image-box" style="margin-bottom: 0; height: 320px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #f5f5f5;">
                                            <img src="<?php echo BASE_URL; ?>assets/images/ohpag/processed-KES IMG_9957.jpeg" 
                                                 alt="Portrait of Dr. Emmanuel Asare, President OHPAG" 
                                                 style="width: 100%; height: 100%; object-fit: cover;"
                                                 loading="lazy"
                                                 width="320"
                                                 height="320">
                                        </figure>
                                        <div class="lower-content" style="padding: 25px 15px; min-height: 100px; display: flex; flex-direction: column; justify-content: center;">
                                            <h3 style="margin-bottom: 8px; font-size: 20px; line-height: 1.3;">
                                                <a href="<?php echo BASE_URL; ?>executives" aria-label="View executives team">Dr. Emmanuel Asare</a>
                                            </h3>
                                            <span class="designation" style="font-size: 15px; line-height: 1.4; display: block;" role="text">President, OHPAG</span>
                                        </div>
                                    </div>
                                </article>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-12 team-block" style="margin-bottom: 50px; padding: 0 15px;">
                                <article class="team-block-one">
                                    <div class="inner-box team-card" style="height: 100%; box-shadow: 0 5px 20px rgba(0,0,0,0.1); border-radius: 8px; overflow: hidden;">
                                        <figure class="image-box" style="margin-bottom: 0; height: 320px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #f5f5f5;">
                                            <img src="<?php echo BASE_URL; ?>assets/images/ohpag/processed-KES IMG_9961.jpeg" 
                                                 alt="Portrait of Dr. Grace Adjei, Vice President" 
                                                 style="width: 100%; height: 100%; object-fit: cover;"
                                                 loading="lazy"
                                                 width="320"
                                                 height="320">
                                        </figure>
                                        <div class="lower-content" style="padding: 25px 15px; min-height: 100px; display: flex; flex-direction: column; justify-content: center;">
                                            <h3 style="margin-bottom: 8px; font-size: 20px; line-height: 1.3;">
                                                <a href="<?php echo BASE_URL; ?>executives" aria-label="View executives team">Dr. Grace Adjei</a>
                                            </h3>
                                            <span class="designation" style="font-size: 15px; line-height: 1.4; display: block;" role="text">Vice President</span>
                                        </div>
                                    </div>
                                </article>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-12 team-block" style="margin-bottom: 50px; padding: 0 15px;">
                                <article class="team-block-one">
                                    <div class="inner-box team-card" style="height: 100%; box-shadow: 0 5px 20px rgba(0,0,0,0.1); border-radius: 8px; overflow: hidden;">
                                        <figure class="image-box" style="margin-bottom: 0; height: 320px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #f5f5f5;">
                                            <img src="<?php echo BASE_URL; ?>assets/images/ohpag/processed-KES IMG_9964.jpeg" 
                                                 alt="Portrait of Dr. Samuel Appiah, Secretary General" 
                                                 style="width: 100%; height: 100%; object-fit: cover;"
                                                 loading="lazy"
                                                 width="320"
                                                 height="320">
                                        </figure>
                                        <div class="lower-content" style="padding: 25px 15px; min-height: 100px; display: flex; flex-direction: column; justify-content: center;">
                                            <h3 style="margin-bottom: 8px; font-size: 20px; line-height: 1.3;">
                                                <a href="<?php echo BASE_URL; ?>executives" aria-label="View executives team">Dr. Samuel Appiah</a>
                                            </h3>
                                            <span class="designation" style="font-size: 15px; line-height: 1.4; display: block;" role="text">Secretary General</span>
                                        </div>
                                    </div>
                                </article>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-12 team-block" style="margin-bottom: 50px; padding: 0 15px;">
                                <article class="team-block-one">
                                    <div class="inner-box team-card" style="height: 100%; box-shadow: 0 5px 20px rgba(0,0,0,0.1); border-radius: 8px; overflow: hidden;">
                                        <figure class="image-box" style="margin-bottom: 0; height: 320px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #f5f5f5;">
                                            <img src="<?php echo BASE_URL; ?>assets/images/ohpag/processed-KES IMG_9965.jpeg" 
                                                 alt="Portrait of Dr. Akosua Boateng, Treasurer" 
                                                 style="width: 100%; height: 100%; object-fit: cover;"
                                                 loading="lazy"
                                                 width="320"
                                                 height="320">
                                        </figure>
                                        <div class="lower-content" style="padding: 25px 15px; min-height: 100px; display: flex; flex-direction: column; justify-content: center;">
                                            <h3 style="margin-bottom: 8px; font-size: 20px; line-height: 1.3;">
                                                <a href="<?php echo BASE_URL; ?>executives" aria-label="View executives team">Dr. Akosua Boateng</a>
                                            </h3>
                                            <span class="designation" style="font-size: 15px; line-height: 1.4; display: block;" role="text">Treasurer</span>
                                        </div>
                                    </div>
                                </article>
                            </div>
                            <?php
                        }
                        ?>
                    </div>
                </div>
                <div class="btn-box centred" style="margin-top: 30px;">
                    <a href="<?php echo BASE_URL; ?>executives" class="theme-btn-one">View All Executives</a>
                </div>
            </div>
        </section>
        <!-- team-section end -->

        <!-- find-location -->
        <section class="find-location">
            <div class="auto-container">
                <div class="row align-items-center">
                    <div class="col-lg-5 col-md-12 col-sm-12 image-column">
                        <div class="image-box">
                            <div class="image-shape"></div>
                            <figure class="image">
                                <img src="<?php echo BASE_URL; ?>assets/images/background/become.jpg" 
                                     alt="Become a member of OHPAG - Join Ghana's premier oral health association" 
                                     loading="lazy"
                                     width="550"
                                     height="650">
                            </figure>
                        </div>
                    </div>
                    <div class="col-lg-7 col-md-12 col-sm-12 content-column">
                        <div class="content-box">
                            <div class="sec-title small light">
                                <span class="sub-title">Join Us</span>
                                <h2>Become a Member of OHPAG Today</h2>
                            </div>
                            <div class="text">
                                <p>Are you an oral health professional looking to advance your career and contribute to improving oral health in Ghana? Join OHPAG and be part of a vibrant community dedicated to excellence.</p>
                                <p><a href="<?php echo BASE_URL; ?>service/membership">Learn about membership benefits</a>, <a href="<?php echo BASE_URL; ?>good-standing">Good Standing</a>, or <a href="<?php echo BASE_URL; ?>contact">contact us</a> for more information.</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- find-location end -->

        <!-- news-section -->
        <section class="news-section">
            <div class="auto-container">
                <div class="upper-box">
                    <div class="sec-title small">
                        <span class="sub-title">Latest Updates</span>
                        <h2>News &amp; Blog</h2>
                    </div>
                    <div class="link">
                        <a href="<?php echo BASE_URL; ?>blog">View all posts</a>
                    </div>
                </div>
                <div class="row clearfix">
                    <?php
                    // Fetch latest 3 blog posts from database
                    $latest_posts_query = "SELECT * FROM posts WHERE post_type = 'blog' AND status = 'published' ORDER BY published_at DESC, created_at DESC LIMIT 3";
                    $latest_posts_result = mysqli_query($conn, $latest_posts_query);
                    
                    if ($latest_posts_result && mysqli_num_rows($latest_posts_result) > 0) {
                        $delay = 0;
                        while ($latest_post = mysqli_fetch_assoc($latest_posts_result)) {
                            $post_date = !empty($latest_post['published_at']) ? strtotime($latest_post['published_at']) : strtotime($latest_post['created_at']);
                            ?>
                            <div class="col-lg-4 col-md-6 col-sm-12 news-block">
                                <div class="news-block-one wow fadeInUp animated" data-wow-delay="<?php echo $delay; ?>ms" data-wow-duration="1500ms">
                                    <div class="inner-box">
                                        <?php if (!empty($latest_post['featured_image'])): ?>
                                        <figure class="image-box">
                                            <a href="<?php echo BASE_URL; ?>post/<?php echo htmlspecialchars($latest_post['slug']); ?>" 
                                               aria-label="Read post: <?php echo htmlspecialchars($latest_post['title']); ?>">
                                                <img src="<?php echo BASE_URL . htmlspecialchars($latest_post['featured_image']); ?>" 
                                                     alt="<?php echo htmlspecialchars($latest_post['title']); ?>" 
                                                     loading="lazy"
                                                     width="370"
                                                     height="280">
                                            </a>
                                        </figure>
                                        <?php endif; ?>
                                        <div class="lower-content">
                                            <span class="post-date"><?php echo date('M d, Y', $post_date); ?></span>
                                            <h3><a href="<?php echo BASE_URL; ?>post/<?php echo htmlspecialchars($latest_post['slug']); ?>" aria-label="Read full article: <?php echo htmlspecialchars($latest_post['title']); ?>"><?php echo htmlspecialchars($latest_post['title']); ?></a></h3>
                                            <p><?php echo htmlspecialchars(substr($latest_post['excerpt'], 0, 100)); ?><?php echo strlen($latest_post['excerpt']) > 100 ? '...' : ''; ?></p>
                                            <div class="link">
                                                <a href="<?php echo BASE_URL; ?>post/<?php echo htmlspecialchars($latest_post['slug']); ?>" aria-label="Continue reading <?php echo htmlspecialchars($latest_post['title']); ?>">Continue Reading ...</a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <?php
                            $delay += 300;
                        }
                    } else {
                        // Fallback static posts if database is empty
                        ?>
                        <div class="col-lg-4 col-md-6 col-sm-12 news-block">
                            <div class="news-block-one wow fadeInUp animated" data-wow-delay="00ms" data-wow-duration="1500ms">
                                <div class="inner-box">
                                    <figure class="image-box">
                                        <a href="<?php echo BASE_URL; ?>blog" aria-label="Read about Annual OHPAG Conference 2025">
                                            <img src="<?php echo BASE_URL; ?>assets/images/news/news-1.jpg" 
                                                 alt="Annual OHPAG Conference 2025 announcement" 
                                                 loading="lazy"
                                                 width="370"
                                                 height="280">
                                        </a>
                                    </figure>
                                    <div class="lower-content">
                                        <span class="post-date"><?php echo date('M d, Y'); ?></span>
                                        <h3><a href="<?php echo BASE_URL; ?>blog" aria-label="Read about Annual OHPAG Conference 2025">Annual OHPAG Conference 2025 Announced</a></h3>
                                        <p>Join us for our biggest professional gathering of the year featuring international speakers and workshops.</p>
                                        <div class="link">
                                            <a href="<?php echo BASE_URL; ?>blog" aria-label="Continue reading about Annual OHPAG Conference 2025">Continue Reading ...</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-4 col-md-6 col-sm-12 news-block">
                            <div class="news-block-one wow fadeInUp animated" data-wow-delay="300ms" data-wow-duration="1500ms">
                                <div class="inner-box">
                                    <figure class="image-box">
                                        <a href="<?php echo BASE_URL; ?>blog" aria-label="Read about New Certification Programme">
                                            <img src="<?php echo BASE_URL; ?>assets/images/news/news-2.jpg" 
                                                 alt="New Certification Programme Launched" 
                                                 loading="lazy"
                                                 width="370"
                                                 height="280">
                                        </a>
                                    </figure>
                                    <div class="lower-content">
                                        <span class="post-date"><?php echo date('M d, Y', strtotime('-3 days')); ?></span>
                                        <h3><a href="<?php echo BASE_URL; ?>blog" aria-label="Read about New Certification Programme Launched">New Certification Program Launched</a></h3>
                                        <p>OHPAG introduces advanced certification in paediatric dentistry for members.</p>
                                        <div class="link">
                                            <a href="<?php echo BASE_URL; ?>blog" aria-label="Continue reading about New Certification Programme">Continue Reading ...</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-4 col-md-6 col-sm-12 news-block">
                            <div class="news-block-one wow fadeInUp animated" data-wow-delay="600ms" data-wow-duration="1500ms">
                                <div class="inner-box">
                                    <figure class="image-box">
                                        <a href="<?php echo BASE_URL; ?>blog" aria-label="Read about Community Outreach Success">
                                            <img src="<?php echo BASE_URL; ?>assets/images/news/news-3.jpg" 
                                                 alt="Community Outreach Success: 5000+ Screened" 
                                                 loading="lazy"
                                                 width="370"
                                                 height="280">
                                        </a>
                                    </figure>
                                    <div class="lower-content">
                                        <span class="post-date"><?php echo date('M d, Y', strtotime('-7 days')); ?></span>
                                        <h3><a href="<?php echo BASE_URL; ?>blog" aria-label="Read about Community Outreach Success">Community Outreach Success: 5000+ Screened</a></h3>
                                        <p>OHPAG's latest community screening programme reaches milestone in rural areas.</p>
                                        <div class="link">
                                            <a href="<?php echo BASE_URL; ?>blog" aria-label="Continue reading about Community Outreach Success">Continue Reading ...</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <?php
                    }
                    ?>
                </div>
            </div>
        </section>
        <!-- news-section end -->

        <!-- google-map-section -->
        <!-- <section class="google-map-section">
            <div class="map-inner">
                <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3970.1234567890123!2d-1.7234567890123!3d8.0567890123456!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x0!2zOMKwMDMnMjQuNCJOIDHCsDQzJzI0LjQiVw!5e0!3m2!1sen!2sgh!4v1234567890123!5m2!1sen!2sgh" width="600" height="535" frameborder="0" style="border:0; width: 100%" allowfullscreen="" aria-hidden="false" tabindex="0"></iframe>
            </div>
            <div class="content-inner">
                <div class="auto-container">
                    <div class="text">
                        <ul class="info clearfix">
                            <li><?php echo SITE_ADDRESS; ?></li>
                            <li><a href="tel:<?php echo str_replace(['(', ')', ' ', '+'], '', SITE_PHONE_1); ?>"><?php echo SITE_PHONE_1; ?></a></li>
                            <li>Mon-Fri: 8:00am - 5:00pm</li>
                            <li>Saturday: 9:00am - 2:00pm</li>
                        </ul>
                    </div>
                </div>
            </div>
        </section> -->
        <!-- google-map-section end -->

<?php include 'includes/footer.php'; ?>

