/* Category Posts Grid Styles */

.category-posts-grid-wrapper {
    width: 100%;
}


/* Filter Tabs */
.category-filter-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.filter-tab {
    padding: 12px 28px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #1F2937;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
}

.filter-tab:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    transform: translateY(-2px);
    color: #1F2937;
}

.filter-tab.active {
    background: #DC2626;
    color: #FFFFFF;
    border-color: #DC2626;
}

.filter-tab.active:hover {
    color: #FFFFFF;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(var(--posts-grid-columns, 3), 1fr);
    gap: 30px;
    align-items: start;
}

/* Individual Post Item */
.grid-post-item {
    background: white;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.grid-post-item.hidden {
    display: none;
}

.grid-post-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
    border: #BA343B solid 1px;
}

/* Post Image */
.grid-post-image {
    position: relative;
    overflow: hidden;
    height: 280px;
    padding: 16px;
}

.grid-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Date Badge */
.grid-post-date {
    position: absolute;
    top: 18px;
    left: 18px;
    background: #BA343B;
    color: white;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    min-width: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.date-day {
    display: block;
    font-size: 18px;
    line-height: 1;
    font-weight: 700;
    width: 100%;
    padding-top: 10px;
    background: black;
}

.date-month {
    display: block;
    font-size: 11px;
    margin-top: 3px;
    opacity: 0.95;
    font-weight: 500;
    padding-bottom: 10px;
}

/* Post Content */
.grid-post-content {
    padding: 28px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.grid-post-category {
    background: #F3F4F6;
    color: #6B7280;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    margin-bottom: 14px;
    width: fit-content;
}

.grid-post-category:hover {
    background: #421AFF;
    color: white;
}

.grid-post-title {
    margin: 0 0 14px 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    color: #1F2937;
}

.grid-post-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.grid-post-title a:hover {
    color: #421AFF;
}

.grid-post-excerpt {
    color: #6B7280;
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 16px 0;
    flex: 1;
}

.grid-post-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 13px;
    color: #9CA3AF;
    margin-top: auto;
}

.grid-post-meta span:not(:last-child)::after {
    content: "•";
    margin-left: 12px;
    color: #D1D5DB;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .category-posts-grid-wrapper {
    }
    
    .category-filter-tabs {
        gap: 10px;
        margin-bottom: 30px;
    }
    
    .filter-tab {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .grid-post-image {
        height: 180px;
    }
    
    .grid-post-content {
        padding: 16px;
    }
    
    .grid-post-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .category-filter-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
    }
    
    .filter-tab {
        flex-shrink: 0;
    }
}

/* Grid Pagination */
.grid-pagination {
    margin-top: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* Page Numbers List in the Middle */
.page-numbers-list {
    flex: 1;
    display: flex;
    justify-content: center;
}

.page-numbers-list .page-numbers {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    align-items: center;
}

.page-numbers-list .page-numbers li {
    list-style: none;
}

.page-numbers-list a.page-numbers,
.page-numbers-list span.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    color: #1F2937;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.page-numbers-list a.page-numbers:hover {
    background: #F3F4F6;
    border-color: #D1D5DB;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.page-numbers-list span.page-numbers.current {
    background: #421AFF !important;
    color: white !important;
    border-color: #421AFF !important;
}

.page-numbers-list .page-numbers.dots {
    border: none;
    background: transparent;
    pointer-events: none;
    min-width: auto;
}

/* Prev/Next Buttons on Sides */
.grid-pagination > .page-numbers.prev,
.grid-pagination > .page-numbers.next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    color: #1F2937;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.grid-pagination > a.page-numbers.prev:hover,
.grid-pagination > a.page-numbers.next:hover {
    background: #F3F4F6;
    border-color: #D1D5DB;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.grid-pagination > .page-numbers.prev.disabled,
.grid-pagination > .page-numbers.next.disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
}

/* Responsive Pagination */
@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .grid-pagination {
        margin-top: 40px;
        gap: 12px;
    }
    
    .page-numbers-list a.page-numbers,
    .page-numbers-list span.page-numbers {
        min-width: 36px;
        height: 36px;
        font-size: 14px;
        padding: 0 8px;
    }
    
    .grid-pagination > .page-numbers.prev,
    .grid-pagination > .page-numbers.next {
        padding: 10px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .post-card {
        border-radius: 8px;
    }
    
    .post-card:hover {
        transform: translateY(-3px);
    }
    
    .post-image {
        height: 140px;
    }
    
    .post-title {
        font-size: 14px;
    }
    
    .post-excerpt {
        font-size: 13px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .grid-pagination {
        gap: 8px;
    }
    
    .grid-pagination > .page-numbers.prev,
    .grid-pagination > .page-numbers.next {
        padding: 8px 12px;
        font-size: 13px;
    }
}
