.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Three columns per row */
    gap: 1.5rem;
    margin-bottom: 2rem;
}
@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Responsive fallback */
    }
}
.news-card {
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}
.news-image {
    width: 100%;
    /*max-height: 200px; /* Limits the height but allows natural aspect ratio */
    object-fit: contain; /* Ensures the whole image is visible */
}
.news-content {
    padding: 1rem;
    flex-grow: 1;
}
.news-date {
    color: #666;
    font-size: 0.9em;
    font-weight: bold;
}
.news-footer {
    padding: 1rem;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
}
.news-footer h3 {
    margin: 0;
    font-size: 0.95rem; /* Smaller title font */
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}
.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 900px; /* Wider for desktop */
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}
.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
}
.modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
}
.modal-layout {
    display: flex;
    flex-direction: row; /* Desktop default */
    align-items: flex-start;
}
.modal-image-wrapper {
    flex: 1;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 1rem;
}
.modal-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    display: block;
}
.modal-info {
    flex: 1;
    padding: 2rem;
}
.modal-date {
    color: var(--accent);
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
.modal-title {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary);
    font-size: 1.2rem; /* Smaller title size */
    line-height: 1.3;
}
.modal-description {
    line-height: 1.6;
    font-size: 0.95rem;
    color: #333;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .modal-layout {
        flex-direction: column;
    }
    .modal-image-wrapper {
        width: 100%;
        min-height: auto;
        padding: 1rem;
        background: transparent;
    }
    .modal-image {
        max-height: 250px;
        width: 80%; /* Smaller image on mobile */
        margin: 0 auto;
    }
    .modal-info {
        padding: 1.5rem;
    }
}
