@php
    $redirectPath = lang_url(config('path.frontend.blog_listing_slug'));
@endphp

<div class="blog-post-hero block-margin-top--{{ $block->margin_type_top }} block-margin-bottom--{{$block->margin_type_bottom}}">
    <div class="blog-post-hero__wrapper">
        <div class="blog-post-hero__container">
            <div class="blog-post-hero__intro">
                <div class="blog-post-hero__image-container">
                    {!! getMediaImg($post->media, '1440x1325', htmlspecialchars($post->title)) !!}
                    @if ($post->image_caption)
                        <div class="blog-post-hero__image-caption">
                            <div class="blog-post-hero__image-caption-bg"></div>
                            <span>{{ $post->image_caption }}</span>
                        </div>
                    @endif
                </div>
                <div class="blog-post-hero__title-container bg--{{ $block->bg_color }}">
                    <span class="blog-post-hero__date">
                        {{ format_date($post->date) }}
                        @if ($post->reading_info)
                            <span class="blog-post-hero__reading-info">{{ $post->reading_info }}</span>
                        @endif
                    </span>
                    <h1 class="blog-post-hero__title">@title($post->title)</h1>
                    <div class="blog-post-hero__categories">
                        @foreach($post->categories as $category)
                            <a href="{{ $redirectPath . '?c=' . $category->id }}" class="blog-post-hero__category">
                                {{ $category->title }}
                            </a>
                        @endforeach
                    </div>
                    <div class="blog-post-hero__line"></div>
                </div>
            </div>
            <div class="blog-post-hero__info">

                <div class="blog-post-hero__author-container">
                    @foreach($post->authors as $author)
                        <a href="{{ lang_url($author->uri) }}" class="blog-post-hero__author">
                            <div class="blog-post-hero__photo">
                                {!! getMediaImg($author->media, '200x200', htmlspecialchars($author->title)) !!}
                            </div>
                            <div class="blog-post-hero__author-info">
                                <span class="blog-post-hero__name">
                                    {{ $author->title }}
                                </span>
                                @if ($author->position_company)
                                    <span class="blog-post-hero__position">
                                        {{ $author->position_company }}
                                    </span>
                                @endif
                            </div>
                        </a>
                    @endforeach
                </div>
                <div class="blog-post-hero__share-container">
                    <span class="blog-post-hero__share">@lang('frontend.share_this')</span>
                    <div class="blog-post-hero__share-icons">
                        <a href="https://www.facebook.com/sharer/sharer.php?u={{ url()->current() }}" class="blog-post-hero__share-icon" target="_blank">
                            @include('frontend.svg.facebook')
                        </a>
                        <a href="https://www.linkedin.com/shareArticle?mini=true&url={{ url()->current() }}" class="blog-post-hero__share-icon" target="_blank">
                            @include('frontend.svg.linkedin')
                        </a>
                        <a href="https://twitter.com/share?url={{ url()->current() }}" class="blog-post-hero__share-icon" target="_blank">
                            @include('frontend.svg.x_twitter')
                        </a>
                        <a href="mailto:?subject=Look at this!&body=Hi, I found this page and thought you might like it {{ url()->current() }}" class="blog-post-hero__share-icon" target="_blank">
                            @include('frontend.templates.icons.email')
                        </a>
                    </div>
                </div>
                <div class="blog-post-hero__line-horizontal"></div>
            </div>
        </div>
    </div>
</div>
