@extends('site.layouts.layout_1')
@section('content_header')
    <div class="content-section">
        <div class="content-wrapper w-container">
            <div class="masterbreadcrumb">
                <div class="container">
                    <div class="breadcrumb">
                        <a href="/">
                            <span class="breadcrumb__inner">
                                <span class="breadcrumb__title">Página inicial</span>
                            </span>
                        </a>
                        <a href="{{ route('site.noticias.index') }}">
                            <span class="breadcrumb__inner">
                                <span class="breadcrumb__title">Notícias</span>
                            </span>
                        </a>
                        <a>
                            <span class="breadcrumb__inner">
                                <span class="breadcrumb__title">{{ $noticia->titulo }}</span>
                            </span>
                        </a>
                    </div>
                </div>
            </div>
            <div class="w-col w-col-8">
                <div class="post-content-text">
                    <h3 style="font-size: 39px;" class="big">{{$noticia->titulo}}</h3>
                    <div class="post-description-box">
                        <p class="post-description">{{$noticia->id_categoria}}</p>
                    </div>
                    <div class="authors-box less-padding">
                        <div class="details-text" style="text-transform: lowercase;">{{ \Carbon\Carbon::parse($noticia->data)->locale('pt_BR')->isoFormat('dddd, DD [de] MMMM [de] YYYY') }}</div>
                    </div>
                    <div class="rich-text-block w-richtext"> 
                        <img src="{{ asset('assets/site/uploads/' . $entidade->id_tce . '/noticias/' . $noticia->foto) }}" width="100%"><br><br>
                        <p style="text-align: justify">{!!$noticia->conteudo!!}</p><br>
                        <br>
                        <a class="button w-button" href="javascript:history.back()">Voltar </a>
                        <br>
                    </div>
                </div>
            </div>
            <div style="padding-right:0px" class="w-col w-col-4">
                @if($entidade->tipo == '1')
                <h1 class="heading-1">Tv Prefeitura</h1>
                @else
                <h1 class="heading-1">Tv Câmara</h1>
                @endif
                @foreach ($videos->take(1) as $video)
                    <div style="padding:10px;" class="w-col w-col-12">
                        <a class="w-lightbox" href="#" data-ix="fade-in-text-on-load-4" style=" cursor:pointer; transition: background-color 0.5s ease 0s, opacity 1200ms cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 500ms cubic-bezier(0.215, 0.61, 0.355, 1); opacity: 1; transform: translateX(0px) translateY(0px);">
                            <img src="https://i1.ytimg.com/vi/{{ $video->video_url }}/hqdefault.jpg" width="100%">
                            <script type="application/json" class="w-json">{ "items": [{
                                "type": "video",
                                "html": "<iframe class=\"embedly-embed\" src=\"https://www.youtube-nocookie.com/embed/{{$video->video_url}}?rel=0&amp;controls=0&amp;showinfo=0\" width=\"854\" height=\"480\" scrolling=\"no\" frameborder=\"0\" allowfullscreen></iframe>",
                                "thumbnailUrl": "",
                                "width": 700,
                                "height": 420
                              }] }
                            </script>
                        </a>
                    </div>
                    <div class="center_vios">{{ $video->video_titulo }}</div>
                    <a href="{{route('site.videos')}}">
                        <div class="all_moveis">
                            <h4>+ Vídeos</h4>
                        </div>
                    </a>
                @endforeach
                <h1 style="margin-top:30px; float:left; width:100%" class="heading-1">Últimas Notícias</h1>
                @foreach ($noticias->take(5) as $noticia)
                    <a href="/noticia/{{ $noticia->slug }}" class="w-dyn-item"> <span
                            class="heading-link-box w-inline-block">
                            <h2 style="font-size: 17px; color: #00652e; font-weight: 500;" class="heading-hover">
                                {{ $noticia->titulo }}</h2>
                            <h2 class="heading-hover">{{ $noticia->id_categoria }}</h2>
                            <p style="margin-bottom:10px; font-size: 15px; color: #999999; font-weight:300"
                                class="details-text">{{ \Carbon\Carbon::parse($noticia->data)->locale('pt_BR')->isoFormat('dddd, DD [de] MMMM [de] YYYY') }} </p>
                        </span>
                    </a>
                @endforeach
            </div>
        </div>
    </div>
@endsection
