/* Light, minimalist theme inspired by Government of Canada web design
   conventions (restrained red accent, deep navy ink, generous whitespace) —
   an independent stylistic homage, not official branding. Palette values
   sourced from a validated accessible palette; see chart-loader.js for the
   matching categorical series colors. */

:root {
  color-scheme: light;
  --bg: #f9f9f7;
  --surface: #ffffff;
  --text: #0b0b0b;
  --text-secondary: #52514e;
  --muted: #898781;
  --border: #e1e0d9;
  --border-strong: #c3c2b7;
  --link: #184f95;
  --link-hover: #0d366b;
  --accent-red: #a4243b;
  --navy: #0d366b;
  --focus: #184f95;

  --status-good-bg: rgba(12, 163, 12, 0.12);
  --status-good-text: #0a6b0a;
  --status-warning-bg: rgba(250, 178, 25, 0.20);
  --status-warning-text: #8a5a00;
  --status-critical-bg: rgba(208, 59, 59, 0.12);
  --status-critical-text: #a12626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
  border-radius: 0 0 6px 0;
}
.skip-link:focus {
  left: 0;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

h1, h2, h3 {
  color: var(--navy);
  font-weight: 700;
  line-height: 1.25;
}
h1 { font-size: 1.9rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.3rem; margin-top: 0; }
h3 { font-size: 1.05rem; margin-top: 0; }

/* --- Header --- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-accent {
  height: 3px;
  background: var(--accent-red);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-title { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.brand-subtitle { font-size: 0.78rem; color: var(--muted); }

.mode-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.1rem;
  font-size: 0.92rem;
}
.mode-nav a {
  color: var(--text-secondary);
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
}
.mode-nav a:hover {
  color: var(--navy);
  text-decoration: none;
  border-bottom-color: var(--accent-red);
}
.mode-nav .mode-learn {
  color: var(--navy);
  font-weight: 600;
}
.mode-divider {
  width: 1px;
  height: 1.1rem;
  background: var(--border-strong);
}

/* --- Layout --- */

.site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.explainer { color: var(--text-secondary); font-size: 0.95rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.stage-flow {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: stretch;
}
.stage-flow .stage {
  flex: 1 1 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--navy);
  border-radius: 8px;
  padding: 1.1rem;
}

/* --- Tables --- */

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--border); }
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
tbody tr:hover { background: var(--bg); }

/* --- Status badges (icon-free; label text always carries the meaning) --- */

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-ok { background: var(--status-good-bg); color: var(--status-good-text); }
.badge-stale { background: var(--status-warning-bg); color: var(--status-warning-text); }
.badge-failed { background: var(--status-critical-bg); color: var(--status-critical-text); }

/* --- Footer --- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}
.run-timestamp { color: var(--text-secondary); font-size: 0.85rem; margin: 0 0 0.4rem; }
.footer-disclaimer { color: var(--muted); font-size: 0.78rem; margin: 0; }
