/* Blitzpanel Standards — house stylesheet for all documents.
   Documents are authored directly as HTML and link this file with:
   <link rel="stylesheet" href="../assets/styles/base.css">
   Readable, printable, light/dark aware. Edit brand colors below. */

:root {
  --bp-fg: #1a1a1a;
  --bp-bg: #ffffff;
  --bp-muted: #5c6773;
  --bp-accent: #2563eb;      /* swap for Blitzpanel brand color */
  --bp-border: #e5e7eb;
  --bp-code-bg: #f5f6f8;
  --bp-gutter: #94a3b8;
  --bp-maxw: 50rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bp-fg: #e6e6e6;
    --bp-bg: #0f1115;
    --bp-muted: #9aa4b2;
    --bp-accent: #7aa2ff;
    --bp-border: #2a2f3a;
    --bp-code-bg: #1a1d24;
    --bp-gutter: #6b7280;
  }
}

* { box-sizing: border-box; }

body {
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--bp-fg);
  background: var(--bp-bg);
  margin: 0;
  padding: 2.5rem 1.25rem 5rem;
}

.doc { max-width: var(--bp-maxw); margin: 0 auto; }

/* ---------- Back-to-index nav (sticky, on every document) ---------- */
.doc-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bp-bg);
  padding: .7rem 0;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--bp-border);
  font-size: .85rem;
}
.doc-nav a { color: var(--bp-muted); font-weight: 600; text-decoration: none; }
.doc-nav a:hover { color: var(--bp-accent); text-decoration: underline; }
@media print { .doc-nav { display: none; } }

/* ---------- Document header ---------- */
.doc-kicker {
  color: var(--bp-muted);
  text-transform: uppercase;
  letter-spacing: .09em;
  font-size: .72rem;
  font-weight: 700;
  margin: 0 0 .35rem;
}
.doc-header { border-bottom: 2px solid var(--bp-border); padding-bottom: 1.1rem; margin-bottom: 2rem; }
.doc-header h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 .6rem; font-weight: 680; }
.doc-meta { display: flex; flex-wrap: wrap; gap: .35rem 1rem; color: var(--bp-muted); font-size: .82rem; margin: 0; }
.doc-meta > span { white-space: nowrap; }
.doc-note {
  font-size: .85rem;
  color: var(--bp-muted);
  background: var(--bp-code-bg);
  border-left: 3px solid var(--bp-accent);
  border-radius: 0 6px 6px 0;
  padding: .6rem .8rem;
  margin-top: 1rem;
}

/* ---------- Sections & headings ---------- */
.doc-section { margin-top: 2.25rem; }
.doc-section h2 {
  font-size: 1.35rem;
  font-weight: 650;
  line-height: 1.25;
  margin: 0 0 .75rem;
  padding-bottom: .3rem;
  border-bottom: 1px solid var(--bp-border);
}
.doc-section h3 { font-size: 1.05rem; font-weight: 640; margin: 1.5rem 0 .5rem; }

/* ---------- Line numbering ----------
   Referenceable content is a top-level <p class="l"> (or <li class="l">).
   The line counter RESETS PER SECTION, so cite as "§4 L3" (Section 4, line 3).
   Numbers are auto-generated — never hand-maintain them; just add/remove <p class="l">. */
.doc-section { counter-reset: line; }
.l {
  counter-increment: line;
  position: relative;
  padding-left: 3.25rem;
  margin: .45rem 0;
}
.l::before {
  content: counter(line);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.25rem;
  text-align: right;
  color: var(--bp-gutter);
  font-size: .78rem;
  line-height: 1.75;
  font-variant-numeric: tabular-nums;
  user-select: none;
  -webkit-user-select: none;
}
.l strong, .l b { font-weight: 660; }

/* ---------- Tables (referenced by section, rows not line-numbered) ---------- */
table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .93rem; }
th, td { border: 1px solid var(--bp-border); padding: .5rem .7rem; text-align: left; vertical-align: top; }
th { background: var(--bp-code-bg); font-weight: 640; }

/* ---------- Inline elements ---------- */
a { color: var(--bp-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .9em; background: var(--bp-code-bg); padding: .12em .4em; border-radius: 4px;
}

/* ---------- TODO / needs-input markers ---------- */
.todo {
  background: #fef3c7; color: #713f12;
  padding: .05em .4em; border-radius: 4px;
  font-weight: 600; font-size: .9em;
}
@media (prefers-color-scheme: dark) { .todo { background: #4d3a12; color: #fde68a; } }

/* ---------- Status badges ---------- */
.status { font-size: .72rem; font-weight: 700; padding: .12rem .55rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.status-draft      { background: #fde68a; color: #713f12; }
.status-in-review  { background: #bfdbfe; color: #1e3a8a; }
.status-approved   { background: #bbf7d0; color: #14532d; }
.status-deprecated { background: #fecaca; color: #7f1d1d; }

/* ---------- Index / catalog page ---------- */
.index-wrap { max-width: 68rem; margin: 0 auto; }
.index-wrap h1 { margin-top: 0; }
.index-filter { color: var(--bp-muted); font-size: .9rem; margin-bottom: 1.5rem; }

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

/* ---------- Print (mark up on paper) ---------- */
@media print {
  body { margin: 0; padding: 0; color: #000; background: #fff; }
  .doc { max-width: none; }
  .doc-section h2 { border-color: #ccc; }
  .l::before { color: #666; }
  a { color: #000; text-decoration: none; }
}
