html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  height: 100%;
  /* Previous site voice, kept verbatim where the fonts exist (Windows,
     macOS, iOS). 'Open Sans' is a webfont fallback with the same
     humanist-sans feel for devices without Trebuchet (e.g. Android),
     so every screen renders the same style. */
  font-family: 'Trebuchet MS', 'Open Sans', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
}

#fullBody {
  position: relative;
  width: 100%;
  min-height: 100%;
  background-color: var(--bg);
}

/* ---- Theme tokens ---- */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f7f7f7;
  --surface: #ffffff;
  --text: #333333;
  --text-strong: #222222;
  --muted: #777777;
  --faint: #959595;
  --border: #eeeeee;
  --border-strong: #dddddd;
  --link: #337ab7;
  --link-hover: #23527c;
  --accent: #007be6;
  --pill: #222222;
  --pill-fg: #ffffff;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141414;
  --bg-soft: #1e1e1e;
  --surface: #1c1c1c;
  --text: #d8d8d8;
  --text-strong: #f2f2f2;
  --muted: #9d9d9d;
  --faint: #7e7e7e;
  --border: #2b2b2b;
  --border-strong: #3d3d3d;
  --link: #6cb2f5;
  --link-hover: #9cc9f8;
  --accent: #4da3f0;
  --pill: #e6e6e6;
  --pill-fg: #141414;
}

body {
  background-color: var(--bg);
  color: var(--text);
}

/* ---- Dark mode: Bootstrap / base elements ---- */
html[data-theme="dark"] a { color: var(--link); }
html[data-theme="dark"] a:hover,
html[data-theme="dark"] a:focus { color: var(--link-hover); }
html[data-theme="dark"] hr { border-top-color: var(--border); }
html[data-theme="dark"] .well { background-color: var(--surface); border-color: var(--border); }
html[data-theme="dark"] .thumbnail { background-color: var(--surface); border-color: var(--border); }
html[data-theme="dark"] pre { background-color: var(--bg-soft); border-color: var(--border); color: var(--text); }
html[data-theme="dark"] code { background-color: rgba(255, 255, 255, 0.09); color: #f49aad; }
html[data-theme="dark"] blockquote { border-left-color: var(--border-strong); }
html[data-theme="dark"] blockquote footer,
html[data-theme="dark"] blockquote small { color: var(--faint); }

.mt-5 {
  margin-top: 5px;
}

.newsTitle {
  color: var(--accent);
}

.sidebaricon {
  padding-right: 1px;
}

#inner {
  max-width: 950px;
}

/* Wide override for blog posts only. Must sit here, right after #inner,
   and use #inner.postWide (ID+class) so it beats the #inner ID above.
   A plain .container.postWide class selector loses to it. */
#inner.postWide {
  width: auto;
  max-width: 1360px;
  padding-left: 24px;
  padding-right: 24px;
  /* Reserve room for the fixed navbar so flow content never starts
     underneath it. */
  padding-top: 58px;
}

.siteSections {
  margin-top: 10px;
}

.siteSections a {
  margin-right: 14px;
  font-size: 14px;
}

/* ---- Focus rings (site-wide) ---- */
/* No outline box when clicking links/buttons with mouse or touch
   (includes the mobile tap highlight). Keyboard users still get a
   subtle indicator via :focus-visible. */
html {
  -webkit-tap-highlight-color: transparent;
}

a:focus,
a:active,
button:focus,
button:active,
summary:focus,
summary:active,
input:focus,
input:active {
  outline: none;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 2px solid #999;
  outline-offset: 2px;
}

/* Fixed post navbar: links left, width toggle right. Posts only. */
.postNavbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 130;
  background: var(--surface, #ffffff);
  background-color: var(--surface, #ffffff);
  border-bottom: 1px solid var(--border, #eeeeee);
}

.postNavbarInner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.postNavbarLinks a {
  margin-right: 14px;
  font-size: 14px;
}

.postNavbarLinks a:last-child {
  margin-right: 0;
}

/* Full-width toggle: right side of the navbar. */
.panelsToggle {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.panelsToggle:hover {
  border-color: var(--faint);
  color: var(--text-strong);
}

/* ---- Theme toggle ---- */
.postNavbarActions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.themeToggle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.themeToggle:hover {
  border-color: var(--faint);
  color: var(--text-strong);
}

.themeToggleRight {
  float: right;
}

.awardStar {
  color: #1a5fb4;
}

html[data-theme="dark"] .awardStar {
  color: #8ab4f8;
}

#inner.panelsHidden .postGrid {
  grid-template-columns: minmax(0, 780px);
  justify-content: center;
}

#inner.panelsHidden .postToc {
  display: none;
}

#inner.panelsHidden .postBody {
  border-left: none;
  border-right: none;
  padding: 0;
  max-width: 780px;
}

