/* Custom overrides — loaded after theme CSS */

/* ---- Section title spacing ---- */
section h2,
#tab-biography h2,
#section-news > h2,
#section-highlights,
#section-education > h2,
#section-awards > h2,
#section-services > h2,
#section-funding > h2,
#section-funding-heading {
  margin-top: 1.6em !important;
  margin-bottom: 0.7em !important;
}

#section-news > h2 {
  margin-top: 1.2em !important;
}

/* First title under nav: tighter top gap */
#tab-biography > h2:first-child,
#tab-biography > *:first-child h2 {
  margin-top: 0.35em !important;
}

#section-highlights {
  margin-top: 1.8em !important;
}

#section-funding,
#section-funding > h2,
#section-funding-heading {
  margin-top: 1.8em !important;
}

#section-awards > h3 {
  margin-top: 1em !important;
  margin-bottom: 0.45em !important;
}

.services-category {
  margin: 1em 0 0.35em 0 !important;
}

.services-category:first-of-type {
  margin-top: 0.35em !important;
}

.services-list {
  margin: 0 0 0.85em 0 !important;
}

/* ---- Nav: two tabs, underline only as wide as labels ---- */
.section-nav {
  display: inline-flex;
  flex-wrap: nowrap;
  width: auto;
  max-width: 100%;
  margin: -1.5em 0 0.6em 0;
}

.section-nav::after {
  left: 0;
  right: 0;
  width: 100%;
}

.section-nav .nav-item {
  border-bottom: none;
  margin-bottom: 0;
  padding: 8px 20px;
  text-align: center;
}

.section-nav .nav-item::after {
  bottom: 0;
  height: 2.5px;
  border-radius: 0;
  box-shadow: none;
  z-index: 1;
}

.section-nav .nav-item:hover::after,
.section-nav .nav-item.active::after {
  box-shadow: none;
}

.section-nav .nav-item.active::after {
  background: #043361;
  box-shadow: none;
}

@media (prefers-color-scheme: dark) {
  .section-nav .nav-item.active::after,
  .section-nav .nav-item:hover::after {
    background: rgb(62, 183, 240);
    box-shadow: none;
  }
}

/* ---- Back to top ---- */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #043361;
  color: #fff;
  font-size: 18px;
  line-height: 42px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(4, 51, 97, 0.3);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: #065a9e;
}

@media (prefers-color-scheme: dark) {
  .back-to-top {
    background: rgb(62, 183, 240);
    color: #20212b;
    box-shadow: 0 2px 12px rgba(62, 183, 240, 0.35);
  }
  .back-to-top:hover {
    background: #7ecbf5;
  }
}

/* ---- Pagination: quiet text style matching nav underline ---- */
.paginated-list ul {
  margin-bottom: 0 !important;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin: 4px 0 32px 0;
  padding: 0;
  border-top: none;
  list-style: none;
}

#news-pagination {
  padding-left: 1.25em;
  margin-bottom: 0.4em;
}

#highlights-pagination {
  padding-left: 0;
  margin-top: 4px;
  margin-bottom: 0.4em;
}

.highlights-block {
  margin-top: 0.25rem !important;
}

.highlights-block ol.bibliography {
  margin-bottom: 0 !important;
}

.highlights-block ol.bibliography li.highlight-item {
  min-height: 0 !important;
  margin-bottom: 1rem;
}

.pagination .page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #6a7a8a;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  border-bottom: 2px solid transparent;
  transition: color 0.18s, border-color 0.18s;
}

.pagination .page-btn:hover {
  color: #043361;
  background: transparent;
  border-bottom-color: #c5d0dc;
  transform: none;
  box-shadow: none;
}

.pagination .page-btn.active {
  color: #043361;
  background: transparent;
  border-bottom-color: #043361;
  box-shadow: none;
  cursor: default;
  transform: none;
}

.pagination .page-btn.page-nav {
  color: #043361;
  font-size: 16px;
  min-width: 24px;
  opacity: 0.55;
}

.pagination .page-btn.page-nav:hover {
  opacity: 1;
  border-bottom-color: transparent;
}

.pagination .page-btn.page-nav.is-disabled {
  opacity: 0.2;
  pointer-events: none;
  cursor: default;
}

.pagination .page-sep {
  color: #c5cdd6;
  font-size: 11px;
  padding: 0 1px;
  user-select: none;
}

@media (prefers-color-scheme: dark) {
  .pagination .page-btn {
    color: #8a93a3;
  }

  .pagination .page-btn:hover {
    color: rgb(62, 183, 240);
    border-bottom-color: #3a3b45;
  }

  .pagination .page-btn.active {
    color: rgb(62, 183, 240);
    border-bottom-color: rgb(62, 183, 240);
  }

  .pagination .page-btn.page-nav {
    color: rgb(62, 183, 240);
  }

  .pagination .page-sep {
    color: #4a4b55;
  }
}

