@php
    $newsfirst = \App\Models\NewEventContain::latest('released_at')->first();
    $newindividuals = \App\Models\NewEventContain::where('id', '!=', $newsfirst->id)->take($news->news_count)->get();
@endphp
<div class="news-events-section">
    <div class="news-events-grid">
        @foreach ($newindividuals as $newindividual)
        <a href="{{ route('individualNews', $newindividual->id) }}" class="news-events-item">
            <div class="news-events-image">
                <img src="{{ asset('storage/' . $newindividual->image) }}" alt="{{ $newindividual->title }}">
                <div class="news-events-overlay">
                    <h3>{{ $newindividual->title }}</h3>
                    <div class="news-events-actions">
                        <span class="news-events-readmore">READ MORE</span>
                        <span class="news-events-arrow">
                            <svg width="40" height="40" viewBox="0 0 60 60" fill="none">
                                <circle cx="30" cy="30" r="29" fill="#fff" stroke="#fff" stroke-width="2"/>
                                <path d="M22 38L38 22" stroke="#111" stroke-width="3" stroke-linecap="round"/>
                                <path d="M38 22V36.5" stroke="#111" stroke-width="3" stroke-linecap="round"/>
                                <path d="M38 22H23.5" stroke="#111" stroke-width="3" stroke-linecap="round"/>
                            </svg>
                        </span>
                    </div>
                </div>
            </div>
        </a>
        @endforeach
    </div>

    <div class="frame-container">
        <button class="see-more-button type1" id="see-more-button">
            <span class="btn-text">{{ $news->button_text }}</span>
            <svg width="16" height="14" viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg">
                <path d="M1 7H15M15 7L9 1M15 7L9 13" stroke="currentColor" stroke-width="1.5"/>
            </svg>
        </button>
    </div>
</div>

