/* ============================================================
   Dr. Muhammad Mohsin — Academic Portfolio
   Two-column layout: left profile card + right page sections
   ============================================================ */

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

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

:root {
  --link:    #0366d6;
  --text:    #24292e;
  --muted:   #586069;
  --border:  #e1e4e8;
  --bg:      #ffffff;
  --nav-h:   52px;
  --left-w:  220px;
}

html { font-size: 16px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ── Top Navigation ── */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-brand {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}
.nav-brand:hover { text-decoration: none; color: var(--link); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
  overflow: hidden;
}

.nav-links .nav-link {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.nav-links .nav-link:hover { color: var(--text); background: #f6f8fa; text-decoration: none; }
.nav-links .nav-link.active { color: var(--link); font-weight: 500; }

.nav-burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
  color: var(--text);
}
.nav-burger svg { width: 22px; height: 22px; display: block; }

/* Mobile nav dropdown */
.nav-mobile {
  display: none;
  flex-direction: column;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 2rem;
}
.nav-mobile.open { display: flex; }
.nav-mobile .nav-link {
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0.5rem 0;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.nav-mobile .nav-link:last-child { border-bottom: none; }
.nav-mobile .nav-link.active { color: var(--link); font-weight: 500; }

/* ── Page Body: Two-Column Layout ── */
.page-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

/* ── Left Profile Column ── */
.left-col {
  width: var(--left-w);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--nav-h) + 2rem);
}

.profile-img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: 1rem;
}

.profile-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.profile-title {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
  line-height: 1.4;
}

.profile-org {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
  line-height: 1.4;
}

.profile-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.profile-links li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.profile-links li svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: var(--muted);
  fill: none;
}

.profile-links li svg[fill="currentColor"] {
  fill: var(--muted);
  stroke: none;
}

.profile-links li a {
  color: var(--link);
  font-size: 0.8rem;
}

/* ── Right Content Column ── */
.right-col {
  flex: 1;
  min-width: 0;
}

/* ── Page Sections (show/hide) ── */
.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

/* ── Section Headings ── */
.page-section > h2:first-child,
.timeline-section-split > div > h2:first-child {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.page-section p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.9rem;
  line-height: 1.7;
}

/* ── Research Section ── */
.research-interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.interest-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
}

.interest-card h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.interest-card p {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

/* ── Publications Section ── */

.pub-category { margin-bottom: 2rem; }

.pub-cat-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 0.4rem;
  margin-bottom: 0.25rem;
  border-bottom: 2px solid var(--border);
}

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

.pub-entry-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f0f2f4;
  align-items: flex-start;
}

.pub-index {
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 22px;
  flex-shrink: 0;
  padding-top: 0.1rem;
  text-align: right;
}

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

.pub-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 0.2rem;
}

.pub-authors-list {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.pub-venue-desc {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
}

.pub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.pub-action-link {
  font-size: 0.75rem;
  color: var(--link);
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  background: none;
  display: inline-block;
  transition: background 0.1s;
}
.pub-action-link:hover { background: #f6f8fa; text-decoration: none; }

/* Collapsible abstract/bibtex */
.pub-collapsible-panel {
  display: none;
  margin-top: 0.5rem;
}
.pub-collapsible-panel.open { display: block; }
.pub-panel-content {
  background: #f6f8fa;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
  position: relative;
}
.pub-panel-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
}
.bibtex-code {
  display: block;
  white-space: pre;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.75rem;
  overflow-x: auto;
  padding-top: 0.25rem;
}
.copy-bibtex-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
  transition: background 0.15s;
}
.copy-bibtex-btn:hover { background: #f6f8fa; }

/* ── Experience / Timeline ── */
.timeline-section-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 0.5rem;
}

.timeline-item {
  position: relative;
  padding-left: 1.25rem;
  padding-bottom: 1.25rem;
  border-left: 1px solid var(--border);
}

.timeline-item:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -4px;
  top: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--link);
  border: 1.5px solid var(--bg);
  box-shadow: 0 0 0 1px var(--link);
}

.timeline-date {
  font-size: 0.72rem;
  color: var(--muted);
  display: block;
  margin-bottom: 0.15rem;
}

.timeline-item h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.1rem;
}

