/* ── Typography ─────────────────────────────────────────────── */
body {
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.75;
}

h1, h2, h3, h4 {
  font-family: "Georgia", serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ── Title block spacing ────────────────────────────────────── */
#title-block-header {
  margin-block-end: 0;
}

#quarto-content .subtitle {
  padding-top: 0;
}

p.subtitle {
  line-height: 1;
  margin-top: .5rem;
  margin-bottom: 0;
}

/* ── Lecture header ─────────────────────────────────────────── */
.lecture-meta {
  font-family: monospace;
  font-size: 0.85rem;
  color: #6c757d;
  border-left: 3px solid #6c757d;
  padding-left: 1rem;
  margin-bottom: 2rem;
}

/* ── Callout overrides ──────────────────────────────────────── */
.callout {
  border-radius: 4px;
  margin: 1.5rem 0;
}

.callout-definition {
  border-left-color: #2c5f8a;
}

.callout-theorem {
  border-left-color: #1a6b3c;
}

.callout-warning {
  border-left-color: #8a5c00;
}

/* ── Math display ───────────────────────────────────────────── */
.math.display {
  overflow-x: auto;
  padding: 0.5rem 0;
}

mjx-container {
  font-size: 1.05em !important;
}

/* ── Equation box ───────────────────────────────────────────── */
.equation-box {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
}

/* Dark mode */
[data-bs-theme="dark"] .equation-box {
  background: #1e2530;
  border-color: #3a4556;
}

/* ── Chapter numbers: display as "Lecture N:" ───────────────── */
.sidebar-item .chapter-number::before,
.quarto-page-breadcrumbs .chapter-number::before,
h1.title .chapter-number::before {
  content: "Lecture ";
}
.sidebar-item .chapter-number::after,
.quarto-page-breadcrumbs .chapter-number::after,
h1.title .chapter-number::after {
  content: ":";
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #6c757d;
  margin-top: 1.25rem;
}

/* ── External link tooltips ─────────────────────────────────── */
a.ext-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: #6c757d;
  text-underline-offset: 3px;
  position: relative;
  cursor: pointer;
}

a.ext-link::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e2530;
  color: #e8eaf0;
  font-family: "Georgia", serif;
  font-size: 0.78rem;
  font-style: italic;
  line-height: 1.5;
  padding: 0.5rem 0.75rem;
  border-radius: 5px;
  white-space: normal;
  width: 240px;
  text-align: left;
  box-shadow: 0 3px 12px rgba(0,0,0,0.25);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 100;
}

a.ext-link::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e2530;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 100;
}

a.ext-link:hover::after,
a.ext-link:hover::before {
  opacity: 1;
}

[data-bs-theme="dark"] a.ext-link::after {
  background: #2c3a4f;
  color: #d8dce8;
  box-shadow: 0 3px 12px rgba(0,0,0,0.5);
}

[data-bs-theme="dark"] a.ext-link::before {
  border-top-color: #2c3a4f;
}

/* ── Theorem / conjecture hanging indent ────────────────────── */
.theorem {
  padding-left: 1.5em;
}

.theorem > p:first-child {
  text-indent: -1.5em;
}

.theorem li {
  text-indent: 0;
}

.corollary-proof {
  padding-left: 1.5em;
}


/* ── Last updated margin note ───────────────────────────────── */
.last-updated-date {
  font-size: 0.76rem;
  color: #6c757d;
  line-height: 1;
  margin-top: 0;
  margin-bottom: 0;
}

.last-updated-date p {
  margin-top: 0.7rem;
  margin-bottom: 0;
}

.last-updated-label {
  font-size: 0.70rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

[data-bs-theme="dark"] .last-updated-date {
  color: #8a9bb0;
}

/* ── Language switcher ──────────────────────────────────────── */
.lang-switch {
  font-size: 1.1rem;
  line-height: 1;
  margin-top: 5px;
  opacity: 0.75;
  text-decoration: none !important;
}

.lang-switch:hover {
  opacity: 1;
}

/* ── Summary box ────────────────────────────────────────────── */
.summary-box {
  background: linear-gradient(135deg, #f0f4f8 0%, #e8f0fb 100%);
  border-radius: 8px;
  padding: 1.5rem 2rem;
  margin: 2rem 0;
}

[data-bs-theme="dark"] .summary-box {
  background: linear-gradient(135deg, #1a2233 0%, #1e2a40 100%);
}
