/*
 Theme Name: Astra Child
 Template: astra
 Version: 1.0.1
 Description: Astra 子主题 - 迁移自父主题的自定义（内页蓝色导航栏 / 页脚深色 / 布局微调）。
*/

/* ============================================================
   1) 内页导航栏背景与首页一致 (#0066cc)，原 Astra 父主题 style.css 末尾追加段
   ============================================================ */
/* 内页导航栏背景与首页一致 #0066cc */
.ast-primary-header-bar,
.site-primary-header-wrap { background-color:#0066cc !important; }
.ast-primary-header-bar .main-header-menu > li > a,
.ast-primary-header-bar .site-title a,
.ast-primary-header-bar .site-logo-img { color:#ffffff !important; }
.ast-primary-header-bar .main-header-menu > li > a:hover,
.ast-primary-header-bar .main-header-menu > li.current-menu-item > a { background-color:#0052a3 !important; color:#ffffff !important; }
.ast-primary-header-bar .main-header-menu .sub-menu { background-color:#0066cc !important; }
.ast-primary-header-bar .main-header-menu .sub-menu a { color:#ffffff !important; }
.ast-primary-header-bar .main-header-menu .sub-menu a:hover { background-color:#0052a3 !important; color:#ffffff !important; }
.ast-primary-header-bar .ast-mobile-menu-buttons .menu-toggle,
.ast-primary-header-bar .ast-mobile-menu-buttons .menu-toggle * { color:#ffffff !important; }

/* ============================================================
   2) 自定义器「额外 CSS」(wp-custom-css，前台已发布生效) 迁移到子主题，
      避免切换主题后丢失（页脚深色 / ricon-about / ricon-products 布局微调等）
   ============================================================ */
.site-primary-footer-wrap { background-color: #1f2329 !important; padding-top: 0 !important; padding-bottom: 0 !important; }
.site-below-footer-wrap { background-color: #1a1d23 !important; padding-top: 0 !important; padding-bottom: 0 !important; }
.site-primary-footer-wrap .widget-area, .site-primary-footer-wrap .ast-builder-layout-element, .site-primary-footer-wrap .site-footer-section { color: #cfcfcf !important; }
.site-primary-footer-wrap h2, .site-primary-footer-wrap h3, .site-primary-footer-wrap .widget-title { color: #ffffff !important; display: block !important; margin-bottom: 15px !important; font-size: 16px !important; font-weight: bold !important; }
.site-primary-footer-wrap a { color: #cfcfcf !important; }
.site-primary-footer-wrap a:hover { color: #ffffff !important; }
.site-primary-footer-wrap ul li { color: #cfcfcf !important; }
.ast-footer-copyright { background-color: #1a1d23 !important; color: #cfcfcf !important; }
.ast-footer-social-1-wrap { display: none !important; }
.site-footer-primary-section-4 { display: none !important; }
.site-footer-primary-section-2 .widget_nav_menu .menu { display: flex !important; flex-wrap: wrap !important; list-style: none !important; padding: 0 !important; margin: 0 !important; gap: 0 !important; }
.site-footer-primary-section-2 .widget_nav_menu .menu li { display: inline !important; float: none !important; padding: 0 !important; margin: 0 0 8px 0 !important; line-height: 1.8 !important; }
.site-footer-primary-section-2 .widget_nav_menu .menu li:not(:last-child)::after { content: ' | ' !important; color: #999 !important; margin: 0 4px !important; }
.site-footer-primary-section-2 .widget_nav_menu .menu li:nth-child(3)::after { content: '' !important; }
.site-footer-primary-section-2 .widget_nav_menu .menu li:nth-child(4) { clear: both !important; margin-left: 0 !important; }
.site-footer-primary-section-2 .widget_nav_menu .menu a { text-decoration: none !important; border-bottom: none !important; }
.site-footer-primary-section-3 .widget_nav_menu .menu a { text-decoration: none !important; border-bottom: none !important; pointer-events: none !important; cursor: default !important; }
.ast-custom-button-link, .ast-custom-button, a[href*="#quote"], a[href*="quote"] { display: none !important; }
section.ricon-about > div:first-child > div:first-child { display: none !important; }
h3 span[style*="letter-spacing:2px"] { display: none !important; }
section.ricon-about p { text-indent: 2em !important; }
section.ricon-about { padding-top: 80px !important; }
section.ricon-about > div:first-child { margin-top: 0 !important; padding-top: 0 !important; }
section.ricon-about > div:first-child h2 { margin-top: 30px !important; }
section.ricon-products { padding-top: 80px !important; }
section.ricon-products > h1 { margin-top: 30px !important; margin-bottom: 40px !important; }
/* 减少页脚上方空白 */
.site-footer { margin-top: 0 !important; }
#ast-footer { margin-top: 0 !important; }

/* ============================================================
   3) 内页页脚与首页页脚对齐（ricon / 2026-08-14）
      - 内页 .site-primary-footer-wrap 背景色改为与首页 .footer(#2b2b2b) 一致
      - 上内边距 padding-top 改为 40px，与首页一致
      - 小工具标题(公司名) .widget-title 与首页 .footer-col h4 一致
        (#fff / 16px / 加粗 / margin-top:0)
      - 正文文字(地址/电话/邮箱/网址)与首页 .footer-col p 接近
        (#999 / 13px / 行高 2)
      - 仅桌面尺寸(min-width:769px)生效，移动端保持原有可读性
   ============================================================ */
@media (min-width: 769px) {
  /* 背景色 & 上内边距：与首页 .footer (#2b2b2b / padding-top:40px) 一致 */
  .site-primary-footer-wrap {
    background-color: #2b2b2b !important;
    background-image: none !important;
    padding-top: 40px !important;
    padding-bottom: 0 !important;
  }
  .site-below-footer-wrap {
    background-color: #2b2b2b !important;
    padding-top: 18px !important;
    padding-bottom: 18px !important;
    border-top: none !important;
  }
  /* 小工具标题（公司名）：与首页 .footer-col h4 一致 */
  .site-primary-footer-wrap .widget-title {
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: bold !important;
    margin-top: 0 !important;
    margin-bottom: 12px !important;
    line-height: 1.4 !important;
    font-family: inherit !important;
  }
  /* 正文文字：与首页 .footer-col p 接近 */
  .site-primary-footer-wrap .textwidget,
  .site-primary-footer-wrap ul,
  .site-primary-footer-wrap ul li {
    color: #999999 !important;
    font-size: 13px !important;
    line-height: 2 !important;
  }
  /* 版权栏：与首页 .footer-bottom 接近 */
  .ast-footer-copyright {
    background-color: #2b2b2b !important;
    color: #999999 !important;
    border-top: none !important;
  }
  .ast-footer-copyright p {
    font-size: 12px !important;
  }
}

/* 内页页脚与首页页脚视觉统一 */
.site-footer,
.site-primary-footer-wrap {
    background-color: #2b2b2b !important;
}
.site-primary-footer-wrap {
    padding-top: 40px !important;
}


/* ============================================================
   内页页脚只保留一条横线（ricon / 2026-08-14）
   - 横线位于主内容区(.site-primary-footer-wrap) 与版权栏之间
   - 用 .site-primary-footer-wrap 的 border-bottom 表现（1px solid #444）
   - 版权栏(.site-below-footer-wrap / .ast-footer-copyright) 上方不再加线
   ============================================================ */
.site-primary-footer-wrap {
    border-top: none !important;
    border-bottom: 1px solid #444 !important;
    box-shadow: none !important;
}
.site-below-footer-wrap {
    border-top: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}
.ast-footer-copyright {
    border-top: none !important;
}



/* ============================================================
   内页页脚三栏标题顶部对齐（ricon / 2026-08-14 修正）
   ------------------------------------------------------------
   真正根因：Astra 基础栅格规则
       .ast-builder-grid-row { display:grid; align-items:center; ... }
   被页脚栅格容器继承
       (.ast-builder-footer-grid-columns.site-primary-footer-inner-wrap.ast-builder-grid-row)
   -> 各栏(.site-footer-section)在栅格内“垂直居中”，
      较矮的第2/3栏内容(标题)被向下推约30px，与左侧公司名不对齐。
   旧规则只把 .footer-widget-area / .widget-title 的 margin-top 清零，
   但桌面端这些元素本就没有 margin-top:30px
   （30px 仅存在于 @media(max-width:544px) 移动端，由 Astra 注入），
   所以旧规则对桌面端无效。
   修正：把页脚栅格 align-items 改为顶部对齐(flex-start)，
   并让 .site-footer-section(flex列) 自身与内容都顶部对齐，
   用 !important 覆盖 Astra 的 align-items:center。
   ============================================================ */
.site-primary-footer-inner-wrap.ast-builder-grid-row,
.ast-builder-footer-grid-columns.ast-builder-grid-row {
    align-items: flex-start !important;
}
.site-footer-section {
    align-self: flex-start !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
}
/* 兜底：清掉可能存在的栏级 margin-top（含移动端 Astra 注入的 30px） */
.site-primary-footer-wrap .footer-widget-area,
.site-primary-footer-wrap .site-footer-section > * {
    margin-top: 0 !important;
}
.site-primary-footer-wrap .widget-title {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ============================================================
   内页页脚三栏标题对齐 - 平板断点修正（ricon / 2026-08-14）
   ------------------------------------------------------------
   实测数据（Chromium 无头测量）：
     - 桌面端(>921px)：三栏 .widget-title top 差值 = 0.00px，已对齐。
     - 平板(544~921px)：Astra 用 ast-builder-grid-row-tablet-2-equal
       (grid-template-columns: repeat(2,1fr))，第4栏
       .site-footer-primary-section-4 已 display:none，可见3栏被排成
       [s1,s2]/[s3]，第3栏标题被挤到第二行，top 比第1/2栏低 ~206px。
       这正是“对齐修复没效果”在窄屏的表现；align-items 只解决“同格内
       垂直居中”，无法解决“跨行”问题。
     - 故在平板断点强制 3 等分列，让三栏标题回到同一行对齐。
   移动端(<544px)保持 Astra 原生堆叠(每栏独占一行)，属正常排版。
   ============================================================ */
@media (max-width: 921px) and (min-width: 545px) {
    .ast-builder-footer-grid-columns.site-primary-footer-inner-wrap.ast-builder-grid-row {
        grid-template-columns: repeat(3, 1fr) !important;
        align-items: flex-start !important;
    }
    .site-footer-section {
        align-self: flex-start !important;
    }
}
