/* ===================================
   Archive Layout
   =================================== */

.archive-container {
    margin-top: 30px;
}

/* ===================================
   Archive Header - FIXED
   =================================== */

.archive-header {
    text-align: left;
    padding: 10px 0;
    margin-bottom: 20px;
    background-color: transparent;
    border-radius: 0;
    border-bottom: 1px solid #e0e0e0;
}

.archive-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    padding-bottom: 10px;
    color: var(--text-color);
    line-height: 1.2;
}

/* Hide Article Count */
.archive-description {
    display: none !important;
}

/* Archive Separator Line */
.archive-separator {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 0 0 30px 0;
    padding: 0;
}

/* Subcategories Display (Like Tags) */
.category-children {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.category-children a {
    display: inline-block;
    padding: 6px 14px;
    background-color: #f5f5f5;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.category-children a:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* ===================================
   Author Header - FIXED
   =================================== */

.author-header {
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
    padding: 0;
    background: none;
}

.author-avatar-large {
    flex-shrink: 0;
}

.author-avatar-large img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #e8f5e9;
}

.author-header-info {
    flex: 1;
}

.author-header .archive-title {
    text-align: left;
    margin-bottom: 5px;
    font-size: 28px;
}

.author-header .archive-description {
    text-align: left;
    margin: 0;
    display: block !important;
    font-size: 14px;
    color: var(--light-text);
}

/* ===================================
   Archive Grid - FIXED
   =================================== */

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

.grid-post,
.grid-post-item {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.grid-post:hover,
.grid-post-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

/* Thumbnail with Placeholder */
.post-thumbnail,
.grid-post-thumb {
    display: block;
    overflow: hidden;
    position: relative;
    background-color: #e8f5e9;
    min-height: 200px;
}

.post-thumbnail.no-image::before,
.grid-post-thumb.no-image::before {
    content: '\f03e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    font-size: 48px;
    color: #c8e6c9;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.post-thumbnail img,
.grid-post-thumb img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.grid-post:hover .post-thumbnail img,
.grid-post:hover .grid-post-thumb img,
.grid-post-item:hover .post-thumbnail img,
.grid-post-item:hover .grid-post-thumb img {
    transform: scale(1.05);
}

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

/* Post Meta */
.post-meta,
.grid-post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    color: var(--light-text);
    margin-bottom: 12px;
}

/* Category Badge - Auto Color Adjustment */
.post-category {
    display: inline-block;
    background-color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
}

.post-category a {
    text-decoration: none;
}

/* Auto-adjust text color based on background */
.post-category,
.post-category a {
    color: #fff; /* Default for dark primary colors */
}

/* If primary color is light, use dark text */
body.light-primary .post-category,
body.light-primary .post-category a {
    color: #333 !important;
}

/* Hover state - keep text color consistent */
.post-category:hover,
.post-category a:hover {
    color: #fff !important; /* Maintain white text on hover */
}

body.light-primary .post-category:hover,
body.light-primary .post-category a:hover {
    color: #333 !important; /* Maintain dark text on hover for light backgrounds */
}

.post-date {
    font-size: 12px;
    color: var(--light-text);
}

/* Headlines - REDUCED SIZE */
.post-title,
.grid-post-title {
    font-size: 18px;
    line-height: 1.4;
    margin-bottom: 10px;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 2.8em;
}

.post-title a,
.grid-post-title a {
    color: var(--text-color);
    text-decoration: none;
}

.post-title a:hover,
.grid-post-title a:hover {
    color: var(--primary-color);
}

/* Post Excerpt */
.post-excerpt,
.grid-post-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: var(--light-text);
    margin-bottom: 15px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Remove Author Section */
.post-author {
    display: none !important;
}

/* ===================================
   Pagination - HORIZONTAL FIX
   =================================== */

.pagination,
.nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 40px 0;
    padding: 0;
    list-style: none;
}

.pagination .page-numbers,
.nav-links .page-numbers {
    display: inline-block;
    padding: 10px 16px;
    background-color: #fff;
    border: 1px solid #ddd;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
    min-width: 40px;
    text-align: center;
}

.pagination .page-numbers.current,
.nav-links .page-numbers.current {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.pagination .page-numbers:hover,
.nav-links .page-numbers:hover {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.pagination .dots,
.nav-links .dots {
    padding: 10px 16px;
    color: #999;
}

.pagination .prev,
.pagination .next,
.nav-links .prev,
.nav-links .next {
    font-weight: 600;
}

/* ===================================
   No Posts Found
   =================================== */

.no-posts {
    text-align: center;
    padding: 60px 20px;
}

.no-posts h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

.no-posts p {
    font-size: 1.125rem;
    color: var(--light-text);
    margin-bottom: 30px;
}

.no-posts .search-form {
    max-width: 500px;
    margin: 0 auto;
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 1024px) {
    .archive-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .archive-title {
        font-size: 28px;
    }
    
    .post-title,
    .grid-post-title {
        font-size: 17px;
    }
}

@media (max-width: 768px) {
    .archive-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .archive-title {
        font-size: 24px;
    }
    
    .archive-header {
        padding: 10px 0;
        margin-bottom: 20px;
    }
    
    .archive-separator {
        margin: 0 0 20px 0;
    }
    
    .author-header {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .author-header-info {
        text-align: center;
    }
    
    .author-header .archive-title,
    .author-header .archive-description {
        text-align: center;
    }
    
    .author-avatar-large img {
        width: 70px;
        height: 70px;
    }
    
    .post-thumbnail img,
    .grid-post-thumb img {
        height: 180px;
    }
    
    .post-title,
    .grid-post-title {
        font-size: 16px;
    }
    
    .category-children {
        gap: 6px;
    }
    
    .category-children a {
        padding: 5px 12px;
        font-size: 12px;
    }
    
    .pagination .page-numbers,
    .nav-links .page-numbers {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 35px;
    }
}