---
import featPerformance from '../../assets/img/feature-performance.jpg';
import featBalance from '../../assets/img/feature-balance.jpg';
import featLongevity from '../../assets/img/feature-longevity.jpg';
import T from '../content/T.astro';
import TImg from '../content/TImg.astro';
import { t } from '../../lib/content';
const blocks = [
  { key: 'performance', image: featPerformance, reverse: false },
  { key: 'balance', image: featBalance, reverse: true },
  { key: 'longevity', image: featLongevity, reverse: false },
];
---
<section class="section">
  <div class="container">
    {blocks.map((b) => (
      <div class:list={['feat', { 'feat--reverse': b.reverse }]}>
        <TImg tag={`home.feature.${b.key}.image`} src={b.image} alt={t(`home.feature.${b.key}.title`)} class="feat__img" widths={[500, 900]} sizes="(max-width: 767px) 100vw, 45vw" data-reveal={b.reverse ? 'right' : 'left'} />
        <div class="feat__text" data-reveal={b.reverse ? 'left' : 'right'}>
          <T tag={`home.feature.${b.key}.title`} as="h2" />
          <T tag={`home.feature.${b.key}.body`} as="p" />
          <a class="btn" href="/services">{t(`home.feature.${b.key}.cta`)}</a>
        </div>
      </div>
    ))}
  </div>
</section>

<style>
  .feat { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; padding-block: 40px; }
  .feat--reverse .feat__img { order: 2; }
  .feat__text h2 { text-transform: uppercase; letter-spacing: .1em; }
  @media (max-width: 767px) { .feat { grid-template-columns: 1fr; gap: 24px; } .feat--reverse .feat__img { order: 0; } }
</style>
