/*
 * tryck default theme.
 *
 * Restyle by overriding variables in a stylesheet listed in theme.css, for
 * example `:root { --font: Georgia, serif; }`. theme.accent sets --accent,
 * which colors links in both schemes. Dark values apply when the color
 * scheme is dark: data-theme="dark" on <html>, or the system preference
 * when data-theme is not "light".
 */
:root {
  color-scheme: light;
  --fg: #1f2328; --muted: #59636e; --bg: #fff; --bg-alt: #f6f8fa; --line: #d1d9e0; --link: #0969da; --warn-bg: #fff8c5; --warn-line: #d4a72c;
  --note: #0969da; --tip: #1a7f37; --info: #8250df; --warning: #9a6700; --danger: #cf222e;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --fg: #e6edf3; --muted: #9198a1; --bg: #0d1117; --bg-alt: #151b23; --line: #3d444d; --link: #4493f8; --warn-bg: #3b2e00; --warn-line: #9e6a03;
  --note: #4493f8; --tip: #3fb950; --info: #ab7df8; --warning: #d29922; --danger: #f85149;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --fg: #e6edf3; --muted: #9198a1; --bg: #0d1117; --bg-alt: #151b23; --line: #3d444d; --link: #4493f8; --warn-bg: #3b2e00; --warn-line: #9e6a03;
    --note: #4493f8; --tip: #3fb950; --info: #ab7df8; --warning: #d29922; --danger: #f85149;
  }
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--fg); background: var(--bg); font: 16px/1.6 var(--font); }
a { color: var(--accent, var(--link)); }
.site-header { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); }
.site-title { display: flex; align-items: center; gap: 0.5rem; margin-right: auto; color: var(--fg); font-weight: 600; text-decoration: none; }
.site-logo { height: 1.75rem; width: auto; }
.site-nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--accent, var(--link)); }
.theme-toggle { display: inline-flex; padding: 0.35rem; border: 1px solid var(--line); border-radius: 6px; background: none; color: var(--fg); font: inherit; line-height: 1; cursor: pointer; }
.site-footer { max-width: 76rem; margin: 3rem auto 0; padding: 1.5rem 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.875rem; }
.draft-banner { padding: 0.5rem 1rem; background: var(--warn-bg); border-bottom: 1px solid var(--warn-line); font-weight: 600; }
.layout { display: flex; flex-wrap: wrap; max-width: 76rem; margin: 0 auto; }
.sidebar { flex: 0 0 16rem; padding: 1rem; font-size: 0.95rem; }
.sidebar ul { list-style: none; margin: 0; padding-left: 0.9rem; }
.sidebar > ul { padding-left: 0; }
.sidebar li { margin: 0.2rem 0; }
.sidebar a { color: var(--fg); text-decoration: none; }
.sidebar a:hover { color: var(--accent, var(--link)); }
.sidebar a[aria-current="page"] { color: var(--accent, var(--link)); font-weight: 600; }
.nav-section { color: var(--muted); font-weight: 600; }
.content { flex: 1 1 32rem; min-width: 0; max-width: 48rem; margin: 0 auto; padding: 1rem; }
.layout > .content { margin: 0; } /* same position with or without a TOC */
.nav-toggle { padding: 0.25rem 0.75rem; border: 1px solid var(--line); border-radius: 6px; background: none; color: var(--fg); font: inherit; cursor: pointer; }
.post-date { color: var(--muted); }
.toc { flex: 0 0 14rem; align-self: flex-start; position: sticky; top: 0; padding: 1rem; font-size: 0.875rem; }
.toc ul { list-style: none; margin: 0; padding-left: 0.75rem; }
.toc > ul { padding-left: 0; }
.toc li { margin: 0.2rem 0; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--accent, var(--link)); }
.toc-title { margin: 0 0 0.5rem; font-weight: 600; }
.reading-time { color: var(--muted); }
.pager { display: flex; gap: 1rem; justify-content: space-between; margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.pager a { display: flex; flex-direction: column; text-decoration: none; }
.pager span { color: var(--muted); font-size: 0.85rem; }
.pager-next { margin-left: auto; text-align: right; }
pre, code { font-family: var(--font-mono); font-size: 0.9em; }
pre { padding: 1rem; overflow-x: auto; background: var(--bg-alt); border-radius: 6px; }
:not(pre) > code { padding: 0.1em 0.3em; background: var(--bg-alt); border-radius: 4px; }
.math { margin: 1rem 0; overflow-x: auto; overflow-y: hidden; } /* a wide formula scrolls, not the page */
.math-display { display: block; }
/* Fonts with math tables, so brackets stretch and limits sit right. */
math { font-family: "Latin Modern Math", "STIX Two Math", "Cambria Math", "Noto Sans Math", math; }
.math-error { color: var(--danger); }
table { border-collapse: collapse; display: block; overflow-x: auto; }
th, td { padding: 0.4rem 0.75rem; border: 1px solid var(--line); }
th { text-align: left; }
img { max-width: 100%; height: auto; }
.admonition { --adm: var(--note); margin: 1rem 0; padding: 0.5rem 1rem; border-left: 4px solid var(--adm); background: var(--bg-alt); border-radius: 0 6px 6px 0; }
.admonition-tip { --adm: var(--tip); }
.admonition-info { --adm: var(--info); }
.admonition-warning { --adm: var(--warning); }
.admonition-danger { --adm: var(--danger); }
.admonition-title { margin: 0.25rem 0; color: var(--adm); font-weight: 600; }
.admonition > :last-child, .tab-panel > :last-child { margin-bottom: 0.5rem; }
details.details { margin: 1rem 0; padding: 0.5rem 1rem; border: 1px solid var(--line); border-radius: 6px; }
details.details > summary { cursor: pointer; font-weight: 600; }
.tabs { margin: 1rem 0; }
.tab-list { display: flex; flex-wrap: wrap; gap: 0.25rem; border-bottom: 1px solid var(--line); }
.tab-list[hidden] { display: none; }
.tab-list [role="tab"] { padding: 0.4rem 0.9rem; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.tab-list [role="tab"][aria-selected="true"] { border-bottom-color: var(--accent, var(--link)); color: var(--fg); font-weight: 600; }
.tab-label { margin: 1rem 0 0.25rem; font-weight: 600; }
.tabs-js .tab-label { display: none; }
/* With JavaScript on (the js class is set before the first paint), show
   the search button and the first tab right away, so nothing jumps when
   the scripts run. */
.js .search[hidden] { display: block; }
.js .tab-list[hidden] { display: flex; }
.js .tabs:not(.tabs-js) > .tab-panel ~ .tab-panel, .js .tabs:not(.tabs-js) .tab-label { display: none; }
@media print {
  .site-header, .sidebar, .toc, .pager, .nav-toggle, .search, .theme-toggle, .tab-list, .heading-anchor, .copy-code, .edit-link { display: none !important; }
  .layout { display: block; max-width: none; }
  .content { max-width: none; padding: 0; }
  .tab-panel[hidden], .tabs .tab-panel { display: block !important; }
  .tab-label, .tabs-js .tab-label { display: block !important; }
  pre, .admonition, table { break-inside: avoid; }
  pre { white-space: pre-wrap; }
  .math, .math-display { overflow: visible; }
}
.version-banner { padding: 0.5rem 1rem; background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.versions { position: relative; }
.versions > summary { list-style: none; padding: 0.3rem 0.6rem; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 0.9rem; cursor: pointer; }
.versions > summary::-webkit-details-marker { display: none; }
.versions > summary::after { content: " ▾"; }
.versions ul { position: absolute; right: 0; z-index: 10; min-width: 100%; margin: 0.25rem 0 0; padding: 0.25rem; list-style: none; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.15); }
.versions a { display: block; padding: 0.3rem 0.6rem; border-radius: 4px; color: var(--fg); text-decoration: none; white-space: nowrap; }
.versions a:hover, .versions a[aria-current] { background: var(--bg-alt); }
.versions-current { color: var(--muted); font-size: 0.8rem; }
.heading-anchor { margin-left: 0.4rem; color: var(--muted); font-weight: 400; text-decoration: none; opacity: 0; }
:is(h2, h3, h4, h5, h6):hover > .heading-anchor, .heading-anchor:focus { opacity: 1; }
@media (hover: none) { .heading-anchor { opacity: 0.6; } }
.code-block { position: relative; }
.copy-code { position: absolute; top: 0.4rem; right: 0.4rem; padding: 0.15rem 0.5rem; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--muted); font: inherit; font-size: 0.75rem; cursor: pointer; opacity: 0; }
.code-block:hover .copy-code, .copy-code:focus { opacity: 1; }
@media (hover: none) { .copy-code { opacity: 1; } }
.page-meta { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; margin-top: 2rem; color: var(--muted); font-size: 0.875rem; }
.search[hidden] { display: none; }
.search-open { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.6rem; border: 1px solid var(--line); border-radius: 6px; background: none; color: var(--muted); font: inherit; font-size: 0.9rem; cursor: pointer; }
.search-open:hover { color: var(--fg); }
.search-open kbd, .search-close { padding: 0 0.35rem; border: 1px solid var(--line); border-radius: 4px; font-family: var(--font-mono); font-size: 0.75rem; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-dialog { width: min(40rem, calc(100vw - 2rem)); max-height: min(36rem, calc(100vh - 6rem)); margin: 4rem auto auto; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); box-shadow: 0 1.5rem 3rem rgb(0 0 0 / 0.25); }
.search-dialog[open] { display: flex; flex-direction: column; }
.search-dialog::backdrop { background: rgb(0 0 0 / 0.4); }
.search-bar { display: flex; gap: 0.5rem; align-items: center; padding: 0.75rem; border-bottom: 1px solid var(--line); }
.search-input { flex: 1; min-width: 0; padding: 0.5rem 0.75rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-alt); color: var(--fg); font: inherit; }
.search-close { padding: 0.25rem 0.5rem; background: none; color: var(--muted); cursor: pointer; }
.search-status { margin: 0; padding: 0.75rem 1.25rem; color: var(--muted); font-size: 0.9rem; }
.search-status:empty { display: none; }
.search-results { list-style: none; margin: 0; padding: 0.5rem; overflow-y: auto; }
.search-results:empty { display: none; }
.search-results a { display: block; padding: 0.5rem 0.75rem; border-radius: 6px; color: var(--fg); text-decoration: none; }
.search-results a[aria-selected="true"], .search-results a:hover { background: var(--bg-alt); }
.search-title { display: block; font-weight: 600; }
.search-heading { display: block; color: var(--accent, var(--link)); font-size: 0.9rem; }
.search-snippet { display: block; margin-top: 0.15rem; color: var(--muted); font-size: 0.85rem; }
.search-results mark { background: color-mix(in srgb, var(--accent, var(--link)) 25%, transparent); color: var(--fg); border-radius: 2px; }
@media (max-width: 50rem) { .search-open span, .search-open kbd { display: none; } }
@media (max-width: 72rem) { .toc { display: none; } }
@media (max-width: 50rem) {
  .sidebar { flex-basis: 100%; border-bottom: 1px solid var(--line); }
  .nav-collapsed .sidebar { display: none; }
}
@media (min-width: 50.01rem) { .nav-toggle { display: none; } }
@media (max-width: 50rem) { .site-nav { display: none; } }
