/*
 * Theming: colors are CSS variables. The theme is picked by the data-theme
 * attribute on <html> (set from the THEME env var); dark mode follows the
 * browser/OS preference automatically.
 */

/* Default theme (release) */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #212121;
  --accent-bar: #90a4ae;
  --link: #6200ea;
  --row-hover: #eeeeee;
  --row-border: rgba(0, 0, 0, 0.075);
  --head-border: rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #212121;
    --fg: #eeeeee;
    --accent-bar: #424242;
    --link: #82b1ff;
    --row-hover: #424242;
    --row-border: rgba(255, 255, 255, 0.2);
    --head-border: rgba(255, 255, 255, 0.3);
  }
}

/* Dragonslair theme: purple accents */
:root[data-theme="dragonslair"] {
  --bg: #fcfaff;
  --fg: #221a2e;
  --accent-bar: #7e57c2;
  --link: #6a1b9a;
  --row-hover: #f1e8fb;
  --row-border: rgba(94, 53, 177, 0.12);
  --head-border: rgba(94, 53, 177, 0.25);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="dragonslair"] {
    --bg: #1b1624;
    --fg: #ece6f5;
    --accent-bar: #5e35b1;
    --link: #ce93d8;
    --row-hover: #2e2440;
    --row-border: rgba(206, 147, 216, 0.18);
    --head-border: rgba(206, 147, 216, 0.3);
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background-color: var(--bg);
  color: var(--fg);
  font-size: 16px;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
}

body {
  min-height: 100vh;
  border-top: 0.5rem solid var(--accent-bar);
  border-bottom: 0.5rem solid var(--accent-bar);
}

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

a:hover {
  border-bottom: 1px solid currentColor;
}

main {
  margin: 0 auto;
  padding: 2rem 1rem;
  max-width: 56rem;
}

.title {
  font-size: 1.25rem;
  font-weight: 500;
  margin: 2rem 0;
}

.title .js-path a {
  padding: 0 0.25rem 0;
  text-decoration: none;
}

footer,
address {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  opacity: 0.875;
}

/* Directory listing table */
table {
  text-align: left;
  white-space: nowrap;
  border-collapse: collapse;
}

table tr {
  padding: 0 0.25rem;
  border-bottom: 1px solid var(--row-border);
}

table tr:hover {
  background-color: var(--row-hover);
}

table tr.indexhead {
  border-bottom-color: var(--head-border);
}

table tr.indexhead,
table tr.indexhead:hover {
  background-color: transparent;
}

table tr.indexhead a {
  font-weight: normal;
  font-size: 0.875rem;
}

table tr .indexcolname {
  width: 100%;
}

table tr .indexcolicon a {
  border: none;
}

table tr .indexcolname a,
table tr .indexcollastmod a,
table tr .indexcolsize a {
  border-bottom: 1px solid transparent;
}

table tr .indexcolname a:hover,
table tr .indexcollastmod a:hover,
table tr .indexcolsize a:hover {
  border-bottom: 1px solid currentColor;
}

table tr.even-parentdir a {
  font-weight: 500;
}

table tr .indexcollastmod,
table tr .indexcolsize {
  padding: 0.5rem 1.5rem;
  font-size: 0.875rem;
}

table th,
table td {
  padding: 0.375rem;
}

table tr .indexcolsize {
  text-align: right;
}

table tr .indexcolicon img {
  width: 2rem;
}
