@extends('layouts.app')

@section('title', 'Nos Réalisations')

@section('content')
@include('components.page-banner', [
'title' => 'Nos Réalisations',
'subtitle' => 'Découvrez nos projets et réalisations',
'image' => asset('img/test_5.jpeg')
])

<section class="py-20 bg-white">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
        @if($realisations->isEmpty())
        <div class="text-center py-16">
            <div class="w-24 h-24 rounded-full bg-slate-100 flex items-center justify-center mx-auto mb-6">
                <svg class="w-12 h-12 text-slate-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" /></svg>
            </div>
            <h3 class="text-xl font-semibold text-slate-800 mb-2">Nos réalisations arrivent bientôt</h3>
            <p class="text-slate-600 max-w-md mx-auto">Nous mettons à jour notre portfolio. Revenez prochainement pour découvrir nos projets.</p>
        </div>
        @else
        <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
            @foreach($realisations as $realisation)
            <article class="group rounded-2xl overflow-hidden bg-slate-50 border border-slate-100 hover:shadow-xl transition-all duration-300">
                <div class="aspect-video overflow-hidden">
                    @if($realisation->image)
                    <img src="{{ asset('storage/' . $realisation->image) }}" alt="{{ $realisation->titre }}" class="w-full h-full object-cover group-hover:scale-105 transition duration-500">
                    @else
                    <img src="https://images.unsplash.com/photo-1621905251189-08b45d6a269e?w=600&q=80" alt="{{ $realisation->titre }}" class="w-full h-full object-cover group-hover:scale-105 transition duration-500">
                    @endif
                </div>
                <div class="p-6">
                    @if($realisation->categorie)
                    <span class="text-xs font-medium text-amber-600 uppercase tracking-wider">{{ $realisation->categorie }}</span>
                    @endif
                    <h3 class="font-bold text-slate-800 mt-2 mb-2">{{ $realisation->titre }}</h3>
                    @if($realisation->description)
                    <p class="text-slate-600 text-sm line-clamp-2">{{ Str::limit($realisation->description, 100) }}</p>
                    @endif
                </div>
            </article>
            @endforeach
        </div>
        @endif
    </div>
</section>
@endsection
