/*
 * سجل الوثائق النظامية — شروط الاستخدام وسياسة الخصوصية.
 * كان القالبان يعلنان body.legal-ledger بلا نظام يقابله، ويعتمدان شبكة
 * Bootstrap وألوانًا زرقاء غير محمّلة. هذا الملف يمنحهما نفس هوية المنصة:
 * حبر داكن، أخضر مهارات، حواف neo، وخط الواجهة نفسه.
 */

.legal-ledger .main-content { background: var(--ui-canvas, #f6f7f5); }

/* ترويسة الوثيقة */
.ledger-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(46px, 6vw, 76px) 0 clamp(52px, 6vw, 84px);
  color: #fff;
  background: linear-gradient(135deg, #0b7652 0%, #07583f 45%, #063426 100%);
}
.ledger-hero::after {
  content: "";
  position: absolute;
  inset-block-start: -30%;
  inset-inline-start: -8%;
  width: min(520px, 52%);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(216, 239, 103, .16), transparent 68%);
  pointer-events: none;
}
.ledger-hero-inner { position: relative; z-index: 1; width: min(1180px, calc(100% - 40px)); margin-inline: auto; text-align: center; }
.ledger-badge {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px;
  padding: 7px 14px; border: 1px solid rgba(216, 239, 103, .42); border-radius: 999px;
  background: rgba(216, 239, 103, .12); color: #dcefa7;
  font-size: .74rem; font-weight: 800;
}
.ledger-hero h1 { margin: 0; color: #fff; font-size: clamp(2rem, 4.2vw, 3.05rem); line-height: 1.15; letter-spacing: -.02em; }
.ledger-lede { max-width: 760px; margin: 16px auto 0; color: #cfe3d8; font-size: clamp(.92rem, 1.4vw, 1.05rem); line-height: 1.85; }
.ledger-hero-meta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 22px;
  margin-top: 24px; color: #a8cbba; font-size: .76rem; font-weight: 700;
}
.ledger-hero-meta span { display: inline-flex; align-items: center; gap: 7px; }

/* جسم الوثيقة */
.ledger-body { width: min(1180px, calc(100% - 40px)); margin-inline: auto; padding: 0 0 clamp(56px, 7vw, 96px); }
.ledger-layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); align-items: start; gap: 28px; margin-top: -34px; }

/* فهرس جانبي لاصق */
.ledger-index {
  position: sticky; top: 92px;
  padding: 20px; border: 1px solid var(--ui-line, #dfe6e1); border-radius: var(--ui-radius-lg, 22px);
  background: #fff; box-shadow: var(--ui-shadow, 0 10px 30px rgba(20, 43, 29, .055));
}
.ledger-index-title {
  display: flex; align-items: center; gap: 9px; margin-bottom: 14px;
  color: var(--ui-ink, #14211a); font-size: .88rem; font-weight: 800;
}
.ledger-index-title i { color: var(--ui-green, #096744); }
.ledger-index ol { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; counter-reset: ledger; }
.ledger-index a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
  color: var(--ui-muted, #68766e); text-decoration: none; font-size: .82rem; font-weight: 650; line-height: 1.45;
  transition: background .18s ease, color .18s ease;
}
.ledger-index a::before {
  counter-increment: ledger; content: counter(ledger);
  flex: 0 0 auto; display: grid; width: 22px; height: 22px; place-items: center; border-radius: 6px;
  background: #eef4f0; color: var(--ui-green, #096744); font-size: .68rem; font-weight: 850;
}
.ledger-index a:hover { background: #f3f8f5; color: var(--ui-ink, #14211a); }
.ledger-index a.is-current { background: var(--ui-green-soft, #edf5f0); color: var(--ui-green, #096744); font-weight: 800; }
.ledger-index a.is-current::before { background: var(--ui-green, #096744); color: #fff; }

/* ملخص سريع */
.ledger-summary {
  margin-bottom: 20px; padding: 22px 24px;
  border: 1px solid #cfe4d7; border-inline-start: 4px solid var(--ui-green, #096744);
  border-radius: var(--ui-radius, 16px); background: var(--ui-green-soft, #edf5f0);
}
.ledger-summary h2 {
  display: flex; align-items: center; gap: 9px; margin: 0 0 12px;
  color: #0b4d35; font-size: 1rem; font-weight: 800;
}
.ledger-summary ul { display: grid; gap: 9px; margin: 0; padding-inline-start: 20px; }
.ledger-summary li { color: #2c463a; font-size: .87rem; line-height: 1.75; }

/* بطاقة البنود */
.ledger-card {
  padding: clamp(22px, 3vw, 40px);
  border: 1px solid var(--ui-line, #dfe6e1); border-radius: var(--ui-radius-lg, 22px);
  background: #fff; box-shadow: var(--ui-shadow, 0 10px 30px rgba(20, 43, 29, .055));
}
.ledger-section { padding-bottom: 30px; margin-bottom: 30px; border-bottom: 1px solid #eef2ef; scroll-margin-top: 104px; }
.ledger-section:last-of-type { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.ledger-section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.ledger-mark {
  flex: 0 0 auto; display: grid; width: 42px; height: 42px; place-items: center;
  border-radius: 12px; background: var(--ui-green-soft, #edf5f0); color: var(--ui-green, #096744);
  font-size: 1.02rem; font-weight: 850;
}
.ledger-section-head h2 { margin: 0; color: var(--ui-ink, #14211a); font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.35; }
.ledger-prose { padding-inline-start: 56px; color: #3d4c44; font-size: .93rem; line-height: 1.9; }
.ledger-prose > p { margin: 0 0 12px; }
.ledger-prose > p:last-child { margin-bottom: 0; }
.ledger-prose ul { display: grid; gap: 10px; margin: 12px 0 0; padding-inline-start: 20px; list-style: disc; }
.ledger-prose li::marker { color: var(--ui-green, #096744); }
.ledger-prose strong { color: var(--ui-ink, #14211a); font-weight: 800; }
.ledger-prose a { color: var(--ui-green, #096744); font-weight: 800; text-decoration: none; border-bottom: 1px solid currentColor; }
.ledger-prose a:hover { color: #063426; }

/* تذييل الوثيقة */
.ledger-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  margin-top: 28px; padding-top: 20px; border-top: 1px solid #eef2ef;
  color: var(--ui-muted, #68766e); font-size: .78rem;
}
.ledger-foot span { display: inline-flex; align-items: center; gap: 7px; }
.ledger-foot i { color: var(--ui-green, #096744); }

@media (max-width: 980px) {
  .ledger-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .ledger-index { position: static; padding: 14px; }
  .ledger-index ol { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; gap: 7px; padding-bottom: 4px; scrollbar-width: thin; }
  .ledger-index a { border: 1px solid var(--ui-line, #dfe6e1); white-space: nowrap; }
  .ledger-prose { padding-inline-start: 0; }
}
@media (max-width: 560px) {
  .ledger-layout { margin-top: -22px; }
  .ledger-section-head { gap: 11px; }
  .ledger-mark { width: 36px; height: 36px; font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ledger-index a { transition: none; }
}
