/* ==========================================================
   Salomon Garcia-Villegas — personal website
   Colors and fonts are defined here; change them in one place.
   ========================================================== */

:root {
  --navy: #13294b;          /* top bar, headings */
  --navy-2: #1f3d6b;        /* top bar gradient */
  --accent: #2563a8;        /* links */
  --accent-soft: #e8f0fa;   /* tag background */
  --text: #2b2f36;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #ffffff;
  --side-bg: #f7f8fa;

  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;

  --topbar-h: 64px;
  --side-w: 300px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 16px); }

body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

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

/* ---------- Top bar ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar-h);
  background: linear-gradient(90deg, var(--navy), var(--navy-2));
  z-index: 10;
  box-shadow: 0 1px 8px rgba(0, 0, 0, .15);
}
.topbar-inner {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: .2px;
}
.brand:hover { text-decoration: none; }

.menu { display: flex; gap: 28px; }
.menu a {
  color: rgba(255, 255, 255, .85);
  font-size: .95rem;
  font-weight: 500;
}
.menu a:hover { color: #fff; text-decoration: none; }

.menu-toggle {
  display: none;
  background: none;
  border: 0;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
}

/* ---------- Two-column layout ---------- */
.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--topbar-h) + 40px) 24px 40px;
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  gap: 56px;
}

/* ---------- Left column ---------- */
.sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 40px);
  align-self: start;
  max-height: calc(100vh - var(--topbar-h) - 60px);
  overflow-y: auto;
  scrollbar-width: thin;
  text-align: center;
  background: var(--side-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 24px;
}
.avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 4px 16px rgba(19, 41, 75, .18);
}
.name {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--navy);
  margin: 18px 0 4px;
  line-height: 1.25;
}
.role { margin: 0; color: var(--text); font-weight: 500; }
.affiliation { margin: 2px 0 0; }

.side-block {
  text-align: left;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: .9rem;
}
.side-block h2 {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}
.side-block p { margin: 0; }

.links { list-style: none; margin: 0; padding: 0; }
.links li { margin: 6px 0; }
.links i { width: 22px; color: var(--navy); text-align: center; margin-right: 8px; }
.links a { color: var(--text); }
.links a:hover { color: var(--accent); }

/* ---------- Main content ---------- */
.content { min-width: 0; }

section { margin-bottom: 48px; }

section > h2 {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 18px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}

.paper { margin-bottom: 22px; }
.paper h3 {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
}
.paper h3 a { color: var(--navy); }
.paper h3 a:hover { color: var(--accent); }
.meta { margin: 2px 0 6px; color: var(--muted); font-size: .92rem; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 500;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 5px;
  border: 1px solid #c9d8ee;
  background: var(--accent-soft);
  color: var(--navy);
  cursor: pointer;
}
.tag:hover, .tag.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  text-decoration: none;
}

.abstract {
  display: none;
  margin-top: 10px;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: var(--side-bg);
  border-radius: 0 6px 6px 0;
  font-size: .93rem;
}
.abstract.open { display: block; }

.teach { margin-bottom: 18px; }
.teach h3 { font-size: 1.02rem; font-weight: 600; color: var(--navy); margin: 0 0 4px; }
.teach ul { margin: 0; padding-left: 18px; }
.teach li { margin: 2px 0; }
.when { color: var(--muted); font-size: .9rem; margin-left: 6px; }
.when::before { content: "· "; }

.footer {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--muted);
  font-size: .85rem;
}

/* ---------- Tablets and phones ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 32px; padding: calc(var(--topbar-h) + 24px) 16px 32px; }
  .sidebar { position: static; max-height: none; overflow: visible; }
  .side-block { max-width: 360px; margin-left: auto; margin-right: auto; }

  .menu-toggle { display: block; }
  .menu {
    display: none;
    position: absolute;
    top: var(--topbar-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--navy);
    padding: 8px 0;
  }
  .menu.open { display: flex; }
  .menu a { padding: 12px 24px; }
  .topbar-inner { padding: 0 16px; }
  .brand { font-size: 1.15rem; }
}
