/*
 * Styles adapted from the al-folio Jekyll theme (MIT License)
 * https://github.com/alshedivat/al-folio
 * Loaded after Bootstrap 4 + MDB 4, like the original theme.
 */

/* ---------- Theme variables ---------- */
:root {
  --global-bg-color: #ffffff;
  --global-text-color: #000000;
  --global-text-color-light: #828282;
  --global-theme-color: #b509ac;
  --global-hover-color: #b509ac;
  --global-hover-text-color: #ffffff;
  --global-footer-bg-color: #1c1c1d;
  --global-footer-text-color: #e8e8e8;
  --global-footer-link-color: #ffffff;
  --global-divider-color: rgba(0, 0, 0, 0.1);
  --global-card-bg-color: #ffffff;
  --global-highlight-color: #b71c1c;
  --global-back-to-top-bg-color: rgba(0, 0, 0, 0.4);
  --global-back-to-top-text-color: #ffffff;
}

html[data-theme="dark"] {
  --global-bg-color: #1c1c1d;
  --global-text-color: #e8e8e8;
  --global-text-color-light: #828282;
  --global-theme-color: #2698ba;
  --global-hover-color: #2698ba;
  --global-hover-text-color: #ffffff;
  --global-footer-bg-color: #e8e8e8;
  --global-footer-text-color: #1c1c1d;
  --global-footer-link-color: #000000;
  --global-divider-color: #424246;
  --global-card-bg-color: #212529;
  --global-back-to-top-bg-color: rgba(255, 255, 255, 0.5);
  --global-back-to-top-text-color: #000000;
}

html.transition,
html.transition *,
html.transition *::before,
html.transition *::after {
  transition: all 750ms !important;
  transition-delay: 0s !important;
}

/* ---------- Base ---------- */
body {
  padding-bottom: 70px;
  color: var(--global-text-color);
  background-color: var(--global-bg-color);
}

body.fixed-top-nav { padding-top: 56px; }

body h1, body h2, body h3, body h4, body h5, body h6 { scroll-margin-top: 66px; }

.container { max-width: 930px; }

p, h1, h2, h3, h4, h5, h6, em, div, li, span, strong { color: var(--global-text-color); }
hr { border-top: 1px solid var(--global-divider-color); }

a,
table.table a { color: var(--global-theme-color); }

a:hover,
table.table a:hover {
  color: var(--global-theme-color);
  text-decoration: underline;
}

table td,
table th {
  font-size: 1rem;
  padding: 1px 1rem 1px 0;
}

table th { font-weight: bold; }

.table { color: var(--global-text-color); }

/* ---------- Navbar ---------- */
.navbar {
  box-shadow: none;
  border-bottom: 1px solid var(--global-divider-color);
  background-color: var(--global-bg-color);
  opacity: 0.95;
}

.navbar.navbar-light a:hover { text-decoration: none; }
.navbar.navbar-light .navbar-brand { color: var(--global-text-color); }
.navbar.navbar-light .navbar-brand:hover { color: var(--global-hover-color); }
.navbar.navbar-light .navbar-brand span { color: inherit; }
.navbar.navbar-light .navbar-nav .nav-item .nav-link { color: var(--global-text-color); }
.navbar.navbar-light .navbar-nav .nav-item .nav-link:hover { color: var(--global-hover-color); }
.navbar.navbar-light .navbar-nav .nav-item.active > .nav-link {
  background-color: inherit;
  font-weight: bolder;
  color: var(--global-theme-color);
}
.navbar.navbar-light .navbar-nav .nav-item.active > .nav-link:hover { color: var(--global-hover-color); }
.navbar .nav-link span { color: inherit; }

.navbar-toggler {
  border: 0;
  box-shadow: none;
}

.navbar-toggler:focus { outline: none; }

.navbar-toggler .icon-bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--global-text-color);
  border-radius: 1px;
  margin-bottom: 4px;
  transition: all 0.2s;
}

.navbar-toggler .top-bar { transform: rotate(45deg); transform-origin: 10% 10%; }
.navbar-toggler .middle-bar { opacity: 0; }
.navbar-toggler .bottom-bar { transform: rotate(-45deg); transform-origin: 10% 90%; }
.navbar-toggler.collapsed .top-bar { transform: rotate(0); }
.navbar-toggler.collapsed .middle-bar { opacity: 1; }
.navbar-toggler.collapsed .bottom-bar { transform: rotate(0); }

/* Light / dark toggle */
#light-toggle {
  padding: 0;
  border: 0;
  background-color: inherit;
  color: var(--global-text-color);
  cursor: pointer;
}

#light-toggle:hover { color: var(--global-hover-color); }
#light-toggle:focus { outline: none; }
#light-toggle i { color: inherit; }

#light-toggle-system,
#light-toggle-dark,
#light-toggle-light {
  display: none;
  padding-left: 10px;
  padding-top: 12px;
}

html[data-theme-setting="system"] #light-toggle-system,
html[data-theme-setting="dark"] #light-toggle-dark,
html[data-theme-setting="light"] #light-toggle-light { display: block; }

/* ---------- Page header ---------- */
.post-header { margin-bottom: 1rem; }

.post-title { margin-bottom: 0.5rem; }

.post-description {
  margin-bottom: 2rem;
  font-size: 0.875rem;
}

