/* ============================================================
   CSI Lab — Academic Website Stylesheet
   Companion to index.html
   ============================================================ */

/* Google Fonts are loaded via <link> in index.html */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #f0ede8;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
}

/* ── Site shell ─────────────────────────────────────────── */
.site {
  font-family: 'EB Garamond', Georgia, serif;
  background: #fff;
  color: #1c1c1c;
  width: 100%;
  max-width: 960px;
  border: 1px solid #000;
  border-radius: 8px;
  overflow: hidden;
}

/* ── Top bar ────────────────────────────────────────────── */
.topbar {
  background: #fff;
  padding: 16px 32px 0;
  border-bottom: 2px solid #000;
}

.lab-title {
  color: #1c1c1c;
  font-size: 19px;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.02em;
  padding-bottom: 4px;
}

.lab-subtitle {
  color: #1c1c1c;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding-bottom: 14px;
}

/* ── Navigation tabs ────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  align-items: flex-end;
}

.tab {
  padding: 9px 20px;
  font-size: 12px;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  color: #1c1c1c;
  background: #fff;
  border: 1px solid transparent;
  border-bottom: none;
  transition: background 0.15s;
  outline: none;
}

.tab:hover:not(.active) {
  background: #e0e0e0;
  color: #1c1c1c;
}

.tab.active {
  color: #c0392b;
  background: #fff;
  border: 1px solid #000;
  border-bottom: 2px solid #fff;
  margin-bottom: -2px;
}

/* ── Content area ───────────────────────────────────────── */
.content {
  padding: 36px 36px 24px;
  min-height: 400px;
  background: #fff;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

/* ── Typography ─────────────────────────────────────────── */
h2 {
  font-family: 'EB Garamond', serif;
  font-size: 22px;
  font-weight: 400;
  color: #1c1c1c;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid #000;
}

h3 {
  font-size: 16px;
  font-weight: 500;
  color: #1c1c1c;
  margin-bottom: 14px;
  margin-top: 24px;
  font-family: 'EB Garamond', serif;
  border-bottom: 1px solid #ccc;
  padding-bottom: 6px;
}

p {
  font-size: 15px;
  line-height: 1.75;
  color: #1c1c1c;
  margin-bottom: 12px;
}

a {
  color: #1c1c1c;
  text-decoration: none;
}

a:hover {
  color: #555;
}

/* ── News ───────────────────────────────────────────────── */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.news-item {
  padding: 13px 0;
  border-bottom: 1px solid #ccc;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.news-date {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: #1c1c1c;
  min-width: 80px;
  padding-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.news-body {
  font-size: 15px;
  line-height: 1.7;
  color: #1c1c1c;
  flex: 1;
}

.news-body a {
  color: #c0392b;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.news-body a:hover {
  color: #555;
}

/* ── Members ────────────────────────────────────────────── */
.member-category {
  margin-bottom: 28px;
}

.pi-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.members-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.member-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.member-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid #000;
  background: #1c1c1c;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  flex-shrink: 0;
  overflow: hidden;
}

.member-photo.pi-avatar {
  width: 80px;
  height: 80px;
  font-size: 16px;
  background: #c0392b;
  border-color: #c0392b;
}

.member-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.member-info {
  flex: 1;
}

.member-name {
  font-size: 15px;
  font-weight: 500;
  color: #1c1c1c;
  margin-bottom: 2px;
}

.member-role-tag {
  font-size: 11px;
  color: #1c1c1c;
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}

.member-bio {
  font-size: 13px;
  color: #1c1c1c;
  line-height: 1.6;
  margin-bottom: 7px;
}

.member-links {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #000;
  border-radius: 4px;
  transition: background 0.15s;
  color: #1c1c1c;
  text-decoration: none;
}

.icon-link:hover {
  background: #e0e0e0;
  color: #1c1c1c;
}

.icon-link svg {
  width: 16px;
  height: 16px;
  display: block;
}

.cv-link {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #1c1c1c;
  border: 1px solid #000;
  padding: 3px 8px;
  border-radius: 3px;
  transition: background 0.15s;
  text-decoration: none;
}

.cv-link:hover {
  background: #e0e0e0;
  color: #1c1c1c;
}

/* ── Publications ───────────────────────────────────────── */
.pub-subtabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid #000;
}

.pub-subtab {
  font-size: 12px;
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 7px 16px;
  cursor: pointer;
  color: #1c1c1c;
  background: #fff;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: background 0.15s;
  outline: none;
}

.pub-subtab:hover:not(.active) {
  background: #e0e0e0;
  color: #1c1c1c;
}

.pub-subtab.active {
  color: #c0392b;
  border-bottom: 2px solid #c0392b;
  background: #fff;
}

.pub-subsection {
  display: none;
}

.pub-subsection.active {
  display: block;
}

