/* ==========================================================
   MARGINALIA — Hugo Theme CSS
   Design: Serif body · Sans UI · Steel-blue accent · Warm bg
   Light mode only · Plain CSS · No build step
   ========================================================== */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  /* Accent */
  --clr-accent:        #3E6592;
  --clr-accent-hover:  #2d5078;
  --clr-accent-bg:     rgba(62, 101, 146, 0.07);
  --clr-accent-border: rgba(62, 101, 146, 0.22);
  /* Peach highlight (sliminality-inspired) */
  --clr-highlight:     rgba(245, 192, 162, 0.48);
  /* Neutrals */
  --clr-bg:            #f8f7f4;
  --clr-surface:       #efefef7a;
  --clr-text:          #1c1c2e;
  --clr-muted:         #64748b;
  --clr-border:        #e2ddd6;
  --clr-border-light:  #eeebe5;
  /* Typography */
  --ff-serif: 'Lora', Georgia, 'Times New Roman', serif;
  --ff-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ff-mono:  'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  /* Scale */
  --fs-xs:   0.75rem;
  --fs-sm:   0.875rem;
  --fs-base: 1rem;
  --fs-lg:   1.125rem;
  --fs-xl:   1.25rem;
  --fs-2xl:  1.5rem;
  --fs-3xl:  1.875rem;
  /* Layout */
  --max-w:     860px;
  --nav-h:     54px;
  /* Spacing */
  --sp-1: 0.25rem;  --sp-2: 0.5rem;  --sp-3: 0.75rem;  --sp-4: 1rem;
  --sp-5: 1.25rem;  --sp-6: 1.5rem;  --sp-8: 2rem;     --sp-12: 3rem;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, video { max-width: 100%; display: block; }

/* ── Base ───────────────────────────────────────────────────── */
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--ff-serif);
  font-size: var(--fs-base);
  line-height: 1.75;
  color: var(--clr-text);
  background-color: var(--clr-bg);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

/* ── Links ──────────────────────────────────────────────────── */
a { color: var(--clr-accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--clr-accent-hover); }

/* ── Headings ───────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-sans);
  font-weight: 700;
  line-height: 1.2;
  color: var(--clr-text);
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5, h6 { font-size: var(--fs-base); }

/* ── Prose elements ─────────────────────────────────────────── */
em { font-style: italic; }
strong { font-weight: 700; }
p { margin-bottom: var(--sp-4); }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.5em; margin-bottom: var(--sp-4); }
li { margin-bottom: var(--sp-1); }

blockquote {
  border-left: 3px solid var(--clr-accent-border);
  padding-left: var(--sp-4);
  color: var(--clr-muted);
  margin: var(--sp-6) 0;
  font-style: italic;
}

code, pre { font-family: var(--ff-mono); font-size: .9em; }

code {
  background: var(--clr-border-light);
  padding: .1em .4em;
  border-radius: 3px;
}

pre {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 8px;
  padding: var(--sp-4);
  overflow-x: auto;
  margin: var(--sp-6) 0;
}

pre code { background: none; padding: 0; }

hr { border: none; border-top: 1px solid var(--clr-border); margin: var(--sp-8) 0; }

/* ── Container ──────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}
@media (max-width: 600px) { .container { padding: 0 var(--sp-4); } }

/* ════════════════════════════════════════════════════════════
   NAVIGATION
   ════════════════════════════════════════════════════════════ */
.site-nav {
  background: var(--clr-bg);
  border-bottom: 1px solid var(--clr-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.site-nav__title {
  font-family: var(--ff-sans);
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--clr-text);
  letter-spacing: -.01em;
  flex-shrink: 0;
}
.site-nav__title:hover { color: var(--clr-accent); }

.site-nav__links {
  display: flex;
  gap: var(--sp-6);
  list-style: none;
  flex-wrap: wrap;
}

.site-nav__links a {
  font-family: var(--ff-sans);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--clr-muted);
  letter-spacing: .02em;
}
.site-nav__links a:hover,
.site-nav__links a[aria-current="page"] { color: var(--clr-text); }

