*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.6;
  color: #111;
  background: #fff;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ══════════════════════════════════════════════
   NAVIGATION
══════════════════════════════════════════════ */

.nav-wrapper {
  border-bottom: 2px solid #111;
  margin-bottom: 2rem;
}

/* Burger button — hidden on desktop */
.nav-burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: monospace;
  font-size: 0.92rem;
  padding: 0.55rem 0;
  color: #111;
  user-select: none;
}

/* Desktop: nav always visible */
nav {
  display: block;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0;
  padding: 0.5rem 0;
}

nav ul li a {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  color: #111;
  text-decoration: none;
  font-family: monospace;
  font-size: 0.9rem;
  border-radius: 3px;
}

nav ul li a:hover { background: #eee; }

/* CSS-only active state — set via <body class="page-X"> */
body.page-home     nav a[href='index.html'],
body.page-people   nav a[href='people.html'],
body.page-software nav a[href='software.html'],
body.page-teaching nav a[href='teaching.html'],
body.page-pubs     nav a[href='publications.html'],
body.page-seminar  nav a[href='seminar.html'],
body.page-positions nav a[href='positions.html'],
body.page-pllum    nav a[href='pllum.html'] {
  background: #111;
  color: #fff;
}

/* External nav links (GitHub, HuggingFace) */
nav ul li a.nav-ext {
  color: #555;
  font-size: 0.82rem;
  border-left: 1px solid #ccc;
  margin-left: 0.4rem;
  padding-left: 0.8rem;
}
nav ul li a.nav-ext:hover { background: #eee; color: #111; }

/* ══════════════════════════════════════════════
   TYPOGRAPHY
══════════════════════════════════════════════ */

h1 { font-size: 1.7rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 0.5rem; border-bottom: 1px solid #ccc; padding-bottom: 0.2rem; }
h3 { font-size: 1rem; margin: 1.2rem 0 0.3rem; }
p  { margin-bottom: 0.9rem; }
a  { color: #00509e; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.5rem; margin-bottom: 0.9rem; }
li { margin-bottom: 0.3rem; }

/* ══════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════ */

footer {
  border-top: 1px solid #ccc;
  margin-top: 3rem;
  padding: 1rem 0;
  font-size: 0.8rem;
  color: #666;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.3rem;
}
footer a { color: #666; }
footer a:hover { color: #111; }

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

/* Lang toggle */
.lang-toggle {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 0.2rem;
}
.lang-toggle button {
  font-family: monospace;
  font-size: 0.78rem;
  padding: 0.15rem 0.55rem;
  border: 1px solid #999;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  color: #555;
}
.lang-toggle button.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

[data-lang] { display: none; }
[data-lang].lang-visible { display: block; }

/* ── Hero row: logo | title + tagline | lang toggle ── */
.home-hero {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin: 1.6rem 0 1.4rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid #eee;
}

.home-logo {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 8px;
  display: block;
}

.home-hero-text { flex: 1; min-width: 0; }
.home-hero-text h1 { margin-bottom: 0.25rem; font-size: 1.6rem; }

.home-tagline {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.5;
  margin: 0;
}

/* ── Quick-link pills ── */
.home-quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.6rem;
}

.home-quicklinks a {
  font-family: monospace;
  font-size: 0.8rem;
  padding: 0.22rem 0.7rem;
  border: 1px solid #bbb;
  border-radius: 20px;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.home-quicklinks a:hover {
  background: #111;
  color: #fff;
  border-color: #111;
  text-decoration: none;
}

/* ── PLLuM highlight box ── */
.highlight-box {
  border: 1px solid #d0d0d0;
  border-left: 4px solid #111;
  border-radius: 4px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.8rem;
  background: #fafafa;
}

.highlight-box h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.highlight-box h3 a { color: #111; }

.highlight-box p {
  font-size: 0.88rem;
  color: #333;
  margin-bottom: 0.6rem;
  line-height: 1.5;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.7rem;
}

.badge {
  font-family: monospace;
  font-size: 0.72rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid #bbb;
  border-radius: 3px;
  color: #444;
  background: #fff;
}

.highlight-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  font-size: 0.85rem;
  margin-top: 0.2rem;
  padding-top: 0.6rem;
  border-top: 1px solid #e8e8e8;
}

.highlight-links a { color: #00509e; text-decoration: none; }
.highlight-links a:hover { text-decoration: underline; }

/* ── Two-column body: news | topics + contact ── */
.home-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 3rem;
}

.home-col h2 { margin-top: 0; }

.topic-list {
  padding-left: 1.1rem;
  margin-bottom: 1.4rem;
}

.topic-list li {
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .lang-toggle { justify-content: flex-start; }
  .home-hero { flex-wrap: wrap; align-items: flex-start; gap: 0.8rem; }
  .home-hero .lang-toggle { margin-left: auto; }
  .home-logo { width: 60px; height: 60px; }
  .home-two-col { grid-template-columns: 1fr; gap: 0; }
  .home-col + .home-col { margin-top: 1.5rem; }
}

/* ══════════════════════════════════════════════
   INFO TABLE (home)
══════════════════════════════════════════════ */

.info-table { border-collapse: collapse; margin: 1.5rem 0; width: 100%; }
.info-table td { padding: 0.4rem 0.6rem; vertical-align: top; }
.info-table td:first-child { white-space: nowrap; font-weight: bold; width: 130px; color: #444; }

/* ══════════════════════════════════════════════
   NEWS
══════════════════════════════════════════════ */

ol.news { padding-left: 1.5rem; }
ol.news li { margin-bottom: 0.6rem; }
details > summary { cursor: pointer; color: #00509e; margin-bottom: 0.5rem; font-style: italic; }

/* ══════════════════════════════════════════════
   PLLUM HIGHLIGHT BOX
══════════════════════════════════════════════ */

.highlight-box {
  border: 2px solid #111;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 4px;
}
.highlight-box h3 { margin-top: 0; font-size: 1.05rem; }
.highlight-box .tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.highlight-box .badge {
  font-family: monospace;
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid #999;
  border-radius: 3px;
  color: #333;
}

/* ══════════════════════════════════════════════
   PEOPLE
══════════════════════════════════════════════ */

.people-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 3rem;
  margin-top: 1.5rem;
}
.person { display: flex; align-items: flex-start; gap: 1rem; }

.avatar {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: bold;
  color: #333;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Monogram colour palette — cycled by JS index */
.avatar-0 { background: #d5e8b7; }
.avatar-1 { background: #b7d5e8; }
.avatar-2 { background: #e8d5b7; }
.avatar-3 { background: #d5b7e8; }
.avatar-4 { background: #e8b7c8; }
.avatar-5 { background: #b7e8d5; }
.avatar-6 { background: #e8e0b7; }

.person .info .name { font-weight: bold; font-size: 0.95rem; }
.person .info .name a { color: #111; }
.person .info .name a:hover { text-decoration: none; }
.person .info .name .email-icon {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.78rem;
  color: #666;
  text-decoration: none;
  vertical-align: text-top;
}
.person .info .name .email-icon:hover { color: #00509e; }
.person .info .bio { font-size: 0.87rem; color: #333; margin-top: 0.15rem; line-height: 1.4; }
.person .info .links { font-size: 0.8rem; margin-top: 0.3rem; }
.person .info .links a { margin-right: 0.5rem; }

/* ══════════════════════════════════════════════
   SOFTWARE
══════════════════════════════════════════════ */

.software-item { margin-bottom: 1.5rem; border-left: 3px solid #ccc; padding-left: 0.8rem; }
.software-item h3 { margin-top: 0; }

/* ══════════════════════════════════════════════
   TABLES (teaching, seminar)
══════════════════════════════════════════════ */

table.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-bottom: 1rem; }
table.data-table th { background: #f0f0f0; text-align: left; padding: 0.4rem 0.6rem; border: 1px solid #ccc; }
table.data-table td { padding: 0.4rem 0.6rem; border: 1px solid #ccc; vertical-align: top; }

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

.pub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.2rem 0 1.5rem;
}
.pub-filters button {
  font-family: monospace;
  font-size: 0.82rem;
  padding: 0.2rem 0.65rem;
  border: 1px solid #999;
  border-radius: 20px;
  background: #fff;
  color: #444;
  cursor: pointer;
  white-space: nowrap;
}
.pub-filters button:hover { border-color: #111; color: #111; }
.pub-filters button.active { background: #111; color: #fff; border-color: #111; }

.pub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.pub-card {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.pub-card.hidden { display: none; }

.pub-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}
.pub-card .title { font-weight: bold; font-size: 0.93rem; line-height: 1.3; }
.pub-card .title a { color: #111; }
.pub-card .title a:hover { color: #00509e; text-decoration: underline; }

.pub-card .venue-block {
  flex-shrink: 0;
  text-align: right;
  line-height: 1.3;
}
.pub-card .venue-name {
  font-family: monospace;
  font-size: 0.72rem;
  background: #eef2ff;
  color: #334;
  border-radius: 4px 4px 0 0;
  padding: 0.15rem 0.4rem;
  display: block;
  white-space: nowrap;
}
.pub-card .venue-year {
  font-family: monospace;
  font-size: 0.72rem;
  background: #dde6ff;
  color: #334;
  border-radius: 0 0 4px 4px;
  padding: 0.1rem 0.4rem;
  display: block;
  text-align: center;
}

.pub-card .authors { font-size: 0.81rem; color: #555; }
.pub-card .abstract {
  font-size: 0.83rem;
  color: #333;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pub-card-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.1rem; }
.pub-tag {
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
  border: 1px solid #bbb;
  color: #555;
  background: #f7f7f7;
}
.pub-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.8rem;
  margin-top: auto;
  padding-top: 0.4rem;
  font-size: 0.81rem;
  border-top: 1px solid #eee;
}
.pub-card-links a { color: #00509e; text-decoration: none; }
.pub-card-links a:hover { text-decoration: underline; }
.pub-card-links .link-disabled { color: #aaa; }

/* BibTeX toggle button (sits in the links row) */
.bibtex-toggle {
  font-family: monospace;
  font-size: 0.78rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid #bbb;
  border-radius: 3px;
  background: #fff;
  color: #555;
  cursor: pointer;
  margin-left: auto;
}
.bibtex-toggle:hover,
.bibtex-toggle.active { background: #111; color: #fff; border-color: #111; }

/* BibTeX code block */
.bibtex-block {
  margin-top: 0.5rem;
  border-top: 1px dashed #ddd;
  padding-top: 0.5rem;
  position: relative;
}
.bibtex-block pre {
  font-family: monospace;
  font-size: 0.72rem;
  line-height: 1.5;
  background: #f6f6f6;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 0.6rem 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  width: 100%;
  color: #222;
  margin: 0;
  box-sizing: border-box;
}
.bibtex-copy {
  margin-top: 0.35rem;
  font-family: monospace;
  font-size: 0.75rem;
  padding: 0.15rem 0.6rem;
  border: 1px solid #bbb;
  border-radius: 3px;
  background: #fff;
  color: #555;
  cursor: pointer;
}
.bibtex-copy:hover { background: #111; color: #fff; border-color: #111; }

.pub-none { display: none; font-style: italic; color: #666; margin-top: 1rem; }
.pub-none.visible { display: block; }

/* ══════════════════════════════════════════════
   OPEN POSITIONS
══════════════════════════════════════════════ */

.position { border: 1px solid #ccc; padding: 1rem; margin-bottom: 1rem; border-radius: 4px; }
.position h3 { margin-top: 0; }
.position .deadline { font-size: 0.85rem; color: #c00; margin-bottom: 0.4rem; }

/* ══════════════════════════════════════════════
   404
══════════════════════════════════════════════ */

.error-page { text-align: center; padding: 4rem 1rem; }
.error-page .code { font-size: 5rem; font-family: monospace; color: #ddd; line-height: 1; }
.error-page h1 { font-size: 1.4rem; margin: 0.5rem 0 1rem; }

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */

@media (max-width: 640px) {
  h1 { font-size: 1.3rem; }

  /* Burger menu on mobile */
  .nav-burger { display: block; }
  nav { display: none; }
  nav.nav-open { display: block; }
  nav ul { flex-direction: column; padding-bottom: 0.5rem; }
  nav ul li a { display: block; padding: 0.4rem 0.5rem; }
  nav ul li a.nav-ext { border-left: none; margin-left: 0; padding-left: 0.5rem; }

  .people-list { grid-template-columns: 1fr; }
  .pub-grid { grid-template-columns: 1fr; }
  .info-table td { display: block; padding: 0.2rem 0; }
  .info-table td:first-child { width: auto; }
  .info-table tr { display: block; margin-bottom: 0.8rem; }
  footer { flex-direction: column; }
}
