/* Chinese typography. Loaded only on pages with lang: zh-CN, after main.css.
   Latin letters and digits keep the fonts of the English site (PT Serif for text,
   PT Sans Narrow for headings and navigation); only Chinese characters fall through
   to the Chinese fonts later in each stack. */

/* Curly quotes, em dashes and ellipses are shared with Latin text. Without this
   face they would come from PT Serif and look narrow and misplaced beside Chinese. */
@font-face {
  font-family: "ZH Punctuation";
  src: local("PingFang SC Regular"), local("PingFangSC-Regular"), local("Microsoft YaHei"), local("Noto Sans CJK SC Regular"), local("NotoSansCJKsc-Regular"), local("Source Han Sans SC Regular");
  font-weight: 400;
  unicode-range: U+2014, U+2018-2019, U+201C-201D, U+2026;
}
@font-face {
  font-family: "ZH Punctuation";
  src: local("PingFang SC Semibold"), local("PingFangSC-Semibold"), local("Microsoft YaHei Bold"), local("Noto Sans CJK SC Bold"), local("NotoSansCJKsc-Bold"), local("Source Han Sans SC Bold");
  font-weight: 700;
  unicode-range: U+2014, U+2018-2019, U+201C-201D, U+2026;
}

html[lang="zh-CN"] {
  font-family: "ZH Punctuation", 'PT Serif', "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
}

html[lang="zh-CN"] h1,
html[lang="zh-CN"] h2,
html[lang="zh-CN"] h3,
html[lang="zh-CN"] h4,
html[lang="zh-CN"] h5,
html[lang="zh-CN"] h6,
html[lang="zh-CN"] .navigation-wrapper,
html[lang="zh-CN"] .latest-news-toggle {
  font-family: "ZH Punctuation", 'PT Sans Narrow', "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
}

/* The site name and contact links are shared English content: identical to the English site. */
html[lang="zh-CN"] .site-name {
  font-family: 'PT Sans Narrow', sans-serif;
}
html[lang="zh-CN"] .article-author-top {
  font-family: 'PT Serif', serif;
}

/* Chinese characters fill their whole em box and look larger than Latin letters at
   the same font size, so desktop text and headings are scaled down a little. Phones
   already use a smaller size. English lists are scaled back to the English site's size. */
@media only screen and (min-width:37.5em) {
  html[lang="zh-CN"] .article-wrap {
    font-size: 0.94em;
  }
  html[lang="zh-CN"] .article-wrap h1 {
    font-size: 2.6rem;
  }
  html[lang="zh-CN"] .article-wrap h2 {
    font-size: 1.7rem;
  }
  html[lang="zh-CN"] .article-wrap h3 {
    font-size: 1.2rem;
  }
  html[lang="zh-CN"] .article-wrap [lang="en"] {
    font-size: 1.0638em;
  }
  html[lang="zh-CN"] .top-navigation li:not(.lang-switch) a {
    font-size: 0.94em;
  }
}

/* Chinese has no true italics: keep Chinese upright while English journal names
   and paper titles use the real italic face of the Latin font. */
html[lang="zh-CN"] {
  font-synthesis: weight;
}

html[lang="zh-CN"] h1,
html[lang="zh-CN"] h2,
html[lang="zh-CN"] h3 {
  letter-spacing: 0.03em;
  line-height: 1.4;
}

html[lang="zh-CN"] .top-navigation li:not(.lang-switch) a {
  letter-spacing: 0.04em;
}

html[lang="zh-CN"] .article-wrap,
html[lang="zh-CN"] .footer-wrap h6 {
  line-height: 1.85;
}

/* inter-word justification would not stretch the gaps between Chinese characters. */
html[lang="zh-CN"] .article-wrap p,
html[lang="zh-CN"] .article-wrap li {
  text-justify: auto;
  -webkit-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
  line-break: strict;
  text-autospace: normal;
}

/* On phones, justifying around long unbreakable English titles leaves wide gaps
   between Chinese characters, so Chinese text is left-aligned there. */
@media only screen and (max-width:37.49em) {
  html[lang="zh-CN"] .article-wrap p,
  html[lang="zh-CN"] .article-wrap li {
    text-align: left !important;
  }
}

/* The conventional first-line indent for Chinese is two characters. */
html[lang="zh-CN"] .about-intro p,
html[lang="zh-CN"] .about-intro p + p,
html[lang="zh-CN"] .article-wrap p + p {
  text-indent: 2em;
}

/* Publication lists stay in English and keep the same look as the English site. */
html[lang="zh-CN"] .article-wrap [lang="en"] {
  font-family: 'PT Serif', serif;
  line-height: 1.6;
}
html[lang="zh-CN"] .article-wrap [lang="en"] li {
  text-justify: inter-word;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
}
