/* paperforge "paper look": research-article styling over the PreTeXt modern
   theme. Goals: LaTeX-familiar fonts, black-and-white, a wide single column,
   and quiet knowl/detail boundaries (light background, no heavy chrome). */

/* -- 6. Computer Modern webfonts (the LaTeX look). Math is already Modern
      via MathJax; this aligns the prose. -- */
@import url("fonts-cm.css");   /* vendored locally, CDN-free */

:root:not(.dark-mode) {
  /* -- 5. black and white: the theme derives nearly everything from these -- */
  --primary-color: #111111;
  --secondary-color: #222222;
  --doc-title-color: #111111;
  --byline-color: #333333;
  --banner-background: #ffffff;
  --navbar-background: #f6f6f6;
  --toc-border-color: #dddddd;
  --tocitem-highlight-background: #e8e8e8;
  --tocitem-highlight-text-color: #111111;
}

/* light TOC sidebar: a paper's margin, not a book's chrome */
.ptx-sidebar .ptx-toc, .ptx-toc {
  background: #fafafa;
}
.ptx-toc .toc-item, .ptx-toc .toc-title-box a, .ptx-toc a {
  background: transparent;
  color: #222222;
}
.ptx-toc .toc-item.active, .ptx-toc .toc-current a {
  background: #e8e8e8;
  color: #111111;
}

/* -- 2. wider content column: the theme hardcodes 696px on .ptx-content -- */
.ptx-main > .ptx-content { max-width: 58rem; }
.ptx-content-footer { max-width: 58rem; }


/* -- 6 cont.: prose in Computer Modern -- */
.ptx-content, .ptx-content .para, .ptx-page, .ptx-masthead .title-container {
  font-family: "Computer Modern Serif", "Latin Modern Roman", Georgia, serif;
}
.ptx-content .frontmatter .author-status-note {
  margin-top: 0.2rem;
  font-size: 0.92em;
}
.ptx-content .heading, .ptx-content h1, .ptx-content h2, .ptx-content h3,
.ptx-content h4, .ptx-content h5 {
  font-family: "Computer Modern Serif", "Latin Modern Roman", Georgia, serif;
}
/* division-heading ladder: the theme's subsection/subsubsection sizes
   (1.15em) fall below theorem-like headings (1.25em); keep every division
   heading at least lemma-sized, ordered by depth under section (1.3em) */
.ptx-content section.subsection > .heading { font-size: 1.275em; }
.ptx-content section.subsubsection > .heading { font-size: 1.25em; }

/* -- 5 cont.: links quiet (papers are ink); keep affordance on hover -- */
.ptx-content a.internal, .ptx-content .xref {
  color: #111111;
  text-decoration: underline;
  text-decoration-color: #bbbbbb;
  text-underline-offset: 2px;
}
.ptx-content a.internal:hover, .ptx-content .xref:hover {
  text-decoration-color: #111111;
}
/* knowl links already carry the theme's state-aware dotted border (hidden
   on :hover/:focus/[open]) — adding our underline gave them a double line
   that flickered with focus. One affordance only. */
.ptx-content a.xref[data-knowl], .ptx-content a.xref[data-knowl]:hover {
  text-decoration: none;
}

/* -- 3. quiet knowls: light gray field instead of borders/boxes -- */
.ptx-content details.born-hidden-knowl {
  border: none;
  background: #f5f5f5;
  border-radius: 4px;
  padding: 0.35rem 0.7rem;
  margin: 0.6rem 0;
}
.ptx-content details.born-hidden-knowl > summary.knowl__link {
  color: #111111;
  font-style: italic;
  text-decoration: none;
  list-style-position: outside;
}
.ptx-content details.born-hidden-knowl > summary.knowl__link .heading {
  color: #111111;
}
.ptx-content details.born-hidden-knowl .knowl__content {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0.2rem 0 0.1rem;
}
/* nested knowls: a knowl surface opened inside another knowl surface is
   grey-on-grey without a boundary. Step the inner one to white with a
   hairline so it reads as a layer. Injected xref knowls are the
   div.knowl__content[id^=knowl-uid-] elements (knowl.js); born-hidden
   details and .lean-knowl doc panels are the other two surfaces. */
