/* ================================================================
   Luis Silvestre — Academic Website
   University of Chicago, Department of Mathematics
   ================================================================ */

:root {
  --maroon:      #800000;
  --maroon-dark: #5c0000;
  --white:       #ffffff;
  --off-white:   #f7f7f7;
  --light-gray:  #eeeeee;
  --border:      #e0e0e0;
  --text:        #1e1e1e;
  --muted:       #666666;
}

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

body {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--white);
}

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

a:hover {
  text-decoration: underline;
}

/* ----------------------------------------------------------------
   Navigation
   ---------------------------------------------------------------- */

.site-nav {
  background: var(--maroon);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.nav-brand {
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  padding: 16px 0;
  white-space: nowrap;
}

.nav-brand:hover {
  text-decoration: none;
}

.nav-menu {
  display: flex;
  list-style: none;
}

.nav-menu a {
  color: rgba(255, 255, 255, 0.9);
  display: block;
  padding: 16px 13px;
  font-size: 0.88rem;
  transition: background 0.15s;
}

.nav-menu a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 10px;
  line-height: 1;
}

/* ----------------------------------------------------------------
   Page Layout
   ---------------------------------------------------------------- */

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

/* ----------------------------------------------------------------
   Profile Header (index.html)
   ---------------------------------------------------------------- */

.profile {
  margin-bottom: 52px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.profile-photo {
  float: right;
  width: 200px;
  height: auto;
  border-radius: 3px;
  margin: 4px 0 20px 36px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.profile-info h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--maroon);
  margin-bottom: 8px;
  line-height: 1.2;
}

.profile-info .dept {
  margin-bottom: 6px;
}

.profile-info .contact {
  color: var(--muted);
  font-size: 0.93rem;
}

/* ----------------------------------------------------------------
   Sections
   ---------------------------------------------------------------- */

section {
  margin-bottom: 52px;
}

section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--maroon);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--maroon);
}

section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--maroon);
  margin: 32px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

section p {
  margin-bottom: 12px;
}

section ul,
section ol {
  padding-left: 22px;
}

section li {
  margin-bottom: 10px;
}

.description {
  font-size: 0.87rem;
  color: var(--muted);
  margin-top: 3px;
}

/* ----------------------------------------------------------------
   Publications Page (preprints.html)
   ---------------------------------------------------------------- */

.page-heading {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--maroon);
  margin-bottom: 32px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--maroon);
}

.info-box {
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 24px 28px;
  margin-bottom: 36px;
}

.info-box h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
  padding: 0;
  border: none;
}

.featured-notes {
  font-size: 1.15em;
  font-weight: 700;
}

.info-box hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.info-box ul,
.info-box ol {
  padding-left: 22px;
}

.info-box li {
  margin-bottom: 7px;
  font-size: 0.95rem;
}

.articles-list {
  list-style: none;
  padding: 0;
}

.articles-list > li {
  padding: 11px 0;
  border-bottom: 1px solid var(--light-gray);
  margin: 0;
}

.articles-list > li:last-child {
  border-bottom: none;
}

.articles-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 10px;
  padding: 0;
  border: none;
}

.toggle-btn {
  display: inline-block;
  vertical-align: middle;
  opacity: 0.5;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0 4px;
}

.toggle-btn:hover {
  opacity: 0.9;
}

.expanded-note {
  background: var(--off-white);
  border-left: 3px solid var(--maroon);
  padding: 12px 16px;
  margin: 8px 0 4px;
  font-size: 0.9rem;
  color: var(--muted);
  display: none;
}

/* ----------------------------------------------------------------
   Footer
   ---------------------------------------------------------------- */

.site-footer {
  background: var(--off-white);
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
}

/* ----------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------- */

@media (max-width: 680px) {
  .profile-photo {
    float: none;
    display: block;
    width: 150px;
    margin: 0 auto 20px;
  }

  .nav-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: -24px;
    right: -24px;
    background: var(--maroon-dark);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }

  .nav-menu.is-open {
    display: flex;
  }

  .nav-menu a {
    padding: 13px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  main {
    padding: 28px 16px 48px;
  }

  .info-box {
    padding: 18px 18px;
  }
}
