/**********************/
/*  Top level layout  */
/**********************/

html {
  min-height: 100%;
}

body {
  padding: 0;
  margin: 0;
  background: #e6e6e6;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.4;
  font-size: 15px;
  color: #111;
}

#wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 10px 20px;
}

#main {
  min-height: calc(100vh - 74px);
  padding: 10px 24px 20px;
  border: 1px solid #666;
  border-radius: 1em;
  background: white;
}

/* clear the floated side box */
#main::after {
  content: "";
  display: block;
  clear: both;
}

/***********************/
/* Style for all pages */
/***********************/

a:link {
  color: #336699;
  text-decoration: none;
}

a:visited {
  color: #aa6699;
  text-decoration: none;
}

/* only real links: publication entries sit inside <a id="..."> anchors */
a[href]:hover {
  color: #6699aa;
  text-decoration: underline;
}

h1 {
  padding: 13px 0 0 0;
  margin: 0 0 20px;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
}

h2 {
  margin: 24px 0 10px;
  font-size: 20px;
  font-weight: normal;
}

h3 {
  font-size: 17px;
  font-weight: normal;
}

p {
  margin-left: 10px;
}

#main li {
  margin-top: 5px;
}

/* keep rules from running underneath the floated side box */
hr {
  overflow: hidden;
  border: 0;
  border-top: 1px solid #999;
}

/*****************************/
/* Side box: photo and links */
/*****************************/

#right_box {
  float: right;
  width: 170px;
  padding-left: 25px;
  margin-top: 66px;
  margin-bottom: 15px;
}

.photo_with_shadow img {
  display: block;
  width: 160px;
  height: auto;
  padding: 2px;
  border: 1px solid #666;
  background-color: white;
  box-shadow: 4px 4px 5px #999;
}

#right_navs {
  margin-top: 16px;
}

#right_navs ul {
  padding-left: 0;
  margin: 0;
  list-style-type: none;
}

#right_navs li {
  position: relative;
  margin-top: 6px;
  padding-left: 19px;
}

/* arrow-in-box bullet */
#right_navs li::before {
  content: "\203A";
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 10px;
  height: 10px;
  border: 1px solid #336699;
  color: #336699;
  font: bold 11px/9px Arial, Helvetica, sans-serif;
  text-align: center;
}

/************************/
/* Page specific styles */
/************************/

table.grants {
  margin: 10px 0 0 10px;
  border-collapse: collapse;
}

table.grants th,
table.grants td {
  padding: 6px 14px 6px 0;
  border-bottom: 1px solid #ddd;
  text-align: left;
  vertical-align: top;
}

table.grants th {
  border-bottom-color: #666;
}

/* period and status stay on one line */
table.grants td:first-child,
table.grants td:last-child {
  white-space: nowrap;
}

/* publication link badges */
.pub-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

a.badge:link,
a.badge:visited {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px 2px 8px;
  border-radius: 999px;
  background: #666;
  color: white;
  font: bold 11px/1.5 Arial, Helvetica, sans-serif;
  letter-spacing: 0.03em;
  text-decoration: none;
}

a.badge:hover {
  color: white;
  text-decoration: none;
  filter: brightness(1.2);
}

/* icon, drawn in the text colour through a mask */
a.badge::before {
  content: "";
  width: 11px;
  height: 11px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

a.badge-pdf { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 1h6v4h4v10H3z M10.500 1l2.500 2.500h-2.500z'/%3E%3C/svg%3E"); }
a.badge-code { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 4L2 8l4 4M10 4l4 4-4 4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
a.badge-tool { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='3.500' fill='none' stroke='black' stroke-width='3'/%3E%3Ccircle cx='8' cy='8' r='6.200' fill='none' stroke='black' stroke-width='2.400' stroke-dasharray='2.435 2.435'/%3E%3C/svg%3E"); }
a.badge-data { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1C4.700 1 2 2 2 3.500S4.700 6 8 6s6-1 6-2.500S11.300 1 8 1z M2 6v2.500C2 10 4.700 11 8 11s6-1 6-2.500V6c0 1.500-2.700 2.500-6 2.500S2 7.500 2 6z M2 11v1.500C2 14 4.700 15 8 15s6-1 6-2.500V11c0 1.500-2.700 2.500-6 2.500S2 12.500 2 11z'/%3E%3C/svg%3E"); }
a.badge-video { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 2l10 6-10 6z'/%3E%3C/svg%3E"); }
a.badge-slides { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1 2h14v9H1z M7 11h2v2h3v1.500H4V13h3z'/%3E%3C/svg%3E"); }
a.badge-bib { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 1h8v14l-4-3.500L4 15z'/%3E%3C/svg%3E"); }
a.badge-news { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 3h7v7M13 3L4 12' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

a.badge-pdf:link, a.badge-pdf:visited { background: #b93a32; }
a.badge-code:link, a.badge-code:visited { background: #2e7d4f; }
a.badge-tool:link, a.badge-tool:visited { background: #2f6fb0; }
a.badge-data:link, a.badge-data:visited { background: #14808a; }
a.badge-video:link, a.badge-video:visited { background: #7b4aa8; }
a.badge-slides:link, a.badge-slides:visited { background: #b8650f; }
a.badge-bib:link, a.badge-bib:visited { background: #6b6b6b; }
a.badge-news:link, a.badge-news:visited { background: #8a6552; }

p.affiliation {
  font-size: 16px;
}

.blink {
  animation: blinkAnimation 2s step-start infinite;
}

@keyframes blinkAnimation {
  50% {
    visibility: hidden;
  }
}

.video-wrapper {
  width: 80%;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

video {
  width: 100%;
  display: block;
}

/*****************/
/* Small screens */
/*****************/

@media (max-width: 640px) {
  #main {
    padding: 10px 14px 20px;
  }

  #right_box {
    float: none;
    width: auto;
    padding-left: 0;
    margin-top: 10px;
  }

  .photo_with_shadow img {
    margin: 0 auto;
  }

  /* funding table: one stacked block per grant */
  table.grants thead {
    display: none;
  }

  table.grants tr {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
  }

  table.grants td {
    display: block;
    padding: 0;
    border: 0;
  }

  table.grants td:first-child,
  table.grants td:nth-child(2) {
    display: inline;
    font-weight: bold;
  }

  table.grants td:first-child::after {
    content: ",";
  }

  table.grants td:last-child {
    font-style: italic;
  }

  #right_navs ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 16px;
  }
}
