:root {
  --link-dark-red: #900010;
  --link-light-red: #ff0020;
  --background-dark-grey: #2b2d32;
  --background-light-grey: #efefef;
  --text-grey: #555;
  --separator-grey: #d5d5d6;
  --menu-grey: #ababad;
  --submenu-grey: #555;
}

@font-face {
  font-family: "DINPro";
  src: url("../fonts/regular.woff2") format("woff2");
  font-style: normal;
  font-weight: normal;
  font-display: fallback;
}

@font-face {
  font-family: "DINPro";
  src: url("../fonts/medium.woff2") format("woff2");
  font-style: normal;
  font-weight: bold;
  font-display: fallback;
}



/*********************
 Document structure
**********************/  

html {
   margin: 0px;
   padding: 0px;
   height: 100%
}

body {
  color: black;
  background: white;
  font-family: "DINPro", Helvetica, Arial, sans-serif;
  font-size: 11pt;
  margin: 0px;
  min-height: 100%
}

#wrapper {
  display: grid;
  grid-gap: 0px;
  grid-template-areas: 
      "sidebar  content"
	  "footer footer";
  grid-template-columns: min-content 1fr;
  grid-template-rows: auto min-content;
  min-height: calc(100vh - 165px);
}

main {
  grid-area: content;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
}

main > section:last-child {
  flex: auto;
}

aside { /* for IE */
  display: none;
}

@supports (display: grid) {
  aside {
    display: unset;
    grid-area: sidebar;
    width: 250px;
    margin-right: 65px;
    margin-top: 50px;
    z-index: 1;
    position: relative;
  }
}

footer {
  grid-area: footer;
}

/* make section backgrounds extend across the whole page */
@media (min-width: 1250px) {
  html {
    overflow-x: hidden;
  }
  
  body {
    max-width: 1200px;
    margin: 0px auto;
    padding: 0px 25px; 
  }

  main > section, footer > section, #navbar {
    position: relative;
    margin-left: -600rem;
    margin-right: -600rem;
    padding-left: 600rem;
    padding-right: 600rem;
  }
}

@media (max-width: 1250px) {
  header, #navbar, main > *, footer > *  {
    padding-left: 25px;
    padding-right: 25px;
  }
  
  aside {
    display: none;
  }
}

@media (max-width: 480px) {
  header, #navbar, main > *, footer > *  {
    padding-left: 15px;
    padding-right: 15px;
  }
}


/*********************
 Basic styling
**********************/ 


main > section, footer > section {
  padding-top: 50px;
  padding-bottom: 50px;
}

@media (max-width: 600px) { 
  main > section, footer > section {
    padding-top: 30px;
    padding-bottom: 30px;
  }
}

section > *:first-child {
  margin-top: 0px;
}

section > *:last-child {
  margin-bottom: 0px;
}

main > section:nth-child(even), .lightgrey {
  background: whitesmoke; /* for IE */
  background: var(--background-light-grey);
}

.darkgrey {
  background: black; /* for IE */
  background: var(--background-dark-grey);
}

h2 {
  margin-top: 0px;
  font-size: 1.8em;
}

h2::before {
  content: '';
  display: block;
  width: 25px;
  border-top: 3px solid black;
  padding-bottom: 12px;
  color: #2b2d32;
}

main h2 {
  border-bottom: 1px solid var(--separator-grey);
  padding-bottom: 10px;
  margin-bottom: 30px;
  color: #2b2d32;
}

@media (max-width: 480px) {
  main h2, footer h2 {
    border-bottom: none;
    padding-bottom: 0px;
    margin-bottom: 15px;
  }
}

h2 a.sidelink {
  float: right;
  color: var(--text-grey);
  font-size: 0.7em;
  padding-top: 5px;
}

h2 a.sidelink:hover {
  color: var(--link-dark-red);
}

@media (max-width: 480px) {
  h2 a.sidelink {
    display: block;
    float: none;
  }
}

h3 {
  margin: 25px 0px 5px;
  font-size: 1.25em;
}

h4 {
  line-height: 1;
  margin-top: 5px;
  margin-bottom: 7px;
}

a:link, a:visited {
  color: var(--link-dark-red);
  text-decoration: none;
}

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

hr { 
  border: 0;
  border-bottom: 1px solid var(--separator-grey); 
  height: 0; 
  margin: 25px 0px;
}

pre {
  background: var(--background-dark-grey);
  color: white;
  padding: 25px;
  border-radius: 7px;
  box-shadow: 0 10px 20px -8px rgba(0, 0, 0, 0.2);
  font-size: 16px;
}

