/* ═══════════════════════════════════════════════════
   REGENTRIBES ADRs — Pure B/W Minimal
   Dark: pure black bg, white text, gray borders
   Light: white bg, dark text, light gray borders
   ═══════════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
body { line-height: 1.7; }

/* ── Theme vars ── */
:root {
  --bg: #000000;
  --text: #888888;
  --heading: #ffffff;
  --muted: #555555;
  --border: #222222;
  --code-bg: #0a0a0a;
  --nav-h: 52px;
}

body.light {
  --bg: #ffffff;
  --text: #333333;
  --heading: #000000;
  --muted: #888888;
  --border: #e0e0e0;
  --code-bg: #f5f5f5;
}

/* ── Base ── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Site header ── */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}

header.site-header .container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

header.site-header h1 {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
  color: var(--heading);
  letter-spacing: 0.02em;
}

header.site-header h1 a { color: var(--heading); text-decoration: none; }
header.site-header h1 a:hover { color: var(--text); }

header.site-header p {
  color: var(--muted);
  margin: 2px 0 0;
  font-size: 0.75rem;
}

/* Nav links in header */
header.site-header nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
header.site-header nav a {
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 3px;
}
header.site-header nav a:hover { color: var(--heading); }

/* Theme toggle — inline in header */
#theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 1rem;
  width: 32px;
  height: 28px;
  border-radius: 3px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}
#theme-toggle:hover { color: var(--heading); border-color: var(--muted); }

/* ── Main ── */
main.container {
  flex: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 2.5rem 4rem;
  width: 100%;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  color: var(--heading);
  font-weight: 600;
  line-height: 1.3;
  margin: 2rem 0 0.75rem;
}
h1 { font-size: 1.75rem; margin-top: 0; }
h2 { font-size: 1.25rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
h3 { font-size: 1.05rem; }

p { margin: 0.75rem 0; }

a { color: var(--muted); text-decoration: underline; }
a:hover { color: var(--heading); }

hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* Lists */
ul, ol { padding-left: 1.75rem; margin: 0.75rem 0; }
li { margin-bottom: 0.35rem; }
li > ul, li > ol { margin-top: 0.35rem; margin-bottom: 0; }

/* Blockquote */
blockquote {
  border-left: 2px solid var(--border);
  margin: 1.25rem 0;
  padding: 0.5rem 1.5rem;
  color: var(--muted);
  font-style: italic;
}

/* ── Code ── */
code {
  background: var(--code-bg);
  color: var(--text);
  padding: 2px 6px;
  font-size: 0.85em;
  border-radius: 3px;
  font-family: 'Courier New', Courier, monospace;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-size: 0.85em;
  line-height: 1.6;
  border-radius: 3px;
  margin: 1.25rem 0;
}
pre code { background: transparent; color: inherit; padding: 0; }

/* ── Tables ── */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.75rem 0;
  font-size: 0.88rem;
  border: 1px solid var(--border);
}

th {
  background: var(--bg);
  color: var(--heading);
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

td {
  padding: 12px 16px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg);
  vertical-align: top;
}

/* ── ADR content ── */
.adr-article { max-width: 800px; }

.adr-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.adr-title-heading { font-size: 1.6rem; margin: 0 0 0.5rem; color: var(--heading); }

.adr-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.adr-meta strong { color: var(--text); }

.adr-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 0.5rem; }

/* Tags */
.tag {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 2px 8px;
  font-size: 0.72em;
  font-family: 'Courier New', Courier, monospace;
  border-radius: 3px;
}

/* Status badges */
.status {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.72em;
  font-weight: 600;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.status.accepted { background: var(--heading); color: var(--bg); }
.status.proposed { border: 1px solid var(--muted); color: var(--muted); }
.status.deprecated, .status.rejected { border: 1px solid var(--muted); color: var(--muted); text-decoration: line-through; }
.status.superseded { border: 1px solid var(--border); color: var(--muted); }

/* Nav */
.adr-nav {
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 2rem 0;
}
.adr-nav a { color: var(--muted); font-weight: 500; }
.adr-nav a:hover { color: var(--heading); }

/* ADR index table rows */
.adr-table-section { overflow-x: auto; margin: 1.5rem 0; }

/* Section content */
.section h1, .section h2, .section h3 { margin-top: 1.5rem; }
.section p { margin: 0.7rem 0; }
.section ul, .section ol { padding-left: 1.5rem; margin: 0.5rem 0; }
.section li { margin-bottom: 0.3rem; }

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.78rem;
  padding: 1.25rem 2rem;
  text-align: center;
}
.site-footer a { color: var(--muted); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Responsive ── */
@media (max-width: 640px) {
  header.site-header { height: auto; }
  header.site-header .container { flex-wrap: wrap; padding: 0 1rem; height: auto; min-height: var(--nav-h); }
  header.site-header nav { flex-direction: column; align-items: flex-start; }
  header.site-header nav a { padding: 6px 0; }
  #theme-toggle { margin-left: 0; }
  main.container { padding: 2rem 1rem 3rem; }
  th, td { padding: 10px 12px; }
  .adr-meta { flex-direction: column; align-items: flex-start; gap: 4px; }
}