html,
body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

* {
    box-sizing: border-box;
}

.news-container {
    max-width: 1200px;
    margin: 80px auto 40px;
    padding: 0 20px;
    position: relative;
    overflow: hidden;
}

.stay-tuned {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 38px;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    background: linear-gradient(45deg, var(--primary-blue), #34a853);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
    padding-bottom: 20px;
    letter-spacing: 1.5px;
    font-weight: 700;
}

.stay-tuned::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 4px;
    background: linear-gradient(90deg, #000000, green, #ff9900, #ff0000, #000000);
    border-radius: 2px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.news-card {
    position: relative;
    background: white;
    border-radius: 10px;
    border: 2.5px solid #00b57c;
    transition: all 0.5s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.news-card::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    border: none;
    height: 0;
    background: #00b57c;
    transition: height 0.5s ease;
    z-index: 1;
}

.news-card:hover::after {
    height: calc(100% + 10px);
}


.news-image {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease-out;
}

.news-card:hover .news-image img {
    transform: scale(1.08);
}

.news-date {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    backdrop-filter: blur(2px);
}



.news-content {
    padding: 18px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-content h2 {
    margin: 0 0 12px;
    color: var(--primary-blue);
    font-size: 1.2rem;
    line-height: 1.4;
}

.news-excerpt {
    color: #5F6C76;
    margin-bottom: 16px;
    line-height: 1.5;
    font-size: 0.9rem;
    flex-grow: 1;
}

.read-more-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
    text-align: center;
    width: 100%;
}

.read-more-static {
    display: none;
    text-align: center;
    padding: 10px 0;
    margin-top: 15px;
    color: var(--primary-blue);
    font-weight: 600;
}

.read-more-static::after {
    content: ' →';
    display: inline-block;
    margin-left: 5px;
    transition: transform 0.3s;
}

.news-card:hover .read-more-overlay {
    opacity: 1;
}

@media (max-width: 768px) {
    .news-card::after {
        display: none;
    }

    .news-card:hover .news-image img {
        transform: none;
    }

    .read-more-overlay {
        display: none;
    }

    .read-more-static {
        display: block;
    }

    .news-content {
        padding-bottom: 40px;
    }
}

.news-card:hover .read-more-overlay::after {
    transform: translateX(5px);
}

.news-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    color: white;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.news-tag[data-category="event"] {
    background: #7E57C2;
}

.news-tag[data-category="research"] {
    background: #26A69A;
}

.news-tag[data-category="announcement"] {
    background: #FFA000;
}

@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }

    .news-image {
        height: 140px;
    }

    .news-content {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .news-image {
        height: 120px;
    }

    .news-content h2 {
        font-size: 1.1rem;
    }
}

.newsletter {
    background: #55b8ff;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    margin: 50px 0;
    border: 1px solid #BBDEFB;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.newsletter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%) -50px 0,
        linear-gradient(225deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%) -50px 0,
        linear-gradient(315deg, rgba(255, 255, 255, 0.1) 25%, transparent 25%),
        linear-gradient(45deg, rgba(255, 255, 255, 0.1) 25%, transparent 25%);
    background-size: 100px 100px;
    animation: floating-tiles 8s infinite linear;
    z-index: 1;
    opacity: 0.7;
}

@keyframes floating-tiles {
    0% {
        background-position: 0 0, 0 0, 0 0, 0 0;
    }

    100% {
        background-position: 100px 100px, 100px 100px, 100px 100px, 100px 100px;
    }
}

.newsletter::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    animation: glossy-sweep 6s infinite;
    z-index: 2;
}

@keyframes glossy-sweep {
    0% {
        left: -100%;
    }

    100% {
        left: 150%;
    }
}

.newsletter>* {
    position: relative;
    z-index: 3;
}

.newsletter h3 {
    margin-top: 0;
    color: rgb(57, 57, 57);
    font-size: 1.8rem;
}

.newsletter p {
    color: #404f56;
    margin-bottom: 20px;
}

.newsletter-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1 1 300px;
    padding: 12px 20px;
    border: 1px solid #BBDEFB;
    border-radius: 4px;
    font-size: 1rem;
    outline: none;
    transition: border 0.3s;
    min-width: 200px;
}

.newsletter-form input:focus {
    border-color: var(--primary-blue);
}

.newsletter-form .subscribe-btn {
    background: rgba(0, 90, 207, 0.687);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.newsletter-form .subscribe-btn:hover {
    background: white;
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
}



/* Fix for mobile scrolling */
html,
body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
}

.news-container {
    overflow: visible;
}

@media (max-width: 768px) {
    body {
        display: block;
        /* Changed from flex */
        min-height: 100vh;
        overflow-y: auto;
        /* Explicitly allow vertical scrolling */
    }

    main {
        min-height: 0;
        /* Remove fixed height */
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .stay-tuned {
        font-size: 2.5rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
        padding: 15px;
        width: 100%;
        box-sizing: border-box;
    }

    /* Prevent horizontal overflow */
    html {
        overflow-x: hidden;
    }

    body {
        position: relative;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        margin: 0;
        padding: 0;
    }

    main,
    footer {
        width: 100%;
        box-sizing: border-box;
    }

    .modal-container {
        margin: 0 10px;
        width: calc(100% - 20px);
    }
}

@media (max-width: 768px) {
    .stay-tuned {
        font-size: 2.5rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stay-tuned {
        font-size: 2rem;
    }

    .flash-message {
        padding-top: 40px;
        padding-bottom: 20px;
    }

    .close-flash {
        top: 8px;
        right: 8px;
    }

    .social-links {
        gap: 15px;
    }

    .social-links a {
        font-size: 1.3rem;
        width: 36px;
        height: 36px;
    }
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.news-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.news-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.news-date {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
}

.news-content {
    padding: 20px;
}

.news-content h2 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
}

.news-excerpt {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

.news-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
}

.news-tag[data-category="event"] {
    background-color: #4CAF50;
}

.news-tag[data-category="announcement"] {
    background-color: #2196F3;
}

.news-tag[data-category="award"] {
    background-color: #FF9800;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.modal-container {
    background: white;
    border-radius: 10px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.modal-image {
    height: 300px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-content {
    padding: 30px;
}

.modal-header {
    margin-bottom: 20px;
}

.modal-date {
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 5px;
}


.modal-tag.event {
    background-color: #4CAF50;
}

.modal-tag.announcement {
    background-color: #2196F3;
}

.modal-tag.award {
    background-color: #FF9800;
}

.modal-title {
    margin: 10px 0 20px 0;
    font-size: 1.8rem;
    text-align: left;
    font-weight: bold;
    color: #105aa5;
}

.modal-body {
    line-height: 1.6;
    color: #555;
}

.modal-body p {
    margin-bottom: 15px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .modal-container {
        max-height: 85vh;
    }

    .modal-image {
        height: 200px;
    }

    .modal-content {
        padding: 20px;
    }

    .modal-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 15px;
    }

    .modal-title {
        font-size: 1.3rem;
    }
}