/* ====================================================
   António Abelha — Academic CV Website
   Theme: Hugo Academic inspired
   ==================================================== */

:root {
  --primary:    #1c136b;
  --primary-lt: #2e22a0;
  --accent:     #e8a020;
  --light-bg:   #f8f9fa;
  --card-bg:    #ffffff;
  --text:       #2c2c2c;
  --muted:      #6c757d;
  --border:     #dee2e6;
  --q1:         #1a7340;
  --q2:         #1655a0;
  --q3:         #8b5d00;
  --q4:         #8b1a1a;
}

/* ---- Base ---- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: #fff;
  margin: 0;
  line-height: 1.65;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-lt); text-decoration: underline; }

/* ---- Navbar ---- */
.navbar {
  background: var(--primary);
  padding: 0.6rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar-brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.nav-links a {
  color: rgba(255,255,255,0.85);
  font-size: 0.88rem;
  transition: color .2s;
}
.nav-links a:hover { color: #fff; text-decoration: none; }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #2e22a0 60%, #4a3cc9 100%);
  color: #fff;
  padding: 4rem 2rem 3.5rem;
}
.hero-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  gap: 3rem;
  align-items: center;
  flex-wrap: wrap;
}
.hero-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255,255,255,0.4);
  flex-shrink: 0;
}
.hero-text h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
}
.hero-text .subtitle {
  font-size: 1.05rem;
  opacity: 0.9;
  margin: 0 0 0.3rem;
}
.hero-text .inst {
  font-size: 0.9rem;
  opacity: 0.75;
  margin: 0 0 1.2rem;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}
.badge-pill {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 20px;
  padding: 0.2rem 0.8rem;
  font-size: 0.8rem;
}
.social-links {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-radius: 6px;
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  transition: background .2s;
}
.social-link:hover { background: rgba(255,255,255,0.28); color: #fff; text-decoration: none; }

/* ---- Sections ---- */
.section {
  padding: 3.5rem 2rem;
}
.section-alt { background: var(--light-bg); }
.section-inner {
  max-width: 960px;
  margin: 0 auto;
}
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.5rem;
  margin-bottom: 1.8rem;
}

/* ---- Metric cards ---- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.metric-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem 1rem;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.metric-card .val {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.metric-card .lbl {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.3rem;
}
.metric-card .src {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* ---- Research interests ---- */
.interest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.interest-card {
  background: var(--card-bg);
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.interest-card h4 { margin: 0 0 0.4rem; font-size: 0.95rem; color: var(--primary); }
.interest-card p { margin: 0; font-size: 0.85rem; color: var(--muted); }

/* ---- Publications ---- */
.pub-filter {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.filter-btn {
  border: 2px solid var(--border);
  background: #fff;
  border-radius: 20px;
  padding: 0.25rem 1rem;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all .2s;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.pub-list { list-style: none; padding: 0; margin: 0; }
.pub-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.8rem;
  display: none;
}
.pub-item.visible { display: block; }
.pub-item.q1 { border-left: 4px solid var(--q1); }
.pub-item.q2 { border-left: 4px solid var(--q2); }
.pub-item.q3 { border-left: 4px solid var(--q3); }
.pub-item.q4 { border-left: 4px solid var(--q4); }
.pub-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.2rem; }
.pub-authors { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.25rem; }
.pub-journal { font-size: 0.82rem; color: var(--text); margin-bottom: 0.4rem; }
.pub-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.pub-badge {
  border-radius: 12px;
  padding: 0.15rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
}
.pub-badge.q1 { background: var(--q1); }
.pub-badge.q2 { background: var(--q2); }
.pub-badge.q3 { background: var(--q3); }
.pub-badge.q4 { background: var(--q4); }
.pub-cit { font-size: 0.75rem; color: var(--muted); }
.doi-link { font-size: 0.75rem; }

/* ---- Tables ---- */
.cv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.cv-table th {
  background: var(--primary);
  color: #fff;
  padding: 0.6rem 0.8rem;
  text-align: left;
}
.cv-table td { padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--border); }
.cv-table tr:nth-child(even) td { background: #f4f6fb; }
.cv-table tr:last-child td { font-weight: 600; background: #e8ecf8; }

/* ---- Project cards ---- */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.proj-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.proj-card .proj-name { font-weight: 700; color: var(--primary); margin-bottom: 0.3rem; }
.proj-card .proj-role { font-size: 0.78rem; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.4rem; }
.proj-card .proj-desc { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.proj-card .proj-tag {
  background: #eef1fb;
  color: var(--primary);
  border-radius: 10px;
  padding: 0.15rem 0.6rem;
  font-size: 0.73rem;
  display: inline-block;
  margin-top: 0.2rem;
}

/* ---- Awards ---- */
.award-list { list-style: none; padding: 0; margin: 0; }
.award-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.award-year {
  flex-shrink: 0;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 52px;
  text-align: center;
}
.award-desc { font-size: 0.88rem; }
.award-desc strong { color: var(--primary); }

/* ---- Footer ---- */
footer {
  background: var(--primary);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.8rem;
}
footer a { color: rgba(255,255,255,0.85); }

/* ---- Bio two-col ---- */
.bio-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 680px) {
  .bio-grid { grid-template-columns: 1fr; }
  .hero-inner { flex-direction: column; gap: 1.5rem; }
  .hero-photo { width: 120px; height: 120px; }
}

.edu-list { list-style: none; padding: 0; margin: 0; }
.edu-item { display: flex; gap: 0.8rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.edu-year { font-size: 0.8rem; color: var(--muted); min-width: 50px; }
.edu-info strong { display: block; font-size: 0.9rem; }
.edu-info span { font-size: 0.82rem; color: var(--muted); }

/* ---- Image figures ---- */
.fig-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.fig-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.fig-card img { width: 100%; height: auto; display: block; }
.fig-card figcaption { padding: 0.5rem 0.8rem; font-size: 0.78rem; color: var(--muted); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }
