/*
 Theme Name:   Bricks Child Theme
 Theme URI:    https://bricksbuilder.io/
 Description:  Use this child theme to extend Bricks.
 Author:       Bricks
 Author URI:   https://bricksbuilder.io/
 Template:     bricks
 Version:      1.1
 Text Domain:  bricks
*/

/*
 * Builder canvas guard (2026-09-15).
 * The reveal system starts elements hidden (e.g. .motion-stagger > * { opacity: 0 })
 * and only shows them when a Bricks enterView interaction sets the data-motion-*
 * attribute. The builder does not run interactions while editing, so those elements
 * stayed invisible on the canvas - still clickable, which is why the template looked
 * blank. Disable the hidden initial state whenever the page is NOT the public front end.
 * The builder canvas strips .bricks-is-frontend from the body (see
 * Bricks\Builder::get_iframe_body_classes), so :not(.bricks-is-frontend) matches the
 * canvas and the builder frame while leaving the live site untouched.
 */
:is(body:not(.bricks-is-frontend), body.bricks-is-builder, body.bricks-is-previewing) .motion-stagger > *,
:is(body:not(.bricks-is-frontend), body.bricks-is-builder, body.bricks-is-previewing) .motion-split-left,
:is(body:not(.bricks-is-frontend), body.bricks-is-builder, body.bricks-is-previewing) .motion-mask-reveal,
:is(body:not(.bricks-is-frontend), body.bricks-is-builder, body.bricks-is-previewing) .motion-reveal,
:is(body:not(.bricks-is-frontend), body.bricks-is-builder, body.bricks-is-previewing) [data-motion-stagger],
:is(body:not(.bricks-is-frontend), body.bricks-is-builder, body.bricks-is-previewing) [data-motion-split],
:is(body:not(.bricks-is-frontend), body.bricks-is-builder, body.bricks-is-previewing) [data-motion-mask] {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
  clip-path: none !important;
  transition: none !important;
  will-change: auto !important;
}

/* Weipei Chinese typography patch 2026-09-24 */
@font-face {
  font-family: "Noto Sans SC";
  src: url("./fonts/noto-sans-sc.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: optional;
}

/* Keep headings balanced without changing their semantic level or token scale. */
body.brx-body :is(h1, h2, h3, h4, h5, h6) {
  text-wrap: balance;
}

/* Avoid iOS Safari zoom when Chinese form controls use the compact text token. */
@media (max-width: 767px) {
  body.brx-body :is(input, select, textarea),
  body.brx-body .brxe-form :is(input, select, textarea),
  body.brx-body .bricks-search-form input {
    font-size: 16px;
    line-height: 1.5;
  }
}

/* >>> weipei-a7-fontface-geometry (#43) >>> */
/*
 * #43 首页字体交换修复 —— Font Awesome 图标字体的几何预留。
 *
 * 图标字体的 @font-face 在 Bricks 核心 assets/css/libs/font-awesome-6-layer.min.css
 * 的 @layer bricks.icons 里。本块**不改核心文件**，在子主题里固定首页图标盒宽。慢速字体到货仍可能使字形内部产生极小偏移；
 * 仅当首页早期脚本已设置 a7-fa-loading 时暂时隐藏图标，字体就绪后立即显示，
 * 链接文字始终可见。
 *
 * 为什么是 1.25em：FA 自己的固定宽度口径（.fa-fw）就是 1.25em，即 FA6 最宽字形，
 * 对任意字形都成立，不需要按字形维护常量表。代价是窄字形最多多 0.25em 间距。
 *
 * 为什么不给图标字体把字体显示设成 optional：那样字体字节赶不上 100ms 阻塞期时，
 * 整页会用系统回退字体渲染私有区码位 —— 系统字体没有这些字形，图标变成占位/空白。
 *
 * 另外注意：本块不出现字体显示声明。服务端 FlyingPress 的 inject_display_swap()
 * 会删掉 CSS 里所有这类声明并重新插入 swap（包括本块的注释文本），本块只做几何与可见性控制，
 * 不参与那条改写（见事实源 rewriteLayer）。本文件当前已由 functions.php 里的
 * flying_press_exclude_from_minify:css 排除出该改写链；这条约束作为回归时的兜底保留。
 *
 * 事实源：scripts/weipei/lib/home-fontface-fix.json。
 */
body.home #brxe-hdacts i.fas,
body.home #brxe-hdrcns i.fas,
body.home #home-actions i.fas,
body.home #home-quick-entry i.fas,
body.home #home-about-action i.fas,
body.home #home-map-action i.fas,
body.home #home-featured-action i.fas,
body.home #home-featured-consult i.fas {
  display: inline-block;
  width: 1.25em;
  text-align: center;
  position: relative;
  height: 1em;
  vertical-align: baseline;
}
body.home #brxe-hdacts i.fas::before,
body.home #brxe-hdrcns i.fas::before,
body.home #home-actions i.fas::before,
body.home #home-quick-entry i.fas::before {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
}
html.a7-fa-loading body.home #brxe-hdacts i.fas,
html.a7-fa-loading body.home #brxe-hdrcns i.fas,
html.a7-fa-loading body.home #home-actions i.fas,
html.a7-fa-loading body.home #home-quick-entry i.fas,
html.a7-fa-loading body.home #home-about-action i.fas,
html.a7-fa-loading body.home #home-map-action i.fas,
html.a7-fa-loading body.home #home-featured-action i.fas,
html.a7-fa-loading body.home #home-featured-consult i.fas {
  visibility: hidden;
}
/* <<< weipei-a7-fontface-geometry (#43) <<< */
