<div class="page-banner">
    <div class="container">
        <h2>Workshops & Training</h2>
        <p>Enhance your skills with our expert-led workshops</p>
        <div class="breadcrumb">
            <a href="/">Home</a>
            <span class="separator"><i class="fas fa-chevron-right"></i></span>
            <span>Workshops</span>
        </div>
    </div>
</div>

<section class="sections-area">
    <div class="container">
        <div class="sections-grid">
            <?php if (!empty($workshops)): ?>
                <?php foreach ($workshops as $ws): ?>
                <div class="workshop-card fade-in-up">
                    <div class="workshop-card-body">
                        <h3><?= htmlspecialchars($ws['title']) ?></h3>
                        <p><?= htmlspecialchars($ws['short_description'] ?? '') ?></p>
                        <div class="workshop-meta">
                            <?php if (!empty($ws['duration'])): ?>
                            <span><i class="fas fa-clock"></i> <?= htmlspecialchars($ws['duration']) ?></span>
                            <?php endif; ?>
                            <?php if (!empty($ws['price'])): ?>
                            <span><i class="fas fa-tag"></i> <?= htmlspecialchars($ws['price']) ?></span>
                            <?php endif; ?>
                            <?php if (!empty($ws['location'])): ?>
                            <span><i class="fas fa-map-marker-alt"></i> <?= htmlspecialchars($ws['location']) ?></span>
                            <?php endif; ?>
                        </div>
                        <div class="d-flex gap-1" style="margin-top: auto; flex-wrap: wrap;">
                            <a href="/workshop/<?= htmlspecialchars($ws['slug'] ?? $ws['id']) ?>" class="btn btn-primary btn-sm">Register Now</a>
                            <a href="/workshop/<?= htmlspecialchars($ws['slug'] ?? $ws['id']) ?>" class="btn btn-secondary btn-sm">Learn More</a>
                        </div>
                    </div>
                </div>
                <?php endforeach; ?>
            <?php else: ?>
                <div class="text-center" style="grid-column: 1 / -1;">
                    <p class="text-muted">No workshops available at this time.</p>
                </div>
            <?php endif; ?>
        </div>
    </div>
</section>
