body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #222;
  padding-bottom: 2rem;
}

.navbar {
  border-bottom: 1px solid #ddd;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.92rem;
}
.navbar-brand {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: bold;
  font-size: 1.15rem;
  color: #333 !important;
}
.nav-link {
  color: #527bbd !important;
  padding-left: 0.85rem !important;
  padding-right: 0.85rem !important;
}
.nav-link:hover {
  color: #224b8d !important;
}
.nav-link.active {
  color: #022b6d !important;
  font-weight: 600;
  border-bottom: 2px solid #527bbd;
}
.navbar-wrapper {
  max-width: 860px;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  color: #527bbd;
  padding-bottom: 0.2em;
  border-bottom: 1px solid #aaa;
  margin-top: 1.4em;
  margin-bottom: 0.4em;
}
h1 { font-size: 1.65em; }
h2 { font-size: 1.25em; }
h3 { font-size: 1.1em; border-bottom: none; }

.page-title {
  margin-top: 0.6em;
  margin-bottom: 0.6em;
  border-bottom: none;
  padding-bottom: 0;
}
.page-title + h2 { margin-top: 1em; }

.page-title-aside {
  font-size: 0.78em;
  font-weight: normal;
  color: #7d8a9c;
  white-space: nowrap;
}

a { color: #224b8d; text-decoration: none; }
a:hover { text-decoration: underline; }

p { line-height: 1.5; margin-bottom: 0.8em; }

ul, ol { line-height: 1.55; }
li { margin-bottom: 0.2em; }

.content-wrapper {
  max-width: 860px;
  margin-top: 1.5rem;
}

.callout {
  border-left: 3px solid #527bbd;
  background: #f4f7fc;
  padding: 0.7em 1em;
  margin: 1em 0 1.2em;
  border-radius: 0 4px 4px 0;
  line-height: 1.5;
}
.callout p { margin-bottom: 0; }
.callout p + p { margin-top: 0.5em; }

/* Homework list */
.hw-list {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  margin: 1em 0 1.5em;
}
.hw-item {
  padding: 0.55em 0.9em;
  border: 1px solid #dde3ec;
  border-left: 4px solid #527bbd;
  border-radius: 6px;
  background: #fff;
  line-height: 1.5;
}
.hw-due { color: #444; margin-left: 0.4em; }
.hw-links { color: #666; margin-left: 0.4em; font-size: 0.92em; }
.hw-item.hw-past {
  opacity: 0.6;
  background: #f6f7f9;
}
.hw-item.hw-past .hw-due { text-decoration: line-through; }

/* Syllabus / lecture cards */
.lecture-controls {
  display: flex;
  gap: 0.5em;
  margin: 0.4em 0 0.8em;
}
.lecture-ctrl-btn {
  font-size: 0.85rem;
  padding: 0.3em 0.85em;
  border: 1px solid #527bbd;
  border-radius: 4px;
  background: #fff;
  color: #527bbd;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.15s, color 0.15s;
}
.lecture-ctrl-btn:hover { background: #527bbd; color: #fff; }

.lecture-list {
  display: flex;
  flex-direction: column;
  gap: 0.45em;
  margin: 0 0 1.5em;
}
.lecture-card {
  border: 1px solid #c8d3e2;
  border-left: 4px solid #527bbd;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  transition: background-color 0.15s, border-color 0.15s;
}
.lecture-card.open {
  border-left-color: #1f3f7a;
}
.lecture-card.lecture-special {
  background: #f4e6f7;
  border-left-color: #b07ab8;
}
.lecture-card.lecture-no-content .lecture-header {
  cursor: default;
}
.lecture-card.lecture-no-content .lecture-arrow { visibility: hidden; }
.lecture-card.lecture-today {
  background: #fff5e0;
  border-left-color: #d97706;
}
.lecture-card.lecture-today.open {
  border-left-color: #b85e00;
}
.lecture-card.lecture-upcoming {
  background: #f3f7ff;
  border-left-color: #2563eb;
}
.lecture-card.lecture-upcoming.open {
  border-left-color: #1d4ed8;
}

.lecture-header {
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.55em 0.9em;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s;
}
.lecture-card:not(.lecture-no-content) .lecture-header:hover {
  background-color: rgba(34, 75, 141, 0.07);
}
.lecture-header:focus-visible {
  outline: 2px solid #527bbd;
  outline-offset: 2px;
}
.lecture-arrow {
  display: inline-block;
  width: 1em;
  font-size: 1.4em;
  line-height: 1;
  color: #888;
  transition: transform 0.15s;
}
.lecture-card.open .lecture-arrow {
  transform: rotate(90deg);
}
.lecture-date {
  flex: 0 0 auto;
  color: #555;
  font-variant-numeric: tabular-nums;
  font-size: 0.9em;
  min-width: 6em;
}
.lecture-title {
  flex: 1;
  color: #333;
  font-weight: 600;
}
.lecture-card.lecture-special .lecture-title {
  color: #6b3a76;
}
.lecture-deadline {
  flex: 0 0 auto;
  color: #b45309;
  font-size: 0.82em;
  font-weight: 600;
  white-space: nowrap;
}
.lecture-content {
  display: none;
  padding: 0.7em 1em 0.85em;
  border-top: 1px solid #e0e6ef;
  background: transparent;
}
.lecture-card.open .lecture-content { display: block; }

.lecture-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin-bottom: 0.7em;
}
.lecture-action {
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: #0d9488;
  background: #fff;
  padding: 0.22em 0.85em;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid #0d9488;
  transition: background-color 0.15s, color 0.15s;
}
.lecture-action:hover {
  background: #0d9488;
  color: #fff;
  text-decoration: none;
}

.lecture-section { margin-bottom: 0.6em; }
.lecture-section:last-child { margin-bottom: 0; }
.lecture-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 0.3em;
}
.lecture-bullets {
  list-style: none;
  padding-left: 2.1em;
  margin: 0;
  line-height: 1.55;
}
.lecture-bullets li {
  position: relative;
  margin-bottom: 0.15em;
}
.lecture-bullets li::before {
  content: '';
  position: absolute;
  left: -0.85em;
  top: 0.65em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.lecture-section .lecture-section-label    { color: #224b8d; }
.lecture-section .lecture-bullets li::before { background: #527bbd; }

#upcoming-deadlines:empty { display: none; }

@media (max-width: 600px) {
  .lecture-deadline { display: none; }
  .lecture-date { min-width: 5em; }
}
