/* Civiq architecture docs — shared stylesheet. No external fonts or CDNs. */

:root {
  --ink: #1c2733;
  --ink-soft: #46586b;
  --ink-faint: #7b8a99;
  --accent: #2f6db5;
  --accent-soft: #e8f0f9;
  --surface: #ffffff;
  --surface-alt: #f6f8fa;
  --border: #d9e0e7;
  --code-bg: #f2f4f7;
  --warn-bg: #fdf6e3;
  --warn-border: #e4d5a6;
  --max-width: 60.5rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1.0rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface);
}

/* Header + navigation */

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 1.25rem 0.45rem;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.brand {
  font-weight: 650;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
}

.brand a { color: var(--ink); text-decoration: none; }
.brand span { color: var(--ink-faint); font-weight: 400; margin-left: 0.35rem; }

nav {
  margin-top: 0.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.2rem;
  font-size: 0.86rem;
}

nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.14rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

nav a:hover { background: var(--surface-alt); color: var(--ink); }
nav a.current { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* Content */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.8rem 1.25rem 4rem;
}

h1 { font-size: 1.72rem; line-height: 1.25; margin: 0.4rem 0 0.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.28rem; margin: 2.4rem 0 0.6rem; letter-spacing: -0.005em; }
h3 { font-size: 1.05rem; margin: 1.8rem 0 0.4rem; }

h2, h3 { scroll-margin-top: 5.5rem; }

p { margin: 0.75rem 0; }

.lede {
  font-size: 1.08rem;
  color: var(--ink-soft);
  margin: 0.2rem 0 1.4rem;
}

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

code, pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
}

code {
  background: var(--code-bg);
  padding: 0.1em 0.36em;
  border-radius: 4px;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
  line-height: 1.5;
}

pre code { background: none; padding: 0; }

/* Diagrams */

figure {
  margin: 1.4rem 0 1.8rem;
  padding: 1.1rem 1rem 0.75rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
}

figure img { max-width: 100%; height: auto; }

figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
  text-align: center;
}

/* Tables */

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0 1.5rem;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--surface-alt);
  font-weight: 600;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}

tbody tr:hover { background: #fafbfc; }

td code, th code { white-space: nowrap; }
td.wrap code { white-space: normal; }

.method {
  display: inline-block;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
}

.method.post { background: #e7f4ec; color: #23744a; }
.method.put { background: #fbf0e0; color: #9a6519; }
.method.delete { background: #fbe9e9; color: #b13a3a; }

/* Callouts */

.note {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  margin: 1rem 0;
  font-size: 0.93rem;
}

.note strong { font-weight: 650; }

/* Page-map cards on the index */

.doc-map {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.8rem;
  margin: 1.4rem 0 2rem;
  padding: 0;
  list-style: none;
}

.doc-map li {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: var(--surface);
}

.doc-map a { font-weight: 620; text-decoration: none; }
.doc-map p { margin: 0.3rem 0 0; font-size: 0.87rem; color: var(--ink-soft); }

/* Footer */

footer {
  border-top: 1px solid var(--border);
  padding: 1.1rem 1.25rem 2.2rem;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

footer .footer-inner { max-width: var(--max-width); margin: 0 auto; }

@media print {
  header { position: static; }
  nav { display: none; }
}
