/* =============================================================================
   The reading pages: the install guide and the three policies (terms, refund,
   privacy). One column at a readable measure, headings in El Messiri, text in
   Almarai at 17px. Code blocks read left to right whatever the page direction.
   Tokens come from theme.css; nothing here invents a colour.
   ============================================================================= */

/* min-width 0: .page is a flex column, and a long code line would otherwise widen the whole page. */
.doc { width: 100%; min-width: 0; padding: clamp(40px, 7vw, 72px) 24px clamp(56px, 8vw, 96px); }
.doc-in { max-width: 68ch; min-width: 0; margin-inline: auto; font-size: 17px; line-height: 1.85; color: var(--text-dim); }
/* LTR inside an Arabic line: `.ydr` otherwise shows as `ydr.`. */
.doc :not(pre) > code { direction: ltr; overflow-wrap: anywhere; }

.doc h1, .doc h2, .doc h3 { font-family: var(--font-display); color: var(--text); font-weight: 700; text-wrap: balance; }
.doc h1 { font-size: clamp(30px, 5vw, 42px); line-height: 1.3; letter-spacing: var(--track-display); }
.doc h2 { font-size: clamp(22px, 3.2vw, 27px); line-height: 1.4; }
.doc h3 { font-size: 19px; line-height: 1.45; margin-top: 30px; }

.doc-date { margin-top: 10px; font-size: 15px; color: var(--text-faint); }
.doc-lede { margin-top: 18px; font-size: 18px; }

.doc section { margin-top: 52px; scroll-margin-top: 84px; }
.doc p, .doc ul, .doc ol { margin-top: 14px; }
.doc h2 + p, .doc h2 + ul, .doc h3 + p { margin-top: 12px; }
.doc ul, .doc ol { padding-inline-start: 1.4em; }
.doc li + li { margin-top: 10px; }
.doc li::marker { color: var(--text-faint); }
.doc b { color: var(--text); font-weight: 700; }
.doc a:not(.btn) { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-lit); text-underline-offset: 4px; }
.doc a:not(.btn):hover { text-decoration-color: currentColor; }

/* On this page: a plain numbered list in a panel. */
.doc-toc { margin-top: 36px; padding: 18px 22px 20px; background: var(--panel); border: 0.8px solid var(--border); border-radius: var(--r-card); }
.doc-toc h2 { font-size: 18px; }
.doc-toc ol { margin-top: 8px; }
.doc-toc li + li { margin-top: 4px; }
.doc-toc a:not(.btn) { text-decoration: none; }
.doc-toc a:not(.btn):hover { text-decoration: underline; }

/* Question, then answer: the common problems. */
.doc-qa h3 { font-size: 18px; }

/* A file name above the code, the copy button beside it. */
.code { margin-top: 16px; background: var(--well); border: 0.8px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  direction: ltr; padding: 6px 6px 6px 14px; min-height: 46px;
  background: var(--panel); border-bottom: 0.8px solid var(--border-soft);
}
.code-file { font-family: var(--font-mono); font-size: 14px; color: var(--text-dim); overflow-wrap: anywhere; }
.code-copy { flex: none; }
.code pre {
  direction: ltr; text-align: left; overflow-x: auto;
  padding: 14px 16px; font-size: 14px; line-height: 1.65; tab-size: 4;
}
.code pre code {
  background: none; border: 0; padding: 0; border-radius: 0;
  font-size: inherit; color: var(--text); white-space: pre; unicode-bidi: normal;
}

.doc-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

@media (max-width: 560px) {
  .doc { padding-inline: 16px; }
  .doc-in { font-size: 16px; }
  .doc-lede { font-size: 17px; }
  .doc-toc { padding-inline: 16px; }
}
