{% extends 'base.html.twig' %}
{% block title %}{{ site_setting('site_name', 'ActuFake') }} - {{ site_setting('site_tagline', 'L\'actualité satirique en temps réel') }}{% endblock %}
{% block body %}
<div class="container-fluid px-0">
{% if featured_articles|length > 0 %}
{% set hero = featured_articles[0] %}
<section class="featured-article-hero">
{% if hero.featuredImage %}
{% set image_path = hero.featuredImage.path starts with '/' ? hero.featuredImage.path|slice(1) : hero.featuredImage.path %}
<img src="{{ base_path }}/{{ image_path }}" alt="{{ hero.featuredImage.alt }}">
{% else %}
<div style="width: 100%; height: 500px; background: linear-gradient(135deg, #1a1a1a 0%, #3a3a3a 100%);"></div>
{% endif %}
<div class="featured-overlay">
<div class="container">
<span class="category-badge mb-2 d-inline-block">{{ hero.category.name }}</span>
<h1>
<a href="{{ path('article_show', {slug: hero.slug}) }}" class="text-white text-decoration-none">
{{ hero.title }}
</a>
</h1>
<p class="lead mb-3">{{ hero.excerpt|slice(0, 180) }}...</p>
<div class="text-white-50">
<i class="fas fa-user"></i> {{ hero.author ?? 'Rédaction' }}
<span class="mx-2">|</span>
<i class="fas fa-clock"></i> {{ hero.publishedAt|date('d M Y, H:i') }}
<span class="mx-2">|</span>
<i class="fas fa-eye"></i> {{ hero.viewCount }} vues
</div>
</div>
</div>
</section>
{% endif %}
</div>
<div class="container my-5">
{% if featured_articles|length > 1 %}
<section class="mb-5">
<h2 class="section-title">À la une</h2>
<div class="row g-4">
{% for article in featured_articles|slice(1, 3) %}
<div class="col-md-4">
<article class="card article-card h-100 border-0">
{% if article.featuredImage %}
{% set image_path = article.featuredImage.path starts with '/' ? article.featuredImage.path|slice(1) : article.featuredImage.path %}
<img src="{{ base_path }}/{{ image_path }}" class="card-img-top" alt="{{ article.featuredImage.alt }}">
{% else %}
<div class="card-img-top bg-secondary d-flex align-items-center justify-content-center" style="height: 200px;">
<i class="fas fa-newspaper fa-4x text-white opacity-25"></i>
</div>
{% endif %}
<div class="card-body">
<span class="category-badge mb-2">{{ article.category.name }}</span>
<h5 class="card-title mt-2">
<a href="{{ path('article_show', {slug: article.slug}) }}">
{{ article.title }}
</a>
</h5>
<p class="card-text text-muted">{{ article.excerpt|slice(0, 120) }}...</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted">
<i class="fas fa-clock"></i> {{ article.publishedAt|date('d/m/Y') }}
</small>
<small class="text-muted">
<i class="fas fa-eye"></i> {{ article.viewCount }}
</small>
</div>
</div>
</article>
</div>
{% endfor %}
</div>
</section>
{% endif %}
<div class="row g-4">
<div class="col-lg-8">
<section class="latest-articles">
<h2 class="section-title">Dernières actualités</h2>
{% for article in latest_articles %}
<article class="article-list-item">
<div class="row g-3">
<div class="col-md-4">
{% if article.featuredImage %}
<a href="{{ path('article_show', {slug: article.slug}) }}">
{% set image_path = article.featuredImage.path starts with '/' ? article.featuredImage.path|slice(1) : article.featuredImage.path %}
<img src="{{ base_path }}/{{ image_path }}" class="img-fluid" style="width: 100%; height: 180px; object-fit: cover;" alt="{{ article.featuredImage.alt }}">
</a>
{% else %}
<div class="bg-secondary d-flex align-items-center justify-content-center" style="height: 180px;">
<i class="fas fa-image fa-3x text-white opacity-25"></i>
</div>
{% endif %}
</div>
<div class="col-md-8">
<span class="category-badge mb-2">{{ article.category.name }}</span>
<h3 class="mb-2" style="font-size: 1.5rem;">
<a href="{{ path('article_show', {slug: article.slug}) }}" class="text-decoration-none">
{{ article.title }}
</a>
</h3>
<p class="text-muted mb-2" style="line-height: 1.6;">{{ article.excerpt|slice(0, 200) }}...</p>
<div class="d-flex justify-content-between align-items-center">
<small class="text-muted">
<strong>{{ article.author ?? 'Rédaction ActuFake' }}</strong>
</small>
<small class="text-muted">
{{ article.publishedAt|date('d M Y') }} • {{ article.viewCount }} vues
</small>
</div>
</div>
</div>
</article>
{% else %}
<div class="alert alert-info">
<i class="fas fa-info-circle"></i> Aucun article publié pour le moment.
</div>
{% endfor %}
</section>
</div>
<div class="col-lg-4">
<aside>
<div class="card mb-4 border-0 shadow-sm">
<div class="card-header bg-danger text-white">
<i class="fas fa-fire"></i> Tendances
</div>
<div class="list-group list-group-flush">
{% for article in popular_articles %}
<a href="{{ path('article_show', {slug: article.slug}) }}" class="list-group-item list-group-item-action border-0">
<div class="d-flex align-items-start">
<span class="badge bg-danger me-2" style="font-size: 0.9rem; min-width: 25px;">{{ loop.index }}</span>
<div>
<h6 class="mb-1" style="font-weight: 700; line-height: 1.3;">{{ article.title }}</h6>
<small class="text-muted d-block mt-1">
<i class="fas fa-eye"></i> {{ article.viewCount }} vues
</small>
</div>
</div>
</a>
{% endfor %}
</div>
</div>
<div class="card mb-4 border-0 shadow-sm">
<div class="card-header bg-dark text-white">
<i class="fas fa-th-large"></i> Catégories
</div>
<div class="list-group list-group-flush">
{% for category in categories %}
<a href="{{ path('category_show', {slug: category.slug}) }}" class="list-group-item list-group-item-action border-0 d-flex justify-content-between align-items-center">
<span style="font-weight: 600;">
{% if category.icon %}
<i class="fas {{ category.icon }} me-2"></i>
{% endif %}
{{ category.name }}
</span>
<span class="badge bg-dark rounded-pill">{{ category.articles|length }}</span>
</a>
{% endfor %}
</div>
</div>
<div class="fake-disclaimer shadow-sm">
<h6 style="font-weight: 700; color: #856404;">
<i class="fas fa-exclamation-triangle"></i> Avertissement
</h6>
<p class="small mb-0" style="line-height: 1.6;">
<strong>{{ site_setting('site_name', 'ActuFake') }} est un site satirique.</strong>
Toutes les informations publiées sont fictives et à but humoristique uniquement.
Ne les prenez pas au sérieux !
</p>
</div>
</aside>
</div>
</div>
</div>
{% endblock %}