.hep-post-archive {
    width: 100%;
    padding: 20px 0;
}

.post-archive-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, 1fr);
}

/* Column variations */
.hep-post-archive.columns-1 .post-archive-grid {
    grid-template-columns: 1fr;
}

.hep-post-archive.columns-2 .post-archive-grid {
    grid-template-columns: repeat(2, 1fr);
}

.hep-post-archive.columns-3 .post-archive-grid {
    grid-template-columns: repeat(3, 1fr);
}

.hep-post-archive.columns-4 .post-archive-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* Post Card */
.post-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #f5f5f5;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 280px;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.post-card-link {
    display: block;
    position: relative;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Image */
.post-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

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

.post-card:hover .post-card-image img {
    transform: scale(1.05);
}

/* Overlay */
.post-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.post-card:hover .post-card-overlay {
    opacity: 0.8;
}

/* Content */
.post-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    z-index: 2;
}

.post-card-category {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 12px;
}

.post-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-excerpt {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 12px 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta */
.post-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.post-date {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-date svg {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

.post-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.post-arrow svg {
    width: 20px;
    height: 20px;
}

.post-card:hover .post-arrow {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-4px);
}

/* RTL Support */
[dir="rtl"] .post-card:hover .post-arrow {
    transform: translateX(4px);
}

/* Responsive */
@media (max-width: 1024px) {
    .hep-post-archive.columns-4 .post-archive-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .post-archive-grid,
    .hep-post-archive.columns-2 .post-archive-grid,
    .hep-post-archive.columns-3 .post-archive-grid,
    .hep-post-archive.columns-4 .post-archive-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .post-card {
        height: 240px;
    }

    .post-card-content {
        padding: 16px;
    }

    .post-card-title {
        font-size: 16px;
    }

    .post-card-excerpt {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .post-archive-grid,
    .hep-post-archive.columns-2 .post-archive-grid,
    .hep-post-archive.columns-3 .post-archive-grid,
    .hep-post-archive.columns-4 .post-archive-grid {
        grid-template-columns: 1fr;
    }

    .post-card {
        height: 220px;
    }
}

/* No posts message */
.hep-post-archive > p {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* Pagination Styles */
.post-archive-pagination {
    margin-top: 40px;
    text-align: center;
}

/* Number Pagination */
.pagination-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination-link:hover {
    background: #6366f1;
    color: #ffffff;
    border-color: #6366f1;
    transform: translateY(-2px);
}

.pagination-link.current {
    background: #6366f1;
    color: #ffffff;
    border-color: #6366f1;
    pointer-events: none;
}

.pagination-link.dots {
    border: none;
    background: transparent;
    pointer-events: none;
}

/* Load More Button */
.load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    background: #6366f1;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.load-more-btn:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.load-more-btn:active {
    transform: translateY(0);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    color: #6366f1;
    font-size: 15px;
    font-weight: 500;
}

.loading-spinner::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Infinite Scroll Trigger */
.infinite-scroll-trigger {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive Pagination */
@media (max-width: 768px) {
    .pagination-link {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 13px;
    }

    .load-more-btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    .post-archive-pagination {
        margin-top: 30px;
    }
}

@media (max-width: 480px) {
    .pagination-numbers {
        gap: 6px;
    }

    .pagination-link {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 12px;
    }
}