@media (max-width: 600px) {
  .site-nav__links { gap: var(--sp-4); }
  .site-nav__links a { font-size: var(--fs-xs); }
}

/* ════════════════════════════════════════════════════════════
   HOMEPAGE
   ════════════════════════════════════════════════════════════ */
.home-page { padding: var(--sp-8) 0 var(--sp-12); }

/* ── Header Card ────────────────────────────────────────────── */
.home-header {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 12px;
  padding: var(--sp-8);
  margin-bottom: 0;
}

.home-header__grid {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: var(--sp-12);
}

@media (max-width: 640px) {
  .home-header { padding: var(--sp-6); }
  .home-header__grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .home-header__photo-col { order: -1; }
}

/* Name */
.home-header__name {
  font-family: var(--ff-sans);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.03em;
  color: var(--clr-text);
  margin-bottom: var(--sp-4);
}

.home-header__name-text {
  background-image: linear-gradient(transparent 65%, var(--clr-highlight) 65%);
  background-repeat: no-repeat;
}

/* Affiliations */
.home-header__affiliations {
  font-family: var(--ff-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--clr-text);
  line-height: 2;
  margin-bottom: var(--sp-3);
}

.home-header__location {
  font-weight: 400;
  text-transform: none;
  letter-spacing: .03em;
  font-size: 0.72rem;
  color: var(--clr-muted);
}

/* Email */
.home-header__email {
  font-family: var(--ff-sans);
  font-size: var(--fs-sm);
  color: var(--clr-muted);
  margin-bottom: var(--sp-4);
  display: block;
}

/* Social links */
.home-header__social {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.home-header__social a {
  color: var(--clr-muted);
  opacity: .8;
  transition: opacity .15s, color .15s;
  display: inline-flex;
  align-items: center;
  font-size: 0; /* hide text labels, show icons only */
}
.home-header__social a svg { width: 18px; height: 18px; }
.home-header__social a:hover { opacity: 1; color: var(--clr-accent); }

/* Section nav pills */
.home-header__nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.home-header__nav-link {
  font-family: var(--ff-sans);
  font-size: 0.78rem;
  font-weight: 500;
  padding: .18rem .6rem;
  color: var(--clr-text);
  text-decoration: none;
  background: var(--clr-highlight);
  border-radius: 5px;
  transition: background 0.15s ease;
}
.home-header__nav-link:hover {
  background: rgba(245, 192, 162, 0.82);
  color: var(--clr-text);
}

/* Photo */
.home-header__photo-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
}

.home-header__photo-frame {
  position: relative;
  padding-right: 14px;
  padding-bottom: 14px;
}

/* Diamond behind photo */
.home-header__photo-frame::before {
  content: '';
  position: absolute;
  width: 100px; height: 100px;
  background: var(--clr-accent-bg);
  transform: rotate(45deg);
  border-radius: 4px;
  top: -10px; right: -6px;
  z-index: 0;
}

/* Offset border */
.home-header__photo-frame::after {
  content: '';
  position: absolute;
  width: calc(100% - 14px);
  height: calc(100% - 14px);
  border: 3px solid rgba(200, 120, 100, 0.5);
  border-radius: 4px;
  bottom: 0; right: 0;
  z-index: 0;
}

.home-header__photo {
  position: relative; z-index: 1;
  width: 180px; height: 215px;
  object-fit: cover;
  object-position: top center;
  border-radius: 4px;
  display: block;
}

/* ── Sections ───────────────────────────────────────────────── */
.home-section {
  border-top: 1px solid var(--clr-border);
  padding: var(--sp-8) 0;
}
.home-section:first-of-type { border-top: none; }

/* Section title — with sliminality-style peach underbar */
.home-section__title {
  font-family: var(--ff-sans);
  font-size: var(--fs-sm);
  font-weight: 700;
  /* letter-spacing: .12em; */
  text-transform: uppercase;
  /* color: var(--clr-muted); */
  margin-bottom: var(--sp-2);
  position: relative;
  display: inline-block;
  padding: 0 .1em .05em;
}

.home-section__title::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 5px;
  background-color: var(--clr-highlight);
  z-index: -1;
}

