/* scheme-reports.org — Modern stylesheet
   Replaces site.css and site2.css */

/* ── Color tokens ── */
:root {
  --bg: #ffffff;
  --bg-subtle: #f5f6f8;
  --bg-code: #f0f2f4;
  --text: #1a1a1a;
  --text-secondary: #555;
  --border: #d0d4d8;
  --link: #1a5ca0;
  --link-visited: #5b3a8c;
  --link-hover: #0e3d6b;
  --accent: #2a6db5;
  --header-bg: #2b2d42;
  --header-text: #f1f1f1;
  --nav-bg: #f5f6f8;
  --nav-hover: #e2e5ea;
  --nav-active: #dce3ed;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1b26;
    --bg-subtle: #222337;
    --bg-code: #272838;
    --text: #d8dae0;
    --text-secondary: #999;
    --border: #3a3c50;
    --link: #6eb0e6;
    --link-visited: #b89ee6;
    --link-hover: #9ccbf5;
    --accent: #6eb0e6;
    --header-bg: #151621;
    --header-text: #d8dae0;
    --nav-bg: #222337;
    --nav-hover: #2e3048;
    --nav-active: #343660;
  }
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* ── Layout ── */
.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 1.5rem 2rem;
}

.site-header h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

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

.site-header .subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  opacity: 0.75;
  font-weight: 400;
}

.site-nav {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.site-nav li a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.site-nav li a:hover {
  background: var(--nav-hover);
  border-bottom-color: var(--accent);
}

.site-nav li a.active {
  background: var(--nav-active);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

main {
  max-width: 52rem;
  margin: 0 auto;
  padding: 2rem;
}

/* ── Typography ── */
h1, h2, h3, h4 {
  color: var(--text);
  line-height: 1.3;
  margin-top: 1.8rem;
  margin-bottom: 0.6rem;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }

main > h1:first-child,
main > h2:first-child {
  margin-top: 0;
}

p { margin: 0.8rem 0; }

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

/* ── Lists ── */
ul, ol { padding-left: 1.5rem; }

li { margin-bottom: 0.3rem; }

li.main { margin-bottom: 0.5rem; }
li.detail { font-size: 0.9rem; margin-bottom: 0.15rem; }

/* ── Code ── */
code, kbd, tt, samp {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9em;
  background: var(--bg-code);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

pre {
  background: var(--bg-code);
  padding: 1rem 1.2rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.5;
  border: 1px solid var(--border);
  white-space: pre-wrap;
  word-wrap: break-word;
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

/* ── Blockquote ── */
blockquote {
  margin: 1rem 0;
  padding: 0.8rem 1.2rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-style: italic;
}

blockquote p { margin: 0.4rem 0; }

/* ── Tables ── */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
}

th, td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}

th {
  background: var(--bg-subtle);
  font-weight: 600;
}

/* ── Horizontal rules ── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ── Footer ── */
.site-footer {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .site-header { padding: 1rem; }
  .site-header h1 { font-size: 1.3rem; }

  .site-nav { padding: 0; }
  .site-nav ul { flex-wrap: wrap; }
  .site-nav li { flex: 1 1 auto; text-align: center; }
  .site-nav li a {
    padding: 0.65rem 0.5rem;
    font-size: 0.85rem;
  }

  main { padding: 1.2rem 1rem; }
  main { overflow-wrap: break-word; word-break: break-word; }

  h1 { font-size: 1.3rem; }
  h2 { font-size: 1.15rem; }

  blockquote { margin-left: 0; margin-right: 0; padding: 0.6rem 0.8rem; }
  ul, ol { padding-left: 1.2rem; }

  .site-footer { padding: 1rem; }
}

/* ── Charter/document pages (preformatted text) ── */
.document-text {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

/* ── Utility ── */
.text-subtle { color: var(--text-secondary); }
.text-small { font-size: 0.9rem; }
