/* ============================================================
   academic homepage — al-folio inspired
   roboto sans · roboto slab headings · white bg · calm blue
   layout: single column, ~800px, generous whitespace
   ============================================================ */

:root {
  --bg:           #ffffff;
  --fg:           #1f1f1f;
  --fg-soft:      #3b3b3b;
  --fg-dim:       #6c757d;
  --fg-faint:     #95989a;
  --link:         #1565c0;
  --link-hov:     #0d3c75;
  --rule:         #e8e8e8;
  --rule-strong:  #cccccc;
  --code-bg:      #f5f5f5;
  --badge-bg:     #f0f4f9;
  --badge-fg:     #1565c0;

  --sans:  'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --max-width: 820px;
  --line:      1.5;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 300;            /* Roboto Light — matches al-folio / MDB Bootstrap */
  line-height: var(--line);
  /* sticky-footer: body becomes a flex column so the footer can pin
     to the viewport bottom when content is short, and naturally fall
     after content when the page is long */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

::selection {
  background: #d8e7f5;
  color: var(--fg);
}

/* ---------- links ---------- */

a {
  color: var(--link);
  text-decoration: none;
  transition: color .15s ease;
}

a:hover,
a:focus-visible {
  color: var(--link-hov);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:focus-visible {
  outline: 1px dotted var(--link);
  outline-offset: 2px;
}

/* ---------- container ---------- */

.page-content,
.site-footer {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding-left: 1.75rem;
  padding-right: 1.75rem;
}

.page-content {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
  flex: 1 0 auto;  /* sticky-footer: grow to push footer down when content is short */
}

.site-footer {
  flex-shrink: 0;
}

/* ---------- sticky header (frosted full-width bar) ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}

.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.85rem 1.75rem;
}

/* ---------- nav ---------- */

.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 14px;
  font-weight: 400;
}

/* navbar contact icons (left side, replaces site-name) */
.site-nav .nav-icons {
  display: flex;
  align-items: center;
  gap: 1.05rem;
  font-size: 20px;
  line-height: 1;
}

.site-nav .nav-icons a {
  color: var(--fg);
  text-decoration: none;
  transition: color .15s ease;
  display: inline-flex;
  align-items: center;
}

.site-nav .nav-icons a:hover {
  color: var(--link);
  text-decoration: none;
}

.site-nav .nav-links {
  display: flex;
  gap: 1.5rem;
}

.site-nav .nav-link {
  color: var(--fg-soft);
  font-weight: 400;
}

.site-nav .nav-link:hover {
  color: var(--link);
  text-decoration: none;
}

.site-nav .nav-link.active {
  color: var(--link);
  font-weight: 500;
}

/* ---------- profile / page header ---------- */

.profile {
  margin: 1.5rem 0 2.25rem;
}

.profile h1 {
  font-family: var(--sans);
  font-size: 36px;
  font-weight: 300;
  line-height: 1.15;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.profile h1 .first {
  font-weight: 700;
}

.profile .desc {
  margin: 0;
  color: var(--fg-dim);
  font-size: 15px;
  font-family: var(--mono);
  letter-spacing: -0.005em;
}

/* ---------- typography ---------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--sans);
  color: var(--fg);
  font-weight: 300;            /* light headings — al-folio look */
  line-height: 1.25;
}

h1 {
  font-size: 32px;
  margin: 0 0 1rem;
}

h2 {
  font-size: 24px;
  margin: 2.5rem 0 1rem;
  text-transform: lowercase;
}

h3 {
  font-size: 19px;
  margin: 1.75rem 0 0.6rem;
}

p {
  margin: 0 0 1rem;
}

ul, ol {
  margin: 0.5rem 0 1.25rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.4rem;
}

li::marker {
  color: var(--fg-faint);
}

strong { font-weight: 700; color: var(--fg); }
em { font-style: italic; }

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.1rem 0 0.1rem 1.2rem;
  border-left: 3px solid var(--rule-strong);
  color: var(--fg-dim);
}