ul:not(.compact) {
  line-height: 1.7; 
}

h2 + ul, h3 + ul, h4 + ul {
  margin-top: 0px;
}

table {
  border-collapse: collapse;
  border-style: hidden;
  margin: 25px 0px;
}

td, th {
  border: 1px solid var(--text-grey);
  padding: 6px;
}

@media (max-width: 480px) {
  .optional {
    display: none;
  }
}


/************************
 Page header
************************/ 

header {
  min-width: 200px;
  padding-top:20px;
  min-height: 65px;
}

header h1 {
  margin: 0px;
}

header h1 a {
  display: block;
  background: url(../images/logo.svg) no-repeat;  
  text-indent: -9999em;
  overflow: hidden;
  width: 192px;
  height: 42px;
}

img#logo-eth {
  float: right;
  width:150px;
  margin-top: 10px;
}

@media (max-width: 600px) {
  header {
    background: var(--background-dark-grey);
  }

  img#logo-eth {
    float: none;
    filter: invert(1);
    width:120px;
  }
  
  header h1 {
    padding: 10px 0px 20px;
  }

  header h1 a {
    background: none;  
    text-indent: 0px;
    width: auto;
    height: auto;
    color: white !important;
    font-size: 17px;
    font-weight: 400;
  }
}

@media (max-width: 480px) {
  header .optional {
    display: none;
  } 
}


/************************
 Page footer
************************/ 

footer h2 {
  color: #fff;
  margin-bottom: 20px;
}

footer h2::before {
  border-top-color: #fff;
}

footer nav li {
  display: block;
}

footer nav li:not(:last-child) {
  margin-bottom: 10px;
}

footer nav a {
  color: white !important; /* for IE */
  color: var(--menu-grey) !important; 
  font-size: 17px;
}

footer nav a:hover {
  color: white !important; 
}

footer #smallprint {
  padding-top: 25px;
  padding-bottom: 50px;
  text-align: right;
  color: #777;
  font-size: 13px;
}

footer #smallprint div {
  padding-bottom: 7px;
}

footer #smallprint a {
  color: inherit;
}

footer #smallprint a:hover {
  color: var(--link-dark-red);
}

footer #smallprint span:not(:first-child)::before {
  content: "|";
  margin: 0px 15px;
}

footer img {
  width: 150px;
  float: left;
}

@media (max-width: 640px) {
  footer img {
    display: none;
  }
  
  footer #smallprint {
    padding-bottom: 25px;
  }
}




/************************
 Teaching
************************/ 

#teaching > div {
  display: grid;
  grid-gap: 0px;
  grid-template-columns: 1fr 1fr 1fr;
  grid-gap: 50px;
}

#teaching ul {
  padding-left: 20px;
  margin: 0px;
}

#teaching li {
  margin-top: 10px;
}

.course:not(:first-of-type) {
  margin-left: -25px;
  padding-left: 25px;
  border-left: 1px solid var(--separator-grey);
}

.course:not(:last-of-type) {
  margin-right: -25px;
  padding-right: 25px;
}

.course h3 {
  margin-top: 0px;
}

@media (max-width: 700px) {
  #teaching > div {
    grid-template-columns: auto;
    grid-gap: 25px;
  }
  
  .course {
    padding: 0px !important;
    margin: 0px !important;
    border-left: none !important;
  }
}



/************************
 Persons
************************/ 

/* overall structure */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(375px, auto));
  grid-gap: 30px;
}

.cards.outer {
  grid-row-gap: 0px;
}

#people h3 {
  border-bottom: 1px solid var(--separator-grey);
  padding-bottom: 8px;
  margin-bottom: 25px;
}

#people h3 {
   margin-top: 50px;
}

#people section.hidden {
    display: none;
}

@media (max-width: 820px) {  
  #people h3 {
    margin-top: 30px !important;
  }
}

@media (max-width: 480px) {
  .cards {
    grid-template-columns: 1fr;
    grid-gap: 15px;
  }
  
  #people h3 {
    margin-bottom: 10px;
    border-bottom: none;
  }
}


/* joint styling with personal page */

.card a, .person a {
  color: black;
}

.card a:hover, .person a:hover {
  color: var(--link-dark-red) !important;
}

.card ul, .person ul {
  list-style-type: none;
  line-height: 2;
  margin: 0px;
  padding-left: 0px;
}

.card ul i, .person ul i {
  margin-left: 2px;
  width: 20px;
  text-align: center;
}

