/* ===================================================================
   Qianmin Hu — personal site
   Minimal academic layout: black on white, serif, generous whitespace.

   To change the overall look, most of what you want is in the two
   blocks marked TYPOGRAPHY and WIDTH below.
   =================================================================== */

/* --- TYPOGRAPHY ---------------------------------------------------- */
:root {
  --ink:        #111;          /* body text */
  --ink-soft:   #555;          /* dates, captions, secondary text */
  --rule:       #ddd;          /* horizontal lines */
  --link:       #1a4a7a;       /* link color */
  --title:      #3a3a3a;       /* paper titles: bold, but softer than the
                                  body so they read less sharply. #2b2b2b
                                  is darker, #4a4a4a lighter.           */
  --heading:    #111;          /* all section headings. Alternatives:
                                  #6d2f3d deep maroon
                                  #4a4038 warm dark brown
                                  #2f5d50 deep green                   */
  --serif:      Charter, "Bitstream Charter", Georgia, "Times New Roman", serif;
}

/* --- WIDTH --------------------------------------------------------- */
/* 38em is about 75 characters per line, which is comfortable reading.
   Raise it for wider text, lower it for narrower.                     */
body {
  max-width: 38em;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 6rem;
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

/* --- Header and navigation ----------------------------------------- */
header { margin-bottom: 2.5rem; }

h1.sitename {
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 1.25rem;
}

/* p.role below is unused — the subtitle line was removed from the pages.
   Kept so that re-adding <p class="role">...</p> just works. */

p.role {
  margin: 0 0 1.25rem;
  color: var(--ink-soft);
  font-size: 1rem;
}

nav {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.6rem 0;
  font-size: 0.95rem;
}
nav a {
  margin-right: 1.5rem;
  text-decoration: none;
  color: var(--ink);
}
nav a:hover { text-decoration: underline; }
nav a[aria-current="page"] { font-weight: 600; }

/* --- Headings ------------------------------------------------------ */
/* Section headings: serif, above a rule. "Courses Taught", "Book
   Project", "Fieldwork", and so on.                                    */
h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--heading);
  margin: 3rem 0 1.15rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule);
}

/* Subtitles within a section: same serif as the body, set larger and
   semibold so they read as a distinct layer without changing family.
   "Substantive Courses", "Formal Theory", "Quantitative Methods",
   "Field-Based Teaching".                                              */
h3 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--heading);
  margin: 3rem 0 1.15rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule);
}

/* A quieter section heading, used for "Student Feedback": a small
   sans-serif label rather than a full heading, so the quotes below it
   read as a coda to the course list rather than a second main section. */
h2.quiet {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  border-bottom: none;
  padding-bottom: 0;
  margin: 3.5rem 0 1.25rem;
}

/* --- Body text ----------------------------------------------------- */
p { margin: 0 0 1.1rem; }

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

/* --- Paper entries -------------------------------------------------- */
article { margin-bottom: 2rem; }

.papertitle {
  font-weight: 600;
  color: var(--title);
  margin-bottom: 0.35rem;
}

/* A book, as opposed to an article: italic, no quotation marks. */
.booktitle { font-style: italic; }
.papernote {
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-style: italic;
  margin-bottom: 0.6rem;
}
.abstract { margin-bottom: 0.5rem; }

/* --- Collapsible abstracts ------------------------------------------- */
/* The paper title lives inside <summary> so the "Abstract" cue can sit on
   the same line, right after the title. Clicking anywhere on that line
   toggles the abstract. Native HTML, no JavaScript.                     */
details.paper { margin: 0 0 2rem; }

details.paper > summary {
  cursor: pointer;
  display: block;
  list-style: none;          /* hides the default triangle in Firefox    */
}
details.paper > summary::-webkit-details-marker { display: none; }  /* Safari */

/* The cue that follows the title. Kept on one line so it never breaks
   across a line by itself.                                              */
.cue {
  color: var(--link);
  font-size: 0.95rem;
  font-weight: 400;
  white-space: nowrap;
  margin-left: 0.15rem;
}
.cue::before { content: "\00A0\25B8\00A0"; }
details.paper[open] .cue::before { content: "\00A0\25BE\00A0"; }
details.paper > summary:hover .cue { text-decoration: underline; }

details.paper > .abstract { margin: 0.7rem 0 0; }

/* --- Course entries -------------------------------------------------- */
.course { margin-bottom: 1.1rem; }
.course .title { font-weight: 600; color: var(--title); }
.course .meta {
  display: block;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* --- Student quotes -------------------------------------------------- */
blockquote {
  margin: 0 0 1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  font-style: italic;
}
blockquote .course-tag {
  display: block;
  font-style: normal;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 0.2rem;
}

/* --- Buttons --------------------------------------------------------- */
.buttons { margin: 1.75rem 0 0; }
.buttons a {
  display: inline-block;
  padding: 0.45rem 1rem;
  margin: 0 0.5rem 0.5rem 0;
  border: 1px solid #999;
  border-radius: 3px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.95rem;
}
.buttons a:hover { background: #f4f4f2; }

/* --- Headshot -------------------------------------------------------- */
.headshot {
  float: right;
  width: 16rem;
  margin: 0 0 1.25rem 1.75rem;
  border-radius: 2px;
}

/* --- Footer ---------------------------------------------------------- */
footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* --- Mobile ---------------------------------------------------------- */
@media (max-width: 30rem) {
  body { padding: 2rem 1.15rem 4rem; font-size: 1rem; }
  .headshot { float: none; display: block; width: 12rem; margin: 0 0 1.25rem; }
  nav a { margin-right: 1rem; }
}

/* --- Print ----------------------------------------------------------- */
@media print {
  nav, .buttons { display: none; }
  body { max-width: none; }
}
