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

:root {
  --color-bg:        #f8f9fa;
  --color-surface:   #ffffff;
  --color-border:    #dee2e6;
  --color-primary:   #1a6eb5;
  --color-primary-h: #1558a0;
  --color-text:      #212529;
  --color-muted:     #6c757d;
  --color-tag-bg:    #e8f0fb;
  --color-tag-text:  #1a6eb5;
  --radius:          6px;
  --shadow:          0 1px 3px rgba(0,0,0,.1);
  --max-width:       860px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--color-primary-h); }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

main { flex: 1; padding: 3rem 0; }

/* ── Header / Nav ─────────────────────────────────────────────────────────── */
header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: .75rem;
  padding-bottom: .75rem;
  flex-wrap: wrap;
  gap: .5rem;
}

.site-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

nav a {
  font-size: .92rem;
  font-weight: 500;
  color: var(--color-muted);
  transition: color .15s;
}
nav a:hover, nav a.active { color: var(--color-primary); text-decoration: none; }

/* ── Sections ─────────────────────────────────────────────────────────────── */
section { margin-bottom: 3.5rem; }
section:last-child { margin-bottom: 0; }

h2.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--color-primary);
  display: inline-block;
}

/* ── About ────────────────────────────────────────────────────────────────── */
#about p { max-width: 680px; color: var(--color-muted); }

/* ── Publications controls ────────────────────────────────────────────────── */
.pub-controls {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  align-items: center;
}

.pub-controls input[type="search"],
.pub-controls select {
  padding: .45rem .75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: .92rem;
  background: var(--color-surface);
  color: var(--color-text);
  outline-offset: 2px;
}

.pub-controls input[type="search"] { flex: 1 1 240px; }
.pub-controls select { min-width: 130px; }

#pub-count {
  font-size: .85rem;
  color: var(--color-muted);
  margin-left: auto;
  white-space: nowrap;
}

/* ── Publication list ─────────────────────────────────────────────────────── */
#pub-list { list-style: none; }

.pub-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: .85rem;
  box-shadow: var(--shadow);
  transition: border-color .15s;
}
.pub-item:hover { border-color: var(--color-primary); }

.pub-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: .3rem;
  line-height: 1.4;
}

.pub-authors {
  font-size: .88rem;
  color: var(--color-muted);
  margin-bottom: .25rem;
}

.pub-meta {
  font-size: .85rem;
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  align-items: center;
  margin-bottom: .5rem;
}

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

.pub-year {
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  border-radius: 20px;
  padding: .1rem .55rem;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}

.pub-citations {
  font-size: .78rem;
  color: var(--color-muted);
}

.pub-links { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .45rem; }

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .8rem;
  font-weight: 600;
  padding: .25rem .65rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  transition: background .15s, color .15s;
}
.btn-link:hover { background: var(--color-primary); color: #fff; text-decoration: none; }
.btn-link.pdf { border-color: #c0392b; color: #c0392b; }
.btn-link.pdf:hover { background: #c0392b; color: #fff; }

/* ── Empty / loading states ───────────────────────────────────────────────── */
.state-msg {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-muted);
  font-size: .95rem;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 1.1rem 0;
  text-align: center;
  font-size: .82rem;
  color: var(--color-muted);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .pub-controls { flex-direction: column; }
  .pub-controls input[type="search"],
  .pub-controls select { width: 100%; }
  #pub-count { margin-left: 0; }
}