/* Section description */
.home-section__desc {
  font-family: var(--ff-serif);
  font-size: var(--fs-sm);
  color: var(--clr-muted);
  margin-top: var(--sp-2);
  line-height: 1.65;
}

/* ── About prose ───────────────────────────────────────────── */
.home-prose {
  font-family: var(--ff-serif);
  font-size: var(--fs-base);
  line-height: 1.8;
}

.home-prose a {
  color: var(--clr-text);
  text-decoration: none;
  background: var(--clr-highlight);
  padding: 0 2px;
  border-radius: 2px;
  transition: background 0.15s ease;
}
.home-prose a:hover { background: rgba(245, 192, 162, 0.82); }
.home-prose p { margin-bottom: var(--sp-4); }
.home-prose p:last-child { margin-bottom: 0; }

/* ── News ──────────────────────────────────────────────────── */
.news-list { list-style: none; padding: 0; margin: 0; }

.news-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: var(--sp-6);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--clr-border-light);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.news-item:last-child { border-bottom: none; }
.news-item.hidden { display: none; }

@media (max-width: 500px) {
  .news-item { grid-template-columns: 1fr; gap: var(--sp-1); }
}

.news-item__date {
  font-family: var(--ff-sans);
  font-size: 0.78rem;
  font-style: italic;
  font-weight: 500;
  color: var(--clr-muted);
  padding-top: 1px;
  text-align: left;
}

.news-item__text { font-family: var(--ff-serif); }
.news-item__text a {
  color: var(--clr-text);
  text-decoration: none;
  background: var(--clr-highlight);
  padding: 0 2px;
  border-radius: 2px;
  transition: background 0.15s ease;
}
.news-item__text a:hover { background: rgba(245, 192, 162, 0.82); }

.news-toggle {
  font-family: var(--ff-sans);
  font-size: var(--fs-sm);
  color: var(--clr-accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-3) 0 0;
}
.news-toggle:hover { color: var(--clr-accent-hover); text-decoration: underline; }

/* ── Timeline (experience / education / training / talks) ──── */
.timeline { display: flex; flex-direction: column; }

.timeline-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: var(--sp-6);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--clr-border-light);
}
.timeline-item:last-child { border-bottom: none; }

@media (max-width: 520px) {
  .timeline-item { grid-template-columns: 1fr; gap: var(--sp-2); }
}

.timeline-period {
  font-family: var(--ff-sans);
  font-size: 0.78rem;
  font-weight: 500;
  font-style: italic;
  color: var(--clr-muted);
  padding-top: 2px;
  text-align: left;
}

.timeline-title {
  font-family: var(--ff-sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--clr-text);
  margin-bottom: var(--sp-1);
}

.timeline-title a,
.timeline-sub a {
  color: var(--clr-text);
  text-decoration: none;
  background: var(--clr-highlight);
  padding: 0 2px;
  border-radius: 2px;
  transition: background 0.15s ease;
}
.timeline-title a:hover,
.timeline-sub a:hover { background: rgba(245, 192, 162, 0.82); color: var(--clr-text); }

.timeline-sub {
  font-family: var(--ff-sans);
  font-size: 0.82rem;
  color: var(--clr-muted);
  line-height: 1.5;
}

.timeline-desc {
  font-family: var(--ff-serif);
  font-size: var(--fs-sm);
  color: var(--clr-muted);
  margin-top: var(--sp-2);
  line-height: 1.55;
}

.timeline-desc a {
  color: var(--clr-text);
  text-decoration: none;
  background: var(--clr-highlight);
  padding: 0 2px;
  border-radius: 2px;
  transition: background 0.15s ease;
}
.timeline-desc a:hover { background: rgba(245, 192, 162, 0.82); color: var(--clr-text); }

/* Teaching collapsible */
.timeline-item.hidden { display: none; }

.timeline-toggle {
  font-family: var(--ff-sans);
  font-size: var(--fs-sm);
  color: var(--clr-accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-3) 0 0;
}
.timeline-toggle:hover { color: var(--clr-accent-hover); text-decoration: underline; }

/* ── Publications preview (homepage) ───────────────────────── */
.pub-preview-list { display: flex; flex-direction: column; }

