@import url('https://cdn.jsdelivr.net/npm/computer-modern@0.1/cmu-serif.css');

/* paper.css — applied to document pages via <link> tag.
   Paper pages are normal web documents. No fixed/sticky nav, no overflow tricks.
   The browser handles zoom, scroll and pan natively. */

/* ── Document base ──────────────────── */
html, body {
  margin: 0 !important;
  padding: 0 !important;
  padding-top: 52px !important; /* Offset for fixed navbar */
  background-color: #ffffff !important;
}

/* ── Paper content column ───────────────────────────────── */
.paper-page {
  background: #ffffff !important;
  color: #2e2b38 !important;
  font-family: "CMU Serif", serif;
  font-size: 14pt;
  line-height: 1.6;
  width: 100%;         /* Fill the wrapper fully */
  max-width: 680px;    /* Cap at readable width on desktop */
  margin: 0 auto !important;
  padding: 40px 20px !important;
  text-align: justify;
  overflow-wrap: break-word;
  word-wrap: break-word;
  box-sizing: border-box; /* padding counts into width */
}

/* Contain mathematical equations so they scroll natively instead of widening the layout */
.math.display {
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding-bottom: 5px !important; /* Prevent scrollbar from clipping subscripts */
}

/* Force KaTeX displays to scroll if overloaded */
.katex-display {
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

/* ── Headings ────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  color: #1c1927 !important;
}
a, a:link, a:visited {
  color: #4535a8 !important;
}
a:hover {
  color: #6857c8 !important;
}

/* ── Blockquotes / notes ─────────────────────── */
blockquote {
  border-left-color: #9d9890 !important;
  background: rgba(0, 0, 0, 0.04) !important;
  color: #2e2b38 !important;
}
blockquote p {
  color: #2e2b38 !important;
}

/* ── Code ────────────────────────────────────── */
code, pre, kbd {
  background: #e0dbd1 !important;
  color: #2e2b38 !important;
}

/* ── Tables ──────────────────────────────────── */
table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
th {
  background: #d8d3c8 !important;  /* warm mid-cream, not bright white */
  color: #1c1927 !important;
}
td {
  color: #2e2b38 !important;
}

/* ── Figures & images ────────────────────────── */
figure {
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  overflow: hidden;
}
img {
  max-width: 100% !important;
  height: auto !important;
}

/* ── Muted / caption text ────────────────────── */
.muted, figcaption, caption, .lead {
  color: #6b6575 !important;
}

/* ── Nav stays dark-theme regardless of paper theme ── */
site-nav, nav {
  background: #0c0c1a !important;
  backdrop-filter: none !important;
}
site-nav .nav-links a,
nav .nav-links a,
site-nav .nav-links a:link,
nav .nav-links a:link,
site-nav .nav-links a:visited,
nav .nav-links a:visited,
site-nav .nav-desktop-links a,
nav .nav-desktop-links a,
site-nav .nav-desktop-links a:link,
nav .nav-desktop-links a:link,
site-nav .nav-desktop-links a:visited,
nav .nav-desktop-links a:visited {
  color: rgba(210, 208, 236, 0.88) !important;
}
site-nav .nav-links a:hover,
nav .nav-links a:hover,
site-nav .nav-links a.active,
nav .nav-links a.active,
site-nav .nav-desktop-links a:hover,
nav .nav-desktop-links a:hover {
  color: #ffffff !important;
}
site-nav .nav-desktop-links a.nav-btn-highlight,
nav .nav-desktop-links a.nav-btn-highlight {
  color: #f0a500 !important;
}
site-nav .nav-brand,
nav:not([role="doc-toc"]) .nav-brand {
  color: #f0a500 !important;
}

/* ── Document Indices (TOC, LOF, LOT) ── */
nav[role="doc-toc"] {
  background: transparent !important;
}
nav[role="doc-toc"] a,
nav[role="doc-toc"] a:link,
nav[role="doc-toc"] a:visited {
  color: #4535a8 !important;
}
nav[role="doc-toc"] a:hover {
  color: #6857c8 !important;
}

/* ── Title block (pandoc-generated header) ── */
#title-block-header {
  text-align: center;
  margin: 0 0 2.5rem;
}
#title-block-header h1.title {
  font-size: 1.7rem !important;
  color: #1c1927 !important;
  line-height: 1.3;
  margin-bottom: 1.2rem !important;
}
p.author {
  font-size: 1rem !important;
  color: #2e2b38 !important;
  margin: 0.15rem 0 !important;
  line-height: 1.5 !important;
}
p.date {
  font-size: 0.9rem !important;
  color: #6b6575 !important;
  margin-top: 0.6rem !important;
}
.abstract {
  margin-top: 2rem !important;
  border-top: 1px solid #c8c3b8 !important;
  padding-top: 1rem !important;
  text-align: left !important;
}
.abstract-title {
  font-weight: 700 !important;
  font-size: 1rem !important;
  color: #1c1927 !important;
  margin-bottom: 0.5rem !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
}

/* ── Mobile Optimizations ────────────────────── */
@media (max-width: 640px) {
  .paper-page {
    padding-left: 10px !important;
    padding-right: 10px !important;
    text-align: left !important;
  }
}
