/* One font and one size everywhere, as in a LaTeX paper: Computer Modern (KaTeX's fonts, the
   ones the formulas use) for text, math at the text size, Lean names in Computer Modern
   Typewriter (\texttt), except the names of declarations linked in the text (the project's and
   the library's), named as a paper names its results.
   The text is as wide as a math paper's: 6.5in at 11pt (letter paper with
   1in margins, the usual arXiv layout) is 42.75em; a project with long module names gets a wider
   column (--text-width, set from the index). */
body { max-width: var(--text-width, 42.75em); margin: 0 auto; padding: .5rem 1.5rem 4rem;
       font: 18px/1.45 KaTeX_Main, "Latin Modern Roman", "CMU Serif", Georgia, serif;
       color: #111; }
/* the bar under the notice, across the window: the project's name (left), search (right) */
#topbar { position: relative; left: 50%; transform: translateX(-50%); width: 100vw; box-sizing: border-box;
          display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: .4rem 1.2rem;
          margin-top: -.5rem; margin-bottom: .8rem; }
#search { justify-self: end; grid-column: 3; }
/* (the title alone on the site's index page; with its icon on a project's pages) */
#home, #homehead { grid-column: 2; }
/* the "Experimental" stamp in the top left corner, outside the text column; it links to the page
   about these pages */
#badge { position: absolute; left: 1.1rem; top: 1.15rem; z-index: 2; transform: rotate(-10deg);
         color: #5f3dc4; border: 2px solid #5f3dc4; border-radius: 4px; padding: 0 .45em;
         font-size: 15px; font-variant: small-caps; letter-spacing: .08em; opacity: .85; }
#badge:hover { opacity: 1; text-decoration: none; background: #f3f0ff; }
/* a narrow window has no room beside the text: the stamp sits in the bar */
@media (max-width: 70em) {
  #badge { position: static; grid-column: 1; grid-row: 1; justify-self: start; margin: .5rem 0 .2rem .3rem; }
}

#home { color: inherit; text-decoration: none; font-weight: bold; }

#search { width: 11em; font: inherit; padding: .1em .35em; }
h1, h2 { font-size: 1em; font-weight: bold; margin: 1em 0 .5em; }
code, pre { font-family: KaTeX_Typewriter, "Latin Modern Mono", "CMU Typewriter Text", monospace; font-size: 1em; }
/* a declaration's own name in its heading (in a preview too, a library declaration's), a
   namespace's, module's or folder's in its page's, a label (a structure's field, ``name``) and a
   link to a declaration in the text, the project's ("by foo") or the library's ("by
   Finset.sum_comm"), in the text's font, as a paper names its results */
