---
import { programs } from '../../data/programs';
import { programIcons as icons } from '../../data/program-icons';
---
<section class="section">
  <div class="container">
    <div class="section-heading" data-reveal>
      <h2>Programmi</h2>
      <p>Questi sono i programmi delle classi di Insanity Lab selezionati per voi. Abbiamo scelto i migliori percorsi per offrirvi un’esperienza di allenamento completa e mirata.</p>
    </div>
    <div class="pgrid">
      {programs.map((p, i) => (
        <a class="pgrid__item" href={`/programs/${p.slug}`} data-reveal style={`--reveal-delay:${(i % 3) * 0.15}s`}>
          <svg viewBox="0 0 24 24" fill="none" stroke="var(--c-accent-dark)" stroke-width="1.4" width="52" height="52" aria-hidden="true"><path d={icons[p.slug]} /></svg>
          <h3>{p.title}</h3>
          <p>{p.subtitle}</p>
        </a>
      ))}
    </div>
  </div>
</section>

<style>
  .pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 50px 40px; text-align: center; }
  .pgrid__item { text-decoration: none; transition: transform .3s ease; }
  .pgrid__item:hover { transform: translateY(-4px); }
  .pgrid__item:hover h3 { color: var(--c-accent-dark); }
  .pgrid__item h3 { transition: color .3s ease; }
  .pgrid__item svg { margin-inline: auto; }
  .pgrid__item h3 { text-transform: uppercase; letter-spacing: .12em; font-size: .95rem; margin: 18px 0 6px; }
  .pgrid__item p { font-size: .85rem; color: var(--c-text-light); margin: 0; }
  @media (max-width: 767px) { .pgrid { grid-template-columns: 1fr 1fr; } }
  @media (max-width: 480px) { .pgrid { grid-template-columns: 1fr; } }
</style>
