/* ============================================================
   Justin S. Rogers — Academic Website
   style.css — shared across all pages
   ============================================================ */

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

:root {
  --cardinal:    #8C1515;   /* Stanford cardinal */
  --cardinal-dk: #651010;
  --text:        #1a1a1a;
  --text-muted:  #555;
  --border:      #ddd;
  --bg:          #ffffff;
  --bg-soft:     #f7f5f2;
  --nav-bg:      #1a1a1a;
  --link:        #8C1515;
  --font-sans:   'Georgia', serif;          /* academic feel */
  --font-body:   'Georgia', serif;
  --max-w:       860px;
  --nav-h:       56px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

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

/* ---- Navigation ------------------------------------------ */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  height: var(--nav-h);
  display: flex;
  align-items: center;
}

nav .nav-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0;
}

nav .nav-name {
  font-size: 0.95rem;
  font-weight: normal;
  color: #fff;
  margin-right: auto;
  letter-spacing: 0.02em;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 0;
}

nav ul li a {
  display: block;
  padding: 0 1rem;
  height: var(--nav-h);
  line-height: var(--nav-h);
  font-size: 0.875rem;
  color: #ccc;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.15s, background 0.15s;
}

nav ul li a:hover,
nav ul li a.active {
  color: #fff;
  background: var(--cardinal);
  text-decoration: none;
}

/* ---- Page layout ----------------------------------------- */
.page-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* ---- Page header (title bar used on subpages) ------------ */
.page-header {
  border-bottom: 2px solid var(--cardinal);
  margin-bottom: 2.5rem;
  padding-bottom: 0.6rem;
}

.page-header h1 {
  font-size: 1.6rem;
  font-weight: normal;
  color: var(--text);
  letter-spacing: 0.01em;
}

/* ---- Home page layout ------------------------------------ */
.home-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.home-photo img {
  width: 180px;
  height: 220px;
  object-fit: cover;
  object-position: center top;
  display: block;
  border: 1px solid var(--border);
}

.home-bio h1 {
  font-size: 1.8rem;
  font-weight: normal;
  margin-bottom: 0.2rem;
}

.home-bio .title-line {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.4rem;
  letter-spacing: 0.02em;
}

.home-bio .affil {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.4rem;
}

.home-bio .affil strong {
  color: var(--text);
  font-weight: normal;
}

/* ---- Research interests list on home page ---------------- */
.interests h2 {
  font-size: 1rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 1.8rem 0 0.8rem;
}

.interests ul {
  padding-left: 1.2rem;
  color: var(--text);
}

.interests ul li {
  margin-bottom: 0.35rem;
}

/* ---- Profile links --------------------------------------- */
.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.profile-links a {
  font-size: 0.82rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--cardinal);
  color: var(--cardinal);
  border-radius: 2px;
  letter-spacing: 0.03em;
  transition: background 0.15s, color 0.15s;
}

.profile-links a:hover {
  background: var(--cardinal);
  color: #fff;
  text-decoration: none;
}

/* ---- Contact block --------------------------------------- */
.contact-block {
  margin-top: 1.8rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.contact-block a { color: var(--link); }

/* ---- Section divider ------------------------------------- */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ---- Research page --------------------------------------- */
.research-project {
  margin-bottom: 2.5rem;
}

.research-project h2 {
  font-size: 1.05rem;
  font-weight: bold;
  color: var(--cardinal);
  margin-bottom: 0.4rem;
}

.research-project p {
  color: var(--text);
}

/* ---- Publications page ----------------------------------- */
.pub-section-heading {
  font-size: 1rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 2rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

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

.pub-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid #f0eded;
  font-size: 0.925rem;
  line-height: 1.65;
}

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

.pub-num {
  color: var(--text-muted);
  font-size: 0.8rem;
  min-width: 2rem;
  display: inline-block;
}

.pub-status {
  font-size: 0.78rem;
  color: var(--cardinal);
  font-style: italic;
}

.pub-links {
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

.pub-links a {
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.pub-links a:hover { color: var(--cardinal); border-color: var(--cardinal); text-decoration: none; }

/* ---- Teaching page --------------------------------------- */
.teaching-list {
  list-style: none;
  padding: 0;
}

.teaching-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid #f0eded;
  font-size: 0.925rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem 1.2rem;
  align-items: baseline;
}

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

.teach-role {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.teach-years {
  text-align: right;
  color: var(--text-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

/* ---- Models page ----------------------------------------- */
.model-entry {
  margin-bottom: 2.2rem;
}

.model-entry h2 {
  font-size: 1.05rem;
  font-weight: bold;
  color: var(--cardinal);
  margin-bottom: 0.4rem;
}

.model-entry p { font-size: 0.925rem; }

/* ---- Footer ---------------------------------------------- */
footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 1.2rem 1rem;
  line-height: 1.8;
}

footer a { color: var(--text-muted); }
footer a:hover { color: var(--cardinal); }

/* ---- Responsive ------------------------------------------ */
@media (max-width: 640px) {
  .home-grid {
    grid-template-columns: 1fr;
  }

  .home-photo img {
    width: 140px;
    height: 170px;
  }

  nav .nav-name { display: none; }

  nav ul li a {
    padding: 0 0.6rem;
    font-size: 0.78rem;
  }

  .teaching-list li {
    grid-template-columns: 1fr;
  }
  .teach-years { text-align: left; }
}
