/**
 * 火桥（huoqiao）· 多功能沉浸式 WordPress 主题
 * 联系方式：12492501@qq.com
 * 支持正版，从我做起，你的支持是我们前行的动力！
 *
 * @package   huoqiao
 * @author    三木
 * @copyright Copyright (c) 2026-09-01 huoqiao.cn
 * @license   GPL-2.0-or-later
 * @link      https://huoqiao.cn
 * @tags      footer, spacing, layout, design-tokens, responsive
 */

/*  页脚让位令牌 */
:root {
    --hq-footer-gap-default: 40px;
    /* ⚠️ 故意不在此声明 --hq-footer-gap：它由 PHP 内联下发（inc/core/theme.php），
       是该变量的唯一声明。若这里再写一份兜底，内联样式被提前到 <head> 顶部后
       反而会被本样式表后到先得地盖掉，导致后台设置失效。兜底只写在 var() 第二参数。 */
    --hq-footer-offset: var(--hq-footer-gap, var(--hq-footer-gap-default));
}

/* 页脚让位  */
html body footer.mag-footer,
html body footer.footer-custom {
    margin-top: var(--hq-footer-offset);
}
/* 单页正文大容器（文章详情 / 下载详情）容器直贴页脚，不留页脚间距 */
html body.single-post footer.mag-footer,
html body.single-post footer.footer-custom,
html body.single-huoqiao_download footer.mag-footer,
html body.single-huoqiao_download footer.footer-custom {
    margin-top: 0;
}


/* 页面主干容器 */
html body #primary.content-area,
html body #primary.content-area > #main.site-main,
html body .hq-info-page,
html body .fl-page,
html body .hq-err-wrap,
html body > .container {
    margin-bottom: 0 !important;
}

/* 首页：小工具区整体*/
html body #primary.home-widgets-area {
    margin-bottom: 0 !important;
}

/* --- 首页 / 分类页 */
html body #primary :is(
    .huoqiao-widget-container,
    .latest-posts-container,
    .hqw-category-showcase,
    .hqw-featured-post-section,
    .hqw-image-list-section,
    .hqw-recommended-articles-section,
    .hqw-news-style-article-section,
    .hqw-article-list-section,
    .hqw-product-grid-section,
    .hqw-guestwall-section,
    .fullscreen-slider-section,
    .mobile-only-banner,
    .hqw-super-posts-section,
    .hqw-video-showcase-section,
    .hqw-downloads-section,
    .hqw-dlc-section
):last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* --- 归档 / 分类 / 搜索*/
html body .pagination {
    margin-bottom: 0 !important;
}

/* --- 搜索页 */
html body .search-results-grid {
    margin-bottom: 0 !important;
}

/* 信息页*/
html body .hq-info-layout {
    padding-bottom: 0 !important;
}

/*友情链接页正文*/
html body .fl-body {
    padding-bottom: 0 !important;
}

/*  404  */
html body .hq-err-wrap {
    padding-bottom: 0 !important;
}

html body .hq2-page,
   /* 用户主页2 外层 */
html body .hq-image-detail__content,    /* 图片详情内容层 */
html body #hq-video-page,               /* 视频详情 */
html body .page-article > .page-content /* 用户中心 / 留言墙等默认页面模板正文 */ {
    padding-bottom: 0 !important;
}
/* 下载详情不在上组：容器需保留内部底部呼吸（末模块与页脚间的视觉间距），
   外缘贴合由「页脚 margin-top:0」（见上方单页例外组）保证 */

/* 用户中心 / 留言墙 */
html body .page-article > .page-content {
    margin-bottom: 0 !important;
}
