<?php
declare(strict_types=1);
require_once __DIR__ . '/config.php';
require_once __DIR__ . '/includes/functions.php';
$clients = clients_all();
$pageTitle = 'Clients — ' . setting('company_name', SITE_NAME);
$current = 'clients';
$breadcrumbTitle = 'Clients';
require __DIR__ . '/includes/head.php';
require __DIR__ . '/includes/preloader.php';
require __DIR__ . '/includes/offcanvas.php';
require __DIR__ . '/includes/header.php';
require __DIR__ . '/includes/breadcrumb.php';
?>
  <main>
    <section class="ot-space">
      <div class="container">
        <style>
          .client-pro-card {
            background: #fff;
            border: 1px solid #e7edf5;
            border-radius: 14px;
            min-height: 150px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 22px;
            box-shadow: 0 8px 22px rgba(4, 34, 62, 0.05);
            transition: all 0.25s ease;
          }

          .client-pro-card:hover {
            transform: translateY(-4px);
            border-color: var(--ot-theme-color);
            box-shadow: 0 14px 30px rgba(4, 34, 62, 0.1);
          }

          .client-pro-logo {
            max-height: 68px;
            width: auto;
            object-fit: contain;
            filter: saturate(0.95);
          }

          .client-pro-link {
            font-weight: 600;
            color: var(--ot-title-color);
          }

          .client-pro-link:hover {
            color: var(--ot-theme-color);
          }
        </style>
        <div class="ot-title-area text-center mb-50">
          <span class="ot-sec-subtitle">Clients & Partners</span>
          <h3 class="ot-sec-title ot-text-anime-3">Trusted By Leading Customers</h3>
          <p class="ot-sec-text mx-auto" style="max-width:760px;">
            We are proud to work with residential and commercial clients who trust Bhatt Enterprises
            for reliable solar solutions and long-term service support.
          </p>
        </div>
        <div class="row gy-4 align-items-center justify-content-center">
          <?php if ($clients): ?>
            <?php foreach ($clients as $c): ?>
              <div class="col-6 col-md-4 col-lg-3 text-center">
                <div class="client-pro-card">
                  <?php if (!empty($c['logo_path'])): ?>
                    <img src="<?= h(img_url($c['logo_path'])) ?>" alt="<?= h((string)$c['name']) ?>" class="client-pro-logo">
                  <?php else: ?>
                    <strong><?= h((string)$c['name']) ?></strong>
                  <?php endif; ?>
                </div>
                <?php if (!empty($c['website_url'])): ?>
                  <a href="<?= h((string)$c['website_url']) ?>" class="client-pro-link small d-inline-block mt-2" target="_blank" rel="noopener">
                    Visit Website <i class="fa-solid fa-arrow-up-right-from-square ms-1"></i>
                  </a>
                <?php endif; ?>
              </div>
            <?php endforeach; ?>
          <?php else: ?>
            <div class="col-12">
              <div class="alert alert-info text-center mb-0">
                Client logos will appear here once you add them from the admin panel.
              </div>
            </div>
          <?php endif; ?>
        </div>
      </div>
    </section>
  </main>
<?php require __DIR__ . '/includes/footer.php'; ?>
