/* style.css -- shared by every page in site/. Colours are set once here,
   with a second set for phones/computers in dark mode. */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #16181d;
  --muted: #5f6672;
  --line: #dde1e7;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --good: #1a7f37;
  --bad: #c62828;
  --code-bg: #eef1f5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --card: #181b21;
    --text: #e6e8eb;
    --muted: #9aa3ae;
    --line: #2c313a;
    --accent: #4c8dff;
    --accent-text: #0f1115;
    --good: #4cc56b;
    --bad: #ff6b6b;
    --code-bg: #20242c;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* keeps hidden buttons hidden despite the button styles below */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); }
main { max-width: 1000px; margin: 0 auto; padding: 16px; }

/* Top bar with the links between pages */
header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
header .bar {
  max-width: 1000px; margin: 0 auto; padding: 10px 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
}
header .name { font-weight: 700; margin-right: auto; }
header nav a { text-decoration: none; color: var(--muted); margin-left: 14px; }
header nav a.here { color: var(--text); font-weight: 600; }

h1 { font-size: 22px; margin: 8px 0 4px; }
h2 { font-size: 17px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin: 16px 0;
}

/* Big numbers on the homepage */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 22px; font-weight: 650; overflow-wrap: anywhere; }
.stat.wide { grid-column: span 2; }
.stat .value.time { font-size: 18px; white-space: nowrap; overflow-wrap: normal; }
@media (max-width: 360px) { .stat .value.time { font-size: 15px; } }

/* "Back to top" button: bottom-right corner, appears once you scroll down */
#toTop {
  position: fixed; right: 16px; bottom: 16px; z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

/* Forms */
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
input[type=text], input[type=number], input[type=search], select {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
}
input[type=search], input.wide { flex: 1 1 220px; min-width: 0; }
input[type=number] { width: 7em; }
button, .button {
  font: inherit; cursor: pointer; text-decoration: none; display: inline-block;
  background: var(--accent); color: var(--accent-text);
  border: 0; border-radius: 8px; padding: 7px 14px;
}
button.plain, .button.plain { background: transparent; color: var(--accent); border: 1px solid var(--line); }
button:disabled { opacity: .5; cursor: default; }
label { white-space: nowrap; }

/* Tables scroll sideways inside their card on narrow phones,
   instead of making the whole page scroll. */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.mono, code, pre { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.key { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; background: var(--code-bg); padding: 8px 10px; border-radius: 8px; }
pre { background: var(--code-bg); padding: 10px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }

.pill { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.good { color: var(--good); }
.bad { color: var(--bad); }

/* Details list on the person page */
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  dl.facts { grid-template-columns: 1fr; }
  dl.facts dd { margin-bottom: 8px; }
}

.advert-frame { width: 100%; min-height: 240px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.advert-img { max-width: 100%; height: auto; border-radius: 8px; }

.pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 12px; }

#qr { background: #fff; padding: 12px; border-radius: 12px; display: inline-block; }
#qr svg { width: min(80vw, 360px); height: auto; display: block; }
.center { text-align: center; }