#inner.panelsHidden .postTocMobile {
  display: block;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

/* Wikipedia-style footnote popup (mini card near the marker). */
.fnPopup {
  position: fixed;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

.fnPopupBody ol,
.fnPopupBody ul {
  margin: 0;
  padding-left: 18px;
}

.fnPopupBody p {
  margin: 0 0 6px 0;
}

.fnPopupBody p:last-child {
  margin-bottom: 0;
}

.fnPopupClose {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.fnPopupClose:hover {
  color: var(--text-strong);
}

.postMeta {
  color: var(--faint);
  font-size: 13px;
  margin-bottom: 16px;
}

.postList {
  list-style: none;
  padding-left: 0;
}

.postList li {
  margin-bottom: 22px;
}

.profilePicture {
  width: 216px;
  margin-bottom: 0px !important;
  margin-top: 20px;
}

.no-padding {
  padding: 0px !important;
}

.no-margin {
  margin: 0px !important;
}

.media-heading {
  font-size: 16px;
}

.conference {
  font-size: 14px;
  margin-bottom: 0px !important;
}

.graphThumb {
  width: 150px;
  height: 150px;
  float: left;
  margin-bottom: 5px;
  margin-right: 5px;
  cursor: pointer;
}

.graphThumbImg {
  width: 100%;
  height: 100% !important;
  object-fit: cover;
}

.paperWell {
  min-height: 170px;
}

.hexagonContainer {
  width: 100px;
  height: 100px;
  position: relative;
  overflow: hidden;
  margin-right: 20px;
}

.hexagonImage.logoLight {
  object-fit: contain;
  padding: 12px;
  background-color: #f4f4f4;
}

.hexagonImage.logoDark {
  object-fit: contain;
  padding: 12px;
  background-color: #1c1c1c;
}

.hexagonImage.logoBf {
  object-fit: contain;
  padding: 12px;
  background-color: #090A09;
}

.hexagonImage.logoRed {
  object-fit: contain;
  padding: 14px;
  background-color: #b31b1b;
}

.hexagonImage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.well {
  background-color: var(--bg);
}

.course {
  background-color: var(--bg);
}

.subtleHeading {
  font-size: 12px;
  font-weight: 700;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mb-2 { margin-bottom: 10px !important; }
.mb-3 { margin-bottom: 15px !important; }
.mb-4 { margin-bottom: 20px !important; }
.mb-5 { margin-bottom: 25px !important; }
.mb-6 { margin-bottom: 30px !important; }

.citeBtn {
  margin-left: 8px;
  color: var(--faint);
  cursor: pointer;
}

.citeBtn:hover {
  color: var(--text-strong);
}

/* ---- Paper filter ---- */
.paperSectionHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

/* Blogs list: match the Research page gap between the nav row and the
   heading (plain h1 gets 20px top margin from Bootstrap). */
.blogSectionHeader {
  margin-top: 20px;
}

.paperSectionTitle {
  margin: 0;
}

.paperFilterWrap {
  position: relative;
  display: inline-block;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.paperFilterButton {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.paperFilterButton:hover {
  border-color: var(--faint);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.paperFilterButton.active {
  border-color: var(--text-strong);
}

.paperFilterButton .fa-filter {
  font-size: 13px;
}

.paperFilterBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  background-color: var(--pill);
  color: var(--pill-fg);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 0 5px;
}

.paperFilterPanel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 290px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  padding: 18px;
  z-index: 60;
}

.paperFilterPanelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 10px;
}

.paperFilterClearBtn {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}

.paperFilterClearBtn:hover {
  color: var(--text-strong);
}

.paperFilterOptions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 320px;
  overflow-y: auto;
}

.paperFilterOption {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 8px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-strong);
  margin-bottom: 0px;
  transition: background-color 0.1s ease;
}

.paperFilterOption:hover {
  background-color: var(--bg-soft);
}

.paperFilterCheckbox {
  width: 16px;
  height: 16px;
  accent-color: var(--pill);
  cursor: pointer;
  flex: 0 0 auto;
}

.paperFilterOptionIcon {
  width: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  flex: 0 0 auto;
}

.paperFilterOptionLabel {
  flex: 1 1 auto;
}

.paperFilterOptionCount {
  color: var(--faint);
  font-size: 12px;
  flex: 0 0 auto;
}

.paperFilterDivider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 0px;
}

