/* =====================================================================
   Stylesheet of the BMW collaboration website.
   Colours, fonts and the width of the text are set in the first block;
   the rest rarely needs changing.
   ===================================================================== */

:root {
  --text:    #1b1b1b;
  --muted:   #5f5f5f;
  --accent:  #1f4e8c;   /* links */
  --rule:    #d9d9d6;   /* thin lines */
  --shade:   #f3f3f0;   /* background of table headers and code */
  --width:   46rem;     /* maximum width of the text column */
  --serif:   Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans:    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---- page ----------------------------------------------------------- */

html {
  font-size: 106.25%;   /* 17px */
}

body {
  max-width: var(--width);
  margin: 0 auto;
  padding: 0 1.25rem;
  font-family: var(--serif);
  line-height: 1.55;
  color: var(--text);
  background: #fff;
}

/* ---- header and link bar -------------------------------------------- */

header {
  padding-top: 2.25rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
}

.site-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.2;
}

.site-title a {
  color: var(--text);
  text-decoration: none;
}

.site-subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

nav ul {
  display: flex;
  flex-wrap: wrap;          /* on narrow screens the links simply wrap */
  gap: 0 1.6rem;
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
}

nav a {
  display: inline-block;
  padding: 0.3rem 0 0.55rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;      /* let the marker sit on the header line */
  color: var(--accent);
  text-decoration: none;
}

nav a[aria-current="page"] {   /* the page you are on */
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* ---- content -------------------------------------------------------- */

main {
  padding: 1.75rem 0 3rem;
}

h1, h2, h3, h4 {
  font-family: var(--sans);
  line-height: 1.25;
}

h1 { font-size: 1.75rem; margin: 0 0 1.25rem; }
h2 { font-size: 1.3rem;  margin: 2.25rem 0 0.6rem; }
h3 { font-size: 1.1rem;  margin: 1.75rem 0 0.5rem; }

a { color: var(--accent); }

p, ul, ol, dl, table, figure { margin-top: 0; margin-bottom: 1rem; }

li { margin-bottom: 0.25rem; }

img {
  max-width: 100%;
  height: auto;
}

figure { margin-left: 0; margin-right: 0; }

figcaption {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

th { background: var(--shade); }

code {
  font-size: 0.9em;
  background: var(--shade);
  padding: 0.1em 0.3em;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2rem 0;
}

math {
  font-family: "Latin Modern Math", "STIX Two Math", "Cambria Math", math;
}

math[display="block"] {
  margin: 1rem 0;
  overflow-x: auto;
}

/* ---- publication list ----------------------------------------------- */

.references {
  margin-top: 1.5rem;
}

.csl-entry {
  margin-bottom: 1.25rem;
  padding-left: 0.9rem;
  border-left: 3px solid var(--rule);
}

.csl-entry > .csl-block:first-child {   /* title */
  font-weight: 700;
}

.csl-entry > .csl-block:nth-child(2) {  /* authors */
  color: var(--muted);
  font-size: 0.92rem;
}

.csl-entry > .csl-block:nth-child(3) {  /* journal, doi, arXiv */
  font-size: 0.92rem;
}

/* ---- people (templates/person.html) --------------------------------- */

.people {                    /* a group of people: columns of ~19rem */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 1.5rem 2rem;
  margin-bottom: 1.5rem;
}

.person {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.person-photo {              /* photos are cropped to this size */
  flex: none;
  width: 5.6rem;
  height: 7rem;
  object-fit: cover;
  background: var(--shade);
}

.person-text p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.4;
}

.person-text .person-name {
  margin-bottom: 0.15rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
}

.person-role {
  font-weight: 700;
}

.person-position,
.person-affiliation {
  color: var(--muted);
}

.person-email {
  margin-top: 0.15rem;
}

.people-short {              /* the one-line form: a plain list */
  display: block;
}

.person-short {
  margin: 0 0 0.35rem;
}

/* ---- footer --------------------------------------------------------- */

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1rem 0 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.85rem;
}

footer p, footer ul { margin: 0; }

footer ul {
  display: flex;
  gap: 1.25rem;
  padding: 0;
  list-style: none;
}

footer a { color: var(--muted); }

/* ---- small screens (phones) ----------------------------------------- */

@media (max-width: 30rem) {
  html { font-size: 100%; }
  nav ul { gap: 0 1.1rem; }
}

/* ---- printing ------------------------------------------------------- */

@media print {
  nav, footer { display: none; }
  a { color: inherit; text-decoration: none; }
}
