@extends('web.home.layout.master')

@section('content')


<div class="container-fluid" style="padding-left: 4%;padding-right:4%;padding-top:0%;">


<!-- Hero Section -->


<!-- Latest News -->
<section class="py-5 bg-light">
    <div class="container">
        <div class="d-flex justify-content-between align-items-center mb-4">
            <h2 class="fw-bold">Latest News</h2>

        </div>
        <div class="row g-4">
            @foreach($newssix->take(8) as $news)
            <div class="col-md-6 col-lg-3">
                <div class="card border-0 rounded-4 shadow-sm h-100">

                    <a href="{{ route('web.home.news.view', ['id' => $news->id]) }}">
                    <img src="{{ asset('admin/assets/img/news/' . $news->news_image) }}" class="card-img-top rounded-top-4 fixed-card-img" alt="{{ $news->news_title }}">
                    </a>
                    <div class="card-body">
                        <span class="badge bg-success mb-2">News</span>
                        <h5 class="card-title fw-bold">{{ Str::limit($news->news_title, 50) }}</h5>
                        <p class="card-text text-muted small">{{ Str::limit($news->news_description, 80) }}</p>
                    </div>
                    <div class="card-footer bg-transparent border-0">
                        <small class="text-muted"><i class="fas fa-clock me-1"></i> {{ $news->created_at->format('M d, Y') }}</small>
                    </div>
                </div>
            </div>
            @endforeach
        </div>
    </div>
</section>

<!-- Upcoming Events -->
<section class="py-5">
    <div class="container">
        <div class="d-flex justify-content-between align-items-center mb-4">
            <h2 class="fw-bold">Upcoming Events</h2>

        </div>
        <div class="row g-4">
            @foreach($eventupcoming->take(8) as $event)
            <div class="col-md-6 col-lg-3">
                <div class="card border-0 rounded-4 shadow-sm h-100">
                    <a href="{{ route('web.home.event.view', ['id' => $event->id]) }}">
                        <img src="{{ asset('admin/assets/img/event/' . $event->event_image) }}" class="card-img-top rounded-top-4 fixed-card-img" alt="{{ $event->event_title }}">
                    </a>
                    <div class="card-body">
                        <span class="badge bg-primary mb-2">Upcoming Event</span>
                        <h5 class="card-title fw-bold">{{ Str::limit($event->event_title, 50) }}</h5>
                        <p class="card-text text-muted small">{{ Str::limit($event->event_description, 80) }}</p>
                    </div>
                    <div class="card-footer bg-transparent border-0">
                        <small class="text-muted"><i class="fas fa-calendar me-1"></i> {{ $event->date }}</small>
                    </div>
                </div>
            </div>
            @endforeach
        </div>
    </div>
</section>

<!-- Past Events -->
<section class="py-5 bg-light">
    <div class="container">
        <div class="d-flex justify-content-between align-items-center mb-4">
            <h2 class="fw-bold">Past Events</h2>

        </div>
        <div class="row g-4">
            @foreach($eventpast->take(8) as $event)
            <div class="col-md-6 col-lg-3">
                <div class="card border-0 rounded-4 shadow-sm h-100">
                    <a href="{{ route('web.home.event.view', ['id' => $event->id]) }}">
                        <img src="{{ asset('admin/assets/img/event/' . $event->event_image) }}" class="card-img-top rounded-top-4 fixed-card-img" alt="{{ $event->event_title }}">
                    </a>
                    <div class="card-body">
                        <span class="badge bg-secondary mb-2">Past Event</span>
                        <h5 class="card-title fw-bold">{{ Str::limit($event->event_title, 50) }}</h5>
                        <p class="card-text text-muted small">{{ Str::limit($event->event_description, 80) }}</p>
                    </div>
                    <div class="card-footer bg-transparent border-0">
                        <small class="text-muted"><i class="fas fa-calendar me-1"></i> {{ $event->date }}</small>
                    </div>
                </div>
            </div>
            @endforeach
        </div>
    </div>
</section>

<!-- Newsletter -->


<!-- Social Media Widget -->
{{-- <section class="py-5">
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-lg-8">
                <div class="card border-0 rounded-4 shadow-sm">
                    <div class="card-body text-center">
                        <h3 class="fw-bold mb-4">Connect With Us</h3>
                        <div class="d-flex justify-content-center gap-3">
                            <a href="#" class="btn btn-primary rounded-circle" style="width: 50px; height: 50px;">
                                <i class="fab fa-facebook-f"></i>
                            </a>
                            <a href="#" class="btn btn-info rounded-circle text-white" style="width: 50px; height: 50px;">
                                <i class="fab fa-twitter"></i>
                            </a>
                            <a href="#" class="btn btn-danger rounded-circle" style="width: 50px; height: 50px;">
                                <i class="fab fa-youtube"></i>
                            </a>
                            <a href="#" class="btn btn-dark rounded-circle" style="width: 50px; height: 50px;">
                                <i class="fab fa-linkedin-in"></i>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section> --}}

</div>
<style>
    .fixed-card-img {
    height: 200px;
    width: 100%;
    object-fit: cover;
}

</style>

@endsection
