/*
 * stockast.app — one stylesheet, both directions.
 *
 * ⚠️ EVERYTHING DIRECTIONAL IS LOGICAL, NOT PHYSICAL. `margin-inline-start`,
 * `padding-inline`, `text-align: start`. A single `margin-left` here is a Hebrew
 * page with its indentation on the wrong side, and `SITE-VISUAL-VERIFICATION`
 * exists because that failure is invisible to the parity suite: broken RTL
 * passes a byte comparison byte-for-byte.
 *
 * ⛔ NO WEB FONT, DELIBERATELY. A remote font file is a third-party request on a
 * legal page, and it is the one page class where a request to another origin has
 * to be justified in the document itself. The system stack renders Hebrew
 * correctly on every platform the app targets.
 */

:root {
  --ink: #101418;
  --ink-soft: #4a5560;
  --rule: #e2e6ea;
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --accent: #1668d8;
  --measure: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8ecf0;
    --ink-soft: #9aa6b2;
    --rule: #2a323a;
    --bg: #0d1116;
    --bg-soft: #161c22;
    --accent: #6aa9ff;
  }
}

* {
  box-sizing: border-box;
}

html {
  /* 100% rather than a px value: a reader who has raised their browser font size
   * has done so on purpose, and a legal document is the last place to override
   * it. */
  font-size: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Hebrew', 'Arial Hebrew', Arial,
    sans-serif;
  line-height: 1.7;
  /* Hebrew legal prose is dense; 1.7 is measured against the §11 grid rather
   * than inherited from a template. */
}

.wrap {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ── header ──────────────────────────────────────────────────────────────── */

.legal-header {
  border-block-end: 1px solid var(--rule);
  padding-block: 2.5rem 1.5rem;
}

.legal-header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.legal-header .meta {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

/* ── the document ────────────────────────────────────────────────────────── */

.rtl-section,
.ltr-section {
  padding-block: 1.75rem 2.5rem;
}

.rtl-section h2,
.ltr-section h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.2rem;
  line-height: 1.4;
}

.rtl-section h3,
.ltr-section h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.rtl-section p,
.ltr-section p {
  margin: 0 0 1rem;
}

/* Marker-less by design: `stripDraft` keeps a clause's number as TEXT, so the
 * generator emits "12.1." inside the item. A CSS marker on top of that would
 * print two numbers, and an <ol> marker would print a number the document does
 * not cite. */
.rtl-section ul,
.ltr-section ul {
  margin: 0 0 1rem;
  padding-inline-start: 0;
  list-style: none;
}

.rtl-section li,
.ltr-section li {
  margin: 0 0 0.6rem;
  padding-inline-start: 1.1rem;
  position: relative;
}

.rtl-section li.bullet::before,
.ltr-section li.bullet::before {
  content: '·';
  position: absolute;
  inset-inline-start: 0.2rem;
  color: var(--ink-soft);
}

/* Sub-items are FLAT in the markup — see site/README.md. Guard 4 in
 * legalSiteHtml.ts throws on an <li> inside an <li>, so the hierarchy is
 * expressed here and only here. */
.rtl-section li.sub,
.ltr-section li.sub {
  padding-inline-start: 2.4rem;
}

.rtl-section li.sub::before,
.ltr-section li.sub::before {
  inset-inline-start: 1.5rem;
}

.rtl-section code,
.ltr-section code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--bg-soft);
  padding: 0.1em 0.3em;
  border-radius: 3px;
  /* Column names inside a legal sentence are LTR even in Hebrew prose. */
  direction: ltr;
  unicode-bidi: isolate;
}

.rtl-section hr,
.ltr-section hr {
  border: 0;
  border-block-start: 1px solid var(--rule);
  margin: 2rem 0;
}

/* ── the §11 disclosure grid ─────────────────────────────────────────────── */

/*
 * ⛔ NO RESPONSIVE REFLOW ON THIS TABLE, AT ANY WIDTH. Every "responsive table"
 * pattern — collapsing to cards, hiding columns, re-labelling cells with
 * ::before — regroups cells, and the parity comparison is per-CELL and blind to
 * row structure (GENERATOR-MUST-PRESERVE-TABLE-ROW-STRUCTURE). Here the binding
 * of a data category to its consequence of refusal IS the legal content. It
 * scrolls sideways instead.
 */
.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.rtl-section table,
.ltr-section table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: 0.9rem;
}

.rtl-section th,
.ltr-section th,
.rtl-section td,
.ltr-section td {
  border-block-end: 1px solid var(--rule);
  padding: 0.6rem 0.75rem;
  text-align: start;
  vertical-align: top;
}

.rtl-section th,
.ltr-section th {
  background: var(--bg-soft);
  font-weight: 600;
}

.rtl-section tr:last-child th,
.rtl-section tr:last-child td,
.ltr-section tr:last-child th,
.ltr-section tr:last-child td {
  border-block-end: 0;
}

/* ── language switch and footer ──────────────────────────────────────────── */

/*
 * `lang-divider` is the extractor's end-of-document marker for the Hebrew page
 * (legalSiteHtml.ts SECTION_END). On the old bilingual site it separated the two
 * language halves; here it separates the document from its language link. Same
 * element, same job, one language at a time.
 */
.lang-divider {
  border-block-start: 1px solid var(--rule);
  padding-block: 1.25rem;
}

.lang-switch {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9375rem;
}

.lang-switch:hover,
.lang-switch:focus-visible {
  text-decoration: underline;
}

.site-footer {
  border-block-start: 1px solid var(--rule);
  padding-block: 1.75rem 3rem;
  color: var(--ink-soft);
  font-size: 0.8125rem;
}

.site-footer p {
  margin: 0 0 0.5rem;
}

/* Print: a legal page is printed and filed. */
@media print {
  :root {
    --ink: #000;
    --ink-soft: #333;
    --bg: #fff;
    --bg-soft: #fff;
    --rule: #999;
  }

  .lang-divider,
  .lang-switch {
    display: none;
  }

  .table-scroll {
    overflow: visible;
  }

  .rtl-section table,
  .ltr-section table {
    min-width: 0;
  }
}
