@extends('site.app')


@php $image = isset($obj->image) ? url('storage/'.$pagina.'/'.$obj->image) : asset('assets/img/content/mv_share.jpg'); @endphp

@section('meta_title', (@$obj->meta_title) ? $obj->meta_title : 'Apoio - ' . $obj->title)
@section('meta_description', @$obj->meta_description)
@section('meta_img', $image)

@section('body')
<article class="c-post  c-bannerPosts-left">
    <header class="c-post__header">
        <div class="container">
            
            @include('site.partials.blocos.breandcrumb_light')

            <div class="c-post__wrap">
                <h1 class="c-post__title">{{str_replace("#$#", "𝝨", $obj->title)}}</h1>
            </div>
            <div class="c-post__header__bar">
                <div class="c-post__wrap">
                    <p class="c-post__meta">
                        <strong>{{$obj->blogcategory->name}}</strong>
                        <time>{{dataBr($obj->date_published)}}</time>
                    </p>
                    <div class="c-post__social">
                        <ul>
                            <li><button class="like-button like-button--article" data-post-id="{{ $obj->id }}"><i class="icon icon-dislike"></i><span>{{ $obj->likes }}</span></button></li>
                            <li><a target="_blank" href="https://api.whatsapp.com/send?text={{ $obj->title }} https://mv.com.br/blog/{{ $obj->slug }}" aria-label="Instagram"><i class="icon icon-whatsapp"></i></a></li>
                            <li><a href="http://www.facebook.com/sharer/sharer.php?u=https://mv.com.br/blog/{{ $obj->slug }}" target="_blank" aria-label="Facebook"><i class="icon icon-facebook"></i></a></li>
                            <li><a target="_blank"  href="http://twitter.com/share?text=<?php echo $obj->nome;?>&url=https://mv.com.br/blog/{{ $obj->slug }}&via=MVsaOficial" aria-label="Twitter"><i class="icon icon-twitter"></i></a></li>
                            <li><a href="#" aria-label="Linkedin"><i class="icon icon-linkedin"></i></a></li>
                        </ul>
                    </div>

                </div>
            </div>
        </div>
    </header>
    <div class="c-post__body container">
        <div class="text-left">
            <h1>{!! $obj->subtitle !!}</h1>

            @php $image = isset($obj->image) ? url('storage/'.$pagina.'/'.$obj->image) : '';
                $alt_text = isset($obj->alt_image) ? $obj->alt_image : @$obj->image;
            @endphp
            @if (@$obj->image)
                <img src="{{$image}}" alt="{{ $alt_text }}">
            @endif

            <p>{!! str_replace("#$#", "𝝨", $obj->content) !!}</p>
            
            @if (@$obj->arquivo)
                <a class="c-button" href="{{ isset($obj->arquivo) ?   url('storage/blog/'.$obj->arquivo) : '' }}" target="_blank" download="">{{$obj->btnfile}}</a>
            @endif
        </div>
        @php 
            $mkt_image = ($obj->mkt_image != "") ? url('storage/blog/'.$obj->mkt_image) : '';
            $mkt_mobile = ($obj->mkt_mobile != "") ? url('storage/blog/'.$obj->mkt_mobile) : '';
            $mkt_link = (@$obj->mkt_link != '') ? $obj->mkt_link : '#';
            $mkt_target = ($obj->mkt_target == 1) ? "target=_blank": '';   
        @endphp
        @if ($mkt_image != '')
        <a href="{{ $mkt_link }}" class="banner-content" {{  $mkt_target  }}>
            <img src="{{ $mkt_image }}" alt="{{ $obj->mkt_image }}">
        </a>
        @endif
        @if ($mkt_mobile != '')
        <a href="{{ $mkt_link }}" class="banner-content baneerMobile" {{  $mkt_target  }}>
            <img src="{{ $mkt_mobile }}" alt="{{ $obj->mkt_mobile }}">
        </a>
        @endif

        @if (@$obj->form_rd)
            <p>{!! $obj->form_rd !!}</p>
        @endif
        
    </div>
    <footer class="c-post__footer container">
        <div class="c-post__wrap">
            <div class="c-post__author">
                {{-- @if ($author)
                @php $image = isset($author['image']) ? url('storage/author/'.$author['image']) : asset('assets/img/content/post-author-01.jpg'); @endphp
                    <figure class="c-post__author__cover">
                        <img src="{{$image}}" alt="Autor">
                    </figure>
                    <div class="c-post__author__info">
                        <h4 class="c-post__author__title">{{$author['name']}}</h4>
                        <p>{!! $author['description'] !!}</p>
                    </div>
                @endif --}}
            </div>
            <div class="c-post__tags" >
                @if ($tags)
                    @foreach ($tags as $tag)
                        <a class="c-post__tag" href="{{ url('blogs/'.trim($tag)) }}" >{{trim($tag)}}</a>
                    @endforeach
                @endif    
                
            </div>
        </div>
    </footer>
</article>

@php 

/*
	@include('site.partials.blocos.blog.cta');
    */
    @endphp
    @include('site.partials.blocos.noticias');

    
@endsection