/*-- ================= CSS FOR NEWS/UPDATES SECTION ================= --*/
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;800&family=Inter:wght@400;600;700&display=swap');

#upload { 
    background:#dcedc8;
    padding: 120px 2rem 4rem;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', sans-serif;
}

.upload-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* === Scroll Animation Base Styles === */
.upload-header,
.news-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.upload-header.reveal,
.news-card.reveal {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for cards */
.news-card.reveal:nth-child(1) { transition-delay: 0.1s; }
.news-card.reveal:nth-child(2) { transition-delay: 0.2s; }
.news-card.reveal:nth-child(3) { transition-delay: 0.3s; }
.news-card.reveal:nth-child(4) { transition-delay: 0.4s; }
.news-card.reveal:nth-child(5) { transition-delay: 0.5s; }
.news-card.reveal:nth-child(6) { transition-delay: 0.6s; }

/* Respect motion preferences */
@media (prefers-reduced-motion: reduce) {
    .upload-header,
    .news-card {
        transition: none;
        opacity: 1;
        transform: none;
    }
}

.upload-header {
    margin-bottom: 3rem;
    text-align: center;
}

.upload-header h2 {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    color: #555;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.upload-header p {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 2.5rem);
    color: #1A1A1A;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 1.5rem;
}

/* News Cards Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.news-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.news-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.news-card-image {
    width: 100%;
    height: 320px;
    overflow: hidden;
    position: relative;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.news-card:hover .news-card-image img {
    transform: scale(1.05);
}

.news-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.news-card:hover .news-card-overlay {
    opacity: 1;
}

.news-card-content {
    padding: 1.5rem;
    text-align: left;
}

.news-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2e7d32;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

/* Modal/Popup Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    padding: 5vh 0;
    box-sizing: border-box;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    position: relative;
    width: 95vw;
    max-width: 1000px;
    height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: default;
    margin: 0 auto;
}

.modal-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    transition: all 0.3s ease;
    z-index: 10000;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1rem;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 30px;
    max-width: 80%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 3rem;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 10000;
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.modal-nav.prev {
    left: 20px;
}

.modal-nav.next {
    right: 20px;
}

.modal-nav.hidden {
    display: none;
}

/* Loading spinner */
.modal-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.2rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 30px;
    border-radius: 50px;
    z-index: 9999;
}

/* ================= RESPONSIVE FOR NEWS SECTION ================= */
@media (max-width: 968px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .news-card-image {
        height: 280px;
    }
}

@media (max-width: 768px) {
    .upload-header h2 {
        font-size: 0.85rem;
    }

    .upload-header p {
        font-size: clamp(2rem, 5vw, 2.5rem);
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .news-card-image {
        height: 300px;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 2rem;
    }
    
    .modal-caption {
        bottom: 10px;
        font-size: 0.9rem;
        padding: 8px 15px;
        white-space: normal;
    }

    .modal-nav {
        width: 40px;
        height: 40px;
        font-size: 2rem;
    }

    .modal-nav.prev {
        left: 5px;
    }

    .modal-nav.next {
        right: 5px;
    }
}

@media (max-width: 480px) {
    .upload-header h2 {
        font-size: 0.85rem;
    }

    .news-card-content {
        padding: 1.25rem;
    }

    .news-card-title {
        font-size: 1rem;
    }
    
    .news-card-image {
        height: 280px;
    }
}