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

:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-light: #555;
  --color-accent: #c00;
  --color-accent-hover: #900;
  --color-border: #ddd;
  --color-bg-subtle: #f7f7f7;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --max-width: 800px;
}

html {
  font-size: 16px;
  line-height: 1.6;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

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

/* ===== Layout ===== */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page {
  max-width: var(--max-width);
}

/* ===== Header / Nav ===== */
.site-header {
  border-bottom: 1px solid var(--color-border);
}

.site-banner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.epfl-logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.epfl-logo {
  height: 22px;
  width: auto;
  display: block;
}

.banner-divider {
  display: block;
  width: 1px;
  height: 1.4rem;
  background: var(--color-border);
  flex-shrink: 0;
}

.lab-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  line-height: 1.2;
}

.lab-name:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.site-nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 0.75rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--color-text-light);
  font-size: 0.9rem;
}

.nav-links a:hover {
  color: var(--color-accent);
}

.nav-links a.active {
  color: var(--color-accent);
  font-weight: 600;
}

/* ===== Footer ===== */
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: var(--color-text-light);
}

/* ===== Homepage ===== */
.hero {
  margin-bottom: 2.5rem;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.hero .subtitle {
  font-size: 1.1rem;
  color: var(--color-text-light);
  margin-bottom: 1rem;
}

.hero .intro {
  font-size: 1rem;
  line-height: 1.7;
}

.home-section {
  margin-bottom: 2.5rem;
}

.home-section h2 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.25rem;
}

.news-list-compact {
  list-style: none;
}

.news-list-compact li {
  margin-bottom: 0.4rem;
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

.news-list-compact time {
  font-size: 0.85rem;
  color: var(--color-text-light);
  flex-shrink: 0;
  width: 6rem;
}

.upcoming-talk {
  padding: 1rem;
  background: var(--color-bg-subtle);
  border-left: 3px solid var(--color-accent);
  border-radius: 2px;
}

.upcoming-talk .talk-meta {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin-bottom: 0.5rem;
}

.talk-location::before {
  content: " \2022 ";
}

/* ===== Page headings ===== */
.page h1 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.page h2 {
  font-size: 1.3rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.25rem;
}

/* ===== People ===== */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.person-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.person-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-bg-subtle);
}

.person-photo-placeholder {
  border: 1px solid var(--color-border);
}

.person-info {
  min-width: 0;
}

.person-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.1rem;
}

.person-position {
  font-size: 0.9rem;
  color: var(--color-text-light);
}

.person-interests {
  font-size: 0.85rem;
  color: var(--color-text-light);
  font-style: italic;
}

/* ===== News ===== */
.news-list {
  margin-top: 1rem;
}

.news-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.news-item:last-child {
  border-bottom: none;
}

.news-item time {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.news-item h2 {
  font-size: 1.15rem;
  margin: 0.25rem 0 0.5rem;
  border: none;
  padding: 0;
}

.news-summary {
  font-size: 0.95rem;
}

/* ===== Publications ===== */
.pub-list {
  list-style: none;
  margin-bottom: 1rem;
}

.pub-item {
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.pub-authors {
  font-size: 0.95rem;
}

.pub-title {
  font-weight: 600;
}

.pub-venue {
  font-style: italic;
}

.pub-links {
  font-size: 0.85rem;
}

.pub-links a {
  margin-right: 0.3rem;
}

.pub-meta {
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

/* ===== Seminar tabs ===== */
.seminar-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 1.5rem;
}

.seminar-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 0.5rem 1.25rem;
  font-size: 0.95rem;
  color: var(--color-text-light);
  cursor: pointer;
  font-family: var(--font-body);
}

.seminar-tab:hover {
  color: var(--color-text);
}

.seminar-tab.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  font-weight: 600;
}

.seminar-info-box {
  background: var(--color-bg-subtle);
  border-left: 3px solid var(--color-accent);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 2px;
}

.seminar-info-box p {
  margin: 0;
}

.seminar-tab-panel > p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.seminar-mailing-list {
  margin-top: 1.25rem;
}

.seminar-sheet-wrapper {
  position: relative;
  width: 100%;
}

.seminar-sheet {
  width: 100%;
  height: 600px;
  border: 1px solid var(--color-border);
  border-radius: 3px;
}

/* ===== Seminar ===== */
.talk-list {
  margin-top: 0.5rem;
}

.talk-item {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.talk-item:last-child {
  border-bottom: none;
}

.talk-header {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin-bottom: 0.25rem;
}

.talk-item h3,
.talk-item h4 {
  font-size: 1.05rem;
  margin: 0.25rem 0;
  border: none;
  padding: 0;
}

.talk-speaker {
  font-size: 0.95rem;
  margin: 0.25rem 0;
}

.talk-abstract {
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

.talk-abstract summary {
  cursor: pointer;
  color: var(--color-accent);
  font-size: 0.9rem;
}

.talk-abstract summary:hover {
  text-decoration: underline;
}

.talk-details {
  background: var(--color-bg-subtle);
  padding: 1rem;
  border-radius: 3px;
  margin-bottom: 1.5rem;
}

.talk-details p {
  margin-bottom: 0.25rem;
}

/* Year group collapsible */
.year-group {
  margin-bottom: 0.5rem;
}

.year-group summary {
  cursor: pointer;
  list-style: none;
}

.year-group summary::-webkit-details-marker {
  display: none;
}

.year-group summary h3 {
  display: inline;
  font-size: 1.15rem;
  border: none;
  padding: 0;
  margin: 0;
}

.year-group summary h3::before {
  content: "\25B6 ";
  font-size: 0.7rem;
  vertical-align: middle;
  margin-right: 0.3rem;
}

.year-group[open] summary h3::before {
  content: "\25BC ";
}

/* ===== Utilities ===== */
.back-link {
  margin-top: 2rem;
  font-size: 0.9rem;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .site-banner {
    padding: 0.75rem 1rem 0.5rem;
    gap: 0.6rem;
  }

  .lab-name {
    font-size: 0.95rem;
  }

  .site-nav {
    padding: 0 1rem 0.6rem;
  }

  .nav-links {
    gap: 1rem;
    flex-wrap: wrap;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .people-grid {
    grid-template-columns: 1fr;
  }

  .news-list-compact li {
    flex-direction: column;
    gap: 0;
  }

  .news-list-compact time {
    width: auto;
  }
}