.ptx-content details.born-hidden-knowl div.knowl__content[id^="knowl-uid-"],
.ptx-content details.born-hidden-knowl details.born-hidden-knowl,
.ptx-content details.born-hidden-knowl .lean-knowl,
.ptx-content details.born-hidden-knowl .section-knowl,
.ptx-content div.knowl__content[id^="knowl-uid-"] div.knowl__content[id^="knowl-uid-"],
.ptx-content div.knowl__content[id^="knowl-uid-"] details.born-hidden-knowl,
.ptx-content div.knowl__content[id^="knowl-uid-"] .lean-knowl,
.ptx-content div.knowl__content[id^="knowl-uid-"] .section-knowl {
  background: #ffffff;
  border: 1px solid #dddddd;
  border-radius: 4px;
  padding: 0.35rem 0.7rem;
}

/* theorem-like blocks: no colored bars or boxes — amsart is flat -- */
.ptx-content article.theorem-like,
.ptx-content article.definition-like,
.ptx-content article.remark-like {
  border: none;
  background: transparent;
  box-shadow: none;
  padding-left: 0;
}

/* xref preview knowls (click-to-open cross references) — same quiet field */
.ptx-content .knowl__content {
  background: #f7f7f7;
  border: none;
  box-shadow: none;
  border-radius: 4px;
}

/* -- dark mode. The theme drives dark entirely via a .dark-mode class on
   :root (readability-options.js adds it from prefers-color-scheme and the
   user toggle; theme.css has no media queries). Every literal light value
   above therefore needs its counterpart here, else the theme's light text
   lands on our light panels (white-on-white paras, #111 links on a dark
   body). Palette sits a step off the theme's dark body (#23241f). -- */
:root.dark-mode .ptx-sidebar .ptx-toc, :root.dark-mode .ptx-toc {
  background: #202119;
}
:root.dark-mode .ptx-toc .toc-item, :root.dark-mode .ptx-toc .toc-title-box a,
:root.dark-mode .ptx-toc a {
  color: #cfd0ca;
}
:root.dark-mode .ptx-toc .toc-item.active, :root.dark-mode .ptx-toc .toc-current a {
  background: #33342c;
  color: #f2f2f2;
}
:root.dark-mode .ptx-content a.internal, :root.dark-mode .ptx-content .xref {
  color: #f2f2f2;
  text-decoration-color: #66665f;
}
:root.dark-mode .ptx-content a.internal:hover,
:root.dark-mode .ptx-content .xref:hover {
  text-decoration-color: #f2f2f2;
}
:root.dark-mode .ptx-content details.born-hidden-knowl {
  background: #2c2d27;
}
:root.dark-mode .ptx-content details.born-hidden-knowl > summary.knowl__link,
:root.dark-mode .ptx-content details.born-hidden-knowl > summary.knowl__link .heading {
  color: #f2f2f2;
}
:root.dark-mode .ptx-content details.born-hidden-knowl div.knowl__content[id^="knowl-uid-"],
:root.dark-mode .ptx-content details.born-hidden-knowl details.born-hidden-knowl,
:root.dark-mode .ptx-content details.born-hidden-knowl .lean-knowl,
:root.dark-mode .ptx-content details.born-hidden-knowl .section-knowl,
:root.dark-mode .ptx-content div.knowl__content[id^="knowl-uid-"] div.knowl__content[id^="knowl-uid-"],
:root.dark-mode .ptx-content div.knowl__content[id^="knowl-uid-"] details.born-hidden-knowl,
:root.dark-mode .ptx-content div.knowl__content[id^="knowl-uid-"] .lean-knowl,
:root.dark-mode .ptx-content div.knowl__content[id^="knowl-uid-"] .section-knowl {
  background: #1d1e19;
  border-color: #4a4b44;
}
:root.dark-mode .ptx-content .knowl__content {
  background: #2a2b25;
}

/* ToC visible by default on wide screens (owner request 2026-07-27). The
   theme's toggle still works: closing adds .hidden, which wins here. */
@media screen and (min-width: 1000px) {
  .ptx-sidebar:not(.hidden) { display: block; }
}

/* Single-page article: the Prev/Up/Next tree buttons are permanently
   disabled, so remove them from the navbar entirely. */
.ptx-navbar .treebuttons { display: none; }
