/* ============================================================
   Stephen L. Morgan — Personal Academic Website
   style.css
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: #222;
  background: #fff;
}

a {
  color: #002D72; /* JHU blue */
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* --- Header --- */
header {
  border-bottom: 3px solid #002D72;
  padding: 1.5rem 2rem 0 2rem; /* no bottom padding so photo sits on the blue line */
  background: #fff;
}

.header-content {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end; /* aligns photo bottom to text bottom, both flush to blue line */
  max-width: 960px;
  margin: 0 auto;
  gap: 1.5rem;
}

.header-info h1 {
  font-size: 1.9rem;
  font-weight: 400;
  color: #002D72;
  margin-bottom: 0.2rem;
}

.header-info .title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  color: #222;
}

.header-info p {
  font-size: 0.88rem;
  color: #555;
  margin-top: 0.15rem;
}

.header-info a { color: #555; }
.header-info a:hover { color: #002D72; text-decoration: underline; }

.header-photo img {
  width: 220px;
  display: block;
  border: 2px solid #002D72;
  border-bottom: none; /* merges into the blue header border below */
}

/* --- Page Layout --- */
.container {
  display: flex;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
  gap: 2.5rem;
}

/* --- Sidebar Navigation --- */
nav {
  width: 155px;
  flex-shrink: 0;
  border-right: 1px solid #ddd; /* single line runs full height of nav, including logo */
  padding-right: 1.5rem;
}

nav ul {
  list-style: none;
}

nav li { margin-bottom: 0.55rem; }

nav a {
  color: #002D72;
  font-size: 0.92rem;
}
nav a:hover { text-decoration: underline; }

nav .active {
  color: #002D72;
  font-weight: 700;
  font-size: 0.92rem;
}

.jhu-logo {
  margin-top: 2rem;
}
.jhu-logo img { width: 100%; max-width: 175px; }

/* --- Main Content --- */
main { flex: 1; min-width: 0; }

main h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #002D72;
  margin: 1.75rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #ddd;
}

main h2:first-child { margin-top: 0; }

main h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin: 1.4rem 0 0.5rem;
}

main p { margin-bottom: 0.75rem; }

/* --- Publications List --- */
ul.publications {
  list-style: none;
  padding: 0;
  margin-bottom: 0.5rem;
}

ul.publications li {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f0f0f0;
  overflow: hidden; /* clear floated book covers */
}

ul.publications li:last-child { border-bottom: none; }

ul.publications img {
  float: right;
  margin: 0 0 0.5rem 1rem;
  border: 1px solid #ddd;
}

ul.publications p { margin-top: 0.4rem; margin-bottom: 0; }

/* --- Courses List --- */
ul.courses {
  list-style: none;
  padding: 0;
}

ul.courses li {
  margin-bottom: 0.4rem;
  padding-left: 1rem;
}

ul.courses li::before {
  content: "›";
  color: #002D72;
  margin-left: -1rem;
  margin-right: 0.4rem;
}

/* --- Responsive --- */
@media (max-width: 720px) {
  .header-photo img { width: 180px; }

  .container {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }

  nav { width: 100%; }

  nav {
    border-right: none;
    padding-right: 0;
  }

  nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    border-bottom: 1px solid #ddd;
    padding: 0 0 0.75rem 0;
  }

  .jhu-logo { display: none; }
}