.card li, .person li {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* styling of cards */

.card {
  display: flex;
  line-height: 1.5;
  background: #fff;
  border-radius: 3px;
  transition-property: box-shadow;
  transition-duration: 1.5s;
  overflow: hidden;
}

.card:hover {
  box-shadow: 
    0 10px 20px -3px rgba(0,0,0,0.2), 
    0 6px 6px rgba(0,0,0,0.1);
}

.card h4 {
  font-size: 1.15em;
}

.card img {
  display: block;
  width:111px;
  height: 100%;
}

.card > div {
  margin: 17px 17px 0px 22px;
  flex: 1;
  min-width: 0px;
}

.card .heading span {
  display: none;
}

@media (max-width: 480px) {  
  .card {
    padding: 15px;
    transition: none;
    box-shadow: none !important;
  }
  
  .card.expanded {
    box-shadow: 
      0 10px 20px -3px rgba(0,0,0,0.2), 
      0 6px 6px rgba(0,0,0,0.1) !important;
  }
  
  .card > a {
     display: none;
  }
  
  .card > div {
    margin: 0px;
  }
  
  .card:not(.expanded) h4 {
    margin: 0px;
  }
  
  .card:not(.expanded) ul {
    display: none;
  }
}


/* Ueli */

.uelidetails {
  display: flex;
}

.uelidetails > * {
  flex: 1;
}

@media (max-width: 990px) {
  .uelidetails div:nth-child(2) {
    display: none;
  }
}

@media (min-width: 821px) {
  #ueli h3 {
    display: none;
  }
  
  #ueli img {
    width:170px;
  }
  
  #ueli .heading {
    border-bottom: 1px solid var(--separator-grey);
    padding-bottom: 8px;
    margin-bottom: 25px;
  }
  
  #ueli .heading span {
    display: unset;
  }
  
  #ueli .card > div {
    margin: 17px 25px 0px;
  }
}

@media (max-width: 820px) {  
  .uelidetails div:first-child strong,
  .uelidetails div:not(:first-child) {
    display: none;
  }
  
  #people section.hidden {
    display: block;
  }
}

/* Seniors */
@media (min-width: 1250px) {
  #seniors.large img {
    width:129px;
  }
  
  #seniors.large .card > div {
    margin-left: 25px;
  }
  
  #seniors.large .card .heading {
    padding-bottom: 10px;
    line-height: 1;
  }
  
  #seniors.large .card .heading span {
    display: unset;
  }
}

/* Personal pages */

.person > div {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-gap: 30px;
  line-height: 1.5;
}

.person > div > img {
  width:150px;
}

.person h3 {
	margin: 0px;
}

.person .persondetails {
  display: flex;
  flex-wrap: wrap;
}

.persondetails > * {
  flex: 1;
  margin-top: 20px;
  white-space: nowrap;
}

.persondetails > :not(:last-child) {
  margin-right: 20px;
}

@media (min-width: 870px) {
  .person.huge img {
    width:235px;
  }
  
  .person.huge .persondetails {
    margin-top: 25px;
  }
}

@media (max-width: 480px) {
  .person > div {
    grid-template-columns: 1fr;
  }
}



/************************
 Publications
************************/ 

.pubentry {
  line-height: 1.7;
}

.pubentry:not(:first-of-type) {
   margin-top: 20px;
}

.pubentry:not(:last-of-type) {
  border-bottom: 1px solid var(--separator-grey); 
  padding-bottom: 20px;
}

.pubentry h3 {
    margin-top: 0px;
    margin-bottom: 7px;
    line-height: 1.3;
}

.venue {
  font-style: italic;
  color: var(--text-grey);
}

.publinks {
  list-style-type: none;
  margin: 0px;
  margin-top: 10px;
  padding: 0px;
}

.publinks li {
  display: inline-block;
}

.publinks li:not(:last-child) {
  padding-right: 35px;
}

.publinks i {
  margin-left: 1px;
  width: 15px;
}

ul.iconlist {
  list-style-type: none;
  line-height: 2;
  margin: 0px;
  padding: 0px;
}

ul.iconlist i {
  width: 25px;
  text-align: left;
}

#bibtex pre {
  max-width: calc(100vw - 120px);
  overflow-x: auto;
}

@media (min-width: 1250px) {
  #bibtex pre {
    max-width: 835px;
  }
}

@media (max-width: 480px) {
  #bibtex pre {
    max-width: calc(100vw - 80px);
  }
}


/************
 Misc
*************/

table.headercol td:first-child {
  text-align: right;
}
