/**
 * ==========================================================================
 * Archive & Search Grid Stylesheet - K-Tech Child Theme
 * ==========================================================================
 */

.ktech-archive-wrapper {
    padding: 20px 0 60px;
    background-color: #ffffff;
    width: 100%;
}

/* 1. Header */
.ktech-archive-header {
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eef2f6;
}

.ktech-archive-subtitle {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color, #003366);
    margin-bottom: 6px;
    display: block;
}

.ktech-archive-title {
    font-size: 28px;
    font-weight: 700;
    color: #003366;
    margin: 0 0 10px;
    line-height: 1.3;
}

.ktech-archive-desc {
    font-size: 15px;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
    max-width: 800px;
}

/* 2. Grid Container (3 cols desktop, 2 cols tablet, 1 col mobile) */
.ktech-post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
    width: 100%;
}

/* 3. Card Item */
.ktech-post-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.ktech-post-card:hover {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
    border-color: #cbd5e1;
}

/* 4. Thumbnail */
.ktech-post-card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background-color: #f1f5f9;
}

.ktech-post-card-thumb-link {
    display: block;
    width: 100%;
    height: 100%;
}

.ktech-post-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

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

.ktech-post-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f5f9;
    color: #94a3b8;
}

/* 5. Body */
.ktech-post-card-body {
    padding: 18px 18px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ktech-post-card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px;
}

.ktech-post-card-title a {
    color: #003366;
    text-decoration: none;
    transition: color 0.2s;
}

.ktech-post-card-title a:hover {
    color: var(--primary-color, #e65100);
}

.ktech-post-card-excerpt {
    font-size: 13.5px;
    line-height: 1.55;
    color: #4b5563;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 60px;
    flex: 1;
}

.ktech-post-card-readmore-wrap {
    margin-top: auto;
}

.ktech-post-card-readmore {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-color, #b31b34);
    text-decoration: none;
    transition: all 0.2s;
}

.ktech-post-card-readmore:hover {
    opacity: 0.8;
    transform: translateX(2px);
}

/* 6. Footer (Date) */
.ktech-post-card-footer {
    padding: 10px 18px;
    border-top: 1px solid #f1f5f9;
    background-color: #ffffff;
    font-size: 12.5px;
    color: #8c96a4;
}

/* 7. Pagination */
.ktech-archive-pagination {
    margin-top: 45px;
    text-align: center;
}

.ktech-archive-pagination .pagination,
.ktech-archive-pagination .nav-links {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.ktech-archive-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 4px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.ktech-archive-pagination .page-numbers:hover,
.ktech-archive-pagination .page-numbers.current {
    background: #003366;
    color: #ffffff;
    border-color: #003366;
}

/* 8. Empty state */
.ktech-archive-empty {
    text-align: center;
    padding: 50px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.ktech-archive-empty h3 {
    font-size: 18px;
    color: #003366;
    margin-bottom: 8px;
}

.ktech-archive-empty p {
    color: #64748b;
    margin: 0;
}

/* 9. Responsive */
@media (max-width: 991px) {
    .ktech-post-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .ktech-post-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .ktech-post-card-title,
    .ktech-post-card-excerpt {
        min-height: auto;
    }
    .ktech-archive-title {
        font-size: 22px;
    }
}
