@extends('site.app')

@section('body')
<section class="c-articles-list">
    <div class="container">
        <div class="c-articles-list__header">
            <div class="c-articles-list__header__item">
                <h2 class="c-articles-list__title">{{ __('messages.footer-case') }} <span>MV</span></h2>
            </div>
            <div class="c-articles-list__header__item">
                <div class="c-filters">
                    <div class="c-filters__body"  data-action="{{route('site.cases')}}">
                        <div class="c-select">
                            @if ($categorias)
                                <select name="c-search_categoria" id="c-select__categoria" data-tipo="categoria">
                                    <option value="">{{ __('messages.pesquisa-categoria') }}</option>
                                    @foreach ($categorias as $categoria)
                                        <option value="{{$categoria->id}}">{{$categoria->name}}</option>
                                    @endforeach
                                </select>
                            @endif
                        </div>
                        <div class="c-search">
                            <input type="search" name="c-search_pesquisa" placeholder="{{ __('messages.pesquisa-pesquisar') }}"  id="c-search__pesquisa" data-tipo="pesquisa"  >
                        </div>
                    </div>
                    <div class="c-filters__footer">
                        <a class="c-filters__footer__tag" href="#">{{ @$tag }}</a>
                        <a class="c-filters__footer__link" href="{{route('site.cases')}}">{{ __('messages.pesquisa-limpar') }}</a>
                    </div>
                </div>
            </div>
        </div>
        <input type="hidden" name="page" id="page" value="1">
        <input type="hidden" name="totalPages" id="totalPages" value="{{$totalPages}}">
        <div class="c-articles-list__body">
            @if ($objs)
                @foreach($objs as $obj)
                    @php
                    $image = isset($obj->image) ? url('storage/blog/'.$obj->image) : asset('assets/img/content/noticia-thumb-01.jpg');
                    $alt_text = isset($obj->alt_image) ? $obj->alt_image : @$obj->image;
                    @endphp
                    <article class="c-card-news">
                        <a href="{{route('site.caseInterna',$obj->slug)}}">
                            <figure class="c-card-news__cover">
                                <img src="{{ $image }}" alt="{{ $alt_text }}">
                            </figure>
                            <p class="c-card-news__meta">
                                <strong>{{$obj->blogcategory->name}}</strong>
                                <time>{{dataBr($obj->date_published)}}</time>
                            </p>
                            <h3 class="c-card-news__title">{{str_replace("#$#", "𝝨", $obj->title)}}</h3>
                        </a>
                    </article>
                @endforeach
            @endif
        </div>
        <div class="c-articles-list__footer">
            @if ($totalPages != 1)
            <a class="c-button  c-button_loadmore" href="#"
                style="background-color: #00A5CD; color: #fff; border-color: transparent;"
                onMouseOver="this.style.backgroundColor='#FFF'; this.style.color='#00A5CD'; this.style.borderColor='#00A5CD'"
                onMouseOut="this.style.backgroundColor='#00A5CD'; this.style.color='#fff'; this.style.borderColor='#00A5CD'">
                {!! __('messages.botao-carregar-mais') !!}
            </a>
            @endif
        </div>
    </div>
</section>

@endsection
