/*
 Theme Name:   GeneratePress Child
 Theme URI:    http://example.com/generatepress-child/
 Description:  GeneratePress Child Theme
 Author:       您的名字
 Author URI:   http://example.com
 Template:     generatepress
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  generatepress-child
*/

/* 在这里添加您的自定义CSS样式 */
/* 图片居左、标题和摘要居右布局 */
.post.has-post-thumbnail .entry-content-area {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px;
    margin-top: 0; /* 去掉上边距，因为标题已经包含在内 */
}

.post.has-post-thumbnail .entry-content-area .post-image {
    flex: 0 0 40%;
    max-width: 40%;
    margin: 0;
}

.post.has-post-thumbnail .entry-content-area .post-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 5px;
}

.post.has-post-thumbnail .entry-content-area .entry-text-content {
    flex: 0 0 calc(60% - 20px);
    max-width: calc(60% - 20px);
}

/* 标题样式调整 */
.post.has-post-thumbnail .entry-content-area .entry-header {
    margin-bottom: 15px;
}

.post.has-post-thumbnail .entry-content-area .entry-title {
    margin: 0 0 10px 0;
    font-size: 1.4em;
    line-height: 1.3;
}

.post.has-post-thumbnail .entry-content-area .entry-title a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s ease;
}

.post.has-post-thumbnail .entry-content-area .entry-title a:hover {
    color: #0073aa;
}

/* 摘要样式 */
.post.has-post-thumbnail .entry-content-area .entry-summary {
    line-height: 1.6;
    color: #666;
}
/* 调整没有图片的文章标题大小 */
.entry-content-area > .entry-text-content .entry-title {
    font-size: 1.5em; /* 初始值，你可以调整这个数字 */
    line-height: 1.3;
    margin-bottom: 10px;
}
/* 调整有图片文章的标题和摘要间距 */
.post.has-post-thumbnail .entry-content-area .entry-text-content {
    padding-top: 0; /* 移除可能存在的上边距 */
}

.post.has-post-thumbnail .entry-content-area .entry-header {
    margin-bottom: 8px !important; /* 减少标题底部间距 */
}

.post.has-post-thumbnail .entry-content-area .entry-summary {
    margin-top: 0 !important; /* 确保摘要顶部没有额外间距 */
    padding-top: 0 !important;
}

/* 确保段落间距合适 */
.post.has-post-thumbnail .entry-content-area .entry-summary p {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    line-height: 1.5;
}
/* 移动端响应式调整 */
@media (max-width: 768px) {
    .post.has-post-thumbnail .entry-content-area {
        flex-direction: column;
        gap: 15px;
    }
    
    .post.has-post-thumbnail .entry-content-area .post-image,
    .post.has-post-thumbnail .entry-content-area .entry-text-content {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .post.has-post-thumbnail .entry-content-area .entry-title {
        font-size: 1.2em;
    }
}

/* 为没有图片的文章保持原有样式 */
.post:not(.has-post-thumbnail) .entry-summary {
    margin-top: 15px;
}

/* 确保所有文章标题都显示 */
.entry-header {
    display: block !important;
}
/* 简洁子分类列表样式 */
.child-categories-list {
  margin: 20px 0;
  background-color: var(--base-3);
  padding: 20px;
}
.child-categories-list ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.child-categories-list ul li a {
  text-decoration: none;
  color: var(--accent);
  padding: 5px 12px;
  display: block;
  transition: color 0.2s ease;
}
.child-categories-list ul li a:hover {
  color: var(--contrast);
  text-decoration: underline;
}
/* 移动端适配 */
@media (max-width: 768px) {
  .child-categories-list {
    padding: 15px;
  }
  
  .child-categories-list ul {
    gap: 8px;
  }
}
/* 移动端标题大小调整 */
@media (max-width: 768px) {
    /* 文章页主标题 h1 */
    .single .entry-title {
        font-size: 1.4em !important;
        line-height: 1.3;
        margin-bottom: 15px;
    }
    
    /* 文章内容中的 h2 标题 */
    .entry-content h2 {
        font-size: 1.3em !important;
        line-height: 1.3;
        margin-top: 25px;
        margin-bottom: 15px;
    }
    
    /* 文章内容中的 h3 标题 */
    .entry-content h3 {
        font-size: 1.2em !important;
        line-height: 1.3;
        margin-top: 20px;
        margin-bottom: 12px;
    }
    
    /* 保持 h4、h5 原有大小或微调 */
    .entry-content h4 {
        font-size: 1.1em !important;
        margin-top: 18px;
        margin-bottom: 10px;
    }
    
    .entry-content h5 {
        font-size: 1em !important;
        margin-top: 15px;
        margin-bottom: 8px;
    }
}
/* 移动端评论标题大小调整 */
@media (max-width: 768px) {
    .comments-title {
        font-size: 1.2em !important;
        line-height: 1.3;
        margin-bottom: 20px;
        text-align: center;
    }
    
    /* 同时调整评论回复标题 */
    .comment-reply-title {
        font-size: 1.1em !important;
        line-height: 1.3;
        margin-bottom: 15px;
    }
}
/* 修复移动端搜索按钮文字换行问题 */
.wp-block-search__button {
    white-space: nowrap !important; /* 强制文字不换行 */
    min-width: auto !important; /* 取消最小宽度限制 */
    padding-left: 1em !important; /* 调整左侧内边距 */
    padding-right: 1em !important; /* 调整右侧内边距 */
}
/* 或者更精确地针对移动端 */
@media (max-width: 768px) {
    .wp-block-search__button {
        white-space: nowrap !important;
        min-width: auto !important;
        padding-left: 0.8em !important;
        padding-right: 0.8em !important;
        font-size: 0.9em !important; /* 可选：微调字体大小 */
    }
}
.wp-block-categories-list.wp-block-categories {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2列等宽 */
    gap: 10px; /* 调整列间距 */
}
/* 移动端侧边栏小工具标题大小调整 */
@media (max-width: 768px) {
    .widget-area .wp-block-heading,
    .sidebar .wp-block-heading,
    #right-sidebar .wp-block-heading {
        font-size: 1.4em !important;
        line-height: 1.2;
        margin-bottom: 12px;
        font-weight: 600;
    }
    
    /* 更精确的选择器，确保只影响侧边栏 */
    .widget .wp-block-heading,
    .widget_block .wp-block-heading {
        font-size: 1.4em !important;
    }
}
/* 自定义底部样式 */
.site-footer {
    background-color: #f8f9fa;
    border-top: 0px solid #eaeaea;
    padding: 20px 0;
    margin-top: 0px;
    font-size: 14px;
    line-height: 1.6;
    color: #6c757d;
}

.inside-site-info {
    text-align: center;
}

.copyright-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 通用链接行样式 */
.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 5px 0;
}

.footer-links a {
    color: #495057;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.footer-links a:hover,
.footer-links a:focus {
    color: #007cba;
    text-decoration: underline;
}

.disclaimer {
    font-style: italic;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 响应式设计：在移动设备上调整布局 */
@media (max-width: 768px) {
    .copyright-bar {
        gap: 8px;
    }
    
    /* 手机端：页面链接行保持水平排列并可换行 */
    .footer-pages {
        gap: 10px;
        flex-direction: row;
    }
    
    /* 手机端：备案信息链接行垂直排列 */
    .footer-icp {
        flex-direction: column;
        gap: 5px;
    }
    
    .site-footer {
        font-size: 13px;
        padding: 15px 0;
    }
}
