/**
 * Wiki 文档首页样式
 * 用于 page-wiki-home.php 模板
 *
 * @package WordPress
 * @subpackage Wiki Doc System
 * @since 1.0.0
 */

/* ========================================
   通用样式
   ======================================== */

.title.excerpts-title {
    border-radius: 6px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
}

.title.excerpts-title h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    line-height: 1;
}

.title.excerpts-title h3 .icon {
    font-size: 16px;
    line-height: 1;
}

.wiki-home-wiki-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tb--line, #e0e0e0);
}

.wiki-home-wiki-heading .icon {
    font-size: 16px;
    line-height: 1;
}

.wiki-home-section {
    margin-bottom: 40px;
    padding: 0 0 20px 0;
}

.wiki-home-section:last-child {
    margin-bottom: 0;
}

/* ========================================
   博客文章区域
   ======================================== */

.wiki-home-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.wiki-home-post-card {
    display: flex;
    align-items: stretch;
    background: var(--tb--white, #fff);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid var(--tb--line, #e0e0e0);
}

.wiki-home-post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.wiki-home-post-thumb {
    flex-shrink: 0;
    width: 120px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--tb--tint, #f8f9fa);
}

.wiki-home-post-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.wiki-home-post-content {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.wiki-home-post-title {
    margin: 0 0 6px 0;
    font-size: 14px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wiki-home-post-title a {
    color: var(--tb--main, #333);
    text-decoration: none;
    transition: color 0.2s ease;
}

.wiki-home-post-title a:hover {
    color: var(--tb--main, #007bff);
}

.wiki-home-post-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--tb--gray, #999);
}

.wiki-home-post-excerpt {
    flex: 1;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--tb--base, #ccc);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   Wiki 文档区域
   ======================================== */

.wiki-home-category {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--tb--white, #fff);
    border-radius: 6px;
    border: 1px solid var(--tb--line, #e0e0e0);
}

.wiki-home-category:last-child {
    margin-bottom: 0;
}

.wiki-home-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--tb--main, #007bff);
}

.wiki-home-category-title {
    margin: 0;
    font-size: 18px;
    color: var(--tb--main, #333);
}

.wiki-home-category-count {
    font-size: 14px;
    color: var(--tb--gray, #999);
    font-weight: normal;
}

.wiki-home-category-more {
    color: var(--tb--main, #007bff);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.wiki-home-category-more:hover {
    color: var(--tb--main, #0056b3);
    text-decoration: underline;
}

.wiki-home-wiki-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (min-width: 1400px) {
    .wiki-home-wiki-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.wiki-home-wiki-card {
    background: var(--tb--tint, #f8f9fa);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--tb--line, #e0e0e0);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.wiki-home-wiki-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wiki-home-wiki-thumb {
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--tb--tint, #f0f0f0);
    border-radius: 4px;
}

.wiki-home-wiki-thumb img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.wiki-home-wiki-card:hover .wiki-home-wiki-thumb img {
    transform: scale(1.05);
}

.wiki-home-wiki-content {
    padding: 8px 10px 10px;
    text-align: center;
}

.wiki-home-wiki-title {
    margin: 0;
    font-size: 13px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wiki-home-wiki-title a {
    color: var(--tb--main, #333);
    text-decoration: none;
    transition: color 0.2s ease;
}

.wiki-home-wiki-title a:hover {
    color: var(--tb--main, #007bff);
}

/* ========================================
   响应式设计
   ======================================== */

/* 平板端 (768px - 1024px) */
@media (max-width: 1024px) {
    .wiki-home-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .wiki-home-wiki-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
}

/* 手机端 (<768px) */
@media (max-width: 768px) {
    .wiki-home-section {
        margin-bottom: 30px;
        padding: 15px 0;
    }
    
    .wiki-home-posts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .wiki-home-category {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .wiki-home-wiki-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    
    .wiki-home-wiki-title {
        font-size: 12px;
    }
    
    .wiki-home-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ========================================
   深色模式支持
   DUX 主题通过 .darking:root 重新定义 CSS 变量
   我们的样式使用 CSS 变量，会自动跟随主题切换
   ======================================== */
