@extends('layouts.app')
@section('title',@$title)
@section('content')
<section id="section3" class="container mx-auto p-12 md:py-12">
	<div class="flex justify-between mb-15">
		<h4 class="text-lg md:text-2xl font-extrabold text-black">Kegiatan Sekolah Adiwiyata</h4>
	</div>
	<div class="flex flex-row">
		<div class="grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-5">
			@foreach($kegiatan as $dataKeg)
				<?php
				        $image = json_decode($dataKeg->image);
				    ?>
				<div class="p-3 border border-[#eaeaea] rounded-[10px] shadow-[2px_1px_5px_0px_rgba(0,0,0,0.10)]">
					<div class="flex flex-col gap-3">
						<img src="{{ asset($image[0]) }}" alt="" class="w-full object-cover rounded-sm h-40 lg:w-[100%]">
						<div class="flex flex-row gap-3 items-center">
							<span class="p-2 bg-warning text-xs rounded-[10px] text-white">Kegiatan {{ $dataKeg->kategori }}</span>
							<span class="text-xs opacity-[50%]">{{ date('D',strtotime($dataKeg->created_at)) }}, {{ date('d M Y',strtotime($dataKeg->created_at)) }}</span>
						</div>
						<h4 class="text-[15px] text-black font-reguler mt-2">
							<a href="{{ url('kegiatan/'.$dataKeg->slug) }}">{{ $dataKeg->judul }}</a>
						</h4>
					</div>	    
				</div>	
			@endforeach
		</div>
	</div>
	<div class="mt-10">
		{!! $kegiatan->links() !!}
	</div>
</section>
@endsection