@media print {
  .back-to-top { display: none !important; }
}

/* ---- Publications page typography & tags ---- */
#tab-publications {
  font-size: 15.5px;
  line-height: 1.55;
}

#tab-publications > h2,
#tab-publications .talks-heading {
  font-size: 1.7rem;
}

#tab-publications .pub-note {
  font-size: 13.5px;
  color: #888;
  margin: -6px 0 14px 0;
}

#tab-publications .tag-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 22px;
}

#tab-publications .pub-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border: 1px solid #c8d0dc;
  border-radius: 20px;
  font-size: 13px;
  color: #043361;
  background: #f5f7fa;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

#tab-publications .pub-tag:hover {
  background: #eef2f6;
  border-color: #043361;
  color: #043361;
}

#tab-publications .pub-tag.active {
  background: #043361;
  border-color: #043361;
  color: #fff;
}

#tab-publications .pub-tag .tag-count {
  font-size: 11.5px;
  opacity: 0.75;
}

#tab-publications .pub-group-title {
  font-size: 16.5px;
  font-weight: 600;
  color: #043361;
  margin: 0 0 12px 0;
  padding-bottom: 5px;
  border-bottom: 1px solid #e5e5e5;
}

#tab-publications .pub-item {
  margin-bottom: 16px;
}

#tab-publications .pub-title {
  font-weight: 500;
  font-size: 15.5px;
  line-height: 1.4;
}

#tab-publications .pub-title a {
  color: #043361;
  text-decoration: none;
}

#tab-publications .pub-title a:hover {
  text-decoration: underline;
}

#tab-publications .pub-authors {
  font-size: 14.5px;
  color: #444;
  margin-top: 3px;
}

#tab-publications .pub-meta {
  font-size: 13.5px;
  color: #666;
  margin-top: 3px;
  line-height: 1.7;
}

#tab-publications .pub-item-tags {
  display: inline;
}

#tab-publications .pub-item-tag {
  display: inline-block;
  margin: 0 0 0 6px;
  padding: 1px 8px;
  border: 1px solid #c8d0dc;
  border-radius: 10px;
  font-size: 11.5px;
  font-style: normal;
  color: #043361;
  background: #f5f7fa;
  vertical-align: middle;
  white-space: nowrap;
  line-height: 1.4;
}

#tab-publications .author-corresponding {
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

#tab-publications .author-corresponding strong {
  text-decoration: none;
  border-bottom: none;
  font-weight: 700;
}

#tab-publications .talk-item {
  font-size: 15px;
  margin-bottom: 12px;
  line-height: 1.5;
}

#tab-publications .talk-meta {
  font-size: 13.5px;
  color: #666;
}

#tab-publications .talk-type {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 10px;
  margin-right: 4px;
  vertical-align: middle;
  background: #eef2f6;
  color: #043361;
  border: 1px solid #d5dae0;
}

#tab-publications .talk-type-oral {
  background: #d4edda;
  color: #155724;
  border-color: #b7dfc2;
}

#tab-publications .talk-type-poster {
  background: #e4ecf5;
  color: #043361;
  border-color: #c8d0dc;
}

@media (prefers-color-scheme: dark) {
  #tab-publications .pub-note { color: #888; }

  #tab-publications .pub-tag {
    background: #2a2b35;
    border-color: #3a3b45;
    color: rgb(62, 183, 240);
  }
  #tab-publications .pub-tag:hover {
    background: #35364a;
    border-color: rgb(62, 183, 240);
  }
  #tab-publications .pub-tag.active {
    background: rgb(62, 183, 240);
    border-color: rgb(62, 183, 240);
    color: #20212b;
  }
  #tab-publications .pub-group-title {
    color: rgb(62, 183, 240);
    border-bottom-color: #3a3b45;
  }
  #tab-publications .pub-title a { color: rgb(62, 183, 240); }
  #tab-publications .pub-authors { color: #b0b4c0; }
  #tab-publications .pub-meta { color: #888; }
  #tab-publications .pub-item-tag {
    background: #2a2b35;
    border-color: #3a3b45;
    color: rgb(62, 183, 240);
  }
  #tab-publications .talk-type {
    background: #2a2b35;
    border-color: #3a3b45;
    color: rgb(62, 183, 240);
  }
  #tab-publications .talk-type-oral {
    background: #1a2e1a;
    border-color: #2a4a2a;
    color: #7ecf7e;
  }
  #tab-publications .talk-type-poster {
    background: #2a2b35;
    border-color: #3a3b45;
    color: rgb(62, 183, 240);
  }
  #tab-publications .talk-meta { color: #888; }
}

