/* =========================================================
   C. Yiwei Zhang — site styles
   Colors, sizes and spacing carried over from the Squarespace
   "Montauk" template settings.
   ========================================================= */

:root {
  --text: #5c5c5c;          /* body text */
  --heading: #222;          /* site title, headings */
  --link: #960303;          /* body link */
  --link-hover: #d71438;    /* body link (hover) */
  --nav: rgba(0, 0, 0, .5); /* navigation */
  --nav-active: #111;       /* navigation (hover / active) */
  --rule: rgba(0, 0, 0, .1);/* page borders */
  --sans: "Figtree", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Merriweather", Georgia, serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: var(--serif);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.8em;
}

/* The bordered "canvas" that holds the whole page */
#canvas {
  max-width: 1400px; /* 1200px content + 100px padding on each side, as on Squarespace */
  margin: 80px auto;
  padding: 100px 100px 0;
  border: 1px solid var(--rule);
}

/* ---------- Header ---------- */
.site-header { text-align: center; }

.site-title {
  margin: 0;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 40px;
  line-height: 1.6em;
  letter-spacing: 0;
}
.site-title a { color: var(--heading); text-decoration: none; }
.site-title a:hover { color: #444; }

.site-nav {
  display: flex;
  align-items: center;
  margin-top: 50px;
}
.site-nav::before,
.site-nav::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--rule);
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0 30px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 30px;
}
.site-nav a {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 1.6em;
  color: var(--nav);
  text-decoration: none;
  padding-bottom: 6px;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--nav-active);
  border-bottom-color: var(--rule);
}

/* ---------- Page content ---------- */
main {
  width: 75%;
  margin: 80px auto;
}

a { color: var(--link); text-decoration: none; }
a:hover, a:active { color: var(--link-hover); }

/* From your Squarespace Custom CSS: dashed underline on co-author links */
a.more:hover { border-bottom: 1px dashed #5c5c5c; }

strong, b { font-weight: 700; }
p { margin: 0 0 1em; }

/* Two-column layouts, matching the Squarespace 12-column grid */
.about,
.contact {
  display: grid;
  column-gap: 34px;
  align-items: start;
}

/* About page: photo area 5 columns, bio 7 columns; photo centered at ~63% of its area */
.about { grid-template-columns: 5fr 7fr; }
.about .headshot img { width: 63%; height: auto; display: block; margin: 0 auto; }

/* Contact page: photo 7 columns (landscape crop), details 5 columns */
.contact { grid-template-columns: 7fr 5fr; }
.contact .photo img {
  width: 100%;
  aspect-ratio: 508 / 399;
  object-fit: cover;
  display: block;
}
.contact h3 {
  margin: 22px 0 8px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .5px;
  color: var(--heading);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 50px 0;
  text-align: center;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 1px;
  color: rgba(0, 0, 0, .4);
}

/* ---------- Smaller screens ---------- */
@media (max-width: 1024px) {
  #canvas { margin: 0 auto; }
}
@media (max-width: 767px) {
  #canvas { padding: 50px 50px 0; }
  main { width: 100%; }
  .about, .contact { grid-template-columns: 1fr; row-gap: 28px; }
  .about .headshot img { width: 60%; max-width: 280px; }
}
@media (max-width: 640px) {
  #canvas { padding: 30px 17px 0; border: 0; }
  .site-title { font-size: 30px; }
  .site-nav { margin-top: 24px; }
  .site-nav::before, .site-nav::after { display: none; }
  .site-nav ul { padding: 0; gap: 4px 20px; }
  .site-nav a { font-size: 12px; }
  main { margin: 40px auto; }
  /* the abstracts have 50px side margins written into the HTML; shrink them on phones */
  main div[style*="margin: 0px 50px"] { margin: 0 !important; }
}