.pub-preview-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: var(--sp-6);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--clr-border-light);
  font-size: var(--fs-sm);
  line-height: 1.65;
}
.pub-preview-item:last-child { border-bottom: none; }

@media (max-width: 520px) {
  .pub-preview-item { grid-template-columns: 1fr; gap: var(--sp-2); }
}

.pub-preview__year {
  font-family: var(--ff-sans);
  font-size: 0.78rem;
  font-weight: 500;
  font-style: italic;
  color: var(--clr-muted);
  padding-top: 2px;
  text-align: left;
}

.pub-preview__meta {
  font-family: var(--ff-sans);
  font-size: 0.82rem;
  color: var(--clr-muted);
  margin-bottom: var(--sp-1);
}

.pub-preview__author-self { font-weight: 600; }

.pub-preview__title {
  font-family: var(--ff-serif);
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--clr-text);
  display: inline;
  line-height: 1.4;
  text-decoration: none;
  background: var(--clr-highlight);
  padding: 0 2px;
  border-radius: 2px;
  transition: background 0.15s ease;
}
.pub-preview__title:hover { background: rgba(245, 192, 162, 0.82); color: var(--clr-text); }

.pub-preview__venue {
  font-family: var(--ff-sans);
  font-size: 0.82rem;
  font-style: italic;
  color: var(--clr-muted);
  margin-top: var(--sp-1);
}

/* See-all link */
.see-all-link {
  font-family: var(--ff-sans);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--clr-accent);
  margin-top: var(--sp-4);
  display: inline-block;
}
.see-all-link:hover { color: var(--clr-accent-hover); text-decoration: underline; }

/* ════════════════════════════════════════════════════════════
   INNER PAGES (publications, projects, posts, etc.)
   ════════════════════════════════════════════════════════════ */
.inner-page { padding: var(--sp-8) 0 var(--sp-12); }

.inner-page__header {
  padding-bottom: var(--sp-6);
  margin-bottom: var(--sp-6);
  border-bottom: 1px solid var(--clr-border);
}

.inner-page__title {
  font-family: var(--ff-sans);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--clr-text);
  margin-bottom: var(--sp-3);
}

.inner-page__desc {
  font-family: var(--ff-serif);
  font-size: var(--fs-sm);
  color: var(--clr-muted);
  line-height: 1.65;
  max-width: 600px;
}

/* ── Publications list ──────────────────────────────────────── */
.pub-list { display: flex; flex-direction: column; }

.pub-item {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-5) 0;
  border-bottom: 1px solid var(--clr-border-light);
  font-size: var(--fs-sm);
  line-height: 1.65;
}
.pub-item:last-child { border-bottom: none; }

.pub-item__icon {
  width: 1rem; height: 1rem;
  flex-shrink: 0;
  margin-top: .3rem;
  color: var(--clr-muted);
  stroke: currentColor;
  fill: none;
}

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

.pub-item__authors {
  font-family: var(--ff-sans);
  font-size: 0.83rem;
  color: var(--clr-muted);
  margin-bottom: var(--sp-1);
}

.pub-item__author-self { font-weight: 600; color: var(--clr-text); }

.pub-item__title {
  font-family: var(--ff-serif);
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--clr-text);
  text-decoration: none;
  background: var(--clr-highlight);
  padding: 0 2px;
  border-radius: 2px;
  transition: background 0.15s ease;
}
.pub-item__title:hover { background: rgba(245, 192, 162, 0.82); color: var(--clr-text); }

.pub-item__venue {
  font-style: italic;
  color: var(--clr-muted);
}

/* Publication link buttons */
.pub-item__links {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: var(--sp-3);
}

.pub-link {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .12rem .5rem;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 4px;
  font-family: var(--ff-sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--clr-text);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s, transform .1s;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.pub-link:hover {
  border-color: var(--clr-accent-border);
  background: var(--clr-accent-bg);
  color: var(--clr-accent);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

.pub-link-icon {
  width: .875rem; height: .875rem;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Projects list ───────────────────────────────────────────── */
.project-list { display: flex; flex-direction: column; }

.project-item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--clr-border-light);
}
.project-item:last-child { border-bottom: none; }

.project-item__title-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
}

