/*
Theme Name: 自动自发成长说
Author: kangsheng
Description: 自动自发家庭教育成长案例展示
Version: 1.0
*/

/* --- 1. 全局重置与基础排版 --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; background-color: #f4f6f8; color: #333; line-height: 1.6; }
a { text-decoration: none; color: #333; transition: color 0.3s; }
a:hover { color: #0073aa; }

/* --- 2. 顶部导航区 --- */
.site-header { 
    background: #fff; 
    padding: 20px 0; 
    border-bottom: 1px solid #eee; 
    margin-bottom: 30px; 
}
.header-inner { max-width: 1000px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
.site-title a { font-size: 24px; font-weight: bold; color: #0073aa; }
.main-nav ul { list-style: none; display: flex; gap: 20px; }
.main-nav a { font-size: 16px; font-weight: 500; }

/* --- 3. 主体内容区 (左右分栏布局) --- */
.container { max-width: 1000px; margin: 0 auto; padding: 0 20px; display: flex; gap: 30px; }
.content-area { flex: 3; } /* 左侧主内容占 3 份 */
.sidebar-area { flex: 1; } /* 右侧边栏占 1 份 */

/* --- 4. 单列卡片流样式 --- */
.post-card { background: #fff; padding: 25px; border-radius: 8px; margin-bottom: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.post-card h2 { font-size: 20px; margin-bottom: 10px; }
.post-meta { font-size: 13px; color: #888; margin-bottom: 10px; }
.post-excerpt { font-size: 15px; color: #555; margin-bottom: 15px; }
.read-more { display: inline-block; padding: 6px 15px; background: #0073aa; color: #fff; border-radius: 4px; font-size: 14px; }
.read-more:hover { background: #005a87; color: #fff; }

/* --- 5. 侧边栏样式 --- */
.widget { background: #fff; padding: 20px; border-radius: 8px; margin-bottom: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.widget h3 { font-size: 16px; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid #0073aa; }
.widget ul { list-style: none; }
.widget li { margin-bottom: 8px; font-size: 14px; }

/* --- 6. 底部版权区 --- */
.site-footer { text-align: center; padding: 30px 0; margin-top: 40px; color: #888; font-size: 13px; border-top: 1px solid #eee; }

/* --- 7. 单篇文章页专属样式 --- */
.single-title { font-size: 26px; margin-bottom: 15px; line-height: 1.4; color: #222; }
.single-meta { margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px dashed #ddd; }

/* 正文排版优化：提升长文阅读体验 */
.single-content { font-size: 16px; line-height: 1.8; color: #444; }
.single-content p { margin-bottom: 15px; }
.single-content h2 { font-size: 20px; margin: 25px 0 15px; color: #0073aa; }
.single-content h3 { font-size: 18px; margin: 20px 0 10px; }
.single-content img { max-width: 100%; height: auto; border-radius: 6px; margin: 15px 0; }
.single-content ul, .single-content ol { padding-left: 20px; margin-bottom: 15px; }

/* 底部专家提示框样式 */
.author-note { margin-top: 30px; padding: 20px; background-color: #f9f9f9; border-left: 4px solid #0073aa; border-radius: 4px; font-size: 14px; color: #555; line-height: 1.6; }
.author-note strong { color: #0073aa; margin-bottom: 8px; display: block; }

/* --- 8. 分类列表页专属样式 --- */
.archive-header { background: #fff; padding: 25px; border-radius: 8px; margin-bottom: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.archive-title { font-size: 22px; color: #0073aa; margin-bottom: 8px; }
.archive-desc { font-size: 14px; color: #666; margin: 0; }

/* --- 9. 移动端响应式适配 (统一整理) --- */
@media screen and (max-width: 768px) {
    /* 1. 主体布局：左右分栏变为上下堆叠 */
    .container { flex-direction: column; gap: 20px; }
    
    /* 2. 顶部导航：变为垂直居中，防止菜单被挤出屏幕 */
    .header-inner { flex-direction: column; gap: 15px; text-align: center; }
    .main-nav ul { flex-wrap: wrap; justify-content: center; gap: 10px; }
    
    /* 3. 文章卡片：缩小内边距 */
    .post-card { padding: 18px; margin-bottom: 15px; }
    .post-card h2 { font-size: 18px; }
    .post-excerpt { font-size: 14px; }
    
    /* 4. 单篇文章详情页：优化长文阅读体验 */
    .single-title { font-size: 22px; }
    .single-content { font-size: 15px; line-height: 1.7; }
    .single-content img { border-radius: 4px; }
    
    /* 5. 分类页标题：缩小字号 */
    .archive-header { padding: 18px; }
    .archive-title { font-size: 18px; }
    
    /* 6. 分页导航：缩小间距 */
    .pagination-wrap .page-numbers { padding: 6px 10px; font-size: 13px; }
}

/* --- 10. 分页导航样式 --- */
.pagination-wrap { margin-top: 30px; margin-bottom: 20px; }
.pagination-wrap .nav-links { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.pagination-wrap .page-numbers { display: inline-block; padding: 8px 14px; background: #fff; border-radius: 4px; font-size: 14px; color: #555; box-shadow: 0 2px 5px rgba(0,0,0,0.05); transition: all 0.3s; }
.pagination-wrap .page-numbers:hover { background: #0073aa; color: #fff; }
.pagination-wrap .page-numbers.current { background: #0073aa; color: #fff; cursor: default; }
.pagination-wrap .page-numbers.current:hover { background: #0073aa; color: #fff; }

/* --- 11. 上一篇/下一篇导航样式 --- */
.post-navigation { 
    display: flex; 
    justify-content: space-between; 
    margin-top: 40px;      /* 增加一点顶部距离，替代原来的虚线 */
    padding-top: 0;        /* 不需要内边距了 */
    /* border-top: 1px dashed #ddd; 已删除虚线 */
}
.post-navigation a { display: inline-block; padding: 10px 20px; background: #f9f9f9; border-radius: 4px; font-size: 14px; color: #555; transition: all 0.3s; }
.post-navigation a:hover { background: #0073aa; color: #fff; }

/* --- 12. 首页精选案例区样式 --- */
.featured-posts-wrap { margin-bottom: 30px; }
.section-title { font-size: 20px; color: #0073aa; margin-bottom: 15px; padding-left: 10px; border-left: 4px solid #0073aa; }
.featured-posts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.featured-card { border-top: 3px solid #0073aa; }

/* --- 13. 文章相关推荐样式 --- */
.related-posts-wrap { margin-top: 30px; padding-top: 20px; border-top: 1px dashed #ddd; }
.related-posts-list { list-style: none; padding: 0; margin-top: 15px; }
.related-posts-list li { margin-bottom: 10px; padding-left: 15px; position: relative; font-size: 15px; }
.related-posts-list li::before { content: "•"; color: #0073aa; position: absolute; left: 0; font-weight: bold; }
.related-posts-list a { color: #333; transition: color 0.3s; }
.related-posts-list a:hover { color: #0073aa; }

/* --- 14. 点赞/收藏按钮样式 --- */
.post-like-wrap { margin-top: 25px; text-align: center; padding: 20px 0; border-top: 1px dashed #ddd; }
.post-like-wrap .simplefavorite-button { 
    display: inline-block; 
    padding: 12px 25px; 
    background-color: #f9f9f9; 
    border: 1px solid #ddd; 
    border-radius: 30px; 
    font-size: 15px; 
    color: #555; 
    cursor: pointer; 
    transition: all 0.3s; 
}
.post-like-wrap .simplefavorite-button:hover { 
    background-color: #0073aa; 
    color: #fff; 
    border-color: #0073aa; 
}

/* --- 15. 终极修复：强制栏目间距 (针对本主题结构优化) --- */

/* 1. 针对单篇文章/页面内容区域内部的栏目 */
.single-content .wp-block-columns {
    display: flex !important; /* 确保它是弹性布局 */
    flex-wrap: wrap !important; /* 允许换行 */
    gap: 30px !important;       /* 【关键】强制设置间距为 30px */
    margin-bottom: 30px !important; /* 底部留白 */
}

/* 2. 针对每一个具体的列 (防止列之间粘连) */
.single-content .wp-block-column {
    flex-grow: 1;
    flex-basis: 0; /* 让列自动平分宽度 */
    min-width: 0;  /* 防止内容溢出撑破布局 */
    margin-left: 0 !important; /* 清除旧版 WordPress 可能加的负边距 */
    margin-right: 0 !important;
}

/* 3. 移动端适配 (手机上看不能太挤，也不能太宽) */
@media (max-width: 768px) {
    .single-content .wp-block-columns {
        gap: 20px !important; /* 手机端间距缩小到 20px */
        flex-direction: column !important; /* 手机上强制上下排列 */
    }
    
    .single-content .wp-block-column {
        flex-basis: 100% !important; /* 手机上每列占满 100% 宽度 */
        width: 100% !important;
    }
}

/* 4. 特殊处理：右侧介绍区美化 */
.wp-block-column:last-child {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eeeeee;
    /* 注意：这里不需要加 margin，因为父级已经加了 gap */
}