/* Blog Page Styles */
#blog-list {
    display: flex;
    justify-content: center;
}

.posts-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns like MarTech */
    grid-auto-rows: minmax(320px, auto);
    gap: 16px; /* This is the gap for non-stacked cards */
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
}

/* BLOG POST CARD */
.blog-post {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* FEATURED POST - BIG LEFT */
.blog-post.featured {
    grid-column: span 2;
    grid-row: span 2;
}

.blog-post.featured .blog-title {
    font-size: 30px; /* or whatever size you want */
}

/* STACKED POSTS - FULL WIDTH UNDERNEATH */
.blog-post.stacked {
    grid-column: span 4;
    flex-direction: row;
    height: 280px;
    margin-bottom: -8; /* Removed the margin-bottom */
    display: flex;
    justify-content: space-between; /* This ensures the space between elements is balanced */
    align-items: center; /* Aligns the image and content vertically */
    margin-top: -10; /* Reduce space only for stacked posts */
}

/* IMAGE FOR STACKED POSTS */
.blog-post.stacked .blog-image {
    width: 300px;
    height: 100%;
    object-fit: cover;
    border-radius: 12px 0 0 12px;
}

/* CONTENT FOR STACKED POSTS */
.blog-post.stacked .blog-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* IMAGE */
.blog-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    display: block;
}

/* CONTENT */
.blog-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
    text-align: left;
}

.meta {
    font-size: 14px;
    font-family: 'Lora', serif !important;
    color: #888;
    font-weight: 600;
}

.blog-title {
    position: relative;
    font-family: 'Lora', serif !important;
    font-size: 20px;
    font-weight: 700;
    color: #000;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    display: inline-block; /* Ensures the underline width matches the text */
}

/* Underline animation */
.blog-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: #00c896;
    transition: width 0.3s ease;
}

.blog-title:hover::after {
    width: 100%; /* Only extends to the end of the text */
}

.blog-title:hover {
    color: #00c896;
}

.blog-content p {
    font-size: 15px;
    font-family: 'Lora', serif !important;
    color: #161616;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.read-more {
    margin-top: auto;
    font-weight: 700;
    font-size: 14px;
    color: #505050;
    text-decoration: none;
    transition: color 0.3s;
    align-self: center;
}

.read-more:hover {
    color: #008b6a;
}

.blog-post:hover {
    transform: translateY(-4px);
}

@media (max-width: 768px) {
    .posts-container {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 10px;
    }

    /* General Styles for All Cards */
    .blog-post,
    .blog-post.featured,
    .blog-post.stacked {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        font-size: 14px;
        text-align: left;
        width: 100%;
    }

    /* Image for All Cards */
    .blog-post .blog-image,
    .blog-post.featured .blog-image,
    .blog-post.stacked .blog-image {
        width: 100%;
        height: 180px;
        border-radius: 12px 12px 0 0;
        aspect-ratio: 16 / 10;
        object-fit: cover;
    }

    /* Content for All Cards */
    .blog-post .blog-content,
    .blog-post.featured .blog-content,
    .blog-post.stacked .blog-content {
        padding: 12px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 100%;
    }

    /* Title for All Cards */
    .blog-post .blog-title,
    .blog-post.featured .blog-title,
    .blog-post.stacked .blog-title {
        font-size: 18px; /* Uniform title size */
        font-weight: bold;
        margin-bottom: 8px;
        display: block;
        width: 100%;
    }

    /* Paragraphs/Text for All Cards - Allow multiple lines */
    .blog-post .blog-content p,
    .blog-post.featured .blog-content p,
    .blog-post.stacked .blog-content p {
        font-size: 14px; /* Uniform text size */
        margin-bottom: 10px;
        overflow: visible; /* Allow text to overflow naturally */
        white-space: normal; /* Allow text to wrap onto new lines */
        display: block; /* Make text block-level so it wraps */
    }

    /* Featured Card Title */
    .blog-post.featured .blog-title {
        font-size: 20px; /* Slightly larger title for featured card */
    }

    /* Featured Card Paragraph Text */
    .blog-post.featured .blog-content p {
        font-size: 14px; /* Uniform text size */
    }

    /* Stacked Card Title */
    .blog-post.stacked .blog-title {
        font-size: 18px; /* Uniform title size for stacked card */
    }

    /* Stacked Card Paragraph Text */
    .blog-post.stacked .blog-content p {
        font-size: 14px; /* Uniform text size for stacked card */
    }

    /* Stacked Cards Now Take Same Layout As Featured */
    .blog-post.stacked {
        flex-direction: column;
        height: auto;
    }

    /* Read More Button */
    .read-more {
        font-size: 13px;
        margin-top: auto;
    }
}



/* Filter Section */
#filter-section {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 600px;
}

#filter-section label {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

#filter-section select {
    font-size: 16px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
}

#filter-section select:hover {
    border-color: #00c896;
}

#filter-section select:focus {
    outline: none;
    border-color: #00c896;
    box-shadow: 0 0 5px rgba(0, 200, 150, 0.5);
}

