/* Bitcoin network entities website. */

/* The light palette is the base. The dark one is redefined twice: once for
   readers on a dark system that have not chosen, and once for readers who
   picked dark with the toggle. */
:root {
  --bg: #fdfdfd;
  --fg: #1c2024;
  --muted: #5c6670;
  --accent: #11607d;
  --border: #dde1e5;
  --surface: #f2f4f6;
  --active: #1e7a46;
  --inactive: #b23a34;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171a;
    --fg: #e7eaed;
    --muted: #98a1aa;
    --accent: #6cc0dd;
    --border: #2a2f35;
    --surface: #1d2126;
    --active: #5ec47f;
    --inactive: #e58a80;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14171a;
  --fg: #e7eaed;
  --muted: #98a1aa;
  --accent: #6cc0dd;
  --border: #2a2f35;
  --surface: #1d2126;
  --active: #5ec47f;
  --inactive: #e58a80;
  color-scheme: dark;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.55 system-ui, sans-serif;
}
header, main, footer { max-width: 64rem; margin: 0 auto; padding: 0 1rem; }
header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.3rem 1.5rem;
  padding: 1.4rem 1rem 0.7rem;
  border-bottom: 1px solid var(--border);
}
.brand { margin: 0; font-size: 1.6rem; font-weight: 600; letter-spacing: -0.015em; }
.brand a { color: var(--fg); text-decoration: none; }
header nav { display: flex; align-items: baseline; gap: 1.2rem; font-size: 0.88rem; }
header nav a { color: var(--muted); text-decoration: none; }
header nav a:hover { color: var(--accent); }
.theme-toggle {
  font: inherit;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); }
main { padding-top: 1rem; padding-bottom: 3rem; }
footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.4rem;
  border-top: 1px solid var(--border);
  padding: 1rem;
  font-size: 0.88rem;
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--accent); }

h1 { font-size: 2rem; margin: 1rem 0 0.4rem; line-height: 1.2; }
h2 { font-size: 1.3rem; margin: 2rem 0 0.6rem; padding-bottom: 0.2rem; border-bottom: 1px solid var(--border); }
a { color: var(--accent); }
.lead { font-size: 1.1rem; }
.muted, .meta { color: var(--muted); }
.warning { border-left: 4px solid var(--accent); padding: 0.5rem 0.8rem; background: var(--surface); }

code, pre { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.92em; }
code { background: var(--surface); padding: 0.05em 0.3em; border-radius: 3px; }
pre { background: var(--surface); padding: 0.8rem 1rem; overflow-x: auto; border-radius: 4px; }
pre code { background: none; padding: 0; }

.tag {
  display: inline-block;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  padding: 0.05em 0.35em;
  background: var(--surface);
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
a.tag:hover { background: var(--accent); color: var(--bg); }
.status { font-weight: 700; text-transform: uppercase; font-size: 0.78rem; }
.status.active { color: var(--active); }
.status.inactive { color: var(--inactive); }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface); font-size: 0.8rem; text-transform: uppercase; color: var(--muted); }
.num { text-align: right; }
td code { white-space: nowrap; }

/* The references trail the description, with no heading of their own. */
.references { margin: 0.9rem 0 0; }
.references li { margin-bottom: 0.15rem; }

/* One card per entity on the index. The whole card is clickable through the
   overlay on the name link; the tags stay above it so they keep their own
   destination. */
.entities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(28rem, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}
.entity {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.entity:hover { border-color: var(--accent); }
.entity p { margin: 0; }
.entity h3 { margin: 0; font-size: 1.05rem; }
.entity h3 a { color: var(--fg); text-decoration: none; }
.entity h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 4px; }
.entity:hover h3 a { color: var(--accent); }
.entity h3 a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }
.entity .chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: auto; padding-top: 0.15rem; }
.entity .tag { position: relative; z-index: 1; }

/* Banlist generator */
.toggles { margin: 0.6rem 0; }
.toggle { display: block; padding: 0.15rem 0; cursor: pointer; }
.toggle input { margin-right: 0.4rem; }
td .toggle { padding: 0; }

.controls { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: center; }
.controls label { color: var(--muted); font-size: 0.9rem; }
button, select, input[type="number"] {
  font: inherit;
  font-size: 0.92rem;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.15rem 0.4rem;
}
button { cursor: pointer; }
button:hover:not(:disabled), select:hover { border-color: var(--accent); }
button:disabled, input:disabled { color: var(--muted); cursor: default; }
input[type="number"] { width: 5rem; }
