/* ==========================================================================
   custom.css  --  site-wide type system, loaded after style.css

   Two families, plus one accent:
     serif     (Palatino, same as the CV)  -> reading text and headings
     sans      (Quicksand, the theme font)  -> small uppercase labels: menu, job title, panel headers
     greeting  (Dancing Script, script)     -> the single "Hi there!" line
   Change the variables below to restyle the whole page.
   ========================================================================== */

:root {
  --serif: Palatino, "Palatino Linotype", "Book Antiqua", "URW Palladio L", "TeX Gyre Pagella", Georgia, serif;
  --sans: "Quicksand", Arial, sans-serif;
  --greeting: "Dancing Script", "Snell Roundhand", cursive;   /* the "Hi there!" line only */
  --ink: #222;        /* main text */
  --muted: #666;      /* secondary text: dates, authors, details */
}

/* ---- base ---- */
body {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  color: #333;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--serif); }

/* ---- sidebar ---- */
#colorlib-aside #colorlib-logo {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
}
#colorlib-aside .position {
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* ---- intro ---- */
/* The intro block is sized to the window by js/main.js. Let it grow when the text is taller than the window. */
#colorlib-hero.js-fullheight,
#colorlib-hero .flexslider.js-fullheight { height: auto !important; min-height: 100vh; }

#colorlib-hero .flexslider .slider-text > .slider-text-inner h1 {
  font-family: var(--greeting);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 22px;
}
@media screen and (min-width: 769px) {
  #colorlib-hero .flexslider .slider-text > .slider-text-inner h1 { font-size: 60px; }
}
@media screen and (max-width: 768px) {
  #colorlib-hero .flexslider .slider-text > .slider-text-inner h1 { font-size: 40px; }
}
#colorlib-hero .flexslider .slider-text > .slider-text-inner h2 {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--ink);
  text-wrap: balance;         /* lines of a paragraph come out about equally long: no stair-step right edge, no lone last word */
}
#colorlib-hero .nowrap { white-space: nowrap; }   /* words that must stay together (also the fallback for older browsers) */

/* ---- section titles: Education / Selected Publication / Work Experience ---- */
.colorlib-heading {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 4px;
  margin-bottom: 3em;
}

/* ---- cards in Education and Selected Publication ---- */
.timeline-centered .timeline-entry .timeline-entry-inner .timeline-label h2 {
  font-family: var(--serif);
  font-size: 18.5px;          /* small enough that most project titles fit on one line */
  text-wrap: balance;         /* a title that still wraps splits into even lines, no stray last word */
  font-weight: 700;
  line-height: 1.4;
  color: #111;
  margin-bottom: 12px;
}
.timeline-centered .timeline-entry .timeline-entry-inner .timeline-label h2 span {
  opacity: 1;
  -ms-filter: none;
  filter: none;
  color: var(--muted);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
}
.timeline-centered .timeline-entry .timeline-entry-inner .timeline-label p,
.timeline-centered .timeline-entry .timeline-entry-inner .timeline-label .paper-conf {
  font-size: 17px;
  line-height: 1.6;
}
.timeline-centered .timeline-entry .timeline-entry-inner .timeline-label .paper-conf {
  color: var(--ink);
  margin: 4px 3px 6px;
}

/* ---- Selected Projects: circle colour = kind of project ---- */
:root {
  --industry: #2F4858;   /* industry project */
  --research: #DA7756;   /* research project (site accent) */
  --fig-w: 200px;        /* width of the figure in a project card (desktop) */
}
.timeline-centered .timeline-entry .timeline-entry-inner .timeline-icon.project-industry { background: var(--industry); }
.timeline-centered .timeline-entry .timeline-entry-inner .timeline-icon.project-research { background: var(--research); }

/* ---- Selected Projects: text + figure layout inside each card ----
   The template put a fixed-width Bootstrap .container inside the card, so the
   figure ended up almost touching (or past) the card's right edge. Lay the two
   columns out with flexbox instead, so the figure keeps the same margin to the
   right edge as the card's padding on the other sides. */
