/* رتّب — صفحة الخصوصية. الألوان من Theme.swift في التطبيق. بلا style داخلي ولا سكربت (CSP الموقع). */
:root {
  color-scheme: light dark;
  --bone: #F5F0E6;
  --sheet: #FBFAF7;
  --ink: #2F3E34;
  --ink-soft: #5B675F;
  --accent: #8C5E16; /* amberDark من التطبيق أغمق قليلاً: ٥:١ على العاجي بدل ٤٫١ */
  --amber: #D9A441;
  --sage: #C9D8C5;
  --rule: rgba(47, 62, 52, 0.14);
  --shadow: 0 1px 2px rgba(47, 62, 52, 0.08), 0 18px 40px -18px rgba(47, 62, 52, 0.28);
  --paper: url("paper.webp");
  --font: system-ui, -apple-system, "SF Arabic", "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
  --measure: 66ch;
}
/* العربي أضيق حرفاً من اللاتيني: ٦٦ch تعطي ~٩٠ حرفاً في السطر، فنكبّر الخط ونضيّق السطر إلى ~٧٥ */
:root:lang(ar) { --measure: 33rem; }

@media (prefers-color-scheme: dark) {
  :root {
    --bone: #1D241F;
    --sheet: #252E27;
    --ink: #EDE6D6;
    --ink-soft: #B8C1B6;
    --accent: #E2B866;
    --sage: #3A4A3D;
    --rule: rgba(237, 230, 214, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 40px -18px rgba(0, 0, 0, 0.6);
    --paper: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-block-start: 1.5rem; }

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.85;
  text-rendering: optimizeLegibility;
}
body:lang(ar) { font-size: 1.125rem; }
body:lang(en) { line-height: 1.65; }

::selection { background: rgba(217, 164, 65, 0.38); color: var(--ink); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
@media (hover: hover) and (pointer: fine) {
  a:hover { text-decoration-thickness: 2px; }
}

.skip {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: -4rem;
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: var(--bone);
  border-radius: 8px;
  z-index: 2;
}
.skip:focus { inset-block-start: 1rem; }

.wrap { max-width: 68rem; margin-inline: auto; padding-inline: 1.25rem; }

/* الترويسة */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
}
.brand img { width: 44px; height: 44px; border-radius: 10px; box-shadow: 0 1px 2px rgba(47, 62, 52, 0.18); }
.brand small { color: var(--ink-soft); font-weight: 500; font-size: 0.85rem; margin-inline-start: 0.15rem; }
.lang {
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
}

/* الافتتاحية */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2rem;
  padding-block: clamp(2rem, 6vw, 4.5rem) 2.5rem;
  border-block-end: 1px solid var(--rule);
}
.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.1rem, 5.4vw, 3.4rem);
  font-weight: 800;
  line-height: 1.2;
  text-wrap: balance;
}
.hero h1:lang(en) { letter-spacing: -0.02em; line-height: 1.08; }
.lead { margin: 0; max-width: 36rem; font-size: clamp(1.1rem, 2.2vw, 1.3rem); line-height: 1.75; text-wrap: pretty; }
.lead:lang(en) { line-height: 1.55; }
.lead strong { font-weight: 700; }
.dates { margin: 1.4rem 0 0; color: var(--ink-soft); font-size: 0.92rem; line-height: 1.7; }
.dates span { display: block; }
.hero img { width: clamp(76px, 12vw, 120px); height: auto; transform: rotate(-7deg); margin-block-end: 0.4rem; }
.hero img:dir(ltr) { transform: rotate(7deg); }

/* الجسم */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem;
  padding-block: 2.5rem 4rem;
}
@media (min-width: 62rem) {
  .layout { grid-template-columns: 13rem minmax(0, 1fr); }
  .contents { position: sticky; inset-block-start: 1.5rem; align-self: start; }
}

.contents { display: none; font-size: 0.95rem; }
@media (min-width: 62rem) { .contents { display: block; } }
.contents p { margin: 0 0 0.6rem; font-weight: 700; color: var(--ink-soft); font-size: 0.88rem; }
.contents ul { list-style: none; margin: 0; padding: 0; }
.contents li + li { margin-block-start: 0.35rem; }
.contents a { color: var(--ink); text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  .contents a:hover { color: var(--accent); text-decoration: underline; }
}

article { max-width: 48rem; }
article p, article ul, article h2 { max-width: var(--measure); }
article section + section { margin-block-start: 3rem; }
article h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 2.6vw, 1.6rem);
  font-weight: 750;
  line-height: 1.35;
  text-wrap: balance;
}
article h2:lang(en) { letter-spacing: -0.01em; }
article p { margin: 0 0 1rem; text-wrap: pretty; }
article ul { margin: 0 0 1rem; padding-inline-start: 1.25rem; }
article li { margin-block-end: 0.6rem; padding-inline-start: 0.2rem; }
article li::marker { color: var(--amber); }

/* خريطة البيانات: ورقة على المكتب */
.map {
  max-width: none;
  margin: 1.25rem 0 0;
  background: var(--sheet) var(--paper);
  background-size: 512px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.map table { width: 100%; border-collapse: collapse; font-size: 0.98rem; line-height: 1.65; }
.map caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.map th, .map td { text-align: start; vertical-align: top; padding: 1rem 1.15rem; }
.map thead th { font-size: 0.85rem; font-weight: 700; color: var(--ink-soft); padding-block: 0.85rem; border-block-end: 1px solid var(--rule); }
.map tbody tr + tr th, .map tbody tr + tr td { border-block-start: 1px solid var(--rule); }
.map tbody th { font-weight: 700; width: 34%; }
.map tbody th span { display: block; font-weight: 400; color: var(--ink-soft); font-size: 0.9rem; margin-block-start: 0.2rem; }
.map .you { font-weight: 700; }

@media (max-width: 40rem) {
  .map thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .map table, .map tbody, .map tr, .map th, .map td { display: block; width: auto; }
  .map tbody tr { padding: 1rem 1.1rem; }
  .map tbody tr + tr { border-block-start: 1px solid var(--rule); }
  .map tbody tr + tr th, .map tbody tr + tr td { border: 0; }
  .map tbody th, .map td { padding: 0; width: auto; }
  .map td { margin-block-start: 0.45rem; }
  .map td::before { content: attr(data-label); display: block; font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); }
}

.contact {
  margin-block-start: 3rem;
  padding: 1.4rem 1.5rem;
  background: var(--sheet) var(--paper);
  background-size: 512px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.contact h2 { margin-block-end: 0.4rem; }
.contact p:last-child { margin-block-end: 0; }
.mail { font-size: 1.15rem; font-weight: 700; direction: ltr; unicode-bidi: isolate; }

footer {
  border-block-start: 1px solid var(--rule);
  padding-block: 1.5rem 2.5rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 1.5rem; }
footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }

@media (max-width: 40rem) {
  .hero { grid-template-columns: 1fr; gap: 1.25rem; }
  .hero img { grid-row: 1; width: 72px; }
  .layout { padding-block-start: 2rem; }
}

@media print {
  :root { --paper: none; --shadow: none; }
  .bar .lang, .contents, .skip { display: none; }
  .layout { display: block; }
}
