{% extends 'base.twig' %}

{% block content %}
	{% include "componentes/hero.twig" with {
		   texto: post.cabecalho_texto,
		   links:[
			{
                title: 'Início',
                url: '/'
            },
			{
                title: post.title,
            },
		   ]
	} %}

	<section class="_pb-104">
		<div class="Container _pt-32">
			<div class="Search _pb-40">
				<form action="" method="get">
					<input type="hidden" name="post_type" value="novidade">
					<div class="_flex _items-center">
						<i class="icon-search"></i>
						<input {% if searched %} value="{{searched}}" {% endif %} type="text" name="s" placeholder="Pesquisa por palavra-chave" aria-label="Pesquisa por palavra-chave">
					</div>
				</form>
			</div>

			{% if posts|length %}
				<div>
					<div class="Row _gutters-x _gutters-y-lg">
						{% for post in posts %}
							<div class="col-4">
								{% set item = {
                                    title: post.title,
                                    image: post.imagem,
                                    link:  post.link,
									date:post.date
                                    }
                                 %}
								{% include "componentes/card-noticia.twig"  %}
							</div>
						{% endfor %}
					</div>
					{% if posts.pagination.total > 1 %}
						<div class="_w-full _pt-40 _text-center _flex _content-center ">{% include "componentes/pagination.twig" with { pagination: posts.pagination } %}</div>
					{% endif %}
				</div>
			{% else %}
				<div class="No-result _flex _items-center _flex-column">
					<img src="{{asset('images/no-result.svg')}}" alt="Sem resultados">
					<h3 class="Title _xs _text-center">Nenhum registro encontrado</h3>
					<p class="Body _text-center">Não encontramos resultados para sua busca, tente outro termo.</p>
				</div>
			{% endif %}
		</section>
	{% endblock %}