code {
  font-family: var(--mono);
  background: var(--code-bg);
  padding: 0.1em 0.4em;
  font-size: 0.88em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  border-left: 3px solid var(--rule-strong);
  margin: 1.5rem 0;
}

pre code { background: none; padding: 0; font-size: inherit; }

img { max-width: 100%; height: auto; }

/* ---------- tables (used by news + post body) ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.95em;
}

table th, table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

table th {
  border-bottom: 2px solid var(--fg);
  font-weight: 500;
}

.post-content table tr:last-child td {
  border-bottom: 1px solid var(--fg);
}

/* ---------- news section (date | event table, no header row) ---------- */

.news table {
  border-top: none;
}

.news table th {
  border-bottom: none;
}

.news table tr {
  border-bottom: 1px dotted var(--rule);
}

.news table tr:last-child {
  border-bottom: none;
}

.news table td {
  border-bottom: none;
  padding: 0.55rem 0.75rem;
}

.news table td:first-child {
  white-space: nowrap;
  color: var(--fg-dim);
  font-family: var(--mono);
  font-size: 13px;
  width: 1%;
  padding-right: 1.25rem;
}

/* ---------- selected publications ---------- */

.bibliography {
  margin: 1rem 0 1.25rem;
}

.pub-entry {
  display: flex;
  gap: 1.25rem;
  padding: 0.85rem 0;
  border-bottom: 1px dotted var(--rule);
}

.pub-entry:last-child { border-bottom: none; }

.pub-badge {
  flex: 0 0 88px;
  text-align: center;
  align-self: flex-start;
  background: var(--badge-bg);
  color: var(--badge-fg);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.4rem 0.3rem;
  border-radius: 4px;
  line-height: 1.35;
}

.pub-badge .year {
  display: block;
  font-size: 10px;
  color: var(--fg-dim);
  margin-top: 0.15rem;
  font-weight: 400;
}

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

.pub-title {
  font-weight: 500;
  margin-bottom: 0.15rem;
  line-height: 1.35;
}

.pub-title a {
  color: var(--fg);
  text-decoration: none;
}

.pub-title a:hover {
  color: var(--link);
  text-decoration: underline;
}

.pub-authors {
  font-size: 14px;
  color: var(--fg-soft);
  margin-bottom: 0.15rem;
  line-height: 1.45;
}

.pub-authors em {
  font-style: normal;
  font-weight: 700;
  color: var(--fg);
}

.pub-venue {
  font-size: 14px;
  color: var(--fg-dim);
}

.pub-venue em { font-style: italic; }

.pub-more {
  margin-top: 1rem;
  font-size: 14px;
}

/* ---------- contact icon row (social links) ---------- */

.contact-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1rem 0 0.5rem;
  font-size: 22px;
  line-height: 1;
  align-items: center;
}

.contact-icons a {
  color: var(--fg-soft);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4em;
  height: 1.4em;
  transition: color .15s ease, transform .15s ease;
}

.contact-icons a:hover {
  color: var(--link);
  text-decoration: none;
  transform: translateY(-1px);
}

.contact-icons a:focus-visible {
  outline: 1px dotted var(--link);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- blog index — card layout ---------- */

.post-cards {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}

.post-card {
  margin: 0 0 1.1rem;
  padding: 0;
  list-style: none;
}

.post-card-link {
  display: block;
  padding: 1rem 1.25rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #ffffff;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .2s ease, transform .2s ease;
}

.post-card-link:hover {
  border-color: #c7d4e3;
  box-shadow: 0 6px 18px rgba(20, 60, 120, 0.07), 0 2px 4px rgba(0, 0, 0, 0.04);
  text-decoration: none;
  transform: translateY(-1px);
}

.post-card-image {
  float: right;
  max-width: 240px;
  width: 38%;
  height: auto;
  margin: 0.25rem 0 0.5rem 1.4rem;
  border-radius: 4px;
  background: #fafafa;
}

.post-card-title {
  margin: 0.25rem 0 0.5rem;
  font-size: 19px;
  font-weight: 400;
  color: var(--fg);
  line-height: 1.3;
  text-transform: none;
}

.post-card-link:hover .post-card-title {
  color: var(--link);
}

.post-card-excerpt {
  margin: 0;
  font-size: 14px;
  color: var(--fg-soft);
  line-height: 1.55;
  font-weight: 300;
}

.post-card-date {
  display: block;
  clear: both;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--fg-dim);
  margin-top: 0.85rem;
  text-align: right;
}

