/* ===== Blog Listing Layout ===== */
#main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}
/* ===== Article Card Grid ===== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* Tablet: 2 cards per row */
@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: stack cards vertically */
@media (max-width: 640px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    #main {
        padding: 2.5rem 1.5rem;
    }
}

/* ===== Article Cards ===== */
.blog-card {
    display: flex;
    flex-direction: column;
    min-height: clamp(420px, 55vh , 720px); /* makes cards taller */
    padding: 2rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    gap: 1rem;
    justify-content: space-between;
    border-left: 4px solid var(--accent);
}

@media (min-width: 641px) {
    .blog-title {
        min-height: 3.45em;
    }

    .blog-meta {
        min-height: 2.8em;
    }
}

/* Hover effect for blog cards */
.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

/* Blog card image placeholder */
.blog-card img {
    width: 100%;
    aspect-ratio: 3 / 2;
    height: auto;
    object-fit: cover;
    object-position: center;
    margin: 0.25rem 0 0.5rem;
    border-radius: 10px;
    border: 1px solid #d7dde2;
    background: #f4f7f8;
}

/* Blog card call-to-action */
.blog-card .blog-link {
    margin-top: auto;
    align-self: flex-start;
}
.blog-link {
    text-decoration: none;
    color: var(--accent);
    font-weight: 600;
    transition: color 0.3s ease;
}
.blog-link:hover {
    color: var(--hover-accent);
}

@media (max-width: 768px) {
    .blog-card .blog-link {
        display: inline-flex;
        min-height: 44px;
        align-items: center;
        padding-block: 0.65rem;
    }
}

.blog-title {
    margin: 0;
    line-height: 1.15;
}

.blog-meta {
    margin: 0;
    color: var(--body-text);
}

.blog-excerpt {
    margin: 0;
    color: var(--body-text);
    line-height: 1.65;
    font-size: 1.02rem;
}

/* ===== Dark Mode ===== */
body.dark-mode .blog-card {
    background: linear-gradient(180deg, var(--surface-bg) 0%, var(--surface-muted) 100%);
    border-color: var(--border);
    border-left-color: var(--accent);
    box-shadow: var(--shadow-soft);
}

body.dark-mode .blog-card:hover {
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.42);
}

body.dark-mode .blog-card img {
    background: #111b20;
    border-color: var(--border);
}

body.dark-mode .blog-title {
    color: var(--heading-color);
}

body.dark-mode .blog-meta,
body.dark-mode .blog-excerpt {
    color: var(--body-text);
}
