/* Lecture notes: reading layout on top of the TeXmacs default css. */
:root { --fg: #1f1f1f; --bg: #fdfdfb; --link: #1b4f8a; --rule: #d6d3cc; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --fg: #e6e4df; --bg: #1c1c1e; --link: #8fb8ea; --rule: #444; }
  :root:not([data-theme="light"]) img { background: #fff; }
}
:root[data-theme="dark"] { --fg: #e6e4df; --bg: #1c1c1e; --link: #8fb8ea; --rule: #444; }
html { background: var(--bg); }
body { max-width: 46em; margin: 2.5em auto 4em; padding: 0 16px; color: var(--fg);
       background: var(--bg);
       font-family: 'EB Garamond', 'TeX Gyre Pagella', Palatino, 'Palatino Linotype', serif;
       font-size: 19.5px; line-height: 1.5; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; }
h2 { margin-top: 2em; border-bottom: 1px solid var(--rule); padding-bottom: .2em; }
img { max-width: 100%; height: auto; }
table { max-width: 100%; }
mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; max-width: 100%; }
center { overflow-x: auto; }

/* Table of contents as a fixed side panel (see cqft-notes.ts). */
:root { --panel: #f4f2ec; --hover: #e7e3d8; --toc-w: 17rem; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --panel: #232326; --hover: #33333a; }
}
.cqft-toc { position: fixed; top: 0; left: 0; bottom: 0; width: var(--toc-w);
            box-sizing: border-box; overflow-y: auto; padding: 1.2rem .9rem 2rem;
            background: var(--panel); border-right: 1px solid var(--rule);
            font-family: 'EB Garamond', Palatino, serif; font-size: 16px; line-height: 1.3;
            text-align: left; z-index: 10; }
.cqft-toc-title { font-weight: 600; font-size: 1.1em; margin: 0 .3em .6em; }
.cqft-toc p { position: relative; margin: .1em 0 !important; padding: .2em .35em; border-radius: 4px; }
.cqft-toc p:hover { background: var(--hover); }
.cqft-toc p:has(> b) { margin-top: .8em !important; }
.cqft-toc p { padding-left: 2.35em; text-indent: -2em; }
.cqft-toc p:has(> font) { padding-left: 2.6em; text-indent: -1em; }
.cqft-toc p a[href^="#auto-"] { position: absolute; inset: 0; font-size: 0; color: transparent; }
.cqft-toc p a[href^="#auto-"]:focus-visible { outline: 2px solid var(--link); border-radius: 4px; }
.cqft-toc span[style*="margin-left: 5mm"] { display: none; }
body { margin-left: max(calc(var(--toc-w) + 2rem), calc((100vw - 46em) / 2)); margin-right: auto; }
html { scroll-padding-top: 1rem; }
@media (max-width: 960px) {
  .cqft-toc { position: static; width: auto; max-height: none; border-right: 0;
              border: 1px solid var(--rule); border-radius: 6px; margin: 1.5em 0; }
  body { margin-left: auto; }
}
@media print { .cqft-toc { position: static; width: auto; border: 0; background: none; } body { margin-left: auto; } }
/* Current position (cqft-notes.js). */
:root { --current: #ebe2cf; --current-fg: #7a1f1f; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --current: #3b3428; --current-fg: #f0c9a0; }
}
.cqft-toc p.toc-current { background: var(--current); color: var(--current-fg);
                          box-shadow: inset 3px 0 0 var(--current-fg); }
.cqft-toc p.toc-current-section { color: var(--current-fg); }