.project-item__year {
  font-family: var(--ff-sans);
  font-size: 0.78rem;
  font-weight: 500;
  font-style: italic;
  color: var(--clr-muted);
  white-space: nowrap;
}

.project-item__title {
  font-family: var(--ff-sans);
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--clr-text);
  text-decoration: none;
  background: var(--clr-highlight);
  padding: 0 2px;
  border-radius: 2px;
  transition: background 0.15s ease;
}
.project-item__title:hover { background: rgba(245, 192, 162, 0.82); color: var(--clr-text); }

.project-item__summary {
  font-family: var(--ff-serif);
  font-size: var(--fs-sm);
  color: var(--clr-muted);
  line-height: 1.6;
}

.project-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}

.project-tag {
  font-family: var(--ff-sans);
  font-size: 0.68rem;
  padding: .1rem .45rem;
  border-radius: 9999px;
  background: var(--clr-accent-bg);
  color: var(--clr-muted);
  border: 1px solid var(--clr-accent-border);
}

/* ── Posts list ─────────────────────────────────────────────── */
.post-list { display: flex; flex-direction: column; }

.post-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: var(--sp-6);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--clr-border-light);
}
.post-item:last-child { border-bottom: none; }

@media (max-width: 500px) {
  .post-item { grid-template-columns: 1fr; gap: var(--sp-1); }
}

.post-item__date {
  font-family: var(--ff-sans);
  font-size: 0.78rem;
  font-style: italic;
  color: var(--clr-muted);
  padding-top: 3px;
}

.post-item__title {
  font-family: var(--ff-sans);
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--clr-text);
  display: block;
  margin-bottom: var(--sp-1);
}
.post-item__title:hover { color: var(--clr-accent); }

.post-item__summary {
  font-family: var(--ff-serif);
  font-size: var(--fs-sm);
  color: var(--clr-muted);
  line-height: 1.55;
}

/* ── Taxonomy (tags) ────────────────────────────────────────── */
.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding: 0;
}

.tag-item a {
  font-family: var(--ff-sans);
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: .3rem .75rem;
  border-radius: 9999px;
  background: var(--clr-accent-bg);
  border: 1px solid var(--clr-accent-border);
  color: var(--clr-accent);
}
.tag-item a:hover {
  background: rgba(62,101,146,.14);
  color: var(--clr-accent-hover);
}

/* ════════════════════════════════════════════════════════════
   SINGLE PAGE (posts, about, research, etc.)
   ════════════════════════════════════════════════════════════ */
.single-page { padding: var(--sp-8) 0 var(--sp-12); }

.single-page__header {
  padding-bottom: var(--sp-6);
  margin-bottom: var(--sp-8);
  border-bottom: 1px solid var(--clr-border);
}

.single-page__title {
  font-family: var(--ff-sans);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--clr-text);
  letter-spacing: -.02em;
  margin-bottom: var(--sp-3);
}

.single-page__meta {
  font-family: var(--ff-sans);
  font-size: var(--fs-sm);
  color: var(--clr-muted);
}

.single-page__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.single-page__tag {
  font-family: var(--ff-sans);
  font-size: var(--fs-xs);
  font-weight: 500;
  padding: .15rem .55rem;
  border-radius: 9999px;
  background: var(--clr-accent-bg);
  border: 1px solid var(--clr-accent-border);
  color: var(--clr-accent);
}

/* Article prose */
.article-content {
  font-family: var(--ff-serif);
  font-size: var(--fs-base);
  line-height: 1.8;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  font-family: var(--ff-sans);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-4);
}

.article-content h2 {
  font-size: var(--fs-xl);
  border-bottom: 1px solid var(--clr-border-light);
  padding-bottom: var(--sp-2);
}

.article-content h3 { font-size: var(--fs-lg); }

.article-content p { margin-bottom: var(--sp-4); }
.article-content ul, .article-content ol { margin-bottom: var(--sp-4); }

.article-content a {
  color: var(--clr-text);
  text-decoration: none;
  background: var(--clr-highlight);
  padding: 0 2px;
  border-radius: 2px;
  transition: background 0.15s ease;
}
.article-content a:hover { background: rgba(245, 192, 162, 0.82); }

