@if(!$items->isEmpty())
    @foreach($items as $item)
        <div class="article-item article-item--hidden">
            <div class="article-item__header">
                <div class="article-item__main">
                    @if($item->content || $item->layout_type == "blocks")
                        <h2><a href="{{lang_url($item->lang_uri)}}">{{$item->title}}</a></h2>
                    @else
                        <h2>@title($item->title)</h2>
                    @endif
                    <div class="article-item__info">
                        <span class="article-item__date">
                            @if(!empty($item->end_date))
                                {{ event_date($item->date, $item->end_date) }}
                            @else
                                {{ format_date($item->date, true) }}
                            @endif
                        </span>
                        @if(!empty($item->author))
                            <span class="article-item__name">@lang('frontend.by') {{ $item->author }}</span>
                        @endif
                        @if(!empty($item->location))
                            <span class="article-item__name">{{ $item->location }}</span>
                        @endif
                        @if(!empty($item->type))
                            <span>@lang('frontend.article_type_' . $item->type)</span>
                        @endif
                        @if(!empty($eventsDetail->undertitle))
                            <span>{{ $eventsDetail->undertitle }}</span>
                        @endif
                    </div>
                </div>
                <div class="article-item__side">
                    <div class="article-item__share">
                        @include('frontend.templates.components.share_button_small', array(
                            'shareTitle' => strip_tags($item->title),
                            'shareDescription' => strip_tags($item->summary),
                            'shareImage' => ($item->media ? getMediaUrl($item->media->filename, '1200x627') : ''),
                            'shareUrl' => lang_url($item->lang_uri)
                        ))

                        @if(!$item->document->isEmpty() && !$item->isPublication)
                            <a
                                target="_blank"
                                class="download-btn download-btn--simple download-btn--small"
                                href="{{ url('/uploads/media/' . $item->document->first()->filename) }}"
                            ></a>
                        @endif

                        @if(!empty($item->pardot_url))
                            <a
                                href="#"
                                class="download-btn download-btn--simple download-btn--small"
                                data-download_id="{{ $item->id }}"
                                data-download="{{ base64_encode(json_encode(["title" => $item->title, "url" => $item->pardot_url ])) }}"
                                data-controller="components/form-modal"
                                data-popupid="download-modal"
                            >
                            </a>
                        @endif

                        @if(!empty($item->end_date))
                            @include('frontend.templates.components.add_to_calendar', ['event' => $item])
                        @endif
                    </div>
                </div>
            </div>
            <div class="article-item__content">
                <div class="article-item__main rich-content">
                    {!! $item->summary !!}
                    @if($item->content || $item->layout_type == "blocks")
                        <div class="article-item__read-more">
                            <a href="{{lang_url($item->lang_uri)}}">@lang('frontend.read_more')</a>
                        </div>
                    @endif
                </div>
                <div class="article-item__side"></div>
            </div>
        </div>
    @endforeach
@endif
