/* =============================================
   style.css — Iacopo Catalano personal website
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Sidebar */
  --sidebar-bg:     #1e293b;
  --sidebar-w:      540px;
  --sidebar-text:   #cbd5e1;
  --sidebar-muted:  #64748b;
  --sidebar-name:   #f1f5f9;
  --sidebar-active: #60a5fa;

  /* Content */
  --text:    #1a1a1a;
  --muted:   #6b7280;
  --accent:  #2563eb;
  --bg:      #ffffff;
  --border:  #e5e7eb;
  --surface: #f8faff;
  --radius:  6px;
  --font:    'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

/* =============================================
   SIDEBAR
   ============================================= */

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-inner {
  padding: 2rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
}

/* Identity block: photo + name + positions */
.sidebar-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.1rem;
}

.sidebar-photo {
  display: block;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  margin-bottom: 2rem;
  border: 3px solid rgba(255,255,255,0.12);
}

.sidebar-name {
  font-size: 2rem;
  font-weight: 100;
  color: var(--sidebar-name);
  text-align: center;
  margin-bottom: 0.55rem;
  line-height: 1.3;
}

.sidebar-positions {
  text-align: center;
}

.sidebar-identity > div {
  text-align: center;
}

.sidebar-positions a {
  color: inherit;
  text-decoration: none;
}

.sidebar-positions a:hover {
  color: var(--sidebar-name);
}

.sidebar-positions p {
  font-size: 1rem;
  color: var(--sidebar-text);
  line-height: 1.55;
}

.sidebar-positions .affil {
  font-size: 0.9rem;
  color: var(--sidebar-muted);
}

/* Keywords */
.sidebar-keywords {
  font-size: 0.9rem;
  color: var(--sidebar-muted);
  text-align: center;
  font-style: italic;
  line-height: 1.65;
  padding-top: 1rem;
  margin-top: 0.25rem;
  border-top: 1px solid rgba(255,255,255,0.07);
}

/* Contact */
.sidebar-contact {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 1.4rem;
}

.sidebar-contact a {
  font-size: 2rem;
  color: var(--sidebar-muted);
  text-decoration: none;
  transition: color 0.15s;
  line-height: 1;
}

.sidebar-contact a:hover {
  color: var(--sidebar-name);
  text-decoration: none;
}

/* =============================================
   CONTENT AREA
   ============================================= */

.content-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top navigation bar — spans content column */
.topnav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
  padding: 0.85rem 3.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.topnav a {
  font-size: 1.5rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.topnav a:hover {
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}

.topnav a.active {
  color: var(--text);
  font-weight: 600;
}

.page {
  padding: 5rem 5rem;
  flex: 1;
}

.page-title {
  font-size: 2.25rem;
  font-weight: 100;
  color: var(--text);
  margin-bottom: 2rem;
}

/* =============================================
   SECTION HEADINGS
   ============================================= */

.section-title {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  margin: 2.75rem 0 1.1rem;
  padding-top: 0.75rem;
  border-top: 2px solid var(--border);
}

/* =============================================
   HOME PAGE
   ============================================= */

.home-intro p {
  margin-bottom: 1em;
  font-size: 1.1rem;
  line-height: 1.8;
}

.home-intro p:last-child { margin-bottom: 0; }

/* News */
.news-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.news-list li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.55;
  align-items: baseline;
}

.news-date {
  color: var(--muted);
  font-size: 0.8rem;
}

/* =============================================
   ABOUT PAGE
   ============================================= */

.bio p {
  margin-bottom: 1em;
  font-size: 1.1rem;
  line-height: 1.75;
}

.bio p:last-child { margin-bottom: 0; }

/* CV download button */
.cv-download {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.75rem;
  padding: 0.6rem 1.4rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
}

.cv-download:hover {
  background: #1d4fd879;
  color: #fff;
  text-decoration: none;
}

/* Recognition */
.recognition-list { list-style: none; }

.recognition-list li {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: 0.5rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.925rem;
  line-height: 1.5;
}

.recognition-list li:last-child { border-bottom: none; }
.recog-year { color: var(--muted); font-size: 0.82rem; padding-top: 0.1rem; }

/* Teaching */
.teaching-list { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.teaching-list li { font-size: 0.925rem; line-height: 1.55; }
.teaching-role { font-weight: 500; }
.teaching-sub { display: block; color: var(--muted); font-size: 0.85rem; }

/* Student recruitment box */
.student-note {
  margin-top: 2.5rem;
  padding: 1.1rem 1.4rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.925rem;
  line-height: 1.65;
}

.student-note strong { display: block; margin-bottom: 0.3rem; }

/* =============================================
   PUBLICATIONS
   ============================================= */

.pubs-intro {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.pub-list { display: flex; flex-direction: column; }

.pub-card {
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.pub-card:first-child { padding-top: 0; }
.pub-card:last-child  { border-bottom: none; }

.pub-thumb {
  width: 250px;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.pub-body { flex: 1; min-width: 0; }

.pub-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.pub-authors {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
  line-height: 1.5;
}

.pub-authors .me { color: var(--text); }

.pub-venue {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.55rem;
}

.venue-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  margin-right: 0.4rem;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

.pub-links { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.pub-link {
  font-size: 0.77rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.pub-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* =============================================
   FOOTER
   ============================================= */

footer {
  padding: 1.5rem 3.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
}

/* Contact links in page (mobile-only fallback) */
.contact-mobile {
  display: none;
  margin-top: 2rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.contact-mobile a {
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.contact-mobile a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* =============================================
   MOBILE
   ============================================= */

@media (max-width: 960px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }

  .sidebar-inner {
    padding: 0.9rem 1.5rem;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .sidebar-identity {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0;
  }

  .sidebar-photo {
    width: 60px;
    height: 60px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .sidebar-name {
    text-align: left;
    font-size: 1rem;
    margin-bottom: 0.1rem;
  }

  .sidebar-positions {
    text-align: left;
  }

  .sidebar-positions p { font-size: 0.75rem; }

  .sidebar-keywords { display: none; }
  .sidebar-contact  { display: none; }

  .contact-mobile { display: flex; }

  .topnav {
    padding: 0.75rem 1.5rem;
  }

  .content-wrap {
    margin-left: 0;
  }

  .page {
    padding: 1.75rem 1.5rem;
  }

  footer { padding: 1.25rem 1.5rem; }

  .pub-card { flex-direction: column; gap: 0.75rem; }
  .pub-thumb { width: 100%; aspect-ratio: 16 / 9; height: auto; }

  .news-list li {
    grid-template-columns: 4.5rem 1fr;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .recognition-list li {
    grid-template-columns: 2.75rem 1fr;
  }
}