.pub-ol {
  list-style: none;
  counter-reset: pub-counter;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pub-entry {
  counter-increment: pub-counter;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.pub-entry::before {
  content: counter(pub-counter) ".";
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #1c1c1c;
  min-width: 26px;
  padding-top: 3px;
  flex-shrink: 0;
}

.pub-img {
  width: 80px;
  height: 60px;
  border: 1px solid #000;
  border-radius: 3px;
  flex-shrink: 0;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #888;
  font-family: 'DM Mono', monospace;
  text-align: center;
  overflow: hidden;
  line-height: 1.4;
}

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

.pub-details {
  flex: 1;
}

.pub-title {
  font-size: 15px;
  color: #1c1c1c;
  line-height: 1.5;
  margin-bottom: 4px;
}

.pub-authors {
  font-size: 13px;
  color: #1c1c1c;
  line-height: 1.5;
  margin-bottom: 3px;
}

.pub-authors b {
  font-weight: 600;
}

.pub-venue {
  font-size: 12px;
  font-family: 'DM Mono', monospace;
  color: #1c1c1c;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pub-year-tag {
  background: #1c1c1c;
  color: #fff;
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 3px;
}

.pub-doi {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  color: #c0392b;
  text-decoration: none;
}

.pub-doi:hover {
  text-decoration: underline;
  color: #555;
}

/* ── Links ──────────────────────────────────────────────── */
.links-section {
  margin-bottom: 28px;
}

.links-section h3 {
  margin-top: 0;
}

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

.course-item {
  font-size: 15px;
}

.course-item a {
  color: #1c1c1c;
}

.course-item a:hover {
  color: #555;
  text-decoration: underline;
}

.github-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}

.github-row a {
  font-size: 15px;
  color: #1c1c1c;
}

.github-row a:hover {
  color: #555;
  text-decoration: underline;
}

/* ── Join Us ────────────────────────────────────────────── */
.join-category {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #ccc;
}

.join-category:last-child {
  border-bottom: none;
}

.join-tag {
  display: inline-block;
  background: #1c1c1c;
  color: #fff;
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  padding: 3px 10px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

/* ── Footer ─────────────────────────────────────────────── */
.footer {
  background: #000;
  padding: 22px 36px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-col h4 {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  margin-bottom: 8px;
}

.footer-col p,
.footer-col a {
  font-size: 13px;
  line-height: 1.75;
  color: #fff;
  text-decoration: none;
}

.footer-col a:hover {
  color: #ccc;
}

.footer-divider {
  width: 1px;
  background: #333;
  align-self: stretch;
}


/* ============================================================
   RESPONSIVE — Tablet & Mobile
   ============================================================ */

/* ── Tablet (max 768px) ─────────────────────────────────── */
@media (max-width: 768px) {

  body {
    padding: 0;
  }

  .site {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .topbar {
    padding: 14px 20px 0;
  }

  .lab-title {
    font-size: 17px;
  }

  .lab-subtitle {
    font-size: 10px;
    padding-bottom: 10px;
  }

  /* Tabs: wrap into a scrollable single row */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    padding: 8px 14px;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .content {
    padding: 24px 20px 20px;
  }

  h2 {
    font-size: 20px;
  }

  h3 {
    font-size: 15px;
  }

  /* Members: 2-col grid drops to 1-col */
  .members-grid-2 {
    grid-template-columns: 1fr;
  }

  /* Publications: hide image thumbnails to save space */
  .pub-img {
    display: none;
  }

  .pub-subtab {
    font-size: 11px;
    padding: 6px 12px;
  }

  /* Footer: stack columns vertically, hide dividers */
  .footer {
    flex-direction: column;
    gap: 20px;
    padding: 20px;
  }

  .footer-divider {
    display: none;
  }
}

/* ── Mobile (max 480px) ─────────────────────────────────── */
@media (max-width: 480px) {

  .topbar {
    padding: 12px 16px 0;
  }

  .lab-title {
    font-size: 15px;
  }

  .lab-subtitle {
    font-size: 9px;
    letter-spacing: 0.04em;
    padding-bottom: 8px;
  }

  .tab {
    padding: 7px 11px;
    font-size: 10px;
  }

  .content {
    padding: 20px 16px 16px;
  }

  h2 {
    font-size: 18px;
    margin-bottom: 14px;
  }

  h3 {
    font-size: 14px;
    margin-top: 18px;
  }

  p {
    font-size: 14px;
  }

  /* News: stack date above body */
  .news-item {
    flex-direction: column;
    gap: 4px;
    padding: 12px 0;
  }

  .news-date {
    min-width: unset;
    padding-top: 0;
  }

  .news-body {
    font-size: 14px;
  }

  /* PI row: stack photo above info */
  .pi-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* Member cards: reduce photo size */
  .member-photo {
    width: 52px;
    height: 52px;
    font-size: 11px;
  }

  .member-photo.pi-avatar {
    width: 64px;
    height: 64px;
    font-size: 14px;
  }

  .member-name {
    font-size: 14px;
  }

  .member-role-tag {
    font-size: 10px;
  }

  .member-bio {
    font-size: 12px;
  }

  /* Publications: tighter layout */
  .pub-entry {
    gap: 8px;
  }

  .pub-entry::before {
    min-width: 20px;
  }

  .pub-title {
    font-size: 14px;
  }

  .pub-authors {
    font-size: 12px;
  }

  .pub-venue {
    font-size: 11px;
    gap: 6px;
  }

  .pub-subtabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .pub-subtabs::-webkit-scrollbar {
    display: none;
  }

  .pub-subtab {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 10px;
    padding: 6px 10px;
  }

  /* Links */
  .course-item {
    font-size: 14px;
  }

  .github-row a {
    font-size: 14px;
  }

  /* Join Us */
  .join-tag {
    font-size: 10px;
  }

  /* Footer */
  .footer {
    padding: 16px;
    gap: 16px;
  }

  .footer-col p,
  .footer-col a {
    font-size: 12px;
  }
}