/* ========================================
   Brunaugh Lab — Main Stylesheet
   UMich Maize: #FFCB05  Blue: #00274C
   ======================================== */

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

:root {
  --blue: #00274C;
  --maize: #FFCB05;
  --maize-light: #FFF8E1;
  --gray-50: #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-200: #EEEEEE;
  --gray-400: #BDBDBD;
  --gray-600: #757575;
  --gray-800: #424242;
  --gray-900: #212121;
  --text: #333333;
  --text-light: #555555;
  --max-width: 1100px;
  --font-sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}

html { font-size: 16px; scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  line-height: 1.7;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-wrap: break-word;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

a { color: var(--blue); text-decoration: none; transition: color 0.2s; }
a:hover { color: #004080; }

img { max-width: 100%; height: auto; display: block; }

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--blue);
  line-height: 1.3;
  font-weight: 600;
}

h1 { font-size: 2.25rem; margin-bottom: 1rem; }
h2 { font-size: 1.65rem; margin-top: 2.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.3rem; margin-top: 2rem; margin-bottom: 0.5rem; }
h4 { font-size: 1.1rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; }
ul, ol { margin-bottom: 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.35rem; }

/* --- Navigation --- */
.site-header {
  background: var(--blue);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.site-logo:hover { color: var(--maize); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  font-weight: 400;
  padding: 0.4rem 0.7rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.site-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.site-nav a.active { color: var(--maize); font-weight: 600; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s;
}

/* --- Hero (Homepage) --- */
.hero {
  background: var(--blue);
  color: #fff;
  padding: 5rem 0 4rem;
  text-align: center;
}
.hero .container { max-width: 820px; }
.hero h1 {
  font-size: 2.75rem;
  color: #fff;
  margin-bottom: 0.25rem;
}
.hero .dept {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 2rem;
  font-weight: 300;
}
.hero .tagline {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--maize);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.hero .description {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.8;
  max-width: 700px;
  margin: 0 auto 2rem;
}
.hero-image {
  margin: 1.5rem auto 2rem;
  max-width: 420px;
}
.hero-image img {
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.15);
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s, transform 0.1s;
  cursor: pointer;
  border: none;
}
.btn:hover { transform: translateY(-1px); }

.btn-maize {
  background: var(--maize);
  color: var(--blue);
}
.btn-maize:hover { background: #e6b800; color: var(--blue); }

.btn-outline {
  border: 2px solid rgba(255, 255, 255, 0.6);
  color: #fff;
  background: transparent;
}
.btn-outline:hover { border-color: #fff; color: #fff; background: rgba(255, 255, 255, 0.1); }

/* --- Snapshot Cards (Homepage) --- */
.snapshot {
  padding: 4rem 0;
  background: var(--gray-50);
}
.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.snapshot-card {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  border-top: 3px solid var(--maize);
}
.snapshot-card h3 {
  color: var(--blue);
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.15rem;
}
.snapshot-card p {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.7;
}
.snapshot-card .card-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blue);
}
.snapshot-card .card-link:hover { color: #004080; }

/* --- Recruiting Callout (Homepage) --- */
.callout {
  padding: 4rem 0;
  background: #fff;
}
.callout-box {
  background: var(--blue);
  color: #fff;
  padding: 3rem;
  border-radius: 8px;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}
.callout-box h2 {
  color: var(--maize);
  margin-top: 0;
  margin-bottom: 1rem;
}
.callout-box p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

/* --- Page Header --- */
.page-header {
  background: var(--blue);
  color: #fff;
  padding: 3rem 0;
}
.page-header h1 {
  color: #fff;
  margin-bottom: 0.25rem;
}
.page-header .subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
}

/* --- Page Content --- */
.page-content {
  padding: 3rem 0 4rem;
}
.page-content h2 {
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gray-200);
}
.page-content h2:first-child { margin-top: 0; }

/* --- Research Pillars --- */
.pillar {
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--gray-200);
}
.pillar:last-child { border-bottom: none; }
.pillar h2 { border-bottom: none; padding-bottom: 0; }
.pillar-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--gray-600);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}
/* Research figures */
.research-figure {
  margin: 1.25rem 0 1.5rem;
  text-align: center;
}
.research-figure img {
  max-width: 600px;
  width: 100%;
  height: auto;
  margin: 0 auto;
  display: block;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--gray-200);
}
.research-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--gray-600);
  line-height: 1.5;
  max-width: 85%;
  margin-left: auto;
  margin-right: auto;
}

.pillar-approaches {
  background: var(--gray-50);
  padding: 1rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-top: 1rem;
  border-left: 3px solid var(--maize);
}
.pillar-projects {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--maize-light);
  border-radius: 6px;
  font-size: 0.9rem;
}
.pillar-projects a {
  font-weight: 600;
  white-space: nowrap;
}