code.own, code.label, a.ref code, a.lib code { font-family: inherit; }
pre { white-space: pre-wrap; text-align: left; }
.katex { font-size: 1em; }
a { color: #00468b; text-decoration: none; }
a:hover { text-decoration: underline; }
ul { padding-left: 1.5em; }
.step { margin: .25em 0; }
/* a statement in paragraphs (a definition's, a theorem's without a proof page) spaced as a
   proof's statement in steps */
.statement > p { margin: .25em 0; }
summary { cursor: pointer; }
.selected { background: #eef2f7; }
/* a declaration's explanation with its Lean source beside it (the Warm-up): the pair wider than
   the text column, the source at a smaller size, in view while the explanation scrolls; one
   column in a narrow window */
.sbs { position: relative; left: 50%; transform: translateX(-50%); width: 96vw; max-width: 84em;
       display: grid; grid-template-columns: minmax(0, 42.75em) minmax(0, 1fr); gap: 2.5em; align-items: start; }
.leanpane { position: sticky; top: 1em; max-height: calc(100vh - 2em); overflow: auto; }
.leanpane pre { margin: .3em 0 0; padding: .6em .8em; background: #f7f8fa; border-radius: 4px;
                font-size: 15px; line-height: 1.45; }
@media (max-width: 62em) {
  .sbs { left: auto; transform: none; width: auto; grid-template-columns: minmax(0, 1fr); gap: 1em; }
  .leanpane { position: static; max-height: none; }
}
.warn { color: #a00; }
.katex-display { margin: .4em 0; overflow-x: auto; overflow-y: hidden; }
.math.broken { display: block; margin: .4em 0 .4em 1.5em; text-align: left; }
.math.broken .mrow { display: block; padding-left: 1.5em; text-indent: -1.5em; }
.math.broken .mtag { float: right; margin-left: 1em; }
ul.items { list-style: disc outside; padding-left: 1.5em; }
ul.items li { margin: .25em 0; list-style-type: disc; }
/* numbered hypotheses like the proof's displayed formulas: centred, the number on the right, at
   the right edge where KaTeX puts a display's \tag */
ul.items.numbered { padding-left: 0; }
ul.items.numbered li { list-style-type: none; position: relative; text-align: center; padding: 0 3.2em; }
ul.items.numbered li > .label { position: absolute; right: 0; white-space: nowrap; }
.step.part { margin-top: .9em; }
.step.end { margin-bottom: .9em; }
/* a case, base case, induction step or part with its own steps: closed by default, its heading
   shows; the triangle sits in the left margin so the text stays aligned */
details.case { margin-top: .9em; margin-left: -1.4em; padding-left: 1.4em; border-radius: 3px; }
details.case > summary { display: block; list-style: none; position: relative; }
details.case > summary::-webkit-details-marker { display: none; }
details.case > summary::before { content: "\25B8"; position: absolute; left: -1.1em; top: .05em; color: #777; }
details.case[open] > summary::before { content: "\25BE"; }
details.case.hover { background: #eef2f7; }
details.case > summary > .step.part { margin-top: 0; }
details.case:not([open]) > summary > .step::after { content: " [\2026]"; color: #777; }
details.case.proof { margin-top: .25em; }
/* a claim's closing line inside its fold: the space after it goes after the fold */
details.case[data-ended] { margin-bottom: .9em; }
details.case[data-ended] > .case-body > .step.end { margin-bottom: 0; }
.openall { margin-left: .8em; font-size: .85em; font-weight: normal; }
/* the preview of a linked declaration */
.preview { position: absolute; z-index: 10; pointer-events: none; max-width: 32em; padding: .3em .8em; background: #fff;
           border: 1px solid #bbb; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,.15);
           font-size: .9em; text-align: left; }
.preview p { margin: .35em 0; }
.preview { max-height: 80vh; overflow: hidden; }
.preview .katex-display { overflow: visible; }
.preview.cut::after { content: "\2026"; position: absolute; left: 0; right: 0; bottom: 0; padding: 1.2em .8em .2em;
                      background: linear-gradient(rgba(255,255,255,0), #fff 60%); color: #555; }
.preview[hidden] { display: none; }
/* the project graph: wider than the text, centred on the page */
.graph-box { position: relative; left: 50%; transform: translateX(-50%); width: 96vw; max-width: 1400px; margin: 1em 0; }
.graph { position: relative; height: 62vh; min-height: 12em; resize: vertical; border: 1px solid #ddd; border-radius: 4px; overflow: hidden; background: #fcfcfd;
         cursor: grab; touch-action: none; user-select: none; }
.graph.dragging { cursor: grabbing; }
.graph-svg { width: 100%; height: 100%; display: block; }
.graph .edges path { fill: none; stroke: #9aa7b8; opacity: .75; }
.graph marker path { fill: #9aa7b8; }
.graph-svg.focus .edges path { opacity: .1; }
.graph-svg.focus .edges path.hl { opacity: 1; stroke: #00468b; }
.graph .node rect { fill: #fff; stroke: #7a8799; stroke-width: 1; }
.graph .node.group rect { fill: #eef2f7; }
/* a module (folders are the other groups), and the box for a folder's or module's other parts */
.graph .node.group.module rect { fill: #f4f7fb; stroke-dasharray: 5 3; }
.graph .node.others rect { fill: #fff; stroke-dasharray: 2 3; }
.graph .node.others text { font-style: italic; }
.graph .node.decl:not(.kind-theorem) rect { fill: #f8f4e8; }
.graph .node.main rect { stroke: #00468b; stroke-width: 2.2; }
.graph .node.hl rect { fill: #dbe7f6; }
.graph .node text { font: 14px KaTeX_Main, serif; fill: #111; pointer-events: none; }
.graph .node { cursor: pointer; }
.graph-crumbs { position: absolute; top: .45em; right: .7em; z-index: 2; padding: .1em .45em; border-radius: 3px;
                background: rgba(252, 252, 253, .92); font-size: .9em; }
.graph-help { font-size: .85em; color: #555; }
.graph .badge rect { fill: #00468b; }
.graph .badge text { font: bold 11px sans-serif; fill: #fff; pointer-events: none; }
.graph .badge { cursor: pointer; }
.graph-tabs { position: absolute; top: .45em; left: .7em; z-index: 2; padding: .1em .45em; border-radius: 3px;
              background: rgba(252, 252, 253, .92); font-size: .9em; }
.graph-tabs .tab.active { color: #111; font-weight: bold; text-decoration: none; cursor: default; }
/* full-width bars must not add a horizontal scrollbar */
html { overflow-x: hidden; }
/* namespace and module pages */
ul.decls { list-style: none; padding-left: 0; }
ul.decls li { margin: .2em 0; }
ul.decls .kind { display: inline-block; min-width: 5.5em; }
code a.ns { color: inherit; text-decoration: underline dotted #888; }
code a.ns:hover { color: #00468b; }
/* the module folders on the overview: a tree, opened folder by folder */
ul.folders { list-style: none; padding-left: 1.2em; }
ul.folders > li { margin: .2em 0; }
ul.folders summary { cursor: pointer; }

/* the site's furniture (app.js): one sans-serif face, apart from the text and its formulas */
.intro { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
/* the text as written, shown otherwise (a heading, a qualified name): kept for what a line says */
.orig { display: none; }
.intro { font-size: 16px; line-height: 1.55; color: #2b3644; max-width: 44em; margin: .2em 0 1em; }
/* a line's links (app.js `lineActs`), while the pointer is on the line: right of it, level with
   its first line of text (the box starts at the line's edge, so the pointer stays on the line on
   its way there), or inside its right end where the window leaves no room */
.hasacts { position: relative; }
.lineacts { display: none; position: absolute; left: 100%; top: .05em; padding-left: .4em; gap: .1em; line-height: 1;
            white-space: nowrap; }
.hasacts:hover > .lineacts { display: flex; }
.actsin > .lineacts { left: auto; right: 0; padding-left: .3em; background: #fff; }
.lineacts .act { display: flex; padding: 3px; border-radius: 3px; color: #7a838e; }
.lineacts .act:hover { color: #00468b; background: #eef2f7; text-decoration: none; }
.act-icon { width: 18px; height: 18px; fill: currentColor; }
/* the top bar: the title with its icon left of it (a link to the site's index page), the search box */
#homehead { position: relative; white-space: nowrap; font-weight: bold; }
.sitelink { position: absolute; right: calc(100% + .5em); top: 50%; transform: translateY(-50%); display: flex; }
.sitelink .icon { width: 2.5em; height: 2.05em; object-fit: contain; }
.gh { width: 13px; height: 13px; fill: currentColor; }
.searchbar { grid-column: 3; justify-self: end; display: flex; align-items: stretch; gap: .55em; }
/* the bar's layout steps (app.js fitBar, the first in which nothing touches): a smaller title;
   the search box on a row of its own under the title; no icon; the stamp on that row, left of it,
   the search box narrower as the window is; a smaller stamp; a smaller title. The title never
   wraps. */
#topbar.compact #homehead { font-size: .84em; }
#topbar.tworow .searchbar { grid-column: 1 / -1; grid-row: 3; justify-self: end; margin-top: .45em; }
#topbar.noicon .sitelink { display: none; }
#topbar.badgerow { grid-template-columns: auto minmax(0, 1fr); }
#topbar.badgerow #homehead { grid-column: 1 / -1; justify-self: center; }
#topbar.badgerow #badge { position: static; grid-column: 1; grid-row: 3; justify-self: start; align-self: center; margin: .45em 1.1rem 0 .3rem; }
#topbar.badgerow .searchbar { grid-column: 2; min-width: 0; max-width: 100%; }
#topbar.badgerow #search { width: auto; min-width: 3em; flex: 0 1 11em; }
#topbar.smallbadge #badge { font-size: 12px; }
#topbar.smalltitle #homehead { font-size: .72em; }
/* the About / help text, on its own page (#about) */
.about-text hr { border: 0; border-top: 1px solid #d5dde7; margin: 1.2em 0 .9em; }
.about-text a { display: inline-flex; align-items: center; gap: .2em; }
.about-page { margin-top: 1em; }
/* a block shown as it is written (a citation entry), selectable as a whole */
.about-text pre.verbatim { font-size: .8em; padding: .6em .9em; background: #f7f7f7; border: 1px solid #e1e1e1;
                           border-radius: 4px; overflow-x: auto; white-space: pre; user-select: all; }
/* a static site's index page (app.js `indexPage`): its projects, each with its featured declarations */
section.project { margin: 1.4em 0; }
section.project h2 { margin: 0 0 .15em; }
section.project .meta { margin: 0 0 .4em; color: #666; font-size: .9em; }
