@extends('layout.web')

<?php
    $date = \Carbon\Carbon::parse($blog->publish_date);
?>

@section('content')
<style>
    .page-title-heading h2{
        font-size: 25px;
    line-height: 40px;
    }
    .cmt-post-featured-wrapper .cmt-post-featured .img-fluid{
        width:100%;
    }
    .sidebar .widget-area .widget.with-title{
            height: 500px;
    overflow-y: scroll;
    }
</style>
<div class="cmt-page-title-row">
            <div class="cmt-page-title-row-inner">
                <div class="container">
                    <div class="row align-items-center">
                        <div class="col-lg-12">
                            <div class="page-title-heading">
                                <h2 class="title">{{$blog->title}}</h2>
                            </div>
                            <div class="breadcrumb-wrapper">
                                <span>
                                    <a title="Homepage" href="{{url('')}}">Home</a>
                                </span>
                                <span>Press Release</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
      <div class="cmt-row sidebar cmt-sidebar-right cmt-bgcolor-white clearfix">
            <div class="container">
                <!-- row -->
                <div class="row">
                    <div class="col-lg-8 content-area">
                        <!-- post -->
                        <article class="post cmt-blog-single clearfix">
                            <!-- cmt-post-featured-wrapper -->
                            <div class="cmt-post-featured-wrapper cmt-featured-wrapper mb-20">
                                <div class="cmt-post-featured">
                                    <img class="img-fluid" src="{{ url($blog->thumbnail) }}" alt="">
                                </div>
                                <div class="cmt-box-post-date">
                                    <span class="cmt-entry-date">
                                        <time class="entry-date" >{{ $date->format('d') }}<span class="entry-month">{{ $date->format('F') }}</span></time>
                                    </span>
                                </div>
                            </div>
                            <!-- cmt-post-featured-wrapper end -->
                            <!-- cmt-blog-single-content -->
                            <div class="cmt-blog-single-content">
                                <div class="cmt-post-entry-header">
                                    <div class="post-meta">
                                        <span class="cmt-meta-line entry-date"><i class="fa fa-calendar"></i><time class="entry-date published" >{{ $date->format('F d, Y / l') }}</time></span>
                                    </div>
                                </div>
                                {!! $blog->description !!}
                            </div><!-- cmt-blog-single-content -->
                        </article><!-- post end -->
                    </div>
                    <div class="col-lg-4 widget-area sidebar-right cmt-col-bgcolor-yes cmt-bg cmt-right-span cmt-bgcolor-grey mt_80 pt-50 mb_80 pb-60 res-991-mt-0 res-991-pt-0">
                        <div class="cmt-col-wrapper-bg-layer cmt-bg-layer"></div>
                        <aside class="widget widget-recent-post with-title">
                            <h3 class="widget-title">Recent Posts</h3>
                            <ul class="widget-post cmt-recent-post-list">
                                @foreach($recentBlogs as $recent)
                                <li>
                                    <a href="{{ url("press/{$recent->id}") }}"><img src="{{ url($recent->thumbnail) }}" alt="post-img"></a>
                                    <div class="post-detail">
                                        <span class="post-date"><i class="fa fa-calendar"></i>{{ \Carbon\Carbon::parse($recent->publish_date)->format('F d, Y') }} </span>
                                        <a href="{{ url("press/{$recent->id}") }}">{{ substr($recent->title, 0, 30) }} {{ strlen($recent->title) > 30 ? '...' : '' }}
                                        </a>
                                    </div>
                                </li>
 @endforeach
                            </ul>
                        </aside>
                    </div>
                </div><!-- row end -->
            </div>
        </div>
@endsection