:root{
  --maxw: 860px;
  --text: #222;
  --muted: #666;
  --link: #1155cc;
}

*{ box-sizing: border-box; }

body{
  margin: 0;
  padding: 32px 18px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
             "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: #fff;
}

.wrapper{
  max-width: var(--maxw);
  margin: 0 auto;
}

/* Links */
a{
  color: var(--link);
  text-decoration: none;
}
a:hover{ text-decoration: underline; }

/* NEW: Desktop two-column layout */
.layout{
  display: flex;
  gap: 28px;
  align-items: flex-start;
}
.sidebar{
  flex: 0 0 260px;
}
.content{
  flex: 1;
  min-width: 0;
}

/* Desktop header: image left, text right */
.header{
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.portrait{
  display: block;
  border-radius: 2px;
  max-width: 280px;
  height: auto;
  margin-bottom: 18px; 
}

.name{
  margin: 0 0 10px 0;
  font-size: 34px;
  font-weight: 700;
  color: var(--text);
}

.affiliation{
  margin: 0 0 10px 0;
}

.contact{ margin: 0; }

/* Email should look like normal text */
.email{
  color: var(--text);
}
.email:hover{ text-decoration: underline; }

.social{
  margin-top: 10px;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: center;          /* center icons vertically in the row */
}

.social-link{
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;          /* center icon inside the box */
  justify-content: center;      /* center icon inside the box */
  color: var(--text);           /* affects icons that use currentColor */
  text-decoration: none;
}

/* Make every svg.icon fill the same box so they render same size */
.social-link .icon{
  width: 100%;
  height: 100%;
  display: block;
}

/* Section headings
   Tweak header size here:
   - Increase to 20px if you want slightly bigger
   - Decrease to 18px if you want smaller
*/
h3{
  margin: 28px 0 14px 0;      /* a bit more breathing room */
  padding-bottom: 0px;        /* space between text and line */
  font-size: 19px;
  font-weight: 700;
  border-bottom: 1px solid #ddd; /* the divider line */
}

/* No spacing before the first header */
.content h3:first-of-type{
  margin-top: 0;
}

/* Paper blocks */
.paper{
  margin: 0 0 16px 0;
}

.paper-title{
  margin: 0;            
  color: var(--text);
}

.paper-title .paper-title-link{
  color: var(--link);
  text-decoration: none;
}

.paper-title .paper-title-link:hover{
  text-decoration: underline;
}

.paper-authors{
  margin: 2px 0 0 0;
  color: var(--text);
}

/* Coauthor links: clickable but NOT underlined */
.paper-authors a{
  color: inherit;
  text-decoration: none;
}
.paper-authors a:hover{
  text-decoration: underline; /* optional: change to none if you want no hover cue */
}

/* Journal/status line: same as body (not italic) */
.paper-meta{
  margin: 2px 0 0 0;
  color: var(--text);
  font-size: 16px;
  font-style: italic;
}

/* Controls row */
.buttonbar{
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Pill toggles */
.toggle{
  appearance: none;
  border: 1px solid #ddd;
  background: #fff;
  padding: 2px 6px;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Chevron indicator (CSS-drawn) */
.toggle::after{
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);      /* down */
  margin-left: 6px;
  transition: transform 0.15s ease;
}

/* Chevron indicator (open) */
.toggle[aria-expanded="true"]::after{
  transform: rotate(-135deg);    /* up */
}

/* Hover: minimal emphasis */
.toggle:hover{
  border-color: #ccc;
}

/* Keyboard focus */
.toggle:focus-visible{
  outline: 2px solid #cfe0ff;
  outline-offset: 2px;
}

/* Expanded state */
.toggle[aria-expanded="true"]{
  background: #fafafa;
  border-color: #bbb;
}



/* Popups (abstract / media & awards) */
.popup{
  margin-top: 8px;
  padding: 10px 12px;
  border-left: 2px solid #ddd;
  color: var(--text);
  background: #fafafa;
}

@media (min-width: 641px){
  .sidebar{
    position: sticky;
    top: 32px;          /* matches your desktop body padding-top */
    align-self: flex-start;
  }

  /* IMPORTANT: ensure the right column is NOT its own scroller */
  .content{
    overflow: visible;
    max-height: none;
  }
}

/* Mobile: image centered above text */
@media (max-width: 640px){
  body{ padding-top: 22px; }

  /* NEW: stack the two columns on mobile */
  .layout{
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
  }
  .sidebar{
    flex: none;
    width: 100%;
  }
  .content{
    width: 100%;
    text-align: left;
  }

  .social{
    justify-content: center;
    flex-wrap: wrap;
  }

  .header{
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
  }

  .portrait{
    max-width: 210px;
    margin-left: auto;   
    margin-right: auto; 
  }
  

  .name{
    font-size: 30px;
  }

  main{
    text-align: left;
  }
}
