/* Framework page — long-form specification layout (contents list + document body).
   The two-column reading layout is the only page-specific structure; container, type
   scale, colours and table styling come from the shared system. */

body.framework-page { min-height: 100vh; }
body.framework-page main { overflow-x: clip; }

.doc-top { padding-block: var(--hero-pad-top) var(--hero-pad-bottom); }
.doc-head { max-width: var(--measure); }

.doc-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: var(--fs-small);
}

.doc-crumbs a { color: var(--signal); text-decoration: none; }
.doc-crumbs a:hover { text-decoration: underline; }

.doc-pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin: 16px 0 14px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: #e6f4ea;
  color: #145a32;
  font-size: var(--fs-small);
}

.doc-pill strong { color: #0e4a28; }

.doc-head h1 { margin: 0 0 12px; }

.doc-lead {
  margin: 0;
  max-width: var(--measure);
  color: var(--muted);
  font-size: var(--fs-lead);
  line-height: var(--lh-lead);
}

.doc-wrap {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding-bottom: var(--section-gap);
}

.doc-side { position: sticky; top: calc(var(--header-height) + 16px); }

.doc-toc {
  padding: 16px 16px 18px;
  border: var(--border);
  border-radius: var(--radius-card);
  background: #faf9f6;
}

.doc-toc-title {
  margin: 0 0 10px;
  color: var(--text);
  font-size: var(--fs-meta);
  font-weight: var(--fw-meta);
  line-height: var(--lh-meta);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
}

.doc-toc-links { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }

.doc-toc-links a {
  display: block;
  padding: 5px 0;
  color: var(--text-soft);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  text-decoration: none;
}

.doc-toc-links a:hover,
.doc-toc-links a[aria-current="true"] { color: var(--signal); }

.doc-paper {
  min-width: 0;
  padding: clamp(20px, 4vw, 44px);
  border: var(--border);
  border-radius: var(--radius-card);
  background: var(--panel);
  color: var(--text-soft);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.doc-sec { scroll-margin-top: calc(var(--header-height) + 16px); }
.doc-sec + .doc-sec { margin-top: 36px; padding-top: 32px; border-top: var(--border); }

.doc-paper h2 { margin: 0 0 16px; }
.doc-n { color: inherit; }
.doc-paper h3 { margin: 22px 0 6px; }
.doc-paper p { margin: 0 0 10px; }
.doc-paper a { color: var(--signal); text-decoration: none; }
.doc-paper a:hover { text-decoration: underline; }

.doc-sub h3 code {
  margin-inline-start: 6px;
  color: var(--muted);
  font: 500 var(--fs-small) var(--font-mono);
}

.doc-eyebrow {
  margin: 22px 0 0 !important;
  color: var(--signal);
  font-size: var(--fs-small);
  font-weight: var(--fw-strong);
}

.doc-eyebrow + h3 { margin-top: 2px; }

.doc-dl { margin: 8px 0 0; }

.doc-dl > div {
  display: grid;
  grid-template-columns: minmax(130px, 200px) minmax(0, 1fr);
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--line-faint);
}

.doc-dl > div:last-child { border-bottom: 1px solid var(--line-faint); }
.doc-dl dt { color: var(--text); font-weight: var(--fw-meta); }
.doc-dl dd { margin: 0; }

.doc-list { margin: 8px 0 0; padding-inline-start: 22px; }
.doc-list li { margin: 3px 0; }

.doc-inline { display: flex; flex-wrap: wrap; margin: 8px 0 0; padding: 0; list-style: none; }
.doc-inline li { color: var(--text); font-weight: var(--fw-strong); }
.doc-inline li + li::before { content: "·"; margin-inline: 10px; color: var(--line-strong); font-weight: 400; }

.doc-formula { margin: 0 0 10px; }
.doc-formula code { direction: ltr; unicode-bidi: isolate; color: var(--text); font-family: var(--font-mono); }

.doc-note strong { display: block; margin-bottom: 4px; color: var(--text); }
.doc-note p { margin: 0; }
.doc-muted { color: var(--muted); }
.doc-paper .doc-h4 { margin: 18px 0 4px; color: var(--signal-deep); font-size: var(--fs-body); }
.doc-evolution h3 { margin-top: 26px; }

/* Tables inside the document: the shared table text size, plain rules, no cards. */
.doc-paper table { min-width: 0; font-size: var(--fs-table); }

.doc-paper th,
.doc-paper td {
  padding: 8px 10px;
  padding-inline-start: 0;
  border-bottom: 1px solid var(--line-faint);
  background: none;
  text-align: start;
  vertical-align: top;
  font-weight: 400;
}

.doc-paper thead th {
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: var(--fw-meta);
  text-transform: none;
  letter-spacing: 0;
  border-bottom: var(--border);
}

.doc-table { width: 100%; max-width: 480px; }
.doc-table td { width: 80px; color: var(--text); font-family: var(--font-mono); }

.doc-vtable { width: 100%; margin-top: 8px; }
.doc-vtable tbody th { color: var(--text); font-weight: var(--fw-meta); white-space: nowrap; }
.doc-evolution .doc-vtable td { color: var(--text-soft); }

/* QERIS Core Standard rule lists (one block per page language). */
.fw-standards { padding: 0; border: 0; background: none; }
.fw-standards > .shell { width: auto; max-width: none; padding: 0; }
.fw-std-block { display: none; }
html:not([lang="ar"]) .fw-std-block[lang="en"],
html[lang="ar"] .fw-std-block[lang="ar"] { display: block; }

.fw-std-head { margin: 0 0 8px; }
.fw-std-head .eyebrow { display: none; }
.fw-std-head h2 { margin: 0 0 4px; font-size: var(--fs-h3); line-height: var(--lh-h3); }
.fw-std-head p { margin: 0; }

.fw-std { margin-top: 22px; }

.fw-std header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 6px;
}

.fw-std header h3 { flex: 1; margin: 0; }
.fw-std header b,
.fw-std-code { color: var(--muted); font: 500 var(--fs-small) var(--font-mono); }

.fw-std-table { overflow-x: auto; }
.fw-std table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.fw-std th:nth-child(1), .fw-std td:nth-child(1) { width: 76px; white-space: nowrap; }
.fw-std th:nth-child(3), .fw-std td:nth-child(3) { width: 96px; white-space: nowrap; color: var(--muted); }
.fw-std td:nth-child(2) { white-space: normal; overflow-wrap: anywhere; }
.fw-std code { color: var(--text); font: 500 var(--fs-small) var(--font-mono); }

@media (max-width: 900px) {
  .doc-wrap { grid-template-columns: 1fr; }
  .doc-side { position: static; }
  .doc-toc-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 18px; }
}

@media (max-width: 560px) {
  .doc-toc-links { grid-template-columns: 1fr; }
  .doc-dl > div { grid-template-columns: 1fr; gap: 2px; }
  .doc-vtable tbody th { white-space: normal; }
  .fw-std th:nth-child(3), .fw-std td:nth-child(3) { width: 78px; }
}