/* --- People --- */
.people-section {
  margin-bottom: 3rem;
}
.people-section h2 {
  border-bottom: 2px solid var(--gray-200);
  padding-bottom: 0.5rem;
}

/* Headshot grid layout */
.headshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}
.headshot-card {
  text-align: center;
}
.headshot-photo {
  width: 200px;
  height: 200px;
  margin: 0 auto 0.75rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--gray-200);
}
.headshot-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
.headshot-placeholder {
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
}
.headshot-card h3 {
  margin-top: 0;
  margin-bottom: 0.15rem;
  font-size: 1rem;
}
.headshot-role {
  font-size: 0.82rem;
  color: var(--gray-600);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.headshot-card .person-links {
  margin-top: 0.4rem;
  font-size: 0.82rem;
}
.headshot-card .person-links a { margin: 0 0.35rem; }

/* PI page featured card */
.pi-card {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}
.pi-photo {
  width: 200px;
  height: 200px;
  border-radius: 8px;
  background: var(--gray-200);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 3rem;
  overflow: hidden;
}
.pi-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.pi-details h2 { margin-top: 0; border-bottom: none; }
.pi-details .title-line {
  font-size: 1.05rem;
  color: var(--gray-600);
  margin-bottom: 1rem;
}
.pi-details .contact-line {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}
.pi-details .profile-links {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}
.pi-details .profile-links a {
  margin-right: 1rem;
  font-weight: 600;
}

/* --- Alumni Table --- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 1rem;
}
.alumni-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.alumni-table th {
  text-align: left;
  background: var(--blue);
  color: #fff;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.alumni-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: top;
}
.alumni-table tr:nth-child(even) { background: var(--gray-50); }

/* --- Publications --- */
.pub-year {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--maize);
  color: var(--blue);
}
.pub-entry {
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-left: 3px solid var(--gray-200);
}
.pub-entry p {
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
  line-height: 1.6;
}
.pub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.pub-tag {
  display: inline-block;
  background: var(--maize-light);
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  text-transform: lowercase;
}
.pub-link {
  font-size: 0.85rem;
  font-weight: 600;
}

/* --- Opportunities --- */
.oppo-section {
  margin-bottom: 2.5rem;
}
.oppo-section h2 { border-bottom: none; }
.trait {
  margin-bottom: 1.5rem;
}
.trait strong {
  color: var(--blue);
  display: block;
  margin-bottom: 0.25rem;
}

/* --- Software / Tools --- */
.tool-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--maize);
}
.tool-card h2 {
  margin-top: 0;
  border-bottom: none;
  padding-bottom: 0;
}
.tool-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--gray-600);
  font-size: 1.05rem;
  margin-bottom: 1rem;
}
.tool-meta {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.tool-meta p {
  margin-bottom: 0.35rem;
}
.tool-meta p:last-child {
  margin-bottom: 0;
}
.tool-links {
  margin-top: 1.25rem;
}
.coming-soon-heading {
  color: var(--gray-600);
  margin-top: 3rem;
}
.tool-card-soon {
  background: var(--gray-50);
  border-left-color: var(--gray-400);
  opacity: 0.6;
}
.tool-card-soon h3 {
  margin-top: 0;
  margin-bottom: 0.35rem;
  color: var(--gray-600);
}
.tool-card-soon p {
  color: var(--gray-600);
  margin-bottom: 0;
}

/* --- Contact --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 1.5rem;
}
.contact-block h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}
.contact-block p {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}
.contact-block a { font-weight: 600; }

/* --- Funding --- */
.funding {
  background: var(--gray-50);
  padding: 1.25rem 1.5rem;
  border-radius: 6px;
  margin-top: 2rem;
  font-size: 0.95rem;
  color: var(--text-light);
}

/* --- Footer --- */
.site-footer {
  background: var(--blue);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 2rem 0;
  font-size: 0.9rem;
}
.site-footer a { color: var(--maize); }
.site-footer a:hover { color: #fff; }
.site-footer p { margin-bottom: 0.25rem; }

/* --- Responsive --- */
@media (max-width: 900px) {
  .snapshot-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
  .pi-card { flex-direction: column; align-items: center; text-align: center; }
  .pi-photo { width: 160px; height: 160px; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--blue);
    flex-direction: column;
    padding: 1rem 2rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.6rem 0; }

  .hero { padding: 3rem 0; }
  .hero h1 { font-size: 2rem; }
  .hero .tagline { font-size: 1.15rem; }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }

  .page-header { padding: 2rem 0; }
  .page-content { padding: 2rem 0 3rem; }
  .container { padding: 0 1.25rem; }
  .callout-box { padding: 2rem 1.5rem; }

  .headshot-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .headshot-photo { width: 160px; height: 160px; }
}
