/* ============================================
   LAYOUT COMPONENTS
   ============================================ */

.articles-grid {
    display: grid;
    /* Use auto-fit so cards wrap automatically without media queries */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    width: 100%;
    transition: all 0.5s;
    animation: slide-up 0.5s var(--std-cubic-bezier);
}

.blog-home {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    /* Reduced padding for mobile, increases on larger screens */
    padding: 2rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Tablet and Desktop padding */
@media (min-width: 768px) {
    .blog-home {
        padding: 4rem 2rem;
    }
}

/* ============================================
   ARTICLE CARD and ARTICLE LINK
   ============================================ */

.highlight-article-card {
    padding: 1rem;
    display: flex;
    flex-direction: column; /* Stacked by default (Mobile First) */
    height: auto; 
    gap: 1.5rem;
    align-items: center;
    border-radius: 2rem;
    overflow: hidden;
    background-color: transparent;
    color: var(--md-sys-color-on-tertiary-container);
    transition: all 0.3s;
}

/* Switch to side-by-side on larger screens */
@media (min-width: 850px) {
    .highlight-article-card {
        flex-direction: row;
        height: 320px;
    }
    
    .highlight-article-card img {
        height: 100%;
        width: auto;
    }
}

.highlight-article-card img {
    width: 100%; /* Full width on mobile */
    aspect-ratio: 16/9;
    object-fit: cover;
}

.highlight-AC-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.highlight-AC-info h1 {
    font-weight: 600;
    font-size: clamp(1.5rem, 5vw, 2.5rem); /* Fluid typography */
}

/* Rest of your card styles */
.article-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    /* Removed min-width: 320px to prevent overflow on small phones */
    width: 100%; 
    border-radius: 2rem;
    transition: all 0.3s;
}

.article-card .card-img {
    aspect-ratio: 16/10;
    width: 100%;
    object-fit: cover;
}

/* Hover & Utility */
.highlight-article-card:hover {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.article-card:hover {
    background-color: var(--md-sys-color-tertiary-container);
}

.article-link {
    color: inherit;
    text-decoration: none;
}

img {
    border: 0.1px solid var(--md-sys-color-outline);
    border-radius: 1.2rem;
    max-width: 100%; /* Ensures images never break the layout */
    object-fit: cover;
}