.article-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: var(--sp-6) 0;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--sp-6) 0;
  font-size: var(--fs-sm);
}

.article-content th,
.article-content td {
  border: 1px solid var(--clr-border);
  padding: var(--sp-2) var(--sp-3);
  font-family: var(--ff-sans);
}

.article-content th {
  background: var(--clr-border-light);
  font-weight: 600;
}

/* ════════════════════════════════════════════════════════════
   SINGLE PUBLICATION
   ════════════════════════════════════════════════════════════ */
.pub-single { padding: var(--sp-8) 0 var(--sp-12); }
.pub-single__header { margin-bottom: var(--sp-6); }
.pub-single__title { font-family: var(--ff-sans); font-size: clamp(1.2rem,3.5vw,1.9rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: var(--sp-4); }
.pub-single__meta { font-family: var(--ff-sans); font-size: var(--fs-sm); color: var(--clr-muted); line-height: 1.7; margin-bottom: var(--sp-4); }
.pub-single__meta strong { color: var(--clr-text); font-weight: 600; }
.pub-single__meta a {
  color: var(--clr-text);
  text-decoration: none;
  background: var(--clr-highlight);
  padding: 0 2px;
  border-radius: 2px;
  transition: background 0.15s ease;
}
.pub-single__meta a:hover { background: rgba(245, 192, 162, 0.82); color: var(--clr-text); }
.pub-single__venue { font-style: italic; }

.pub-single__actions { margin-bottom: var(--sp-6); }
.pub-single__actions .pub-item__links { margin-top: 0; }

.pub-single__abstract {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 8px;
  padding: var(--sp-6);
  margin-bottom: var(--sp-6);
}
.pub-single__abstract h2 {
  font-family: var(--ff-sans);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--clr-muted);
  margin-bottom: var(--sp-4);
}
.pub-single__abstract p {
  font-family: var(--ff-serif);
  font-size: var(--fs-sm);
  line-height: 1.75;
  color: var(--clr-text);
  margin: 0;
}

/* ════════════════════════════════════════════════════════════
   CITATION MODAL
   ════════════════════════════════════════════════════════════ */
.citation-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
}
.citation-modal.is-open { display: flex; }

.citation-modal__box {
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: 10px;
  padding: var(--sp-8);
  width: 90%;
  max-width: 620px;
  max-height: 82vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}

.citation-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-4);
}

.citation-modal__heading {
  font-family: var(--ff-sans);
  font-size: var(--fs-lg);
  font-weight: 700;
}

.citation-modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--clr-muted);
  cursor: pointer;
  padding: 0;
  transition: color .15s;
}
.citation-modal__close:hover { color: var(--clr-text); }

.citation-modal__pre {
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: 6px;
  padding: var(--sp-4);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.citation-modal__copy {
  margin-top: var(--sp-4);
  font-family: var(--ff-sans);
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: var(--sp-2) var(--sp-4);
  background: var(--clr-accent-bg);
  border: 1px solid var(--clr-accent-border);
  border-radius: 4px;
  color: var(--clr-accent);
  cursor: pointer;
  transition: background .15s;
}
.citation-modal__copy:hover { background: rgba(62,101,146,.14); }

/* ════════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--clr-border);
  background: var(--clr-bg);
  padding: var(--sp-8) 0;
}

.site-footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--ff-sans);
  font-size: var(--fs-sm);
  color: var(--clr-muted);
}

@media (max-width: 500px) {
  .site-footer__inner { flex-direction: column; gap: var(--sp-2); text-align: center; }
}

.site-footer a { color: var(--clr-muted); text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--clr-accent); }

/* ── 404 ─────────────────────────────────────────────────── */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-8) var(--sp-6);
  min-height: 50vh;
  gap: var(--sp-4);
}

.not-found__code {
  font-family: var(--ff-sans);
  font-size: 5rem;
  font-weight: 800;
  color: var(--clr-border);
  line-height: 1;
  margin: 0;
}

.not-found__title {
  font-family: var(--ff-sans);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--clr-text);
  margin: 0;
}

