/* ============================================================
   Morgan C. Williams, Jr. — Academic Website
   Stylesheet
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Lora:ital,wght@0,400;0,600;1,400&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --navy:       #1a2e4c;
  --navy-light: #2a4470;
  --accent:     #4a7fc1;
  --accent-hover: #3668a8;
  --text:       #2c2c2c;
  --text-light: #5a5a5a;
  --border:     #d8dde6;
  --bg:         #ffffff;
  --bg-alt:     #f5f7fa;
  --bg-card:    #ffffff;
  --max-width:  960px;
  --nav-height: 64px;
}

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

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

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--accent-hover); text-decoration: underline; }

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

/* ---------- Navigation ---------- */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

.nav-inner {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: 'Lora', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.nav-brand:hover { color: #c8d8f0; text-decoration: none; }

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

.nav-links a {
  color: #c8d8f0;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.4rem 0.85rem;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  text-decoration: none;
}

/* Hamburger (mobile) */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.25rem;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #c8d8f0;
  border-radius: 2px;
  transition: all 0.3s;
}

/* ---------- Page Wrapper ---------- */
.page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

/* ---------- Hero (Homepage) ---------- */
.hero {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3rem;
  align-items: start;
  padding: 3.5rem 2rem 3rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 4px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.hero-photo-placeholder {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 4px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.8rem;
  text-align: center;
}

.hero-name {
  font-family: 'Lora', serif;
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.hero-title {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.hero-affiliation {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1.1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none !important;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
  border: 1.5px solid var(--navy);
}
.btn-primary:hover { background: var(--navy-light); border-color: var(--navy-light); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
}
.btn-outline:hover { background: var(--navy); color: #fff; }

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

.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

h2.section-heading {
  font-family: 'Lora', serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 1.25rem;
}

h3.subsection-heading {
  font-family: 'Lora', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.8rem;
}

/* ---------- Bio / Body Text ---------- */
.bio-text p {
  font-size: 0.975rem;
  color: var(--text);
  margin-bottom: 1rem;
  max-width: 72ch;
}

/* ---------- Info Box (contact, sabbatical notice) ---------- */
.info-box {
  background: var(--bg-alt);
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 1.5rem;
}
.info-box strong { color: var(--navy); }

/* ---------- Research Page ---------- */
.paper-list { list-style: none; }

.paper-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}
.paper-item:last-child { border-bottom: none; }

.paper-title {
  font-family: 'Lora', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.3rem;
  line-height: 1.4;
}

.paper-meta {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.6rem;
}
.paper-meta em { font-style: italic; }

.paper-abstract {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 0.75rem;
  max-width: 72ch;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.tag-published  { background: #e8f0fe; color: #1a56cc; }
.tag-working    { background: #fef3c7; color: #92400e; }
.tag-progress   { background: #ede9fe; color: #5b21b6; }
.tag-forthcoming { background: #d1fae5; color: #065f46; }

.paper-link-btn {
  font-size: 0.8rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0.2rem 0.65rem;
  transition: all 0.2s;
}
.paper-link-btn:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* ---------- Teaching Page ---------- */
.course-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}
.course-item:last-child { border-bottom: none; }

.course-title {
  font-family: 'Lora', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.3rem;
}

.course-meta {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.course-desc {
  font-size: 0.9rem;
  color: var(--text);
  max-width: 72ch;
  line-height: 1.65;
}

/* ---------- CV Page ---------- */
.cv-section { margin-bottom: 2.5rem; }

.cv-entry {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0 1.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.cv-entry:last-child { border-bottom: none; }

.cv-year {
  color: var(--text-light);
  font-size: 0.85rem;
  padding-top: 0.05rem;
}

.cv-detail strong {
  display: block;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.95rem;
}

.cv-detail span {
  color: var(--text-light);
  font-size: 0.875rem;
}

/* ---------- Footer ---------- */
footer {
  background: var(--navy);
  color: #a8bcd8;
  text-align: center;
  padding: 2rem;
  font-size: 0.82rem;
  line-height: 1.6;
}
footer a { color: #c8d8f0; }
footer a:hover { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
  .hamburger { display: flex; }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--navy);
    padding: 1rem 1.5rem 1.5rem;
    gap: 0.1rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 0.95rem; padding: 0.6rem 0.75rem; }

  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 2rem 1.25rem;
  }
  .hero-photo, .hero-photo-placeholder {
    margin: 0 auto;
  }
  .hero-links { justify-content: center; }
  .bio-text p { max-width: 100%; }

  .page-wrapper { padding: 2rem 1.25rem 4rem; }

  .cv-entry { grid-template-columns: 1fr; gap: 0.1rem; }
  .cv-year { color: var(--accent); font-size: 0.8rem; }
}
