/* ============================================================
   omnilaw.dev portal — shared content-page stylesheet
   Single source of truth for tokens + element styles.
   Pages link this file; no per-page <style> blocks.
   Accent: #9F0500 (signature cherry red, RGB 159,5,0).
   All neutrals are true grays — no warm/cool hue drift.
   ============================================================ */

:root {
  /* color tokens */
  --bg: #000000;
  --fg: #ffffff;
  --accent: #9F0500;
  --accent-wash: rgba(159, 5, 0, 0.28);
  --dim: #888888;
  --line: #262626;
  --card: #0d0d0d;
  /* type tokens — rem scale (root = 16px browser default).
     Change the root size once and the whole scale moves together. */
  --font-body: 'Inter Tight', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --text-body: 0.875rem;    /* 14px */
  --text-small: 0.6875rem;  /* 11px */
  --text-h1: 1.1875rem;     /* 19px */
  --text-h2: 0.875rem;      /* 14px */
  --text-h3: 0.8125rem;     /* 13px */
  --text-table: 0.6875rem;  /* 11px */
  --text-code: 0.65625rem;  /* 10.5px */
  --leading: 1.65;
  --leading-table: 1.55;

  /* layout tokens — rem so spacing scales with type */
  --page-max: 55rem;        /* 880px */
  --page-max-wide: 67.5rem; /* 1080px */
  --page-pad-x: 2.75rem;
  --page-pad-y: 3.5rem;
  --space-section: 2.75rem; /* above h2 */
  --space-block: 0.875rem;  /* between paragraphs */
}

[data-theme="light"] {
  --bg: #ffffff;
  --fg: #000000;
  --dim: #666666;
  --line: #e4e4e4;
  --card: #f6f6f6;
  /* accent stays #9F0500 in both themes */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading);
  display: grid;
  grid-template-columns: 11rem minmax(0, var(--page-max));
  gap: 3rem;
  justify-content: center;
  padding: var(--page-pad-y) var(--page-pad-x) 96px;
}

body.layout-wide { grid-template-columns: 11rem minmax(0, var(--page-max-wide)); }  /* table-heavy pages */

/* pages without a section sidebar — no reserved sidebar column */
body.no-toc { grid-template-columns: minmax(0, var(--page-max)); }
body.no-toc.layout-wide { grid-template-columns: minmax(0, var(--page-max-wide)); }

/* section sidebar — jump nav + coverage preview (long prose pages only) */
.toc {
  position: sticky; top: var(--page-pad-y); align-self: start;
  font-family: var(--font-mono); font-size: var(--text-small); line-height: 1.6;
  border-left: 1px solid var(--line); padding-left: 0.875rem;
}
.toc-title {
  color: var(--dim); font-size: 0.625rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.toc a { display: block; color: var(--dim); text-decoration: none; padding: 0.15rem 0; }
.toc a:hover { color: var(--accent); }
.toc a.active { color: var(--accent); }
.toc a.toc-sub { padding-left: 0.875rem; font-size: var(--text-code); }
@media (max-width: 56rem) {
  body, body.layout-wide { grid-template-columns: minmax(0, var(--page-max)); }
  .toc { display: none; }
}

/* letter measure — long-form legal text reads cramped at full width */
main.narrow { max-width: 42rem; }
main.letter { line-height: 1.75; }
main.letter p { margin-bottom: 1rem; }
.recital p { padding-left: 1.5rem; text-indent: -1.5rem; }

/* update banner — journalist-correction line above the title (spec: brief, update flagging) */
.update-banner {
  font-family: var(--font-mono); font-size: var(--text-small);
  color: var(--accent); letter-spacing: 0.02em;
  margin: 0 0 1rem; padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

h1 { font-size: var(--text-h1); font-weight: 700; margin: 0 0 4px; }
h2 {
  font-size: var(--text-h2); font-weight: 700;
  margin: var(--space-section) 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
h3 { font-size: var(--text-h3); font-weight: 700; margin: 1.75rem 0 0.625rem; }
p  { margin: 0 0 var(--space-block); }
ul, ol { padding-left: 20px; margin: 0 0 var(--space-block); }
li { margin-bottom: 0.4375rem; }
strong { font-weight: 700; }
u { text-underline-offset: 2px; }
hr { border: none; border-top: 1px solid var(--line); margin: 2.25rem 0; }

/* meta strip under the title — carries what YAML would have told a human */
.meta {
  color: var(--dim);
  font-size: var(--text-small);
  font-family: var(--font-mono);
  margin-bottom: 2.25rem;
}

/* tables: mono, hairline rules, no boxes */
.wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: var(--text-table);
  line-height: var(--leading-table);
  margin: 0.625rem 0 1.25rem;
}
th {
  text-align: left;
  color: var(--dim);
  font-weight: 500;
  padding: 0.375rem 0.625rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 0.5625rem 0.625rem; border-bottom: 1px solid var(--line); vertical-align: top; }
td:first-child { color: var(--dim); }
table.col-wide td:first-child { white-space: normal; min-width: 5.625rem; }

code {
  font-family: var(--font-mono);
  font-size: var(--text-code);
  color: #aaaaaa;
}

/* obsidian ==highlight== → accent wash */
mark { background: var(--accent-wash); color: var(--fg); padding: 0 2px; }

/* interaction states — the one accent, the one meaning */
a { color: var(--fg); }
a:hover { color: var(--accent); }
::selection { background: var(--accent-wash); }

/* drafting-notes / internal-annotation block — separated by hairline, not indented */
.draft {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 3rem;
}
.draft h2 { border-bottom: none; margin-top: 0; padding-bottom: 0; }
.draft li { margin-bottom: 0.75rem; }

/* letter-page address/signature blocks */
.block { margin-bottom: 1.25rem; }
