/* ============================================================
   style.css  —  Minimal academic portfolio
   Typeface: Spectral (serif body), DM Sans (UI/labels)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=DM+Sans:wght@300;400;500&family=DM+Mono:wght@400&display=swap');

/* ── Reset & base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #faf9f7;
  --bg-alt:     #f3f2ef;
  --text:       #1c1c1a;
  --muted:      #6b6b68;
  --faint:      #c4c3be;
  --accent:     #1c1c1a;
  --link:       #2a52a0;
  --link-hover: #1c1c1a;
  --border:     #e2e1dc;

  --ff-serif: "Spectral", Georgia, serif;
  --ff-sans:  "DM Sans", system-ui, sans-serif;
  --ff-mono:  "DM Mono", monospace;

  --max-w: 720px;
  --pad:   clamp(1.25rem, 4vw, 2rem);
}

html { font-size: 17px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-serif);
  font-weight: 400;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ── Page wrapper ────────────────────────────────────────── */
.page-wrap {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
  flex: 1;
}

/* ── Header / nav ────────────────────────────────────────── */
#site-nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.6rem 0 1.4rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-left {
  display: flex;
  align-items: baseline;
  gap: .75rem;
}

.nav-watermark {
  font-family: var(--ff-sans);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  user-select: none;
  flex-shrink: 0;
}

.nav-logo {
  font-family: var(--ff-serif);
  font-weight: 500;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -.01em;
  white-space: nowrap;
  text-decoration: none !important;
}
.nav-logo:hover { color: var(--muted); }

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

.nav-links a {
  font-family: var(--ff-sans);
  font-size: .82rem;
  font-weight: 400;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text);
}

/* ── Footer ──────────────────────────────────────────────── */
#site-footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 2rem 0;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-family: var(--ff-sans);
  font-size: .78rem;
  color: var(--muted);
}
.footer-social { display: flex; gap: .75rem; }
.footer-social a, .footer-email {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--ff-sans);
  font-size: .78rem;
}
.footer-social a:hover, .footer-email:hover { color: var(--text); }
.footer-email { margin-left: auto; }
.footer-watermark { color: var(--faint); font-size: .68rem; }
.footer-admin {
  font-family: var(--ff-sans);
  font-size: .72rem;
  color: var(--faint);
  text-decoration: none;
  letter-spacing: .06em;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.footer-admin:hover { color: var(--muted); border-color: var(--faint); }

/* ── Typography helpers ──────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--ff-serif);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: -.02em;
}

/* ── Section spacing ─────────────────────────────────────── */
.section { margin-top: 3.2rem; }
.section-label {
  font-family: var(--ff-sans);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0 0;
}

/* ── Tags / badges ───────────────────────────────────────── */
.tag {
  display: inline-block;
  font-family: var(--ff-sans);
  font-size: .73rem;
  font-weight: 400;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: .15em .55em;
  letter-spacing: .01em;
}

.pub-badge {
  display: inline-block;
  font-family: var(--ff-mono);
  font-size: .72rem;
  color: var(--muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: .12em .5em;
  letter-spacing: .01em;
}

/* ════════════════════════════════════════════════════════════
   HOME PAGE
   ════════════════════════════════════════════════════════════ */

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2.5rem;
  align-items: start;
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
}
.hero-text h1 {
  font-size: clamp(1.7rem, 4vw, 2.1rem);
  font-weight: 400;
  margin-bottom: .25rem;
}
.hero-text .name-local {
  font-family: var(--ff-sans);
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 1rem;
  letter-spacing: .02em;
}
.hero-text .hero-meta {
  font-family: var(--ff-sans);
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 1.4rem;
}
.hero-bio p {
  font-size: .97rem;
  color: var(--text);
  margin-bottom: .8rem;
  line-height: 1.7;
}
.hero-bio p:last-child { margin-bottom: 0; }

.hero-photo {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Interests ───────────────────────────────────────────── */
.interests {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: 1.1rem;
}

/* ── News ────────────────────────────────────────────────── */
.news-list { list-style: none; }
.news-item {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: .5rem 1.25rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.news-item:first-child { border-top: 1px solid var(--border); }
.news-date {
  font-family: var(--ff-mono);
  font-size: .75rem;
  color: var(--muted);
  white-space: nowrap;
  padding-top: .08em;
}
.news-text {
  font-size: .93rem;
  line-height: 1.55;
}
.news-text a {
  font-family: var(--ff-sans);
  font-size: .78rem;
  margin-left: .35rem;
  color: var(--muted);
  border-bottom: 1px solid var(--faint);
  text-decoration: none;
}
.news-text a:hover { color: var(--text); border-color: var(--text); }

/* ── Home publication cards ─────────────────────────────── */
.pub-card-list { list-style: none; }
.pub-card {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--border);
}
.pub-card:first-child { border-top: 1px solid var(--border); }
.pub-card-title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: .3rem;
}
.pub-card-title a { color: var(--text); }
.pub-card-title a:hover { color: var(--link); text-decoration: none; }
.pub-card-authors {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: .25rem;
  font-family: var(--ff-sans);
  font-weight: 300;
}
.pub-card-venue {
  font-family: var(--ff-sans);
  font-size: .82rem;
  color: var(--muted);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .4rem;
}
.pub-card-links {
  display: flex;
  gap: .75rem;
  margin-top: .4rem;
  flex-wrap: wrap;
}
.pub-link {
  font-family: var(--ff-sans);
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--faint);
  padding-bottom: 1px;
  transition: color .15s, border-color .15s;
}
.pub-link:hover { color: var(--text); border-color: var(--text); text-decoration: none; }

