/* =====================================================================
   Bui Thanh Khoa - site theme
   Quiet, text first. One column, one accent, no chrome.

   Layout and interaction follow the reference site:
     - single measure of 40em, centred
     - link colour is ink; hover is a gold highlight
     - external links carry an arrow
     - hairline rules, no shadows, no fills

   Type: IBM Plex Serif for headings, IBM Plex Sans for text,
         IBM Plex Mono for numbers, dates, and metadata.
   ===================================================================== */

/* -- 1. Page ------------------------------------------------------- */
html {
  font-size: 1em;            /* respect the reader's own font size */
  max-width: 40em;
  margin: 0 auto;
  padding: 1.5rem 1rem 0;

  /* Always show the scrollbar, so the text does not jump between
     long and short pages: */
  overflow-y: scroll;

  font-family: "IBM Plex Sans", system-ui, sans-serif;
  line-height: 1.6;
  color: #111;
  background: #fff;
}

body {
  margin: 0;
}

/* -- 2. Headings --------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
  margin: 2.2rem 0 0.8rem;
}

h1 { font-size: 1.65rem; }
h2 { font-size: 1.28rem; }
h3 { font-size: 1.06rem; }
h4,
h5,
h6 { font-size: 1rem; }

h2 + p,
h3 + p,
h4 + p { margin-top: 1.1rem; }

h1:first-child,
h2:first-child { margin-top: 0; }

/* A linked heading, shown only on hover, as on the reference site: */
h2 > a.anchor,
h3 > a.anchor {
  text-decoration: none;
  margin-left: 0.3em;
  font-size: 0.75em;
  color: #bbb;
  visibility: hidden;
}
h2:hover > a.anchor,
h3:hover > a.anchor { visibility: visible; }

/* -- 3. Text ------------------------------------------------------- */
p,
ul,
ol { margin: 1.2rem 0; }

li + li { margin-top: 0.5rem; }

hr {
  border: 0;
  border-top: 1px solid #ddd;
  margin: 1.5rem 0;
}
.nav-hr {
  clear: both;
  margin-top: 1rem;
}

.lede { font-size: 1.05rem; }
.meta {
  color: #666;
  font-size: 0.9rem;
}
.small { font-size: 0.85rem; }

code,
pre,
kbd,
samp {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.88em;
}
pre {
  background: #f2f2f0;
  border: 1px solid #ddd;
  border-radius: 0.3rem;
  padding: 0.6rem;
  overflow-x: auto;
}

blockquote {
  margin: 1.5rem 0 1.5rem 1rem;
  padding: 0.5rem 1rem;
  background: #f7f7f5;
  border-left: 3px solid #d9d9d4;
  border-radius: 0 0.3rem 0.3rem 0;
  color: #333;
}
blockquote p { margin: 0.5rem 0; }

/* -- 4. Links ------------------------------------------------------ */
a {
  color: #111;
  text-decoration-color: #b9b9b9;
  text-underline-offset: 0.15em;
}
a:hover { background-color: gold; }

/* External links get an arrow, so the reader knows they will leave: */
a[target="_blank"]::after {
  content: "\2197";
  margin-left: 0.14em;
  font-size: 0.8em;
}

/* -- 5. Header ----------------------------------------------------- */
.site-title {
  margin: 0;
  font-size: 1.5rem;
}
.site-title a { text-decoration: none; }

.tagline {
  margin: 0.25rem 0 1.1rem;
  color: #555;
  font-style: italic;
}

/* -- 6. Navigation ------------------------------------------------- */
nav > a {
  margin-right: 0.9rem;
  text-decoration: none;
}
nav > a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.feed-link {
  color: #c25e0a;
  padding: 0 0.2rem;
}
.feed-link:hover {
  background-color: #d2660b;
  color: #fff;
}

/* -- 7. Lists ------------------------------------------------------ */
ul.plain,
ol.plain {
  padding-left: 0;
  list-style: none;
}

/* Lists of posts and papers: title on one line, source below. */
.entry { margin-bottom: 1rem; }
.entry > a,
.entry .entry-title {
  text-decoration: none;
  font-weight: 700;
}
.entry > a:hover,
.entry .entry-title:hover { background-color: gold; }
.entry .source {
  display: block;
  color: #666;
  font-size: 0.85rem;
}

/* Publication list: a numbered bibliography. */
.pub-list {
  padding-left: 2.3rem;
  margin-top: 1rem;
}
.pub-list > li {
  margin-bottom: 1rem;
  padding-left: 0.15rem;
}
.pub-list > li::marker {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  color: #999;
}
.pub-title { font-weight: 600; }
.pub-venue { font-style: italic; color: #444; }
.pub-quartiles {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: #276749;
  white-space: nowrap;
}
.pub-cites {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: #888;
  white-space: nowrap;
}

/* -- 8. Fact tables (education, appointments) ---------------------- */
.cv {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
}
.cv th {
  text-align: left;
  font-weight: 400;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  color: #666;
  white-space: nowrap;
  padding: 0.55rem 1.2rem 0.55rem 0;
  border-top: 1px solid #eee;
  vertical-align: baseline;
}
.cv td {
  padding: 0.55rem 0;
  border-top: 1px solid #eee;
  vertical-align: baseline;
}
.cv tr:first-child th,
.cv tr:first-child td { border-top: 0; }
.cv .place {
  display: block;
  color: #666;
  font-size: 0.85rem;
}

/* -- 9. Media ------------------------------------------------------ */
main img,
main video {
  max-width: 100%;
  height: auto;
  border: 1px solid #111;
  border-radius: 0.3rem;
}
.portrait {
  max-width: 10em;
  float: none;
  margin: 0 0 1rem;
}

/* -- 10. Profile links --------------------------------------------- */
.links { padding-left: 0; list-style: none; }
.links li { margin-bottom: 0.45rem; }

/* -- 11. Footer ---------------------------------------------------- */
footer {
  margin-top: 3rem;
  padding-bottom: 2rem;
  text-align: right;
  font-size: 0.8rem;
  color: #666;
}
footer a { color: #666; }
footer p { margin: 0.6rem 0; }

/* -- 12. Small screens --------------------------------------------- */
@media (max-width: 32em) {
  html { padding: 1rem 0.9rem 0; }
  nav > a { margin-right: 0.65rem; }
  .pub-list { padding-left: 1.7rem; }
  .cv th { white-space: normal; padding-right: 0.9rem; }
}

/* -- 13. Print ----------------------------------------------------- */
@media print {
  html {
    max-width: none;
    padding: 0;
    font-size: 10.5pt;
  }
  nav,
  footer,
  .feed-link,
  hr { display: none; }
  a { text-decoration: none; }
  a[target="_blank"]::after { content: ""; }
  .pub-list > li { page-break-inside: avoid; }
}