<style>
    .news-events-section {
        padding: 40px 5%;
        max-width: 1200px;
        margin: 0 auto;
    }

    .news-events-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
        margin-bottom: 40px;
    }

    .news-events-item {
        display: block;
        position: relative;
        width: 365px; /* Adjust as needed */
        border-radius: 10px;
        height: 235px;
        overflow: hidden;
        text-decoration: none;
    }

    .news-events-image {
        position: relative;
        width: 100%;
        height: 100%; /* Adjust as needed */
    }

    .news-events-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        filter: grayscale(100%);
    }

    .news-events-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(10, 67, 117, 0.6); /* semi-transparent dark overlay */
        color: #fff;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        padding: 18px 16px;
        box-sizing: border-box;
    }

    .news-events-overlay h3 {
        font-size: 1.3rem;
        font-weight: 700;
        margin: 0 0 18px 0;
        line-height: 1.1;
    }

    .news-events-actions {
        display: flex;
        align-items: center;
        gap: 18px;
    }


    .news-events-readmore {
    background: #0a4375;
    color: #fff;
    padding: 10px;
    border-radius: 10px;
    font-weight: 400;
    font-size: 16px;
    letter-spacing: 2px;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    font-family: inherit;

    }

    .news-events-arrow {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: none;
        margin-left: 2px;
    }

    .news-events-arrow svg {
        display: block;
    }

    .frame-container {
        display: flex;
        justify-content: center;
        margin-top: 20px;
    }

    .see-more-button {
        height: 50px;
        width: 200px;
        border-radius: 20px;
        position: relative;
        background-color: {{ $news->button_background_color }};
        cursor: pointer;
        border: 2px solid #0082d6;
        overflow: hidden;
        color: {{ $news->button_color }};
        transition: all 0.5s ease-in-out;
        font-family: Poppins;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }

    .btn-text {
        position: relative;
        z-index: 2;
        font-size: 14px;
        letter-spacing: 2px;
        transition: color 0.5s ease-in-out;
    }

    .type1::after {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        transition: all 0.5s ease-in-out;
        background-color: #0082d6;
        visibility: hidden;
        height: 10px;
        width: 10px;
        z-index: 1;
    }

    .see-more-button:hover {
        color: white;
    }

    .see-more-button:hover svg {
        transform: translateX(5px);
    }

    .type1:hover::after {
        visibility: visible;
        transform: scale(100) translateX(2px);
    }

    .see-more-button svg {
        position: relative;
        z-index: 2;
        transition: transform 0.3s ease;
    }

 /* Enhanced responsive styles */
 @media (max-width: 1200px) {
        .news-events-section {
            padding: 35px 4%;
            max-width: 1000px;
        }
        .news-events-grid {
            gap: 25px;
            margin-bottom: 35px;
        }
        .news-events-item {
            width: 320px;
            height: 210px;
        }
        .news-events-overlay {
            padding: 16px 14px;
        }
        .news-events-overlay h3 {
            font-size: 1.2rem;
            margin-bottom: 16px;
        }
        .news-events-actions {
            gap: 16px;
        }
        .news-events-readmore {
            padding: 9px;
            font-size: 15px;
        }
        .news-events-arrow {
            width: 45px;
            height: 45px;
        }
        .frame-container {
            margin-top: 18px;
        }
        .see-more-button {
            height: 45px;
            width: 180px;
        }
        .btn-text {
            font-size: 13px;
        }
    }

    @media (max-width: 992px) {
        .news-events-section {
            padding: 30px 3%;
            max-width: 900px;
        }
        .news-events-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 20px;
            margin-bottom: 30px;
        }
        .news-events-item {
            width: 100%;
            height: 200px;
        }
        .news-events-overlay {
            padding: 14px 12px;
        }
        .news-events-overlay h3 {
            font-size: 1.1rem;
            margin-bottom: 14px;
        }
        .news-events-actions {
            gap: 14px;
        }
        .news-events-readmore {
            padding: 8px;
            font-size: 14px;
        }
        .news-events-arrow {
            width: 40px;
            height: 40px;
        }
        .frame-container {
            margin-top: 16px;
        }
        .see-more-button {
            height: 42px;
            width: 170px;
        }
        .btn-text {
            font-size: 12.5px;
        }
    }

    @media (max-width: 768px) {
        .news-events-section {
            padding: 25px 2%;
        }
        .news-events-grid {
            gap: 18px;
            margin-bottom: 25px;
        }
        .news-events-item {
            height: 180px;
        }
        .news-events-overlay {
            padding: 12px 10px;
        }
        .news-events-overlay h3 {
            font-size: 1rem;
            margin-bottom: 12px;
        }
        .news-events-actions {
            gap: 12px;
        }
        .news-events-readmore {
            padding: 7px;
            font-size: 13px;
        }
        .news-events-arrow {
            width: 35px;
            height: 35px;
        }
        .frame-container {
            margin-top: 14px;
        }
        .see-more-button {
            height: 40px;
            width: 160px;
        }
        .btn-text {
            font-size: 12px;
        }
    }

    @media (max-width: 600px) {
        .news-events-section {
            padding: 20px 1%;
        }
        .news-events-grid {
            gap: 15px;
            margin-bottom: 20px;
        }
        .news-events-item {
            height: 160px;
        }
        .news-events-overlay {
            padding: 10px 8px;
        }
        .news-events-overlay h3 {
            font-size: 0.95rem;
            margin-bottom: 10px;
        }
        .news-events-actions {
            gap: 10px;
        }
        .news-events-readmore {
            padding: 6px;
            font-size: 12px;
        }
        .news-events-arrow {
            width: 30px;
            height: 30px;
        }
        .frame-container {
            margin-top: 12px;
        }
        .see-more-button {
            height: 35px;
            width: 140px;
        }
        .btn-text {
            font-size: 11px;
        }
    }

    @media (max-width: 576px) {
        .news-events-section {
            padding: 15px 1%;
        }
        .news-events-grid {
            grid-template-columns: 1fr;
            max-width: 400px;
            margin: 0 auto 30px;
            gap: 12px;
        }
        .news-events-item {
            height: 200px;
        }
        .news-events-overlay {
            padding: 12px 10px;
        }
        .news-events-overlay h3 {
            font-size: 1rem;
            margin-bottom: 12px;
        }
        .news-events-actions {
            gap: 12px;
        }
        .news-events-readmore {
            padding: 8px;
            font-size: 13px;
        }
        .news-events-arrow {
            width: 35px;
            height: 35px;
        }
        .frame-container {
            margin-top: 10px;
        }
        .see-more-button {
            height: 35px;
            width: 130px;
        }
        .btn-text {
            font-size: 10px;
        }
    }

    @media (max-width: 480px) {
        .news-events-section {
            padding: 12px 1%;
        }
        .news-events-grid {
            max-width: 350px;
            gap: 10px;
            margin-bottom: 20px;
        }
        .news-events-item {
            height: 180px;
        }
        .news-events-overlay {
            padding: 10px 8px;
        }
        .news-events-overlay h3 {
            font-size: 0.9rem;
            margin-bottom: 10px;
        }
        .news-events-actions {
            gap: 10px;
        }
        .news-events-readmore {
            padding: 7px;
            font-size: 12px;
        }
        .news-events-arrow {
            width: 30px;
            height: 30px;
        }
        .frame-container {
            margin-top: 8px;
        }
        .see-more-button {
            height: 32px;
            width: 120px;
        }
        .btn-text {
            font-size: 9px;
        }
    }

    @media (max-width: 400px) {
        .news-events-section {
            padding: 10px 1%;
        }
        .news-events-grid {
            max-width: 300px;
            gap: 8px;
            margin-bottom: 15px;
        }
        .news-events-item {
            height: 160px;
        }
        .news-events-overlay {
            padding: 8px 6px;
        }
        .news-events-overlay h3 {
            font-size: 0.85rem;
            margin-bottom: 8px;
        }
        .news-events-actions {
            gap: 8px;
        }
        .news-events-readmore {
            padding: 6px;
            font-size: 11px;
        }
        .news-events-arrow {
            width: 25px;
            height: 25px;
        }
        .frame-container {
            margin-top: 6px;
        }
        .see-more-button {
            height: 30px;
            width: 110px;
        }
        .btn-text {
            font-size: 8px;
        }
    }

    @media (max-width: 360px) {
        .news-events-section {
            padding: 8px 1%;
        }
        .news-events-grid {
            max-width: 280px;
            gap: 6px;
            margin-bottom: 12px;
        }
        .news-events-item {
            height: 140px;
        }
        .news-events-overlay {
            padding: 6px 4px;
        }
        .news-events-overlay h3 {
            font-size: 0.8rem;
            margin-bottom: 6px;
        }
        .news-events-actions {
            gap: 6px;
        }
        .news-events-readmore {
            padding: 5px;
            font-size: 10px;
        }
        .news-events-arrow {
            width: 20px;
            height: 20px;
        }
        .frame-container {
            margin-top: 4px;
        }
        .see-more-button {
            height: 28px;
            width: 100px;
        }
        .btn-text {
            font-size: 7px;
        }
    }
</style>
