/* 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;
    min-width: 0;
}

/* 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 */
}


.blog-post.featured .blog-content p {
    display: block !important;
    overflow: visible !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: initial !important;
    font-size: 19px;
  }
  
  .stacked .blog-content p:not(.meta) {
    display: block !important;
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
}

  

/* 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);
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .posts-container {
        grid-template-columns: 1fr 1fr;
    }

    .blog-post.featured {
        grid-column: span 2;
        grid-row: span 1;
    }

    .blog-post.stacked {
        flex-direction: column;
        grid-column: span 2;
        height: auto;
    }

    .blog-post.stacked .blog-image {
        width: 100%;
        height: 220px;
        border-radius: 12px 12px 0 0;
    }
}

@media (max-width: 768px) {
    .posts-container {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        padding: 16px;
    }

    .blog-post.featured {
        grid-column: span 1;
        grid-row: span 1;
    }

    .blog-post.stacked {
        grid-column: span 1;
    }

    .blog-post.featured .blog-title,
    .blog-post.stacked .blog-title {
        font-size: 22px;
    }

    .blog-post.featured .blog-content p,
    .blog-post.stacked .blog-content p {
        font-size: 16px;
    }

    #filter-section {
        margin-inline: 16px;
    }

    #filter-section label,
    #filter-section select {
        width: 100%;
    }
}

/* 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);
}

.featured .blog-content p:not(.meta) {
    display: block !important;
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
}

.blog-post.stacked:first-of-type .blog-content p:not(.meta) {
    display: block !important;
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
  }

/* Larger title for stacked posts */
.blog-post.stacked .blog-title {
    font-size: 24px;
}

/* Larger paragraph for stacked posts */
.blog-post.stacked .blog-content p {
    font-size: 17px;
    line-height: 1.6;
}