/* responsive: image stacks above text on narrow screens */
@media (max-width: 560px) {
  .post-card-link {
    padding: 0.85rem 1rem 0.75rem;
  }
  .post-card-image {
    float: none;
    display: block;
    width: 100%;
    max-width: none;
    margin: 0 0 0.75rem;
  }
  .post-card-title {
    font-size: 17px;
  }
}

/* ---------- post page: figure images inside post body ---------- */

.post-hero,
.post-figure {
  display: block;
  margin: 1.75rem auto;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.post-hero {
  margin-top: 0;
}

/* kramdown wraps standalone images in <p>; remove the paragraph margin
   so the figure isn't double-spaced */
.post-content p > img.post-hero,
.post-content p > img.post-figure {
  margin: 0 auto;
}
.post-content p:has(> img.post-figure) {
  margin: 1.75rem 0;
  text-align: center;
}
.post-content p:has(> img.post-hero) {
  margin: 0 0 1.75rem;
  text-align: center;
}

/* ---------- post page ---------- */

.post-header {
  margin: 1rem 0 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.post-header h1 {
  font-family: var(--sans);
  margin-bottom: 0.5rem;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.25;
}

.post-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-dim);
  margin: 0;
}

.post-content { margin-bottom: 3rem; }

.post-content h2 { text-transform: none; }
.post-content h3 { text-transform: none; }

.post-back {
  font-size: 14px;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

/* ---------- publications page ---------- */

.publications h2 {
  margin-top: 2.25rem;
  font-size: 18px;
  text-transform: none;
  color: var(--fg-dim);
  font-weight: 500;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.4rem;
}

.pub {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
  text-indent: -1.4rem;
  font-size: 15px;
  line-height: 1.5;
}

.pub .pub-venue {
  color: var(--fg-dim);
  font-style: italic;
  display: inline;
}

/* ---------- footer ---------- */

.site-footer {
  padding-top: 1.25rem;
  padding-bottom: 2rem;
  margin-top: 3rem;
  border-top: 1px solid var(--rule);
  color: var(--fg-dim);
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
}

.site-footer p { margin: 0; }

.site-footer a {
  color: var(--fg-dim);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--link);
  text-decoration: underline;
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  body { font-size: 15px; }

  .site-header,
  .page-content,
  .site-footer {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .site-nav { gap: 0.5rem; }
  .site-nav .nav-links { gap: 1rem; }
  .site-nav .site-name { font-size: 15px; }

  .profile h1 { font-size: 28px; }
  .profile .desc { font-size: 13px; }

  h1 { font-size: 24px; }
  h2 { font-size: 19px; margin-top: 2rem; }
  h3 { font-size: 16px; }

  .pub-entry { gap: 0.85rem; padding: 0.75rem 0; }
  .pub-badge {
    flex: 0 0 64px;
    font-size: 10px;
    padding: 0.35rem 0.2rem;
  }
  .pub-badge .year { font-size: 9px; }
  .pub-title { font-size: 15px; }
  .pub-authors, .pub-venue { font-size: 13px; }

  .news table td { padding: 0.45rem 0.55rem; font-size: 14px; }
  .news table td:first-child { padding-right: 0.85rem; font-size: 12px; }

  pre { font-size: 12px; }
  table { font-size: 0.88em; }
}