.post-description a { color: inherit; }
.post-description a:hover { color: var(--global-theme-color); text-decoration: none; }

/* ---------- Profile ---------- */
.profile { width: 100%; }
.profile.float-right { margin-left: 1rem; }

@media (min-width: 576px) {
  .profile { width: 30%; }
}

.profile figure { margin-bottom: 1rem; }

.profile .profile-img {
  overflow: hidden;
}

.profile .profile-img img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transform: scale(1.3);
  transform-origin: 50% 40%;
}

/* Inline emoji, slightly smaller than the surrounding text */
.emoji {
  font-size: 0.9em;
  vertical-align: 0.05em;
}

/* ---------- News ---------- */
.news { margin-bottom: 1rem; }
.news .table { margin-bottom: 0; }
.news th { white-space: nowrap; }

/* ---------- Publications ---------- */
.publications { margin-top: 2rem; }

.publications h2 { margin-bottom: 1rem; }

.publications h2.bibliography {
  color: var(--global-divider-color);
  border-top: 1px solid var(--global-divider-color);
  padding-top: 1rem;
  margin-top: 2rem;
  text-align: right;
}

.publications ol.bibliography {
  list-style: none;
  padding: 0;
  margin-top: 0;
}

.publications ol.bibliography li { margin-bottom: 1rem; }
.publications ol.bibliography li .abbr { margin-bottom: 0.5rem; }
.publications ol.bibliography li .abbr figure { margin: 0.25rem 0 0; }

.publications ol.bibliography li .preview {
  display: block;
  width: 100%;
  height: auto;
  background-color: #fff;
  cursor: zoom-in;
}

.publications ol.bibliography li .title { font-weight: bolder; }

.publications ol.bibliography li .author a {
  border-bottom: 1px dashed var(--global-theme-color);
}

.publications ol.bibliography li .author a:hover {
  border-bottom-style: solid;
  text-decoration: none;
}

.publications ol.bibliography li .author > em {
  border-bottom: 1px solid;
  font-style: normal;
}

.publications ol.bibliography li .author > span.more-authors {
  color: var(--global-text-color-light);
  border-bottom: 1px dashed var(--global-text-color-light);
  cursor: pointer;
}

.publications ol.bibliography li .author > span.more-authors:hover {
  color: var(--global-text-color);
  border-bottom: 1px dashed var(--global-text-color);
}

.publications ol.bibliography li .links a.btn {
  color: var(--global-text-color);
  border: 1px solid var(--global-text-color);
  padding: 0.25rem 1rem;
  margin-left: 0;
}

.publications ol.bibliography li .links a.btn:hover {
  color: var(--global-theme-color);
  border-color: var(--global-theme-color);
}

/* ---------- Social ---------- */
.social { text-align: center; }

.social .contact-icons { font-size: 4rem; }

.social .contact-icons a { margin: 0 0.15em; }

.social .contact-icons a i::before {
  color: var(--global-text-color);
  transition-property: all 0.2s ease-in-out;
}

.social .contact-icons a:hover { text-decoration: none; }
.social .contact-icons a:hover i::before { color: var(--global-theme-color); }

.social .contact-note { font-size: 0.8rem; }

/* ---------- Background (education / experience / honors) ---------- */
.background { margin-bottom: 40px; }

.background h2 {
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--global-divider-color);
}

.background h2:first-child { margin-top: 0.5rem; }

.background .bg-subhead {
  margin: 1.5rem 0 1rem;
  color: var(--global-text-color-light);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.background .bg-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.background .bg-item {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.background .bg-item.no-logo { margin-bottom: 1rem; }

.background .item-logo {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  padding: 6px;
  border: 1px solid var(--global-divider-color);
  border-radius: 0.5rem;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.background .item-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.background .item-body {
  flex: 1 1 auto;
  min-width: 0;
}

.background .item-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  column-gap: 1.5rem;
}

.background .item-title { font-weight: 500; }

.background .item-date {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--global-text-color-light);
  font-size: 0.9rem;
  white-space: nowrap;
}

.background .item-sub {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
}

.background .item-details {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

.background .item-details li {
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

@media (max-width: 575px) {
  .background .bg-item { gap: 0.9rem; }

  .background .item-logo {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
    padding: 4px;
  }

  .background .item-date {
    margin-left: 0;
    width: 100%;
  }
}

/* ---------- Footer ---------- */
footer.fixed-bottom {
  background-color: var(--global-footer-bg-color);
  font-size: 0.75rem;
}

footer.fixed-bottom .container {
  color: var(--global-footer-text-color);
  padding-top: 9px;
  padding-bottom: 8px;
  text-align: center;
}

footer.fixed-bottom a { color: var(--global-footer-link-color); }

footer.fixed-bottom a:hover {
  color: var(--global-theme-color);
  text-decoration: none;
}

/* ---------- Back to top ---------- */
#back-to-top {
  position: fixed;
  right: 30px;
  bottom: 30px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: var(--global-back-to-top-text-color);
  background: var(--global-back-to-top-bg-color);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  cursor: pointer;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

#back-to-top i { color: inherit; }
#back-to-top:focus { outline: none; }

.medium-zoom-overlay,
.medium-zoom-image--opened { z-index: 999; }