.timeline-label .container { width: auto; max-width: none; padding: 0; margin: 0; }
.timeline-label .container > .row { margin: 0; }
.timeline-label .container > .row > [class*="col-md-"] { float: none; width: auto; min-height: 0; padding-right: 0; }
.timeline-label .container > .row > .col-md-4 { padding-left: 0; }
.timeline-label .container > .row > .col-md-5 p a { white-space: nowrap; }   /* never split a link label across lines */
.timeline-label .container > .row > .col-md-5 p,
.timeline-label .container > .row > .col-md-5 .paper-conf { text-wrap: balance; }   /* wrapped lines come out even, so no short last line */
.timeline-label .container > .row > .col-md-4 img,
.timeline-label .container > .row > .col-md-4 video { display: block; width: 100%; height: auto; }
/* Paper figures have a white background; "multiply" lets the card colour show
   through the white, so the figure sits on the card instead of in a white box.
   Coloured parts of the figure are unaffected. No image files are changed. */
.timeline-label .container > .row > .col-md-4 img { mix-blend-mode: multiply; }
.timeline-label .container > .row > .col-md-4 img.project-logo { width: 70%; margin: 0 auto; }   /* wordmark logo, not a figure */
@media screen and (min-width: 992px) {   /* side by side */
  .timeline-label .container > .row { display: flex; align-items: center; }   /* figure vertically centred against the text */
  .timeline-label .container > .row > .col-md-5 { flex: 1 1 0; min-width: 0; padding-left: 0; }   /* text lines up with the title; leaves room for a larger figure */
  .timeline-label .container > .row > .col-md-4 { flex: 0 0 var(--fig-w); margin-left: 20px; }
}
@media screen and (min-width: 992px) {
  /* .figure-full: for cards whose title is short (it does not run above the figure),
     centre the figure against the whole card, title included, instead of the text below it. */
  .timeline-label.figure-full { display: grid; grid-template-columns: minmax(0, 1fr) var(--fig-w); column-gap: 20px; }
  .timeline-label.figure-full > h2 { grid-column: 1; grid-row: 1; }
  .timeline-label.figure-full > .container,
  .timeline-label.figure-full > .container > .row { display: contents; }
  .timeline-label.figure-full > .container:before, .timeline-label.figure-full > .container:after,
  .timeline-label.figure-full > .container > .row:before, .timeline-label.figure-full > .container > .row:after { display: none; }
  .timeline-label.figure-full > .container > .row > .col-md-5 { grid-column: 1; grid-row: 2; }
  .timeline-label.figure-full > .container > .row > .col-md-4 { grid-column: 2; grid-row: 1 / span 2; align-self: center; margin-left: 0; }
}
@media screen and (max-width: 991px) {   /* stacked: figure under the text */
  .timeline-label .container > .row > .col-md-4 { max-width: 260px; margin-left: 15px; }
  .timeline-label .container > .row > .col-md-4 img.project-logo { width: 132px; margin: 4px 0 0; }
}

/* ---- Work Experience: same timeline cards as Education ---- */
.timeline-image .exp-logo {
  width: 10%;
  max-width: 10%;
  aspect-ratio: 1;
  object-fit: cover;
  vertical-align: middle;
}
/* flat company marks sit whole inside a white disc with a hairline edge
   (a wrapper, so the circle does not clip the corners of square marks) */
.timeline-image .exp-logo { background: #fff; border: 1px solid #e9e4db; }
.timeline-image .exp-disc {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 10%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #e9e4db;
}
.timeline-image .exp-disc img { display: block; width: 58%; max-height: 58%; object-fit: contain; }
.timeline-image .exp-disc.exp-disc-wide img { width: 72%; }      /* wordmark */
.timeline-image .exp-disc.exp-disc-square img { width: 46%; }    /* square mark: keep its corners inside */
.timeline-label .exp-points {
  margin: 0;
  padding-left: 20px;
  font-size: 17px;
  line-height: 1.6;
  color: #333;
}
.timeline-label .exp-points li { margin-bottom: 2px; text-wrap: pretty; }
.timeline-label .exp-points li:last-child { margin-bottom: 0; }

/* ---- even space above and below the text in every card ----
   The trailing margin of the last element used to add to the card's
   bottom padding, so the gap under the text was larger than the gap above. */
.timeline-centered .timeline-entry .timeline-entry-inner .timeline-label h2:last-child { margin-bottom: 0; }
@media screen and (min-width: 992px) {   /* side-by-side layout: text column ends the card */
  .timeline-centered .timeline-entry .timeline-entry-inner .timeline-label p:last-child { margin-bottom: 0; }
}
