/* Print Stylesheet for Sisheng Chris Zhang CV */
/* Pixel-matched to Apple Pages PDF layout */

@font-face {
  font-family: "Adobe Caslon Pro";
  src: local("Adobe Caslon Pro"),
       local("ACaslonPro-Regular"),
       url("fonts/ACaslonPro-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Adobe Caslon Pro";
  src: local("Adobe Caslon Pro Italic"),
       local("ACaslonPro-Italic"),
       url("fonts/ACaslonPro-Italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Adobe Caslon Pro";
  src: local("Adobe Caslon Pro Semibold"),
       local("ACaslonPro-Semibold"),
       url("fonts/ACaslonPro-Semibold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Adobe Caslon Pro";
  src: local("Adobe Caslon Pro Semibold Italic"),
       local("ACaslonPro-SemiboldItalic"),
       url("fonts/ACaslonPro-SemiboldItalic.otf") format("opentype");
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Adobe Caslon Pro";
  src: local("Adobe Caslon Pro Bold"),
       local("ACaslonPro-Bold"),
       url("fonts/ACaslonPro-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Adobe Caslon Pro";
  src: local("Adobe Caslon Pro Bold Italic"),
       local("ACaslonPro-BoldItalic"),
       url("fonts/ACaslonPro-BoldItalic.otf") format("opentype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@page {
  size: A4 portrait;
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

:root {
  --primary-color: #2374b8;
}

body.theme-green,
html[lang="zh-cn"] body,
body.lang-zh {
  --primary-color: #578726;
}

body {
  font-family: "Adobe Caslon Pro", "ACaslonPro-Regular", "Libre Caslon Text", Baskerville, Georgia, "Times New Roman", serif;
  font-size: 8.8pt;
  line-height: 1.24;
  color: #000000;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.lang-zh,
html[lang="zh-cn"] body {
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Songti SC", SimSun, sans-serif;
  font-size: 9.3pt;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.no-print,
.screen-toolbar {
  display: none !important;
}

#cv-container {
  width: 210mm;
  margin: 0;
  padding: 0;
}

/* Strict A4 Page Container */
.cv-page {
  width: 210mm;
  height: 297mm;
  max-height: 297mm;
  position: relative;
  box-sizing: border-box;
  page-break-after: always !important;
  break-after: page !important;
  overflow: hidden;
  background: #ffffff;
}

/* Top Banner on Page 1 */
.top-banner {
  position: relative;
  height: 23.4mm;
  background-color: var(--primary-color, #2374b8);
  padding: 0 10mm;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-banner::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1.2mm;
  width: 100%;
  height: 1.2mm;
  background: repeating-linear-gradient(
    to right,
    var(--primary-color, #2374b8) 0,
    var(--primary-color, #2374b8) 2.8mm,
    transparent 2.8mm,
    transparent 5.6mm
  );
  z-index: 2;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-photo-wrapper {
  margin-right: 6mm;
  display: flex;
  align-items: center;
}

.header-photo {
  width: 18.5mm;
  height: 23.6mm;
  object-fit: cover;
  border: 0.75pt solid #7e786c;
  border-radius: 1px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  display: block;
}

.header-name {
  font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-size: 34pt;
  font-weight: 300;
  color: #ffffff;
  letter-spacing: -0.3pt;
}

.header-meta {
  text-align: right;
  font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

.header-cv {
  font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-size: 16pt;
  font-weight: 300;
  color: #ffffff;
}

.header-date {
  font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-size: 9.5pt;
  font-weight: 300;
  color: #ffffff;
  margin-top: 2pt;
}

/* Main Content Body */
.page-body {
  padding: 3.5mm 10mm 15mm 10mm;
}

.page-2-body {
  padding-top: 12.5mm;
  padding-left: 10mm;
  padding-right: 10mm;
}

/* Summary (Page 1 only) */
.summary,
#page-1 .page-body > p:first-of-type {
  font-size: 10pt;
  line-height: 13pt;
  margin-top: 2pt;
  margin-bottom: 4pt;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Section Headings */
h2,
.section-title {
  font-family: "Adobe Caslon Pro", "ACaslonPro-Regular", "Libre Caslon Text", Baskerville, Georgia, serif;
  font-size: 19.5pt;
  font-weight: 400;
  color: var(--primary-color, #2374b8);
  margin-top: 11pt;
  margin-bottom: 2pt;
  line-height: 23pt;
  border: none;
  padding: 0;
}

h2 + table,
h2 + table.edu-table,
h2 + p,
h2 + p:has(> code:first-child),
h2 + .row,
h2 + p.row,
h2 + ul {
  margin-top: 3pt !important;
}

/* Education Table */
table,
table.edu-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: none;
  margin-bottom: 3pt;
}

thead {
  display: none;
}

td {
  border: none;
  padding: 0;
  font-size: 9.8pt;
  line-height: 13pt;
  vertical-align: baseline;
  font-family: inherit;
  font-weight: normal;
}

td.col-date,
td:first-child {
  width: 80px;
  text-align: left;
}

td:first-child code {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
}

td.col-inst,
td:nth-child(2) {
  width: 215px;
  text-align: left;
}

td.col-deg,
td:nth-child(3) {
  width: 135px;
  text-align: left;
}

td.col-field,
td:last-child {
  width: 288px;
  text-align: right;
}

tbody tr:nth-child(2) td:nth-child(2),
tr.sub-row td {
  padding-top: 0;
  padding-bottom: 0;
  font-size: 9.5pt;
  line-height: 13pt;
  font-style: italic;
  overflow: visible;
  white-space: nowrap;
}

tbody tr td:nth-child(3):has(+ td:empty),
tbody tr:last-child td:nth-child(3) {
  overflow: visible;
  white-space: nowrap;
}

tr.sub-row em {
  font-style: italic;
}

/* 3-Column Experience Header Rows */
.row,
p.row,
p:has(> code:first-child) {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: bold;
  font-size: 10pt;
  line-height: 13pt;
  margin-top: 10.5pt;
  margin-bottom: 0;
}

.row b:first-child,
p.row b:first-child,
p > code:first-child {
  width: 90px;
  flex-shrink: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: bold;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
}

.row b:nth-child(2),
p.row b:nth-child(2),
p > code:first-child + strong {
  flex-grow: 1;
  text-align: left;
  font-weight: bold;
}

.row b:last-child,
p.row b:last-child,
p > code:first-child + strong ~ strong:last-child {
  margin-left: 10px;
  text-align: right;
  flex-shrink: 0;
  font-weight: bold;
}

.job-desc,
.page-body p:not(:has(code)) {
  font-size: 10pt;
  line-height: 13pt;
  margin: 0;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

#page-1 .page-body > p:first-of-type {
  margin-top: 2pt;
  margin-bottom: 4pt;
}

/* Bullet Lists */
ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

li {
  position: relative;
  padding-left: 12px;
  font-size: 10pt;
  line-height: 13pt;
  margin-bottom: 0;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

li::before {
  content: "•";
  position: absolute;
  left: 0;
  font-size: 9pt;
  color: #000;
}

li strong {
  font-weight: bold;
}

/* Skills Sub-lists */
ul ul {
  margin-left: 16px;
  margin-top: 0;
  margin-bottom: 0;
}

ul ul li {
  margin-bottom: 0;
}

/* Bottom Banner / Footer */
.bottom-banner {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 12.5mm;
  background-color: var(--primary-color, #2374b8);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 7.5pt;
  line-height: 1.3;
  text-align: center;
}

.banner-line {
  color: #ffffff;
}

.bottom-banner a {
  color: #ffffff;
  text-decoration: underline;
}

/* Chinese Typography Overrides */
body.lang-zh td.col-date,
body.lang-zh td:first-child,
body.lang-zh .row b:first-child,
body.lang-zh p.row b:first-child,
body.lang-zh p > code:first-child,
html[lang="zh-cn"] td.col-date,
html[lang="zh-cn"] td:first-child,
html[lang="zh-cn"] .row b:first-child,
html[lang="zh-cn"] p.row b:first-child,
html[lang="zh-cn"] p > code:first-child {
  width: 108px;
  padding-right: 6px;
}

body.lang-zh td.col-inst,
body.lang-zh td:nth-child(2),
html[lang="zh-cn"] td.col-inst,
html[lang="zh-cn"] td:nth-child(2) {
  width: 195px;
}

body.lang-zh td.col-deg,
body.lang-zh td:nth-child(3),
html[lang="zh-cn"] td.col-deg,
html[lang="zh-cn"] td:nth-child(3) {
  width: 90px;
}

body.lang-zh td.col-field,
body.lang-zh td:last-child,
html[lang="zh-cn"] td.col-field,
html[lang="zh-cn"] td:last-child {
  width: 325px;
}

body.lang-zh .top-banner,
html[lang="zh-cn"] .top-banner {
  height: 28.5mm;
}

body.lang-zh .header-name,
html[lang="zh-cn"] .header-name {
  font-family: "Songti SC", "STSongti-SC-Bold", "STSong", "Noto Serif SC", SimSun, serif;
  font-size: 28pt;
  font-weight: 700;
  letter-spacing: 2pt;
}

body.lang-zh .header-cv,
html[lang="zh-cn"] .header-cv {
  font-family: "Songti SC", "STSongti-SC-Bold", "STSong", "Noto Serif SC", SimSun, serif;
  font-size: 16pt;
  font-weight: 700;
  letter-spacing: 1pt;
}

body.lang-zh h2,
body.lang-zh .section-title,
html[lang="zh-cn"] h2,
html[lang="zh-cn"] .section-title {
  font-family: "Songti SC", "STSongti-SC-Bold", "STSong", "Noto Serif SC", SimSun, serif;
  font-weight: 700;
}
