/*
Theme Name: xinbaian
Theme URI: https://www.xinbaian.com.cn
Author: SIXE（北京六翼信息技术有限公司）
Author URI:
Description: 新百安（xinbaian）WordPress 主题。基于 ACF Flexible Content 构建页面模块，全部可见内容由后台字段驱动，模板中不硬编码任何文案 / 图片 / 链接。
Version: 0.1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: xinbaian
Tags: custom-menu, featured-images, translation-ready
*/

/* 主题识别用最小样式，页面外观由 ACF 模块与 source-* 搬运 CSS 决定 */
html {
	box-sizing: border-box;
}
*,
*::before,
*::after {
	box-sizing: inherit;
}
body {
	margin: 0;
}

/* 屏幕阅读器专用文本（搜索框 label 等），WP 核心样式不加载时需自带 */
.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
}

/* ------------------------------------------------------------------
   布局修正：修复页脚被 flex 容器压缩为 0 高度而完全不可见（BUG-05）
   实测（headless CDP，1280x929 视口）：
     源站   body=block          .page-wrapper 高 6897（随内容撑开）   footer 高 656
     目标站 body=flex/column    .page-wrapper 高 929（锁死一屏）      footer 高 0
   成因：body 与 .page-wrapper 为 flex 列容器且高度锁死一屏，内容 6000+px 溢出后
        页脚作为末尾 flex item 被 flex-shrink 压缩到 0，内容被 overflow:auto 裁掉。
   修正：对齐源站 —— body 恢复 block，wrapper 高度随内容，页脚禁止被压缩。
   注：本文件最后加载，可覆盖 source-* 同名属性，无需 !important。
   ------------------------------------------------------------------ */
body {
	display: block;
}

.page-wrapper {
	height: auto;
	min-height: 100vh;
}

.footer-container {
	flex-shrink: 0;
}

/* ------------------------------------------------------------------
   全站视觉校对后的两处通用修正（校对报告 2026-09-29）
   1) 图片行 .image-row：源站以 block + white-space:nowrap 横排，项目多到一行放不下时
      会把 <html> 撑宽产生横向滚动条（实测 6 页溢出 215~768px，如 /touding、/fuqiangshi-hulan）。
      改为 flex + wrap：一行放得下时表现与源站一致，放不下时自动换行而不是撑破视口。
      .is-carousel（JS 轮播）保持原样，避免影响交互稿。
   2) 全宽区块 .layout--full 内的 .image-row：父级已是全宽，再叠加
      margin: 0 calc((50vw - 50%) * -1) 的出血会造成额外溢出，此处归零。
   注：本文件最后加载，可覆盖 source-* 同名属性，无需 !important。
   ------------------------------------------------------------------ */
.image-row:not(.is-carousel) {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}

/* 项目宽度自适应：源站实测单行可排 5~8 张（每张 18rem 上限），
   flex-basis 12rem + 可伸缩后，一行放得下时列数与源站完全一致，放不下时收缩而非溢出 */
.image-row:not(.is-carousel) > * {
	flex: 1 1 12rem;
	width: auto;
	min-width: 9rem;
}

.layout--full .image-row {
	margin-left: 0;
	margin-right: 0;
	width: 100%;
}