.not-found__desc {
  font-family: var(--ff-serif);
  font-size: var(--fs-base);
  color: var(--clr-muted);
  margin: 0;
}

.not-found__home {
  font-family: var(--ff-sans);
  font-size: var(--fs-sm);
  color: var(--clr-accent);
  text-decoration: none;
  margin-top: var(--sp-2);
}
.not-found__home:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ════════════════════════════════════════════════════════════
   PUBLICATION YEAR GROUPS
   ════════════════════════════════════════════════════════════ */
.pub-year-group {
  margin-top: var(--sp-8);
}
.pub-year-group:first-of-type {
  margin-top: 0;
}

.pub-year-heading {
  font-family: var(--ff-sans);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--clr-muted);
  padding-bottom: var(--sp-3);
  margin-bottom: 0;
  border-bottom: 2px solid var(--clr-border);
  position: relative;
  display: block;
}

.pub-year-heading::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 2.5rem; height: 2px;
  background: var(--clr-accent);
}

/* ════════════════════════════════════════════════════════════
   BLOG / POSTS LIST
   ════════════════════════════════════════════════════════════ */
.blog-list { display: flex; flex-direction: column; }

.blog-item {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: var(--sp-6);
  padding: var(--sp-5) 0;
  border-bottom: 1px solid var(--clr-border-light);
}
.blog-item:last-child { border-bottom: none; }

@media (max-width: 520px) {
  .blog-item { grid-template-columns: 1fr; gap: var(--sp-2); }
}

.blog-item__date {
  font-family: var(--ff-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--clr-muted);
  text-align: right;
  padding-top: 4px;
  line-height: 1.4;
}

@media (max-width: 520px) {
  .blog-item__date { text-align: left; }
}

.blog-item__body { min-width: 0; }

.blog-item__title {
  font-family: var(--ff-sans);
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--clr-text);
  display: inline;
  margin-bottom: var(--sp-1);
  line-height: 1.3;
  text-decoration: none;
  background: var(--clr-highlight);
  padding: 0 2px;
  border-radius: 2px;
  transition: background 0.15s ease;
}
.blog-item__title:hover { background: rgba(245, 192, 162, 0.82); color: var(--clr-text); }

.blog-item__desc {
  font-family: var(--ff-serif);
  font-size: var(--fs-sm);
  color: var(--clr-muted);
  line-height: 1.6;
  margin-bottom: var(--sp-2);
}

.blog-item__footer {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.blog-item__reading-time {
  font-family: var(--ff-sans);
  font-size: 0.7rem;
  color: var(--clr-muted);
  opacity: .7;
}

.blog-item__tags { display: flex; gap: .3rem; flex-wrap: wrap; }

.blog-tag {
  font-family: var(--ff-sans);
  font-size: 0.68rem;
  padding: .1rem .45rem;
  border-radius: 9999px;
  background: var(--clr-accent-bg);
  color: var(--clr-muted);
  border: 1px solid var(--clr-accent-border);
}

/* ════════════════════════════════════════════════════════════
   SHORTCODE: IMG
   ════════════════════════════════════════════════════════════ */
.article-figure {
  margin: var(--sp-6) 0;
}

.article-figure img {
  border-radius: 8px;
  width: 100%;
  height: auto;
  border: 1px solid var(--clr-border-light);
}

.article-figure figcaption {
  font-family: var(--ff-sans);
  font-size: var(--fs-xs);
  color: var(--clr-muted);
  text-align: center;
  margin-top: var(--sp-2);
  font-style: italic;
  line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════
   SHORTCODE: PDF
   ════════════════════════════════════════════════════════════ */
.pdf-embed {
  margin: var(--sp-6) 0;
  border: 1px solid var(--clr-border);
  border-radius: 8px;
  overflow: hidden;
}

.pdf-embed object {
  display: block;
  width: 100%;
}

/* ════════════════════════════════════════════════════════════
   PAGE TRANSITIONS
   ════════════════════════════════════════════════════════════ */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

#main-content {
  animation: pageFadeIn 0.28s ease-out both;
}

body.page-is-leaving #main-content {
  animation: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s ease-in, transform 0.18s ease-in;
}
