/* ============================================================
   sddytj 整站优化 · 全局样式（阶段1）
   1.1 图片自适应 / 移动端点按 / 行距
   1.2 统一容器宽度与间距（消除“宽窄不一 / 留白过大”）
   1.3 移动端断点（导航折叠 / 字号 / 按钮点击区域 / 表格滚动）
   全站生效，随版本库回退；不依赖主题，优先级高于主题默认。
   ============================================================ */

/* ---------- 1.1 图片与基础 ---------- */
img {
  max-width: 100%;
  height: auto;
}
.entry-content img,
.elementor-widget-image img,
.elementor-widget-media-carousel img {
  border-radius: 6px;
}

/* ---------- 1.2 统一容器宽度与间距 ---------- */
/* 根因防护：任何元素超出视口都会在手机上造成横向错位，最稳妥的一致性修复 */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}
/* Astra 正文容器：统一左右留白（宽度沿用主题 1200 设定，不强行改宽） */
.ast-container {
  padding-left: 24px;
  padding-right: 24px;
}
/* Gutenberg 超宽区块收敛到正文宽度，消除“个别页过宽” */
.wp-block-group.alignwide,
.wp-block-columns.alignwide {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
/* 统一带背景区块的上下内边距，去除“留白过大/过小”不一致 */
.wp-block-group.has-background {
  padding-top: 56px;
  padding-bottom: 56px;
}

/* ---------- 1.3 移动端断点（对齐 Astra 平板断点 921px） ---------- */
@media (max-width: 921px) {
  .ast-container {
    padding-left: 18px;
    padding-right: 18px;
  }
  /* 字号下限，避免手机上字过小难读 */
  body {
    font-size: 16px;
    line-height: 1.75;
  }
  /* 导航/按钮点击区域 ≥40px，手指好按 */
  .ast-nav-menu .menu-item > a,
  .ast-mobile-menu-buttons a,
  a.button,
  .wp-block-button__link,
  input[type="submit"],
  button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  /* 表格在手机上可横向滚动，避免撑破布局 */
  .entry-content > table,
  .wp-block-table table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
@media (max-width: 544px) {
  body {
    font-size: 15px;
  }
  .wp-block-group.has-background {
    padding-top: 40px;
    padding-bottom: 40px;
  }
}
