/* ------------------------------------------------------------------ *
 * Styling for nginx's generated directory listings.
 *
 * nginx emits a bare <html><h1>Index of ...</h1><pre>...</pre>, with no
 * stylesheet of its own. A sub_filter injects a link to this file, which
 * gives those pages the site's typography and dark mode.
 * ------------------------------------------------------------------ */
:root
{
  color-scheme: light dark;
  --bg:      #ffffff;
  --text:    #000000;
  --link:    #898989;
  --title:   #000000;
  --rule:    #e6e6e6;
  --muted:   #666666;
  --accent:  #006600;
}

@media (prefers-color-scheme: dark)
{
  :root
  {
    --bg:      #14161a;
    --text:    #d7dade;
    --link:    #aab2bb;
    --title:   #e9ecef;
    --rule:    #39404a;
    --muted:   #8b9198;
    --accent:  #7ec27e;
  }
}

html {background: var(--bg);}

body
{
  background: var(--bg);
  color: var(--text);
  font-family: "Bitstream Vera Sans", Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
  padding: 2em 1.5em 3em 1.5em;
  max-width: 980px;
}

h1
{
  font-size: 15px;
  font-weight: normal;
  color: var(--title);
  margin: 0 0 .9em 0;
  padding-bottom: .5em;
  border-bottom: 1px solid var(--rule);
}

hr {display: none;}

pre
{
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
  white-space: pre;
  overflow-x: auto;
}

pre a
{
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

pre a:hover
{
  color: var(--title);
  border-bottom-color: var(--accent);
}

/* the parent-directory link reads as navigation rather than content */
pre a[href="../"] {color: var(--muted);}

@media (max-width: 600px)
{
  body {padding: 1.5em 1em 3em 1em; font-size: 11px;}
  pre  {font-size: 11px;}
}
