/* git.virtualshack.io — stagit pages in the virtualshack palette.
 *
 * Tokens and rules from STYLE.md: neutral text and headings, virtualshack accents (cyan links,
 * pink hover/focus, blue-purple focus rings), links never underlined, dark-first with a light
 * scheme. Diff colours stay functional (added / removed). Selectors follow stagit 1.3's
 * markup (ids: #content #blob #log #files #index #branches #tags; classes: .desc .url .num
 * .line .h .i .d .A .D). stagit emits no inline styles, which is what lets the vhost's CSP
 * be style-src 'self'.
 */

:root {
  --bg: #212121;
  --fg: #dadada;
  --link: #22d3ee;
  --hover: #ff79c6;
  --focus: #9b8cff;
  --panel: #2b2b2b;
  --rule: #424242;
  --muted: #8b949e;
  --add: #3ddc97;
  --del: #ff5370;
  --hunk: #9b8cff;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafafa;
    --fg: #212121;
    --link: #0e7490;
    --hover: #c2185b;
    --focus: #5b4fe0;
    --panel: #efefef;
    --rule: #d5d5d5;
    --muted: #5c6570;
    --add: #0f7a4d;
    --del: #c62828;
    --hunk: #5b4fe0;
  }
}

html { color-scheme: dark light; }

body {
  margin: 0 auto;
  max-width: 1100px;
  padding: 20px 16px 48px;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.55 ui-monospace, Menlo, Consolas, monospace;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--link); text-decoration: none; transition: color .15s ease; }
a:hover, a:focus { color: var(--hover); text-decoration: none; }
a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
a:target { background: var(--panel); outline: 1px solid var(--focus); }

h1, h2, h3, h4, h5, h6 { font-size: 1em; margin: 0; }
h1 { font-size: 1.25em; }
h2 { margin: 1.5em 0 .5em; }
img, h1, h2 { vertical-align: middle; }
img { border: 0; }

hr { border: 0; border-top: 1px solid var(--rule); height: 1px; margin: 12px 0; }

.desc { color: var(--muted); }
tr.url td { color: var(--muted); padding-top: 4px; }

table td { padding: 1px .5em; }
table thead td { font-weight: bold; color: var(--muted); }
td.num { text-align: right; }

/* Wide tables and file views scroll inside their own box; the page itself never scrolls
   sideways on a phone. */
#content { overflow-x: auto; }
#content table td { vertical-align: top; white-space: nowrap; }
#index tr td:nth-child(2),
#tags tr td:nth-child(3),
#branches tr td:nth-child(3),
#log tr td:nth-child(2) { white-space: normal; }

#branches tr:hover td,
#tags tr:hover td,
#index tr:hover td,
#log tr:hover td,
#files tr:hover td { background: var(--panel); }

pre {
  font-family: inherit;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 10px 12px;
  overflow-x: auto;
  tab-size: 4;
}

a.d, a.h, a.i, a.line { text-decoration: none; }
#blob a { color: var(--muted); }
#blob a:hover { color: var(--link); }

pre a.h { color: var(--hunk); }
.A, span.i, pre a.i { color: var(--add); }
.D, span.d, pre a.d { color: var(--del); }
pre a.h:hover, pre a.i:hover, pre a.d:hover { text-decoration: none; }

code {
  background: var(--panel);
  padding: 1px 5px;
  border-radius: 3px;
  word-break: break-all;
}
