/**
 * AJAX Posts Grid Styles
 * 
 */

body .ajax-posts-grid-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 0px;
    direction: rtl;
}
body .ajax-posts-grid-wrapper h3{
	font-weight: 500 !important;
}
.post-category a {
    font-size: 18px;
    color: #606060;
    background: #E8E8E8;
    border-radius: 5px;
    padding: 5px 10px;
    display: inline-block;
    margin-bottom: 5px;
    font-weight: 500;
}
/* Header Section */
.grid-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
}
.ajax-posts-grid-wrapper .search-container {
    transform: none !important;
}

/* Search Container */
.search-container {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    position: relative;
    align-items: center;
    width: fit-content;
}

.posts-search-input {
    flex: 0 0 245px;
    font-size: 14px;
    transition: all 0.3s ease;
    padding: 10px 50px 10px 10px !important;
    height: 50px;
    border-color: #E8E8E8 !important;
    border-radius: 7px !important;
    background: #e8e8e85c;
    color: #777777;
}

.posts-search-input:focus {
    outline: none;
    border-color: #4db8a8;
    box-shadow: 0 0 0 3px rgba(77, 184, 168, 0.1);
}

.search-button {
    padding: 10px;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    background: transparent;
}

/* Categories Tabs */
.categories-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 0px 0px 0px 0px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    padding: 10px 5px;
    color: #333;
    background-color: transparent;
    border: 2px solid transparent;
    cursor: pointer;
    border-bottom: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-top-right-radius: 5px;
    border-top-left-radius: 5px;
}

.tab-btn:hover {
    background-color: #29929747;
    color: #364B5E;
    border-color: #299297;
    border-bottom: none;
}

.tab-btn.active {
    background-color: #29929747;
    color: #364B5E;
    border-color: #299297;
    border-bottom: none;
}

/* Posts Grid Container */
.posts-grid-container {
    position: relative;
    min-height: 400px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

/* Post Item */
.ajax-post-item {
    background: #fff;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.ajax-post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.post-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

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

.ajax-post-item:hover .post-thumbnail img {
    transform: scale(1.1);
}

.post-content {
    padding: 15px 5px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-title {
    font-size: 20px;
    margin: 0 0 12px 0;
    line-height: 1.4;
    color: #141414;
}

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

.post-title a:hover {
    color: #4db8a8;
}

.post-excerpt {
    color: #595959;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
    flex: 1;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.post-date {
    font-size: 15px;
    color: #8E8E8E;
    font-weight: 500;
}

.read-more-link {
    color: #4db8a8;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.read-more-link:hover {
    color: #3da091;
}

/* No Posts Message */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
    grid-column: 1 / -1;
}

/* Loading Spinner */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4db8a8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.load-more-btn {
    padding: 15px 50px;
    background-color: #299297;
    color: white;
    border: none;
    border-radius: 0px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background-color: #3da091;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(77, 184, 168, 0.3);
}

.load-more-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.load-more-btn.hidden {
    display: none;
}

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

@media (max-width: 768px) {
	
	.ajax-posts-grid-wrapper .search-container {
		display:none;
	}
    .search-container {
        flex-direction: column;
		margin-top: 30px;
    }
    
    .posts-search-input {
        flex: 1;
        width: 100%;
    }
        .grid-header {
        flex-direction: column;
        overflow: hidden;
    }
    .categories-tabs {
        justify-content: flex-start;
        flex-wrap: nowrap;
        white-space: nowrap;
        margin-bottom: 20px;
        overflow: scroll;
        padding-bottom: 10px;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .post-thumbnail {
        height: 180px;
    }
}