@extends('Frontend.Layouts.app')
@section('title', __('lang.Blog'))
@section('content')
    <!-- HEADER AREA -->
    @include('Frontend.Includes.navbar')
    <!-- HEADER AREA END -->
    <div class="site-content">

        <div class="container-fluid">
            <div class="item-efftect">
                <div class="efftect overflow-hidden"></div>
                <div class="efftect overflow-hidden"></div>
                <div class="efftect overflow-hidden"></div>
                <div class="efftect overflow-hidden"></div>
                <div class="efftect overflow-hidden"></div>
            </div>
        </div>

        <div class="inner-header bg-holder" data-bg="{{ asset('front/images/head.jpg') }}">
            <div class="container">
                <div class="row  justify-content-center">
                    <div class="col-md-12 text-center">
                        <h1 class="title">{{ __('lang.Blog') }}</h1>
                        <p>{{ __('lang.Information on light... will benefit you a lot') }}</p>
                    </div>
                </div>
            </div>
        </div>

        <div class="content-wrapper">

            @php
                $hsetting = App\Models\Home_setting::select(
                    'section10_subtitle',
                    'section10_title',
                    'section10_title_en',
                    'section10_subtitle_en',
                )->first();
            @endphp
                <section class="space-ptb ellipse-top ellipse-bottom">
                    <div class="container">
                        <div class="row justify-content-start">
                            <div class="section-title pb-0 pb-lg-4">
                                <span class="sub-title">
                                    {{__('lang.If you`re looking for new ideas, want to develop your business, or even just want to understand technology and marketing in a simpler way... this is the place for you.')}}
                                </span>
                                <h3 class="title">
                                    {{ __('lang.On the blog, we write in the language of the people, and we share our experience with you with ease.')}}
                                </h3>
                            </div>
                            <div class="col-lg-12">
                                <div class="blog-items grid-wrapper grid-xl-3 grid-md-2 grid-sm-1">
                                    @php
                                        if (app()->getLocale() == 'ar') {
                                            $blogs = App\Models\Blog::where('status', 1)
                                                ->where('language_id', 2)
                                                ->latest()
                                                ->get();
                                        } else {
                                            $blogs = App\Models\Blog::where('status', 1)
                                                ->where('language_id', 1)
                                                ->latest()
                                                ->get();
                                        }
                                    @endphp
                                    @foreach ($blogs as $blog)
                                        <div class="blog-post-wrapper blog-style-1">
                                            <div class="blog-post-img"><img class="img-fluid"
                                                src="{{ asset('storage/files/' . ($blog->image ?? 'default.png')) }}"
                                                alt=""></div>
                                            <div class="blog-post-info">
                                                <h5 class="post-title"><a href="{{ route('front.blog', $blog->id) }}">
                                                        {{ $blog->title }}</a></h5>
                                                <p class="post-title"> {{ $blog->category }} </p>
                                            </div>

                                        </div>
                                    @endforeach
                                </div>
                            </div>
                        </div>
                </section>
            <section class="space-small-ptb ellipse-top bg-black z-index-2">
                <div class="container">
                    <div class="row mb-lg-5">
                        <div class="col-xxl-6 col-lg-8">
                            <div class="section-title mb-lg-0">
                                <span
                                    class="sub-title">{{ app()->getLocale() == 'ar' ? $hsetting->section10_title : $hsetting->section10_title_en }}</span>
                                <h2 class="title mb-0">
                                    {{ app()->getLocale() == 'ar' ? $hsetting->section10_subtitle : $hsetting->section10_subtitle_en }}
                                </h2>
                            </div>
                        </div>
                        <div class="col-xxl-6 col-lg-4 align-self-end">
                            <div class="d-flex justify-content-center mt-5 ms-sm-5 ms-0">
                                <a class="btn btn-primary" href="{{ route('front.form') }}">
                                    <span>{{ __('lang.start now') }}</span>
                                    <svg width="20" height="22" viewBox="0 0 20 22" fill="none"
                                        xmlns="http://www.w3.org/2000/svg">
                                        <g clip-path="url(#clip0_59_253)">
                                            <path
                                                d="M19.4854 11.4293L17.0513 12.221C13.1214 13.4993 10.3036 16.9595 9.84784 21.0668C9.49371 16.981 6.71926 13.5081 2.81255 12.2604L0.210283 11.4293"
                                                stroke="white" stroke-width="2" />
                                            <path d="M9.83594 20.8889L9.83594 0" stroke="white" stroke-width="2" />
                                        </g>
                                        <defs>
                                            <clipPath id="clip0_59_253">
                                                <rect width="21.3333" height="20" fill="white"
                                                    transform="translate(20) rotate(90)" />
                                            </clipPath>
                                        </defs>
                                    </svg>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </div>

    @include('Frontend.Includes.Footer')
    <!-- FOOTER AREA END -->
@endsection