/* ── Hobbies / personal ─────────────────────────────────── */
.hobby-list {
  list-style: none;
  padding: 0;
}
.hobby-list li {
  font-size: .9rem;
  color: var(--muted);
  padding: .22rem 0;
  padding-left: 1rem;
  position: relative;
}
.hobby-list li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--faint);
}

/* ════════════════════════════════════════════════════════════
   PUBLICATIONS PAGE
   ════════════════════════════════════════════════════════════ */

.pub-page-header {
  padding: 2.8rem 0 1.6rem;
  border-bottom: 1px solid var(--border);
}
.pub-page-header h1 {
  font-size: 1.75rem;
  font-weight: 400;
}

/* Filter tabs */
.pub-filters {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  margin: 1.8rem 0;
  border-bottom: 1px solid var(--border);
}
.filter-btn {
  font-family: var(--ff-sans);
  font-size: .78rem;
  font-weight: 400;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: .55rem 1rem .55rem 0;
  margin-right: .5rem;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.filter-btn:hover { color: var(--text); }
.filter-btn.active { color: var(--text); border-bottom-color: var(--text); }

/* Year groups */
.pub-year-group { margin-bottom: 3rem; }
.pub-year {
  font-family: var(--ff-mono);
  font-size: .78rem;
  color: var(--muted);
  letter-spacing: .06em;
  margin-bottom: 1rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}

/* Full pub list items */
.pub-list { list-style: none; }
.pub-entry {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  transition: opacity .15s;
}
.pub-entry.hidden { display: none; }
.pub-entry-title {
  font-size: .99rem;
  font-weight: 500;
  line-height: 1.42;
  margin-bottom: .28rem;
}
.pub-entry-title a { color: var(--text); }
.pub-entry-title a:hover { color: var(--link); text-decoration: none; }
.pub-entry-authors {
  font-family: var(--ff-sans);
  font-size: .83rem;
  font-weight: 300;
  color: var(--muted);
  margin-bottom: .2rem;
}
.pub-entry-meta {
  font-family: var(--ff-sans);
  font-size: .8rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
}

/* ════════════════════════════════════════════════════════════
   PUBLICATION DETAIL PAGE
   ════════════════════════════════════════════════════════════ */

.pub-detail-wrap {
  padding: 2.5rem 0;
}

.back-link {
  font-family: var(--ff-sans);
  font-size: .78rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-bottom: 2rem;
}
.back-link:hover { color: var(--text); text-decoration: none; }
.back-link::before { content: "←"; }

.pub-detail-title {
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -.025em;
  margin-bottom: 1.1rem;
}

.pub-detail-byline {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.8rem;
}
.pub-detail-authors {
  font-family: var(--ff-sans);
  font-size: .9rem;
  font-weight: 300;
}
.pub-detail-venue {
  font-family: var(--ff-sans);
  font-size: .85rem;
  color: var(--muted);
  font-style: italic;
}
.pub-detail-meta {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: .25rem;
}

/* Abstract */
.pub-abstract-section { margin-bottom: 2.4rem; }
.pub-abstract-section p {
  font-size: .97rem;
  line-height: 1.78;
  color: var(--text);
  margin-bottom: 1em;
}
.pub-abstract-section p:last-child { margin-bottom: 0; }

/* Resources grid */
.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
  margin-top: 1rem;
}
.resource-card {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1rem 1.1rem;
  background: var(--bg);
  transition: border-color .15s, background .15s;
}
.resource-card:hover { border-color: var(--text); background: var(--bg-alt); }
.resource-card a { text-decoration: none; }
.resource-card-label {
  font-family: var(--ff-sans);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .35rem;
}
.resource-card-title {
  font-size: .88rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}
.resource-card-sub {
  font-family: var(--ff-sans);
  font-size: .74rem;
  color: var(--muted);
  margin-top: .2rem;
}

/* Audio player */
.audio-player {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding: .85rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-alt);
}
.audio-player audio { flex: 1; height: 28px; }

/* Citation box */
.citation-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1.1rem 1.25rem;
  font-family: var(--ff-mono);
  font-size: .78rem;
  line-height: 1.65;
  color: var(--text);
  position: relative;
  margin-top: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.copy-btn {
  font-family: var(--ff-sans);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: .25em .65em;
  cursor: pointer;
  margin-top: .75rem;
  transition: color .15s, border-color .15s;
  display: inline-block;
}
.copy-btn:hover { color: var(--text); border-color: var(--text); }
.copy-btn.copied { color: #2d7a4f; border-color: #2d7a4f; }

/* Video embed */
.video-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 1rem;
}
.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* PDF embed (slides / presentation as PDF) */
.pdf-embed-wrap {
  width: 100%;
  height: 600px;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 1rem;
}
.pdf-embed-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ════════════════════════════════════════════════════════════
   TEACHING / CV / GENERIC PAGES
   ════════════════════════════════════════════════════════════ */

.generic-page {
  padding: 2.8rem 0;
}
.generic-page h1 {
  font-size: 1.75rem;
  font-weight: 400;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.empty-state {
  font-family: var(--ff-sans);
  font-size: .9rem;
  color: var(--muted);
  padding: 2rem 0;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 520px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-photo {
    width: 100px;
    height: 100px;
    order: -1;
  }
  .news-item {
    grid-template-columns: 1fr;
    gap: .2rem;
  }
  .resources-grid {
    grid-template-columns: 1fr;
  }
  .footer-email {
    margin-left: 0;
  }
  #site-nav {
    flex-direction: column;
    gap: .75rem;
  }
}
