@extends('front.layout.pages-layout')
@section('pageTitle', $pageTitle)
@section('meta_tags') {!! SEO::generate() !!} @endsection
@section('content')

<section class="section">
    <div class="container">
        <div class="row">
            <div class="col-12">
                <div class="d-flex justify-content-between align-items-center mb-4 flex-wrap">
                    <!-- Title -->
                    <h3 class="mb-0">Facilities</h3>
                    <!-- Breadcrumb -->
                    <nav aria-label="breadcrumb">
                        <ol class="breadcrumb bg-transparent mb-0 px-0">
                            <li class="breadcrumb-item"><a href="{{ url('/') }}">Home</a></li>
                            <li class="breadcrumb-item active" aria-current="page">Facilities</li>
                        </ol>
                    </nav>
                </div>
                <hr>
            </div>
        </div>
        <div class="row mt-5 shadow-sm card-radius">
            @forelse($facilities as $facility)
            <div class="col-md-6 col-lg-3 mb-4">
                <div class="card h-100 border-0">
                    <a href="{{ route('facilities_photo', $facility->slug) }}">
                        <img src="{{ $facility->cover_photo ? asset('/images/facilities/' . $facility->cover_photo) : asset('/front/images/programs/logo/no_facility_photo.png') }}"
                            alt="{{ $facility->name }}"
                            class="card-img-top card-radius"
                            style="height: 200px; object-fit: cover;">
                    </a>
                    <div class="card-body text-center">
                        <h6 class="card-title mb-0 text-dark">
                            <a href="{{ route('facilities_photo', $facility->slug) }}" class="text-dark text-decoration-none">
                                {{ $facility->name }}
                            </a>
                        </h6>
                    </div>
                </div>
            </div>

            @empty
            <div class="col-12">
                <p>No facilities found.</p>
            </div>
            @endforelse
        </div>
    </div>
</section>

@endsection