/* ---------------------------------------------------------------------------
   Mahmoud Ali — academic personal site
   Clean, responsive theme (no build step required)
--------------------------------------------------------------------------- */

:root {
  --accent: #7a1f2b;          /* IU crimson-ish */
  --accent-soft: #a23545;
  --text: #1f2328;
  --muted: #5b636b;
  --line: #e6e8eb;
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --link: #8a1f2b;
  --radius: 12px;
  --maxw: 1080px;
  --sidebar-w: 300px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; display: block; }

/* ---------- Top nav ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  height: 60px; display: flex; align-items: center; justify-content: space-between;
}
.brand { font-weight: 700; letter-spacing: .2px; color: var(--text); }
.brand:hover { text-decoration: none; color: var(--accent); }
.nav-links { display: flex; gap: 22px; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: 15px; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); text-decoration: none; }

/* ---------- Layout ---------- */
.wrap {
  max-width: var(--maxw); margin: 0 auto; padding: 40px 24px 80px;
  display: grid; grid-template-columns: var(--sidebar-w) 1fr; gap: 48px;
  align-items: start;
}

/* ---------- Sidebar ---------- */
.sidebar { position: sticky; top: 92px; text-align: center; }
.avatar {
  width: 210px; height: 210px; border-radius: 50%;
  object-fit: cover; margin: 0 auto 18px;
  border: 4px solid #fff; box-shadow: 0 6px 24px rgba(0,0,0,.12);
}
.sidebar h1 { font-family: var(--font-serif); font-size: 26px; margin: 6px 0 2px; font-weight: 600; }
.sidebar .role { color: var(--accent); font-weight: 600; font-size: 15px; }
.sidebar .affil { color: var(--muted); font-size: 14px; margin-top: 4px; }
.sidebar .affil a { color: var(--muted); }

.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 20px 0 6px; }
.socials a { color: var(--muted); font-size: 20px; transition: color .15s ease, transform .15s ease; }
.socials a:hover { color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.socials svg { width: 22px; height: 22px; fill: currentColor; display: block; }

/* ---------- Main content ---------- */
.content { min-width: 0; }
section { margin-bottom: 44px; scroll-margin-top: 80px; }
.content h2 {
  font-family: var(--font-serif); font-size: 24px; font-weight: 600;
  margin: 0 0 18px; padding-bottom: 8px; border-bottom: 2px solid var(--line);
}
.content h2 .em { color: var(--accent); }
.lead p { margin: 0 0 14px; }
.lead a { font-weight: 500; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag {
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--muted);
  padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 500;
}

/* ---------- News ---------- */
.news { list-style: none; padding: 0 8px 0 0; margin: 0; max-height: 460px; overflow-y: auto; }
.news li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 15.5px; }
.news li:last-child { border-bottom: 0; }
.news .date { color: var(--accent); font-weight: 600; font-size: 13.5px; white-space: nowrap; padding-top: 1px; }
.news::-webkit-scrollbar { width: 8px; }
.news::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

/* ---------- Publications ---------- */
.pub { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.pub:last-child { border-bottom: 0; }
.pub-thumb {
  width: 150px; height: 96px; border-radius: 8px; object-fit: cover;
  background: var(--bg-soft); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 12px; color: var(--muted); padding: 6px; font-weight: 600;
}
.pub-year { float: right; margin-left: 14px; color: var(--accent); font-weight: 700; font-size: 14px; white-space: nowrap; }
.pub-title { font-weight: 600; font-size: 16.5px; margin: 0 0 4px; }
.pub-authors { color: var(--muted); font-size: 15px; margin: 0 0 4px; }
.pub-authors .me { color: var(--text); font-weight: 700; }
.pub-venue { font-size: 14.5px; margin: 0 0 8px; }
.pub-venue .badge {
  display: inline-block; background: var(--accent); color: #fff; font-size: 11.5px;
  font-weight: 700; padding: 2px 9px; border-radius: 6px; margin-right: 8px; letter-spacing: .3px;
}
.pub-venue em { color: var(--muted); font-style: italic; }
.pub-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pub-links a {
  font-size: 13px; font-weight: 600; padding: 3px 11px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--muted); background: #fff;
}
.pub-links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- CV ---------- */
.cv-block { margin-bottom: 30px; }
.cv-item { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.cv-item:last-child { border-bottom: 0; }
.cv-item .row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cv-item .title { font-weight: 600; }
.cv-item .where { color: var(--muted); font-size: 15px; }
.cv-item .when { color: var(--accent); font-weight: 600; font-size: 14px; white-space: nowrap; }
.cv-item ul { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 15px; }
.cv-item ul li { margin-bottom: 3px; }
.cv-item p.desc { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.cv-item .theme { color: var(--text); font-weight: 600; }
.note { color: var(--muted); font-size: 14px; margin-top: 6px; }
.skills p { margin: 4px 0; }
.skills b { color: var(--text); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: #fff;
  padding: 9px 18px; border-radius: 8px; font-weight: 600; font-size: 15px; margin-bottom: 10px;
}
.btn:hover { background: var(--accent-soft); text-decoration: none; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg-soft); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 22px 24px; color: var(--muted); font-size: 13.5px; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .wrap { grid-template-columns: 1fr; gap: 28px; padding-top: 28px; }
  .sidebar { position: static; }
  .nav-links { gap: 16px; }
  .pub { grid-template-columns: 1fr; }
  .pub-thumb { width: 100%; height: 150px; }
  .news li { grid-template-columns: 78px 1fr; }
}
@media (max-width: 520px) {
  .nav-links { gap: 13px; }
  .nav-links a { font-size: 14px; }
  body { font-size: 16px; }
}
