Current Affairs

<!DOCTYPE html>
<html>
<head>
    <title>Current Affairs</title>
    <!-- Include Bootstrap CSS (or your chosen CSS framework) -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
    <style>
        /* Custom CSS for the layout */
        .img_col {
            width: 60px; /* Adjust as needed */
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>Current Affairs</h1>

        <section id="daily">
            <h2>Daily Current Affairs</h2>
            <div class="row">
                @forelse($postsByCategory['daily-current-affairs'] as $post)
                    <article class="col-12 shadow-sm bg-white rounded-lg my-2 p-2">
                        <a href="{{ route('current-affairs.show', $post->slug) }}" class="link d-flex align-items-center text-decoration-none">
                            <div class="img_col me-3">
                                <img src="{{ $post->thumbnail }}"
                                     class="rounded-circle border"
                                     style="width: 50px; height: 50px; object-fit: cover;"
                                     alt="{{ $post->name }}" />
                            </div>
                            <div class="text_col">
                                <h2 class="mb-1 text-dark fw-bold" style="font-size: 14px; line-height: 1.2;">
                                    {{ ucwords($post->title) }} <!-- Use $post->title instead of $post->name -->
                                </h2>
                                <p class="mb-0 text-muted" style="font-size: 11px;">{{ $post->created_at->format('F d, Y') }}</p>
                            </div>
                        </a>
                    </article>
                @empty
                    <div class="col-12">
                        <p>No daily current affairs posts yet.</p>
                    </div>
                @endforelse
            </div>
        </section>

        <section id="weekly">
            <h2>Weekly Current Affairs</h2>
            <div class="row">
                @forelse($postsByCategory['weekly-current-affairs'] as $post)
                    <article class="col-12 shadow-sm bg-white rounded-lg my-2 p-2">
                        <a href="{{ route('current-affairs.show', $post->slug) }}" class="link d-flex align-items-center text-decoration-none">
                            <div class="img_col me-3">
                                <img src="{{ $post->thumbnail }}"
                                     class="rounded-circle border"
                                     style="width: 50px; height: 50px; object-fit: cover;"
                                     alt="{{ $post->name }}" />
                            </div>
                            <div class="text_col">
                                <h2 class="mb-1 text-dark fw-bold" style="font-size: 14px; line-height: 1.2;">
                                    {{ ucwords($post->title) }}  <!-- Use $post->title instead of $post->name -->
                                </h2>
                                <p class="mb-0 text-muted" style="font-size: 11px;">{{ $post->created_at->format('F d, Y') }}</p>
                            </div>
                        </a>
                    </article>
                @empty
                    <div class="col-12">
                        <p>No weekly current affairs posts yet.</p>
                    </div>
                @endforelse
            </div>
        </section>

        <section id="monthly">
            <h2>Monthly Current Affairs</h2>
            <div class="row">
                @forelse($postsByCategory['monthly-current-affairs'] as $post)
                    <article class="col-12 shadow-sm bg-white rounded-lg my-2 p-2">
                        <a href="{{ route('current-affairs.show', $post->slug) }}" class="link d-flex align-items-center text-decoration-none">
                            <div class="img_col me-3">
                                <img src="{{ $post->thumbnail }}"
                                     class="rounded-circle border"
                                     style="width: 50px; height: 50px; object-fit: cover;"
                                     alt="{{ $post->name }}" />
                            </div>
                            <div class="text_col">
                                <h2 class="mb-1 text-dark fw-bold" style="font-size: 14px; line-height: 1.2;">
                                    {{ ucwords($post->title) }}  <!-- Use $post->title instead of $post->name -->
                                </h2>
                                <p class="mb-0 text-muted" style="font-size: 11px;">{{ $post->created_at->format('F d, Y') }}</p>
                            </div>
                        </a>
                    </article>
                @empty
                    <div class="col-12">
                        <p>No monthly current affairs posts yet.</p>
                    </div>
                @endforelse
            </div>
        </section>
    </div>

    <!-- Include Bootstrap JS (optional, if you need Bootstrap's JavaScript features) -->
    <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.3/dist/umd/popper.min.js"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>