/*
Theme Name:   CAIEES Child
Theme URI:    https://caiees.cn
Description:  Child theme for CAIEES — Xinjiang–Central Asia Institute for Economic and Environmental Studies. Provides typography, layout and component customization for Astra.
Author:       CAIEES
Author URI:   https://caiees.cn
Template:     astra
Version:      1.2.0
License:      GPL-2.0-or-later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  caiees-child
*/

/* ==========================================================================
   Global design tokens — override Astra defaults at highest specificity
   ========================================================================== */

:root,
html body,
body.ast-theme-transparent-header {
  /* Override Astra typography variables for all languages */
  --ast-body-font-family: "等线", "DengXian", "Microsoft YaHei UI", "微软雅黑", "PingFang SC", "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif !important;
  --ast-heading-font-family: "等线", "DengXian", "Microsoft YaHei UI", "微软雅黑", "PingFang SC", "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif !important;
  --ast-h1-font-family: var(--ast-heading-font-family) !important;
  --ast-h2-font-family: var(--ast-heading-font-family) !important;
  --ast-h3-font-family: var(--ast-heading-font-family) !important;
  --ast-h4-font-family: var(--ast-heading-font-family) !important;
  --ast-h5-font-family: var(--ast-heading-font-family) !important;
  --ast-h6-font-family: var(--ast-heading-font-family) !important;
}

/* For Russian: switch to Times New Roman family */
html[lang^="ru"],
html[lang^="ru"] body {
  --ast-body-font-family: "Times New Roman", "PT Serif", "Liberation Serif", Georgia, serif !important;
  --ast-heading-font-family: "Times New Roman", "PT Serif", "Liberation Serif", Georgia, serif !important;
}

/* For English: switch to Inter / system sans */
html[lang^="en"],
html[lang^="en"] body {
  --ast-body-font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, "Liberation Sans", sans-serif !important;
  --ast-heading-font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, "Liberation Sans", sans-serif !important;
}

/* Hide page title on Home and CATPU pages — those pages have a custom hero/H1 */
body.home .entry-header,
body.home .ast-article-single > .entry-header,
body.home .post-thumbnail,
body.home > * .entry-title,
body.home h1.entry-title,
body.page-id-145 .entry-header,
body.page-id-145 h1.entry-title,
body.page-id-325 .entry-header,
body.page-id-325 h1.entry-title,
body.page-id-327 .entry-header,
body.page-id-327 h1.entry-title {
  display: none !important;
}

/* Ensure full-width groups inside content escape Astra's narrow content max-width */
body.home .alignfull,
body.page-id-145 .alignfull,
body.page-id-325 .alignfull,
body.page-id-327 .alignfull {
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  max-width: 100vw !important;
  width: 100vw !important;
}

/* When home page uses full-width groups, also reset article container padding */
body.home .site-content .ast-container,
body.page-id-145 .site-content .ast-container,
body.page-id-325 .site-content .ast-container,
body.page-id-327 .site-content .ast-container {
  padding-left: 0 !important;
  padding-right: 0 !important;
  max-width: 100% !important;
}

body.home .entry-content,
body.page-id-145 .entry-content,
body.page-id-325 .entry-content,
body.page-id-327 .entry-content {
  margin-top: 0 !important;
}
