@php
    $boardMembers = \App\Models\BoardMember::all();
@endphp
@if ($boardMembers && $boardMembers->count() > 0)
    <div class="board-member-container">
        <h2>Board Members</h2>
        <div class="board-member-grid">
            @foreach ($boardMembers as $member)
                <div class="board-member-card">
                    <img src="{{ $member->image ? asset('storage/' . $member->image) : 'https://via.placeholder.com/400x400?text=No+Image' }}"
                        alt="{{ $member->name }}" class="board-member-img">
                    <div class="board-member-overlay">
                        <div class="board-member-info">
                            <div class="board-member-name">{{ strtoupper($member->name) }}</div>
                            <div class="board-member-description">{{ Str::words($member->description, 18) }}</div>
                            <div class="board-member-icons">
                                <span class="icon-info">
                                    <span>{{ $member->position ?? 'N/A' }}</span>
                                </span>
                                <span class="icon-info">
                                    <span>{{ $member->college ?? 'N/A' }}</span>
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
            @endforeach
        </div>
    </div>
@endif
<style>
    .board-member-container {
        width: 100%;
        padding: 40px 0 60px 0;
        background: #f8f8f8;
    }

    .board-member-container h2 {
        text-align: center;
        font-size: 2.2rem;
        font-weight: 700;
        color: #0a4977;
        margin-bottom: 36px;
        letter-spacing: 1px;
    }

    .board-member-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 36px;
        max-width: 1100px;
        margin: 0 auto;
        padding: 0 24px;
    }

    .board-member-card {
        position: relative;
        overflow: hidden;
        border-radius: 12px;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
        background: #fff;
        min-height: 370px;
        transition: box-shadow 0.25s, transform 0.25s;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .board-member-img {
        width: 100%;
        height: 370px;
        object-fit: cover;
        display: block;
        border-radius: 12px;
        transition: filter 0.3s;
    }

    .board-member-card:hover .board-member-img {
        filter: brightness(0.45);
    }

    .board-member-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        align-items: flex-end;
        justify-content: flex-start;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.4s cubic-bezier(.4, 1.4, .6, 1), transform 0.4s cubic-bezier(.4, 1.4, .6, 1);
        z-index: 3;
        background: none;
        transform: translateY(30px);
    }

    .board-member-card:hover .board-member-overlay {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .board-member-info {
        color: #fff;
        text-align: left;
        padding: 36px 28px 24px 28px;
        width: 100%;
        max-width: 90%;
        margin: 0 auto 30px auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        opacity: 0;
        transform: scale(0.95) translateY(30px);
        transition: opacity 0.4s cubic-bezier(.4, 1.4, .6, 1), transform 0.4s cubic-bezier(.4, 1.4, .6, 1);
    }

    .board-member-card:hover .board-member-info {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    .board-member-name {
        font-size: 1.18rem;
        font-weight: 700;
        letter-spacing: 1px;
        margin-bottom: 10px;
        color: #0a4977;
        text-shadow: 0 1px 0 #222;
    }

    .board-member-description {
        font-size: 0.99rem;
        margin-bottom: 18px;
        color: #fff;
        min-height: 48px;
    }

    .icon-info {
        font-size: 14px;
        font-weight: 450;
        color: #F3881B;
        margin-right: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 10px;
        gap: 10px;
    }



    /* ####################### Additional responsive breakpoints ####################### */
    @media (max-width: 1200px) {
        .board-member-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 30px;
            padding: 0 20px;
        }
    }

    @media (max-width: 900px) {
        .board-member-container h2 {
            font-size: 1.9rem;
            margin-bottom: 30px;
        }

        .board-member-grid {
            gap: 24px;
            padding: 0 16px;
        }

        .board-member-img {
            height: 320px;
        }

        .board-member-card {
            min-height: 320px;
        }
    }

    @media (max-width: 700px) {
        .board-member-grid {
            grid-template-columns: 1fr;
            gap: 18px;
        }

        .board-member-img {
            height: 220px;
        }

        .board-member-info {
            padding: 18px 10px 14px 10px;
        }
    }

    @media (max-width: 480px) {
        .board-member-container {
            padding: 30px 0 40px 0;
        }

        .board-member-container h2 {
            font-size: 1.6rem;
            margin-bottom: 24px;
        }

        .board-member-grid {
            padding: 0 12px;
            gap: 16px;
        }

        .board-member-img {
            height: 200px;
        }

        .board-member-card {
            min-height: 200px;
        }

        .board-member-info {
            padding: 16px 8px 12px 8px;
            margin-bottom: 20px;
        }

        .board-member-name {
            font-size: 1rem;
            margin-bottom: 8px;
        }

        .board-member-description {
            font-size: 0.9rem;
            margin-bottom: 14px;
            min-height: 40px;
        }

        .icon-info {
            font-size: 13px;
            margin-bottom: 8px;
        }
    }

    @media (max-width: 360px) {
        .board-member-container h2 {
            font-size: 1.4rem;
            margin-bottom: 20px;
        }

        .board-member-grid {
            padding: 0 8px;
            gap: 14px;
        }

        .board-member-img {
            height: 180px;
        }

        .board-member-card {
            min-height: 180px;
        }

        .board-member-info {
            padding: 14px 6px 10px 6px;
            margin-bottom: 16px;
        }

        .board-member-name {
            font-size: 0.9rem;
            margin-bottom: 6px;
        }

        .board-member-description {
            font-size: 0.8rem;
            margin-bottom: 12px;
            min-height: 36px;
        }

        .icon-info {
            font-size: 12px;
            margin-bottom: 6px;
        }
    }
</style>
