* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #fff5ee;
}

.article-grid {
    margin: 5vh;
    display: grid;
    gap: 1rem;
    grid-template-columns: 2fr 1fr;
}

.main-article {
    position: relative;
    overflow: hidden;
}

.main-article img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.side-articles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: minmax(100px, auto);
    gap: 0.5rem;
}

/* Creates a tint overlay on the main and side articles */
.main-article::after,
.side-article1::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    /* Black tint with 40% opacity. Change this color for a different tint. */
    z-index: 1;
    /* Places the tint above the image */
}

/* Lifts the text elements above the new tint overlay */
.label,
.meta,
.title {
    position: absolute;
    /* This should already be present */
    z-index: 2;
    /* <-- ADD THIS LINE to ensure text is on top */
}

.side-article1 {
    position: relative;
    overflow: hidden;
}

.side-article1.large {
    grid-column: span 2;
}

.side-article1 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.label {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #0077ff;
    color: white;
    font-size: 0.8rem;
    padding: 3px 6px;
    border-radius: 2px;
    font-family: 'Oswald', sans-serif;
}

.label.orange {
    background: orange;
}

.meta {
    position: absolute;
    bottom: 3.5rem;
    left: 10px;
    font-size: 1rem;
    color: white;
    font-family: 'Oswald', sans-serif;
}

.title {
    position: absolute;
    bottom: 1rem;
    left: 10px;
    right: 10px;
    font-size: 1rem;
    color: white;
    font-weight: bold;
    line-height: 1.2;
    font-family: 'Oswald', sans-serif;
}

.slide1-meta {
    bottom: 5rem;
}

.slide3-title {
    max-width: 350px;
}

/* Responsive */
@media (max-width: 1024px) {
    .slide3-meta {
        bottom: 5rem;
    }
}

@media (max-width: 992px) {
    .slide1-meta {
        bottom: 7rem;
    }
}

@media (max-width: 768px) {
    .slide1-meta {
        bottom: 2.5rem;
    }

    .slide3-meta {
        bottom: 4rem;
    }

    .article-grid {
        grid-template-columns: 1fr;
    }

    .side-articles {
        grid-template-columns: 1fr;
    }

    .side-article1.large {
        grid-column: span 1;
    }
}

@media (max-width: 426px) {
    .slide1-meta {
        bottom: 3.5rem;
    }

    .slide3-meta {
        bottom: 3.5rem;
    }

    .meta {
        font-size: 0.8rem;
    }

    .title {
        font-size: 0.8rem;
    }

    .label {
        top: 10px;
        left: 10px;
        font-size: 0.7rem;
    }
}

@media (max-width: 321px) {
    .meta {
        bottom: 2.5rem;
    }

    .slide1-meta {
        bottom: 3rem;
    }

    .slide3-meta {
        bottom: 3rem;
    }
}



/* --- Animation Additions (Updated for Scroll Trigger) --- */

/* 1. Fade-in Keyframe Animation (This part remains the same) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 2. Set the Initial "Hidden" State */
/* The articles start off invisible and will wait for the .is-visible class */
.main-article,
.side-article1 {
    opacity: 0;
    transition: opacity 0.5s ease; /* Optional: for a smooth fade-out */
}

/* 3. The Animation Trigger Class */
/* When JavaScript adds '.is-visible', this class will apply the animation */
.is-visible {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* 4. Staggering the Animation Delays */
/* We now apply delays to the .is-visible state */
.main-article.is-visible {
    animation-delay: 0.2s;
}
.side-articles .side-article1:nth-child(1).is-visible {
    animation-delay: 0.2s;
}
.side-articles .side-article1:nth-child(2).is-visible {
    animation-delay: 0.2s;
}
.side-articles .side-article1:nth-child(3).is-visible {
    animation-delay: 0.2s;
}

/* 5. Hover Effect on Images (This part remains the same) */
.main-article img,
.side-article1 img {
    transition: transform 0.4s ease-in-out;
}

.main-article:hover img,
.side-article1:hover img {
    transform: scale(1.05);
}