/* The docs site: the fonts and the accent of the pages (src/Papyr.Server/wwwroot/css/app.css), with softer borders and
   a tint for the current page. */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f4f5f7;
  --text: #1c1e21;
  --muted: #5f6672;
  --border: #e3e6ea;
  --accent: #2557d6;
  --accent-soft: #e8eefc;
  --slogan-end: #e35a2e;
  --code-bg: #f6f8fa;
  --bar: 3.75rem;
  --anchor-offset: 5rem;
  --measure: 46rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1f2226;
    --text: #e6e8eb;
    --muted: #9aa2ae;
    --border: #2c3036;
    --accent: #6c93f5;
    --accent-soft: #1e2a47;
    --slogan-end: #ff7a59;
    --code-bg: #1b1e22;
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: var(--anchor-offset); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.15em; }

.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1.25rem;
  height: var(--bar); padding: 0 1.5rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--text); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; }
.tagline { color: var(--muted); font-size: 0.9rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tagline + .top-link { margin-left: auto; }
.top-link { color: var(--muted); font-size: 0.92rem; font-weight: 500; }
.top-link:hover { color: var(--text); text-decoration: none; }

.frame { display: grid; grid-template-columns: 15rem minmax(0, 1fr) 14rem; max-width: 88rem; margin: 0 auto; }
.side, .toc { position: sticky; top: var(--bar); align-self: start; max-height: calc(100vh - var(--bar)); overflow-y: auto; padding: 1.75rem 1rem 2rem 1.5rem; font-size: 0.9rem; }
.side summary { display: none; }
.side .group, .toc p { color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.side .group { margin: 1.4rem 0 0.35rem; }
.side .group:first-of-type { margin-top: 0; }
.side ul, .toc ul { list-style: none; margin: 0; padding: 0; }
.side li a { display: block; padding: 0.28rem 0.7rem; margin-left: -0.7rem; border-radius: 6px; color: var(--text); }
.side li a:hover { background: var(--surface); text-decoration: none; }
.side li a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side li a span { color: var(--muted); font-size: 0.8em; }
.toc { padding-left: 1rem; }
.toc p { margin: 0 0 0.5rem; }
.toc a { display: block; padding: 0.2rem 0 0.2rem 0.75rem; border-left: 2px solid var(--border); color: var(--muted); line-height: 1.4; }
.toc a.sub { padding-left: 1.5rem; font-size: 0.85em; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.here { border-left-color: var(--accent); color: var(--accent); }

.content { padding: 2.25rem 2.5rem 3rem; min-width: 0; }
article { max-width: var(--measure); }
article > :first-child { margin-top: 0; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.015em; scroll-margin-top: var(--anchor-offset); }
h1 { font-size: 2.3rem; margin: 0 0 1.25rem; letter-spacing: -0.025em; }
h1::after { content: ""; display: block; width: 3rem; height: 4px; margin-top: 0.9rem; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--slogan-end)); }
h2 { font-size: 1.5rem; margin: 2.75rem 0 0.85rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
h3 { font-size: 1.18rem; margin: 2rem 0 0.6rem; }
h4 { font-size: 1rem; margin: 1.5rem 0 0.5rem; }
.anchor { margin-left: 0.4rem; color: var(--border); font-weight: 400; opacity: 0; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; text-decoration: none; }
p, ul, ol, table, pre, blockquote { margin: 0 0 1.1rem; }
li { margin: 0.25rem 0; }
li > ul, li > ol { margin: 0.25rem 0 0; }
strong { font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
blockquote { margin-left: 0; padding: 0.75rem 1rem; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 8px 8px 0; color: var(--muted); }
blockquote > :last-child { margin-bottom: 0; }

code { font-family: var(--mono); font-size: 0.86em; padding: 0.12em 0.35em; border-radius: 5px; background: var(--surface); }
pre, .highlight { background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; }
pre { padding: 1rem 1.15rem; overflow-x: auto; line-height: 1.5; font-size: 0.86rem; }
.highlight { margin: 0 0 1.1rem; }
.highlight pre { margin: 0; border: 0; background: none; }
pre code { padding: 0; background: none; font-size: inherit; }

table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { border-bottom-width: 2px; font-weight: 650; white-space: nowrap; }
tbody tr:hover { background: var(--surface); }

.foot { display: flex; justify-content: space-between; gap: 1rem; max-width: var(--measure); margin-top: 3.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.88rem; }

/* Rouge's token classes */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cp { color: #6a737d; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kr, .highlight .kt, .highlight .kc, .highlight .nt { color: #cf222e; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sh, .highlight .se, .highlight .sx { color: #0a3069; }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .il { color: #0550ae; }
.highlight .nf, .highlight .fm, .highlight .nc, .highlight .nn { color: #8250df; }
.highlight .na, .highlight .nb, .highlight .bp, .highlight .nv, .highlight .vg, .highlight .vi { color: #953800; }
.highlight .o, .highlight .ow { color: #cf222e; }
@media (prefers-color-scheme: dark) {
  .highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cp { color: #8b949e; }
  .highlight .k, .highlight .kd, .highlight .kn, .highlight .kr, .highlight .kt, .highlight .kc, .highlight .nt, .highlight .o, .highlight .ow { color: #ff7b72; }
  .highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sh, .highlight .se, .highlight .sx { color: #a5d6ff; }
  .highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .il { color: #79c0ff; }
  .highlight .nf, .highlight .fm, .highlight .nc, .highlight .nn { color: #d2a8ff; }
  .highlight .na, .highlight .nb, .highlight .bp, .highlight .nv, .highlight .vg, .highlight .vi { color: #ffa657; }
}

/* Narrower screens: no outline, then the contents above the page */
@media (max-width: 75rem) {
  .frame { grid-template-columns: 14rem minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 52rem) {
  .tagline { display: none; }
  .top { padding: 0 1rem; }
  .frame { display: block; }
  .side { position: static; max-height: none; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
  .side summary { display: list-item; cursor: pointer; font-weight: 600; }
  .side details:not([open]) .group, .side details:not([open]) ul { display: none; }
  .content { padding: 1.5rem 1.15rem 2.5rem; }
  h1 { font-size: 1.85rem; }
}
