/*
 Theme Name:   Astra Child
 Theme URI:    https://hubcn.com
 Description:  Astra Child Theme for HubCN
 Author:       HubCN
 Author URI:   https://hubcn.com
 Template:     astra
 Version:      1.0.3
*/

/* 移除标签页、分类页的 archive description 标题区域 */
.ast-archive-description,
.ast-archive-title,
header.ast-archive-header,
.page-header.ast-archive-description {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 移除面包屑和文章块之间的留白 */
body.archive .ast-container {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

body.archive #content .ast-container {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

body.archive .ast-breadcrumbs-wrapper {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

body.archive #primary {
    padding-top: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

body.archive .site-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

body.archive #content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

body.archive .ast-row:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.archive .ast-article-post:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* 删除搜索页面 #primary 的 margin */
body.search #primary {
    margin: 0 !important;
}

/* 删除单篇文章页面 #primary 的 margin */
body.single #primary {
    margin: 0 !important;
}

/* ===== 统一分页样式 - 让 all-articles 页面分页与分类页面一致 ===== */
/* 为没有 ast-pagination 包装器的分页应用相同样式 */
.ast-pagination {
    text-align: center !important;
    margin: 2em 0 !important;
}

.ast-pagination .nav-links {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5em !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
}

.ast-pagination .page-numbers {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 2.5em !important;
    height: 2.5em !important;
    padding: 0 0.75em !important;
    border-radius: 4px !important;
    background: #f0f0f0 !important;
    color: #333 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
}

.ast-pagination .page-numbers:hover,
.ast-pagination .page-numbers.current {
    background: #0274be !important;
    color: #fff !important;
}

.ast-pagination .page-numbers.dots {
    background: transparent !important;
    color: #666 !important;
    cursor: default !important;
}

/* 修改 Next/Previous 按钮的箭头为 Astra 风格的 → */
.ast-pagination .next.page-numbers,
.ast-pagination .prev.page-numbers {
    font-family: Arial, sans-serif !important;
    font-weight: bold !important;
}

/* 文章特色图片样式 */
.hubcn-featured-image {
    width: 100% !important;
    height: auto !important;
    max-height: 500px !important;
    object-fit: cover !important;
    border-radius: 12px !important;
    margin-bottom: 30px !important;
    display: block !important;
}

.hubcn-featured-image-wrapper {
    margin: 20px 0 30px 0 !important;
}

/* 强制特色图片显示 */
.entry-content .hubcn-featured-image-wrapper,
.entry-content .hubcn-featured-image {
    width: 100% !important;
    height: auto !important;
    min-height: 200px !important;
    max-height: 500px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.entry-content .hubcn-featured-image {
    object-fit: cover !important;
    object-position: center !important;
}

/* Latest Guides View All 链接右侧间距 */
.gb-element-latest-guides-header .gb-text-view-all-link {
    margin-right: 20px !important;
}

/* ===== Featured Articles 区域间距调整 ===== */
/* 增加 Featured Articles 区域与上方 Popular Topics 的间距 */
.gb-element-featured-articles-section {
    margin-top: 40px !important;
}

/* 减少 Featured Articles 标题与下方文章卡片的间距 */
.gb-text-featured-heading {
    margin-bottom: 0 !important;
}

/* 增加 Popular Topics 区域的底部间距 */
.gb-element-41c48878 {
    margin-bottom: 20px !important;
}

/* 使用更高优先级覆盖 GenerateBlocks 内联样式 */
#gb-element-featured-articles-section .gb-text-featured-heading {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* 直接覆盖容器内部间距 */
.gb-element-featured-articles-section > *:first-child {
    margin-bottom: 0 !important;
}