.paperCard {
  animation: paperFadeIn 0.35s ease both;
}

.paperCard-hidden {
  display: none !important;
}

@keyframes paperFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.paperEmptyState {
  padding: 30px 0px;
  text-align: center;
}

/* ---- Blog post 3-column reading layout ---- */
/* (Container width override lives next to #inner at the top of this file.) */

.postGrid {
  display: grid;
  /* TOC rail left, article center, right track left empty so the
     article stays centered with symmetric gutters. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 780px) minmax(0, 1fr);
  gap: 0 32px;
  /* Must be start (not stretch): a stretched rail is as tall as the
     article, leaving sticky with no range, so the TOC scrolls away. */
  align-items: start;
}

.postBody {
  min-width: 0;
  max-width: 780px;
  justify-self: center;
  width: 100%;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 0 36px;
}

.postArticle {
  min-width: 0;
}

/* Anchor jumps (in-article links and TOC) land below the fixed navbar
   instead of hiding underneath it. */
.postArticle h1,
.postArticle h2,
.postArticle h3,
.postArticle h4 {
  scroll-margin-top: 64px;
}

.postToc {
  position: sticky;
  /* Fixed navbar height + gap, so the rail pins below the navbar
     instead of sliding underneath it while scrolling. */
  top: 72px;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  align-self: start;
  font-size: 13px;
  line-height: 1.5;
  width: 100%;
  min-width: 0;
  justify-self: end;
  max-width: 230px;
  /* Line the rail label up with the article title: Bootstrap gives the
     article h1 a 20px top margin, so offset the rail by the same. */
  padding-top: 20px;
}

/* Bottom footnote list (the only footnote panel now). */
.postArticle .footnotes {
  font-size: 13px;
  color: var(--text);
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.postTocUl {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.postTocUl li {
  margin-bottom: 6px;
}

.postTocUl a {
  display: block;
  color: var(--muted);
  text-decoration: none;
}

.postTocUl a:hover {
  color: var(--text-strong);
  text-decoration: underline;
}

.postTocUl a.active {
  color: var(--text-strong);
  /* No font-weight change here: bolding the active link alters its
     width/wrapping, which shifts the whole rail while scrolling. */
}

.postTocUl a:focus,
.postTocUl a:active {
  outline: none;
}

.postToc-h1 {
  padding-left: 0;
}

.postToc-h2 {
  padding-left: 0;
}

.postToc-h3 {
  padding-left: 14px;
  font-size: 12px;
}

.postTocEmpty {
  color: var(--faint);
  font-size: 12px;
  margin: 0;
}

.postTocMobile {
  display: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
  background: var(--bg-soft);
}

.postTocMobile summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
}

@media (max-width: 1150px) {
  .postGrid {
    gap: 0 24px;
  }
}

@media (max-width: 991px) {
  #inner.postWide {
    max-width: 950px;
  }
  .panelsToggle {
    display: none;
  }
  .postGrid {
    grid-template-columns: minmax(0, 1fr);
  }
  .postBody {
    max-width: 100%;
    border-left: none;
    border-right: none;
    padding: 0;
  }
  .postToc {
    display: none;
  }
  .postTocMobile {
    display: block;
  }
}

/* footer */
.siteFooter {
  margin-top: 30px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 13px;
}

/* ---- Responsive ---- */
.profilePicture {
  max-width: 100%;
}

.paperFilterPanel {
  max-width: calc(100vw - 30px);
}

/* Mobile: center profile photo, let cards breathe */
@media (max-width: 767px) {
  .profilePictureCol {
    text-align: center;
  }

  #inner h1 {
    text-align: center;
  }

  .profilePicture {
    width: 200px;
    margin-left: auto;
    margin-right: auto;
  }

  .paperBody {
    height: auto !important;
  }

  .hexagonContainer {
    width: 80px;
    height: 80px;
    margin-right: 14px;
  }

  .media-heading {
    font-size: 15px;
  }
}

/* Very small screens: fit gallery thumbs two per row */
@media (max-width: 480px) {
  .graphThumb {
    width: 130px;
    height: 130px;
  }

  .hexagonContainer {
    width: 64px;
    height: 64px;
    margin-right: 12px;
  }
}
