/* The Go doc pages (doc2go output) under /godoc/, in the wiki's look. The
   wiki-fetcher links this file into every page after doc2go's own main.css
   when it unpacks a version, so a change here restyles every published
   version. Tokens: css/general.css (dark default, light by data-theme). */
:root {
  --c-page: 255 255 255;
  --c-surface: 250 250 250;
  --c-raised: 244 244 245;
  --c-line: 228 228 231;
  --c-line-strong: 212 212 216;
  --c-fg: 24 24 27;
  --c-fg-muted: 82 82 91;
  --c-fg-subtle: 113 113 122;
  --c-accent: 21 128 61;
  --c-accent-hover: 22 101 52;
  --c-k: 185 28 28;
  --c-s: 29 78 216;
  --c-n: 126 34 206;
  --c-c: 113 113 122;
  --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --c-page: 9 9 11;
  --c-surface: 24 24 27;
  --c-raised: 39 39 42;
  --c-line: 39 39 42;
  --c-line-strong: 63 63 70;
  --c-fg: 250 250 250;
  --c-fg-muted: 161 161 170;
  --c-fg-subtle: 113 113 122;
  --c-accent: 74 222 128;
  --c-accent-hover: 134 239 172;
  --c-k: 248 113 113;
  --c-s: 147 197 253;
  --c-n: 216 180 254;
  --c-c: 113 113 122;
  color-scheme: dark;
}

html { background: rgb(var(--c-page)); }

body {
  margin: 0 auto;
  padding: 0 1rem 2rem;
  max-width: 64rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: rgb(var(--c-fg));
  background: rgb(var(--c-page));
}

h1, h2, h3, h4, h5, h6 {
  color: rgb(var(--c-fg));
  font-weight: 600;
  line-height: 1.3;
  margin-top: 1.6em;
  margin-bottom: .5em;
}
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; padding-bottom: .3rem; border-bottom: 1px solid rgb(var(--c-line)); }
h4 { font-size: 1.05rem; font-family: var(--font-mono); }

a { color: rgb(var(--c-accent)); text-decoration: none; }
a:hover { color: rgb(var(--c-accent-hover)); text-decoration: underline; }
a.permalink { color: rgb(var(--c-fg-subtle)); }

code, kbd, pre { font-family: var(--font-mono); }
code {
  font-size: .9em;
  padding: .1em .3em;
  border-radius: 4px;
  background: rgb(var(--c-raised));
}
pre {
  color: rgb(var(--c-fg));
  background: rgb(var(--c-surface));
  border: 1px solid rgb(var(--c-line));
  border-radius: 8px;
  padding: .8rem 1rem;
  font-size: .875rem;
  line-height: 1.5;
  tab-size: 4;
}
pre code { padding: 0; background: none; }

/* The page bar: doc2go's breadcrumb, plus godoc.js's logo and tools */
body > nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .75rem;
  margin: 0 -1rem 1rem;
  padding: .6rem 1rem;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: .9rem;
  color: rgb(var(--c-fg-muted));
  background: rgb(var(--c-page) / .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgb(var(--c-line));
}
body > nav .navbar-right { margin-left: 0; color: rgb(var(--c-fg-subtle)); }
body > nav .ttg-godoc-logo {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  border-radius: 4px;
}
.ttg-godoc-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-left: auto;
  font-family: var(--font-sans);
  font-size: .875rem;
  white-space: nowrap;
}
.ttg-godoc-bar a { color: rgb(var(--c-fg-muted)); }
.ttg-godoc-bar a:hover { color: rgb(var(--c-accent)); text-decoration: none; }
.ttg-godoc-bar select,
.ttg-godoc-bar .ttg-godoc-theme,
.ttg-godoc-bar .ttg-godoc-version {
  font: inherit;
  font-family: var(--font-mono);
  color: rgb(var(--c-fg));
  background: rgb(var(--c-surface));
  border: 1px solid rgb(var(--c-line-strong));
  border-radius: 6px;
  padding: .1rem .45rem;
}
.ttg-godoc-bar .ttg-godoc-theme { cursor: pointer; line-height: 1.4; }
@media (max-width: 640px) {
  .ttg-godoc-bar .ttg-godoc-wiki-label { display: none; }
  body > nav .navbar-right { display: none; }
}

#pkg-index + ul li, #pkg-examples + ul li { font-family: var(--font-mono); font-size: .875rem; }
#pkg-index + ul ul { padding-left: 1.25rem; }

details.example > summary { color: rgb(var(--c-accent)); }
span.deprecated-tag { color: rgb(var(--c-page)); background: rgb(var(--c-fg-subtle)); }
#generated-by-footer { margin-top: 3rem; color: rgb(var(--c-fg-subtle)); }

table { border-collapse: collapse; }
th, td { padding: .3rem .6rem; border: 1px solid rgb(var(--c-line)); }

/* Syntax colours (doc2go's chroma classes), both themes */
.bg, .chroma { background: transparent; color: rgb(var(--c-fg)); }
.chroma .k, .chroma .kc, .chroma .kd, .chroma .kn, .chroma .kp, .chroma .kr, .chroma .kt { color: rgb(var(--c-k)); }
.chroma .s, .chroma .sa, .chroma .sb, .chroma .sc, .chroma .dl, .chroma .sd, .chroma .s2, .chroma .se,
.chroma .sh, .chroma .si, .chroma .sx, .chroma .sr, .chroma .s1, .chroma .ss,
.chroma .m, .chroma .mb, .chroma .mf, .chroma .mh, .chroma .mi, .chroma .il, .chroma .mo { color: rgb(var(--c-s)); }
.chroma .nf, .chroma .fm, .chroma .nb, .chroma .no, .chroma .nt, .chroma .nd { color: rgb(var(--c-n)); }
.chroma .na, .chroma .nc, .chroma .nn, .chroma .nx, .chroma .p, .chroma .o, .chroma .ow { color: rgb(var(--c-fg)); }
.chroma .c, .chroma .ch, .chroma .cm, .chroma .c1, .chroma .cs, .chroma .cp, .chroma .cpf { color: rgb(var(--c-c)); font-style: italic; }
.chroma a { color: inherit; text-decoration: underline dotted rgb(var(--c-fg-subtle)); }
.chroma a:hover { color: rgb(var(--c-accent)); }