.timeline-org {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.timeline-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Skills */
.skill-category-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
}

.skill-category-card h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.skill-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.skill-chip {
  background: #f6f8fa;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Teaching Section ── */
.teaching-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.course-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem;
}

.course-period {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.course-card h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
  line-height: 1.35;
}

.course-meta-desc {
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── Talks Section ── */
.talks-list { display: flex; flex-direction: column; gap: 0; }

.talk-item-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f0f2f4;
}

.talk-meta-left { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }

.talk-item-title {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.4;
}

.talk-venue-info {
  font-size: 0.78rem;
  color: var(--muted);
}

.talk-date-badge {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 0.1rem;
}

/* ── Awards Section ── */
.awards-grid-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.award-item-row {
  display: flex;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid #f0f2f4;
  align-items: baseline;
}

.award-item-year {
  font-size: 0.78rem;
  color: var(--muted);
  min-width: 38px;
  flex-shrink: 0;
  font-weight: 500;
}

.award-item-title {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.4;
}

/* ── Service Section ── */
.service-columns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.service-column-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
}

.service-column-card h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.service-item-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.service-item-list li {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
  padding-left: 0.75rem;
  position: relative;
}

.service-item-list li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--muted);
}

/* ── Service single-column layout ── */
.service-single-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.service-group h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}

/* Talks subsection h2 */
#page-talks h2:not(:first-child) {
  margin-top: 0.25rem;
  margin-bottom: 1rem;
}

/* ── CFP Section ── */
.cfp-section-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-top: 1rem;
}

.cfp-main-info { flex: 1; min-width: 0; }
.cfp-side-cards { width: 240px; flex-shrink: 0; display: flex; flex-direction: column; gap: 1rem; }

.cfp-banner-box {
  background: #f6f8fa;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.cfp-banner-box h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.cfp-banner-forum {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
}

.cfp-description-text {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.cfp-topics-wrapper { margin-bottom: 1rem; }

.cfp-topics-wrapper h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.cfp-topics-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.cfp-topic-pill {
  background: #f0f5ff;
  border: 1px solid #c8d8f5;
  color: #3563b8;
  border-radius: 12px;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
}

.cfp-dates-card,
.cfp-organizers-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem;
}

.cfp-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.cfp-dates-list { display: flex; flex-direction: column; gap: 0.4rem; }

.cfp-date-row-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.cfp-date-label-text { font-size: 0.75rem; color: var(--muted); }
.cfp-date-value-text { font-size: 0.75rem; color: var(--text); font-weight: 500; white-space: nowrap; }
.cfp-date-value-text.highlight { color: #e36209; }

.cfp-organizers-list { display: flex; flex-direction: column; gap: 0.5rem; }

.cfp-organizer-item { display: flex; flex-direction: column; gap: 0.05rem; }
.cfp-organizer-name { font-size: 0.8rem; font-weight: 500; color: var(--text); }
.cfp-organizer-title { font-size: 0.75rem; color: var(--muted); }

.cfp-btn-outline,
.cfp-btn-solid {
  display: block;
  text-align: center;
  padding: 0.45rem 0.75rem;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.cfp-btn-outline {
  border: 1px solid var(--link);
  color: var(--link);
  background: transparent;
}
.cfp-btn-outline:hover { background: #f0f5ff; text-decoration: none; }

.cfp-btn-solid {
  background: var(--link);
  border: 1px solid var(--link);
  color: #fff;
}
.cfp-btn-solid:hover { background: #0256b4; text-decoration: none; }

/* ── Mobile Responsive ── */
@media (max-width: 860px) {
  .cfp-section-layout { flex-direction: column; }
  .cfp-side-cards { width: 100%; }
  .service-columns-grid { grid-template-columns: 1fr; }
  .timeline-section-split { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }

  .page-body {
    flex-direction: column;
    padding: 1.5rem 1rem;
    gap: 1.5rem;
  }

  .left-col {
    width: 100%;
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .profile-img {
    width: 110px;
    height: 110px;
  }

  .profile-links {
    align-items: center;
  }

  .research-interests-grid { grid-template-columns: 1fr; }
  .teaching-grid { grid-template-columns: 1fr; }
}
