/* =========================================================
   afarzaneh.com — main stylesheet
   ========================================================= */

/* ---- Variables ----------------------------------------- */
:root {
  --blue:       #1d4ed8;
  --blue-dark:  #1e3a8a;
  --blue-light: #eff6ff;
  --text:       #111827;
  --muted:      #6b7280;
  --border:     #e5e7eb;
  --bg:         #ffffff;
  --bg-soft:    #f9fafb;
  --radius:     8px;
  --max-w:      860px;
  --nav-h:      64px;
  --transition: 0.18s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--blue-dark); text-decoration: underline; }

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

/* ---- Layout -------------------------------------------- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

main {
  padding-top: calc(var(--nav-h) + 48px);
  padding-bottom: 80px;
  min-height: calc(100vh - var(--nav-h));
}

section { margin-bottom: 56px; }

/* ---- Navigation ---------------------------------------- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.nav-logo:hover { color: var(--blue); text-decoration: none; }

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: color var(--transition), background var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--blue);
  background: var(--blue-light);
  text-decoration: none;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border: none;
  background: none;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ---- Page Title ---------------------------------------- */
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
  color: var(--text);
}

/* ---- Home / About -------------------------------------- */
.profile {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  margin-bottom: 48px;
}

.profile-photo {
  flex-shrink: 0;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--blue-light);
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-photo .initials {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: -0.04em;
}

.profile-info h1 {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin-bottom: 6px;
}

.profile-role {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 4px;
  line-height: 1.4;
}

.profile-social {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.social-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
  text-decoration: none;
}
.social-btn svg { width: 15px; height: 15px; }

/* About body text */
.about-body p {
  margin-bottom: 16px;
  color: #374151;
  font-size: 0.97rem;
}

.research-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--blue-light);
  color: var(--blue-dark);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Home — Recent News preview */
.news-preview-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.news-preview-item {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.news-preview-item:first-child { border-top: 1px solid var(--border); }

.news-date-badge {
  flex-shrink: 0;
  width: 90px;
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}

.news-preview-item p {
  font-size: 0.93rem;
  color: var(--text);
  line-height: 1.5;
}
.news-preview-item a { font-weight: 500; }

/* Section headings */
.section-heading {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-heading a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--blue);
}

/* ---- Publications -------------------------------------- */
.year-group { margin-bottom: 40px; }

.year-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.pub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pub-item {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.pub-item:hover {
  border-color: #93c5fd;
  box-shadow: 0 2px 12px rgba(29,78,216,0.07);
}

.pub-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 5px;
}
.pub-title a { color: inherit; }
.pub-title a:hover { color: var(--blue); text-decoration: none; }

.pub-authors {
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.pub-authors strong { color: #374151; font-weight: 600; }

.pub-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pub-venue {
  font-size: 0.82rem;
  color: #374151;
  font-style: italic;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-conf   { background: #ecfdf5; color: #065f46; }
.badge-jour   { background: #fffbeb; color: #92400e; }
.badge-pre    { background: #f3f4f6; color: #374151; }
.badge-workshop { background: #fdf4ff; color: #6b21a8; }

.pub-links {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--blue);
  padding: 3px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  background: var(--blue-light);
  transition: background var(--transition), border-color var(--transition);
}
.pub-link:hover {
  background: #dbeafe;
  border-color: var(--blue);
  text-decoration: none;
}

/* ---- News / Posts ------------------------------------- */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.news-card {
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.news-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 2px 12px rgba(29,78,216,0.07);
}

.news-card-date {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.news-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.news-card-body {
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.6;
}

/* ---- Teaching ------------------------------------------ */
.teaching-intro {
  font-size: 0.95rem;
  color: #374151;
  margin-bottom: 28px;
  line-height: 1.65;
}

.institution-group { margin-bottom: 40px; }

.institution-name {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.course-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.course-item {
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.course-item:hover {
  border-color: #93c5fd;
  box-shadow: 0 2px 12px rgba(29,78,216,0.07);
}

.course-code {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--blue-dark);
  text-align: center;
  line-height: 1.2;
}

.course-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.course-desc {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---- Footer -------------------------------------------- */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

footer a { color: var(--muted); }
footer a:hover { color: var(--blue); }

/* ---- Utilities ----------------------------------------- */
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }

/* ---- Responsive ---------------------------------------- */
@media (max-width: 640px) {
  :root { --nav-h: 56px; }

  main { padding-top: calc(var(--nav-h) + 32px); }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 8px 16px 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 12px; border-radius: 6px; }

  .nav-toggle { display: flex; }

  .profile { flex-direction: column; align-items: center; text-align: center; gap: 20px; }
  .profile-social { justify-content: center; }
  .profile-photo { width: 130px; height: 130px; }
  .profile-info h1 { font-size: 1.6rem; }

  .news-preview-item { flex-direction: column; gap: 4px; }
  .news-date-badge { width: auto; }

  .page-title { font-size: 1.4rem; }

  .pub-item, .news-card, .course-item { padding: 14px 16px; }
}
