/* The dark values of the blog's site/assets/css/main.css, always on. Classes
   only, SVG included: the CSP allows no inline style. TestContrast reads the
   custom properties below. */
:root {
  color-scheme: dark;
  --fg: #e3e5e7;
  --muted: #a0a6ab;
  --bg: #17191b;
  --link: #79b8ff;
  --rule: #34383c;
  --panel: #212427;
  --ok: #3fb950;
  --warn: #d29922;
  --bad: #f85149;
  --none: #a0a6ab;
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 72rem;
  padding: 1.5rem 1.25rem 3rem;
  color: var(--fg);
  background: var(--bg);
  font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: var(--link); }

header.site {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}

nav.site { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
nav.site a { text-decoration: none; }
nav.site a:hover { color: var(--fg); }
nav.site a:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 2px; }
nav.site a[aria-current="page"] { color: var(--fg); font-weight: 700; }

main { padding-top: 1.5rem; }

h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 2rem; margin-top: 0; }
h2 { margin: 2rem 0 0.5rem; }
h3 { font-size: 1.0625rem; margin: 0 0 0.5rem; }

.intro, .meta, .label { color: var(--muted); }
.meta { font-size: 0.9375rem; margin: 0.25rem 0; }
.meta.stale { color: var(--warn); }
.label { font-size: 0.875rem; }

/* Wrapping flex rather than a grid: the cards of the last row share its
   width, so no row has a hole whatever the number of cards. */
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}
.cards > * { flex: 1 1 17rem; }

.card, .panel {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem;
  min-width: 0;
}

.panel h2 { margin-top: 0; font-size: 1.25rem; }

.stat, .tile { margin: 0 0 0.5rem; }
.big {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.unit { font-size: 1rem; font-weight: 400; margin-left: 0.2em; color: var(--muted); }
.status { font-weight: 700; white-space: nowrap; }

.big.ok, .status.ok { color: var(--ok); }
.big.warn, .status.warn { color: var(--warn); }
.big.bad, .status.bad { color: var(--bad); }
.big.none, .status.none { color: var(--none); }

/* A panel of stat tiles takes a whole row, so its tiles sit side by side;
   tiles that still wrap share the last row's width, as the cards do. */
.cards > .stats { flex-basis: 100%; }
.tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.tile { flex: 1 1 10rem; }
.tile p { margin: 0; }

.meter, .bars { margin: 0.5rem 0 0.25rem; }
/* Fixed heights: the charts stretch to their card's width (the SVGs have
   preserveAspectRatio="none"), so a wider card gets wider bars, not
   taller ones. */
.meter svg, .bars svg { display: block; width: 100%; }
.meter svg { height: 1.25rem; }
.bars svg { height: 4rem; }

svg rect { fill: var(--link); }
svg rect.track { fill: var(--rule); }
svg rect.ok { fill: var(--ok); }
svg rect.warn { fill: var(--warn); }
svg rect.bad { fill: var(--bad); }
svg rect.none { fill: var(--none); }
svg line.target { stroke: var(--fg); stroke-width: 1; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }

.later { color: var(--muted); }
.later p { margin: 0; }

footer.site {
  margin-top: 3rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
}

@media (max-width: 40rem) {
  .cards > *, .tile { flex-basis: 100%; }
}
