/* Whitepaper pages (generated by deploy/tools/whitepaper.py): document layout
   on top of site.css. Logical properties so Arabic (rtl) needs no overrides. */
.wp { position: relative; z-index: 1; padding: 52px 0 48px; }
.nav a.active { color: var(--text); }

/* hero */
.wp-hero { display: grid; gap: 16px; max-width: 860px; }
.wp-hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.06; text-wrap: balance; }
.wp-hero .lede { font-size: 17px; max-width: 64ch; margin: 0; }
.wp-version { color: var(--muted2); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; margin: 0; }
.wp-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted2); }
.wp-meta b { color: var(--text); font-weight: 500; }
.wp-stats { margin-top: 10px; grid-template-columns: 1fr; }
.wp-stats .stat b { font-size: clamp(22px, 3vw, 28px); }
.wp-stats .stat.listing { border-color: var(--gold-line); background: rgba(30,26,16,.9); }
@media (min-width: 700px) { .wp .wp-stats { grid-template-columns: repeat(3, 1fr); } }

/* two columns from 960px: sticky section index beside the document */
.wp-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 36px; }
.wp-index { font-size: 14px; min-width: 0; }
.wp-index p { margin: 0 0 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted2); }
.wp-index ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.wp-index a { display: inline-block; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(21,22,27,.88); }
.wp-index a:hover { color: var(--text); }
.wp-index a[aria-current="true"] { color: var(--text); border-color: var(--gold-line); }
.wp-doc { min-width: 0; background: rgba(12,12,15,.88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 14px; padding: 6px 18px 20px; }
@media (min-width: 700px) { .wp-doc { padding: 14px 32px 32px; } }
@media (min-width: 960px) {
  .wp-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 40px; }
  .wp-index { position: sticky; top: 76px; align-self: start; }
  .wp-index ol { flex-direction: column; gap: 2px; }
  .wp-index a { display: block; border: 0; border-inline-start: 2px solid var(--line); border-radius: 0; background: none; padding: 6px 12px; }
  .wp-index a[aria-current="true"] { border-inline-start-color: var(--gold); }
}

/* document */
.wp-doc section { padding: 20px 0 10px; scroll-margin-top: 76px; }
.wp-doc section + section { border-top: 1px solid var(--line); }
.wp-doc h2 { font-size: clamp(22px, 3vw, 28px); line-height: 1.15; margin: 0 0 14px; text-wrap: balance; }
.wp-doc h3 { font-family: var(--sans); font-weight: 700; font-size: 17px; letter-spacing: 0; margin: 24px 0 8px; }
.wp-doc p { margin: 0 0 14px; max-width: 72ch; line-height: 1.6; }
.wp-doc ul, .wp-doc ol { margin: 0 0 16px; padding-inline-start: 22px; display: grid; gap: 8px; max-width: 72ch; line-height: 1.55; }
.wp-doc li::marker { color: var(--gold-soft); font-family: var(--mono); }
.wp-doc code { font-family: var(--mono); font-size: .9em; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.wp-doc a { text-decoration: underline; text-decoration-color: var(--gold-line); }
.wp-notice { border: 1px solid var(--gold-line); background: rgba(30,26,16,.9); border-radius: 12px; padding: 14px 18px; margin: 12px 0 20px; font-size: 15px; line-height: 1.55; }
.wp-notice strong { color: var(--gold); }

/* tables: scroll inside their frame, never the page */
.wp-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: rgba(16,17,20,.9); margin: 0 0 18px; }
.wp-table .table { margin: 0; font-size: 14.5px; }
.wp-table th, .wp-table td { text-align: start; padding: 10px 14px; }
.wp-table thead th { background: rgba(21,22,27,.9); white-space: nowrap; font-family: var(--mono); font-weight: 500; color: var(--muted2); }
.wp-table tbody tr:last-child td { border-bottom: 0; }
.wp-table td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--gold-soft); }
.wp-table tr.key td { background: rgba(30,26,16,.9); }
.wp-table tr.key td:first-child { border-inline-start: 3px solid var(--gold); }
.wp-table td strong { color: var(--text); }
/* phones: wide tables keep readable columns and scroll inside their frame */
@media (max-width: 640px) { .wp-table .cols-3 { min-width: 520px; } .wp-table .cols-4, .wp-table .cols-5 { min-width: 640px; } }

/* key/value lists (tables without a header row) */
.facts { display: grid; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 12px; background: rgba(16,17,20,.9); overflow: hidden; }
.fact { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: 0; }
.fact dt { margin: 0; font-family: var(--mono); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted2); padding-top: 2px; }
.fact dd { margin: 0; font-size: 15px; line-height: 1.5; }
@media (min-width: 640px) { .fact { grid-template-columns: minmax(130px, 170px) minmax(0, 1fr); gap: 12px; } }

/* other languages */
.wp-langs ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; max-width: none; }
.wp-langs a { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 14px; text-decoration: none; }
.wp-langs a:hover { color: var(--text); }
.wp-langs a[aria-current="page"] { color: var(--gold); border-color: var(--gold-line); }
