/* ─────────────────────────────────────────────────────────────────────────────
   Matbakhna legal pages: privacy.html, terms.html, index.html
   Shared so the two documents cannot drift apart visually.

   ⚠️ SYSTEM FONTS ON PURPOSE, NO GOOGLE FONTS. A privacy policy that makes a
   request to a third party the moment it loads is a bad look, and it would mean
   widening the CSP in _headers to admit fonts.googleapis.com. The stack below
   resolves to a real Arabic face on every platform we care about: Segoe UI on
   Windows, SF Arabic on iOS and macOS, Noto Sans Arabic on Android and Linux.
   ───────────────────────────────────────────────────────────────────────────*/

:root {
  --ground: #FAF6F0;
  --surface: #FFFFFF;
  --sunk: #F2EAE0;
  --ink: #2A1F18;
  --inkSoft: #4A3F37;
  --muted: #7B6E64;
  --faint: #A1948A;
  --line: #E8DDCE;
  --accent: #C96A4A;
  --accentSoft: #F7DBCE;
  --shadow: 0 1px 2px rgba(42, 31, 24, .05), 0 8px 28px rgba(42, 31, 24, .06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #17120F;
    --surface: #1F1915;
    --sunk: #2A221D;
    --ink: #F2EAE2;
    --inkSoft: #D8CCC2;
    --muted: #A89A8E;
    --faint: #7D7166;
    --line: #342B24;
    --accent: #E08A6B;
    --accentSoft: #3A241B;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 28px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Segoe UI", "SF Arabic", "Noto Sans Arabic", "Helvetica Neue",
               system-ui, -apple-system, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

/* ── top bar ──────────────────────────────────────────────────────────── */
.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--ground);
  border-bottom: 1px solid var(--line);
}
.bar-in {
  max-width: 820px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.wordmark {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.01em;
  margin-inline-end: auto;
  color: inherit;
  text-decoration: none;
}
.wordmark span { color: var(--accent); }

.seg { display: flex; background: var(--sunk); border-radius: 9px; padding: 3px; gap: 2px; }
.seg a,
.seg button {
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
  text-decoration: none;
}
.seg a[aria-current="page"],
.seg button[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(42, 31, 24, .08);
}
.seg a:focus-visible,
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ── page ─────────────────────────────────────────────────────────────── */
.wrap { max-width: 820px; margin: 0 auto; padding: 0 20px; padding-block: 34px 80px; }

h1 {
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 0 0 8px;
  text-wrap: balance;
}
.updated { color: var(--muted); font-size: 14px; margin: 0 0 30px; }

nav.toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 34px;
  box-shadow: var(--shadow);
}
nav.toc p {
  margin: 0 0 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--faint);
}
nav.toc ol { margin: 0; padding-inline-start: 20px; columns: 2; column-gap: 26px; }
nav.toc li { margin-bottom: 4px; font-size: 14.5px; break-inside: avoid; }
nav.toc a { color: var(--inkSoft); text-decoration: none; }
nav.toc a:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 560px) { nav.toc ol { columns: 1; } }

section { margin-bottom: 34px; scroll-margin-top: 72px; }
h2 {
  font-size: 19px;
  line-height: 1.3;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accentSoft);
}
h2 .n { color: var(--accent); font-variant-numeric: tabular-nums; margin-inline-end: 8px; }
h3 { font-size: 15.5px; margin: 20px 0 6px; color: var(--inkSoft); }
p { margin: 0 0 12px; color: var(--inkSoft); }
ul { margin: 0 0 12px; padding-inline-start: 22px; color: var(--inkSoft); }
li { margin-bottom: 6px; }
strong { color: var(--ink); font-weight: 600; }
a { color: var(--accent); }

/* Wide tables scroll in their own box so the page body never does. */
.tbl-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin: 6px 0 14px; font-size: 14.5px; }
th, td { text-align: start; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink); background: var(--sunk); }
td { color: var(--inkSoft); }

.contact {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.contact p:last-child { margin-bottom: 0; }

footer {
  margin-top: 42px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13px;
}
footer a { color: var(--muted); }

/* ── the draft banner ─────────────────────────────────────────────────────
   DELETE THE .draft BLOCK FROM EACH PAGE once a lawyer has signed the text
   off. The styles stay here so re-adding it during a future revision is one
   line rather than a rebuild. */
.draft {
  background: #FBEED8;
  border: 1px solid #E0A94B;
  color: #7A5410;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14.5px;
  margin-bottom: 30px;
}
.draft b { display: block; margin-bottom: 3px; font-size: 15px; }
@media (prefers-color-scheme: dark) {
  .draft { background: #2E2312; border-color: #9C7526; color: #E5C583; }
}

[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ── the apex placeholder, index.html ─────────────────────────────────── */
  .home { text-align: center; padding-block: 60px 20px; }
  .home h1 { font-size: clamp(34px, 8vw, 52px); margin-bottom: 10px; }
  .home h1 span { color: var(--accent); }
  .home .tag { color: var(--muted); font-size: 17px; margin: 0 auto 36px; max-width: 46ch; }
  .cards { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
  .cards a {
    display: block; text-decoration: none; color: inherit;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
    padding: 18px 22px; min-width: 210px; box-shadow: var(--shadow);
  }
  .cards a:hover { border-color: var(--accent); }
  .cards b { display: block; font-size: 16px; margin-bottom: 2px; }
  .cards span { color: var(--muted); font-size: 13.5px; }
  .home-foot { text-align: center; }
