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

body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  color: var(--text, #222);
  background: var(--bg, #ffffff);
  line-height: 1.4;
}

/* DARK MODE VARIABLES (already in JS toggle) */
:root {
  --bg: #ffffff;
  --text: #222;
  --subtext: #666;
  --accent: #0077cc;
  --sidebar-bg: #f2f2f2;
}
.dark {
  --bg: #111;
  --text: #eee;
  --subtext: #aaa;
  --accent: #4ab3ff;
  --sidebar-bg: #1a1a1a;
}

/* FIXED NAV BAR (at top now) */
.top-subnav {
  display: flex;
  justify-content: center;
  gap: 45px;
  padding: 14px 0;
  font-size: 18px;
  background: var(--bg);
  border-bottom: 1px solid rgba(120, 120, 120, 0.35);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999;
}

.top-subnav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}
.top-subnav a:hover {
  color: var(--accent);
}

/* PAGE LAYOUT — spacing below fixed nav */
.layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 80px; /* space for fixed nav */
  gap: 50px;
  position: relative;
}

/* FIXED SIDEBAR */
.sidebar {
  width: 260px;
  position: fixed;
  left: 50%;
  transform: translateX(-600px);
  top: 100px;
  text-align: center;
}

.sidebar img {
  width: 240px;
  height: 280px;
  object-fit: cover;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
  margin-bottom: 20px;
  border-radius: 8px;
}

.sidebar .name {
  font-size: 22px;
  font-weight: bold;
}

.sidebar .subtitle {
  font-size: 15px;
  color: var(--subtext);
  margin-bottom: 22px;
}

.sidebar a {
  display: block;
  margin: 6px 0;
  text-decoration: none;
  color: var(--accent);
  text-align: left;
  padding-left: 6px;
}

.icon-svg {
  width: 18px;
  height: 18px;
  vertical-align: -2px;
  margin-right: 8px;
  fill: var(--accent);
  transition: opacity 0.2s ease;
}
.sidebar a:hover .icon-svg {
  opacity: 0.7;
}

/* RIGHT CONTENT (scrolls independently) */
.main {
  flex: 1;
  margin-left: 350px;
  max-width: 700px;
  height: calc(100vh - 140px);
  overflow-y: auto;
  padding: 0 24px 80px 0;  /* Added right padding */
  box-sizing: border-box;  /* Prevents layout shifts */
}

/* HEADINGS */
section {
  margin-bottom: 40px;
}
section h2, section h3 {
  margin-bottom: 10px;
  color: var(--text);
  border-left: 4px solid var(--accent);
  padding-left: 8px;
}

/* PUBLICATIONS */
.pub-card {
  display: flex;
  gap: 20px;
  margin-bottom: 22px;
  padding-bottom: 18px; /* add spacing above separator */
  align-items: flex-start;
  border-bottom: 1px solid rgba(120, 120, 120, 0.35);
}

/* Remove line under the last publication */
.pub-card:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.pub-tag {
  width: 100px;       /* fixed width */
  height: 80px;       /* fixed height */
  flex-shrink: 0;     /* prevents resizing */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;

  background: var(--sidebar-bg, #f2f2f2);
  border-radius: 6px;
  border: 1px solid rgba(120,120,120,0.3);
}

.pub-type {
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.pub-year {
  font-size: 14px;
  font-weight: bold;
  color: var(--accent);
}

.pub-content a {
  color: var(--accent);
}

.author-link {
  color: #c64809; /* dark academic blue */
  font-weight: 500;
}

.author-link:hover {
  color: #003366;
  text-decoration: underline;
}

/* EXPERIENCE WITH LOGO */
.exp-card {
  display: flex;
  gap: 18px;
  margin-bottom: 35px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(120, 120, 120, 0.25);
}

.exp-logo {
  width: 58px;     /* adjust to taste */
  height: 58px;
  object-fit: contain;
  margin-top: 4px; /* align with title */
}

.exp-body {
  flex: 1;
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.exp-title {
  font-size: 17px;
  font-weight: 600;
}

.exp-dates {
  font-size: 14px;
  color: var(--subtext);
}

.exp-role {
  font-size: 15px;
  margin-top: 6px;
  color: var(--text);
  font-style: italic;
}

.exp-details {
  margin-top: 10px;
  padding-left: 18px;
}

.exp-details li {
  line-height: 1.5;
  margin-bottom: 6px;
}

/* RESPONSIVE: CLEAN MOBILE LAYOUT */
@media (max-width: 850px) {

  /* Make navbar comfortable */
  .top-subnav {
    flex-wrap: wrap;
    gap: 25px;
    padding: 12px 0;
    font-size: 16px;
  }

  /* Stack layout vertically */
  .layout {
    flex-direction: column;
    padding-top: 100px; /* leave room for navbar */
    gap: 0;
    margin: 0 16px;
  }

  /* Sidebar moves to top and becomes centered */
  .sidebar {
    position: relative;
    left: 0;
    transform: none;
    width: 100%;
    text-align: center;
    margin-bottom: 28px;
    top: 0;
  }

  .sidebar img {
    width: 150px;
    height: 170px;
    margin: 0 auto 14px auto;
  }

  .sidebar a {
    text-align: center;
    padding-left: 0;
  }

  /* Main content takes full width */
  .main {
    margin-left: 0;
    max-width: 100%;
    padding: 0 4px 60px 4px;
    height: auto;
    overflow-y: visible;
  }

  /* Publications layout adjusts for space */
  .pub-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .pub-tag {
    width: 90px;
    height: 70px;
    margin-bottom: 10px;
  }

  /* Experience — full stacked layout with spacing */
  .exp-card {
    flex-direction: column;
    gap: 10px;
    padding-bottom: 20px;
  }

  .exp-logo {
    width: 48px;
    height: 48px;
    margin-bottom: 4px;
  }

  .exp-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .exp-title {
    font-size: 18px;
    margin-bottom: 2px;
  }

  .exp-dates {
    font-size: 14px;
    margin-bottom: 4px;
  }

  .exp-role {
    margin-top: 4px;
  }

  .exp-details {
    padding-left: 16px;
  }
}
