/* صفحتا سياسة الخصوصية وشروط الاستخدام (١٨ أكتوبر ٢٠٢٦) — تُحمَّل بعد site.css */
/* خط الوثائق الرسمية نفسه المستخدم في ملفات PDF */
body.legal-page { --display: 'IBM Plex Sans Arabic', system-ui, sans-serif; --text: 'IBM Plex Sans Arabic', system-ui, sans-serif; font-family: var(--text); }
body.legal-page h1, body.legal-page h2, body.legal-page h3 { font-weight: 700; }
html[lang="en"] body.legal-page h1 { letter-spacing: -0.02em; }
html[lang="ar"] .doc-en, html[lang="en"] .doc-ar { display: none; }
.progress { position: fixed; z-index: 40; inset: 0 0 auto 0; height: 3px; pointer-events: none; direction: ltr; }
.progress i { display: block; height: 100%; width: 0; background: var(--apricot); }
html[dir="rtl"] .progress { direction: rtl; }

.legal-hero { padding-bottom: 110px; }
.legal-hero h1 { margin-bottom: 18px; }
.meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.meta span { display: inline-flex; flex-direction: column; gap: 2px; padding: 10px 18px; border-radius: 16px; background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.meta small { color: rgba(255,255,255,.55); font-size: .8rem; }
.meta b { font: 700 1.02rem var(--display); color: #fff; }
.print-btn svg { width: 18px; height: 18px; }
.print-btn:hover svg, html[dir="ltr"] .print-btn svg, html[dir="ltr"] .print-btn:hover svg { transform: none; }

.legal-grid { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 34px; align-items: start; margin-top: -64px; padding-bottom: 110px; position: relative; z-index: 2; }
.toc { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow: auto; padding: 22px 14px 18px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-sm); scrollbar-width: thin; }
.toc-h { margin: 0 10px 10px; font: 700 .95rem var(--display); color: var(--ink-3); list-style: none; cursor: default; }
.toc-h::-webkit-details-marker { display: none; }
.toc-n:empty { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { position: relative; display: flex; flex-direction: column; padding: 8px 12px; border-radius: 12px; text-decoration: none; color: var(--ink-2); line-height: 1.45; transition: background-color .2s ease, color .2s ease; }
.toc a:hover { background: var(--bg); color: var(--ink); }
.toc a.on { background: var(--teal-tint); color: var(--teal); }
.toc a.on::before { content: ""; position: absolute; inset-inline-start: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--teal); }
.toc-n { font-size: .78rem; color: var(--ink-3); }
.toc a.on .toc-n { color: var(--teal-2); }
.toc a > span:last-child { font-weight: 700; font-size: .95rem; }

.legal { min-width: 0; padding: 40px clamp(22px, 4vw, 54px) 46px; border-radius: 28px; background: var(--surface); box-shadow: var(--shadow-sm); }
.legal p { margin: 0 0 14px; color: var(--ink-2); font-size: 1.04rem; line-height: 1.95; }
html[lang="en"] .legal p { line-height: 1.75; }
.legal p strong { color: var(--ink); }
.trans { padding: 14px 18px; border-radius: 14px; background: var(--bg); font-size: .95rem !important; color: var(--ink-3) !important; }
.glance { margin-bottom: 14px; padding: 26px 28px; border-radius: 22px; background: var(--night); color: #fff; }
.glance h2 { font-size: 1.25rem; font-weight: 700; color: #fff; margin-bottom: 14px; }
.glance ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.glance li { display: flex; gap: 10px; color: rgba(255,255,255,.86); line-height: 1.6; }
.glance li svg { flex: none; width: 22px; height: 22px; margin-top: 2px; padding: 3px; border-radius: 50%; background: var(--apricot); color: var(--night); }
.glance p { margin: 16px 0 0; color: rgba(255,255,255,.55); font-size: .88rem; }
.clause { padding: 30px 0 14px; border-bottom: 1px solid var(--line); scroll-margin-top: 96px; }
.clause:last-of-type { border-bottom: 0; }
.clause h2 { position: relative; display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; font-size: 1.4rem; font-weight: 700; line-height: 1.5; }
.clause .kicker { font: 700 .85rem var(--text); color: var(--apricot-deep); }
.clause .anchor { position: absolute; inset-inline-end: 0; top: 0; padding: 2px 8px; border-radius: 8px; color: var(--ink-3); text-decoration: none; font: 700 1rem var(--text); opacity: 0; transition: opacity .2s ease, background-color .2s ease; }
.clause:hover .anchor, .clause .anchor:focus-visible { opacity: 1; }
.clause .anchor:hover { background: var(--bg); color: var(--teal); }
.clause:target h2 .name { background: linear-gradient(transparent 62%, var(--apricot-tint) 62%); }
.ask { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 26px; padding: 22px 24px; border-radius: 20px; background: var(--teal-tint); }
.ask b { display: block; font: 700 1.1rem var(--display); }
.ask span { color: var(--ink-2); }
.foot a[aria-current="page"] { color: #fff; text-decoration: underline; }

@media (max-width: 1040px) {
  .legal-grid { grid-template-columns: 1fr; margin-top: -50px; }
  .toc { position: static; max-height: none; padding: 6px 14px; }
  .toc-h { cursor: pointer; display: flex; justify-content: space-between; align-items: center; margin: 0; padding: 12px 10px; color: var(--ink); }
  .toc-h::after { content: "+"; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--teal-tint); color: var(--teal); font: 700 1.1rem/1 var(--text); transition: transform .3s var(--ease); }
  .toc details[open] .toc-h::after { transform: rotate(45deg); }
  .toc ol { padding-bottom: 10px; }
  .toc ol { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 720px) {
  .legal-hero { padding-bottom: 90px; }
  .legal { padding: 26px 20px 30px; border-radius: 22px; }
  .glance { padding: 22px; }
  .glance ul { grid-template-columns: 1fr; }
  .clause h2 { font-size: 1.25rem; }
  .ask { flex-direction: column; align-items: flex-start; }
  .toc ol { grid-template-columns: 1fr; }
}

@media print {
  html { zoom: 1 !important; }
  .top, .sheet, .progress, .toc, .foot, .skip, .legal-hero .cta-row, .ask, .anchor { display: none !important; }
  body { background: #fff; }
  .hero { background: none !important; color: #000; padding: 0 0 12px !important; }
  .hero::before, .chip { display: none; }
  .legal-hero h1 { color: #000; font-size: 26pt; margin: 0 0 8px; }
  .meta span { background: none; box-shadow: none; padding: 0 16px 0 0; }
  .meta small, .meta b { color: #333; }
  .legal-grid { display: block; margin: 0; padding: 0; }
  .wrap { width: 100%; }
  .legal { box-shadow: none; padding: 0; }
  .glance { background: #f4f4f4; color: #000; }
  .glance h2, .glance li { color: #000; }
  .legal p { color: #111; font-size: 11pt; }
  .clause { break-inside: avoid-page; }
}
body.legal-page .brand, body.legal-page .btn, body.legal-page .lang { font-weight: 700; }
