/* Base */
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #212529;
  background: #ffffff;
}

main.content {
  max-width: 46rem;
  margin: 0 auto;
  padding: 4.5rem 1rem 2rem 1rem;
}

/* Fixed top bar */
header.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  z-index: 100;
}

nav.topnav {
  display: flex;
  align-items: stretch;
  max-width: 46rem;
  margin: 0 auto;
}

.topnav-item {
  display: block;
  padding: 0.75rem 1rem;
  color: #212529;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

a.topnav-item:hover {
  background: #e9ecef;
}

/* CSS-only dropdowns, open on hover or focus */
.topnav-dropdown {
  position: relative;
}

.topnav-dropdown:hover .topnav-item {
  background: #e9ecef;
}

.topnav-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 14rem;
  max-height: 70vh;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  padding: 0.5rem 0;
}

.topnav-dropdown:hover .topnav-menu,
.topnav-dropdown:focus-within .topnav-menu {
  display: block;
}

/* Menu lists (chapters, appendices, and the page TOC) */
.topnav-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.topnav-menu li a {
  display: block;
  padding: 0.4rem 1rem;
  color: #212529;
  text-decoration: none;
}

.topnav-menu li a:hover {
  background: #f1f3f5;
}

/* Content */
.center {
  text-align: center;
}

.right {
  text-align: right;
}

dt {
  display: block;
}

dd {
  display: block;
  margin: 0 0 0 1rem;
}

/* Bibliography */
.hanging-indent .csl-entry {
  margin-left: 2em;
  text-indent: -2em;
}

div.syllabus {
  background: #f5f5f5;
  border: 1px solid #d0d0d0;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

div.syllabus::before {
  content: "Syllabus";
  font-weight: bold;
  display: block;
  margin-bottom: 0.25rem;
}

div.syllabus > :first-child {
  margin-top: 0;
}

div.syllabus > :last-child {
  margin-bottom: 0;
}

span.smallcaps {
  font-variant: small-caps;
}

header.quarto-title-block {
  display: none;
}

/* Code blocks */
pre {
  background: #f5f5f5;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  overflow-x: auto;
}

/* Notes */
.note {
  background: #f5f5f5;
  border: 1px solid #d0d0d0;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

.note::before {
  content: "Note";
  font-weight: bold;
  display: block;
  margin-bottom: 0.25rem;
}

.note[data-title]::before {
  content: attr(data-title);
}

.note > :first-child {
  margin-top: 0;
}

.note > :last-child {
  margin-bottom: 0;
}

/* Blockquotes */
blockquote cite {
  display: block;
}

blockquote cite::before {
  content: "— ";
}

/* Flex grid (12-column) */
.row {
  display: flex;
  flex-flow: row wrap;
  width: 100%;
}

.row > * {
  flex: 1;
}

.col-1 { flex-basis: 8.33%; }
.col-2 { flex-basis: 16.66%; }
.col-3 { flex-basis: 25%; }
.col-4 { flex-basis: 33.33%; }
.col-5 { flex-basis: 41.66%; }
.col-6 { flex-basis: 50%; }
.col-7 { flex-basis: 58.33%; }
.col-8 { flex-basis: 66.66%; }
.col-9 { flex-basis: 75%; }
.col-10 { flex-basis: 83.33%; }
.col-11 { flex-basis: 91.66%; }
.col-12 { flex-basis: 100%; }
