---
import { getLangFromUrl, t } from '../i18n/utils';
import general from '../content/settings/general.json';
const lang = getLangFromUrl(Astro.url);
---

<section class="hero-section">
  <div class="hero-bg" aria-hidden="true"></div>
  <div class="container-site hero-content min-h-[60vh]">
    <div class="hero-text">
      <p class="hero-eyebrow">{general.tagline}</p>
      <h1 class="hero-title">{t(lang, 'hero.title')}</h1>
      <p class="hero-subtitle">{t(lang, 'hero.subtitle')}</p>
      <div class="hero-actions">
        <a href="/soumission" class="btn-primary hero-cta-primary">
          <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" aria-hidden="true">
            <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>
            <polyline points="14,2 14,8 20,8"/>
            <line x1="16" y1="13" x2="8" y2="13"/>
            <line x1="16" y1="17" x2="8" y2="17"/>
            <polyline points="10,9 9,9 8,9"/>
          </svg>
          {t(lang, 'hero.cta')}
        </a>
        <a href="/services" class="btn-outline-white">
          {t(lang, 'cta.learn_more')}
          <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" aria-hidden="true">
            <line x1="5" y1="12" x2="19" y2="12"/>
            <polyline points="12,5 19,12 12,19"/>
          </svg>
        </a>
      </div>
      <div class="hero-trust">
        <div class="trust-item">
          <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
            <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>
          </svg>
          <span>RBQ 5839 8736 01</span>
        </div>
        <div class="trust-separator" aria-hidden="true">·</div>
        <div class="trust-item">
          <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
            <path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/>
            <circle cx="12" cy="10" r="3"/>
          </svg>
          <span>{general.serviceArea}</span>
        </div>
        <div class="trust-separator" aria-hidden="true">·</div>
        <div class="trust-item">
          <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
            <polyline points="20 6 9 17 4 12"/>
          </svg>
          <span>Soumission gratuite</span>
        </div>
      </div>
    </div>
    <div class="hero-logo-wrap" aria-hidden="true">
      <img
        src="/images/logo.png"
        alt=""
        width="320"
        height="320"
        loading="eager"
        class="hero-logo"
      />
    </div>
  </div>
</section>

<style>
  .hero-section {
    position: relative;
    background-color: var(--color-brand-600);
    color: #ffffff;
    padding: 5rem 0 4rem;
    overflow: hidden;
  }

  .hero-bg {
    position: absolute;
    inset: 0;
    background:
      radial-gradient(ellipse at 70% 50%, rgba(122, 136, 118, 0.25) 0%, transparent 60%),
      linear-gradient(135deg, var(--color-brand-700) 0%, var(--color-brand-600) 100%);
    pointer-events: none;
  }

  .hero-content {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 3rem;
  }

  .hero-eyebrow {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 1rem;
  }

  .hero-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 500;
    color: #ffffff;
    line-height: 1.1;
    margin-bottom: 1.25rem;
  }

  .hero-subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.65;
    max-width: 540px;
    margin-bottom: 2.25rem;
  }

  .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
  }

  .hero-cta-primary {
    background-color: #ffffff;
    color: var(--color-brand-600);
    font-size: 1rem;
    padding: 0.875rem 2rem;
  }

  .hero-cta-primary:hover {
    background-color: var(--color-brand-50);
  }

  .hero-trust {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.875rem;
  }

  .trust-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.65);
  }

  .trust-separator {
    color: rgba(255, 255, 255, 0.3);
  }

  .hero-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hero-logo {
    width: 280px;
    height: 280px;
    object-fit: contain;
    opacity: 0.18;
    filter: brightness(0) invert(1);
  }

  @media (max-width: 768px) {
    .hero-section {
      padding: 3.5rem 0 3rem;
    }

    .hero-content {
      grid-template-columns: 1fr;
    }

    .hero-logo-wrap {
      display: none;
    }

    .hero-title {
      font-size: clamp(1.75rem, 6vw, 2.5rem);
    }
  }
</style>
