/* 
Category Posts Grid Styles
Modern card-based layout for category archive pages
*/

/* Category Header */
.category-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
}

.category-title-section {
    max-width: 600px;
    margin: 0 auto;
}

.category-title {
    font-size: 2.5em;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
    font-family: Georgia, "Times New Roman", serif;
}

.category-description {
    font-size: 1.1em;
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 20px;
}

.category-meta {
    color: #95a5a6;
    font-size: 14px;
    font-weight: 500;
}

/* Posts Grid */
.category-posts-grid {
    margin-bottom: 60px;
}

.posts-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* Post Cards */
.category-post-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #f1f3f4;
    position: relative;
}

.category-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Post Thumbnail */
.post-thumbnail {
    position: relative;
    overflow: hidden;
    height: 220px;
    background: #f8f9fa;
}

.post-image-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

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

.post-placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    color: #6c757d;
    font-size: 2em;
}

.post-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-post-card:hover .post-image-overlay {
    opacity: 1;
}

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

.read-more-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2c3e50;
    font-size: 18px;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.category-post-card:hover .read-more-icon {
    transform: scale(1);
}

/* Category Badge */
.category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.20);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: background-color 0.3s ease;
    z-index: 2;
}

.category-badge:hover {
    background: #d4a404;
    color: white;
}

/* Post Content */
.post-content {
    padding: 25px;
}

.post-title {
    margin-bottom: 15px;
}

.post-title a {
    font-size: 1.3em;
    font-weight: 600;
    color: #2c3e50;
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.3s ease;
}

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

/* Post Meta */
.post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #6c757d;
    flex-wrap: wrap;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-meta i {
    font-size: 12px;
    opacity: 0.8;
}

.post-meta a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-meta a:hover {
    color: #2c3e50;
}

/* Post Excerpt */
.post-excerpt {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 15px;
}

/* Read More Link */
.read-more-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #e3b505;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
}

.read-more-link:hover {
    color: #d4a404;
    gap: 8px;
}

.read-more-link i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.read-more-link:hover i {
    transform: translateX(2px);
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin: 50px 0;
}

.load-more-posts {
    background: #e3b505;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
}

.load-more-posts:hover {
    background: #d4a404;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(227, 181, 5, 0.3);
}

.load-more-posts:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Pagination */
.pagination-container {
    text-align: center;
    margin: 50px 0;
}

.page-numbers {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.page-numbers li {
    margin: 0;
}

.page-numbers a,
.page-numbers span {
    display: block;
    padding: 10px 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    text-decoration: none;
    transition: all 0.3s ease;
}

.page-numbers a:hover {
    background: #e3b505;
    color: white;
    border-color: #e3b505;
}

.page-numbers .current {
    background: #e3b505;
    color: white;
    border-color: #e3b505;
}

/* No Posts Found */
.no-posts-found {
    text-align: center;
    padding: 80px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 40px 0;
}

.no-posts-content i {
    font-size: 4em;
    color: #dee2e6;
    margin-bottom: 20px;
}

.no-posts-content h3 {
    color: #6c757d;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.no-posts-content p {
    color: #868e96;
    margin-bottom: 30px;
    font-size: 1.1em;
}

/* Loading State */
.category-posts-grid.loading .posts-grid-container {
    opacity: 0.6;
    pointer-events: none;
}

.load-more-posts.loading {
    position: relative;
    color: transparent;
}

.load-more-posts.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .posts-grid-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .category-title {
        font-size: 2em;
    }
    
    .category-header {
        padding: 30px 20px;
        margin-bottom: 30px;
    }
    
    .post-meta {
        gap: 10px;
        font-size: 12px;
    }
    
    .post-content {
        padding: 20px;
    }
    
    .post-thumbnail {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .posts-grid-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .category-title {
        font-size: 1.8em;
    }
    
    .category-header {
        padding: 25px 15px;
        margin-bottom: 25px;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .category-badge {
        top: 10px;
        left: 10px;
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .load-more-posts {
        padding: 12px 25px;
        font-size: 14px;
    }
}

/* Card Hover Animation */
@media (prefers-reduced-motion: no-preference) {
    .category-post-card {
        animation: fadeInUp 0.6s ease forwards;
        opacity: 0;
        transform: translateY(30px);
    }
    
    .category-post-card:nth-child(1) { animation-delay: 0.1s; }
    .category-post-card:nth-child(2) { animation-delay: 0.2s; }
    .category-post-card:nth-child(3) { animation-delay: 0.3s; }
    .category-post-card:nth-child(4) { animation-delay: 0.4s; }
    .category-post-card:nth-child(5) { animation-delay: 0.5s; }
    .category-post-card:nth-child(6) { animation-delay: 0.6s; }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
