/* =========================================================================
   Lamha - the legal pages (/privacy, /terms)
   Loaded after app.css and landing.css, and built only on their tokens: every
   colour, radius, shadow, space and font below is one of app.css's custom
   properties. A policy is a document, so this file is mostly typography:
   one readable column, generous line height, and headings you can scan.
   Logical properties throughout, so Arabic (the default) and English lay out
   from the same rules.
   ========================================================================= */

.lg-body { background-attachment: fixed; }

.lg-main { display: block; padding-block: var(--s8) var(--s9); }

/* 74ch is about 11 words a line in English and comfortable in Arabic too.
   Wider than this and the eye loses the start of the next line. */
.lg-wrap { max-width: 860px; }

/* ------------------------------------------------------------------ head */

.lg-head { margin-block-end: var(--s7); }

.lg-crumb { margin: 0 0 var(--s4); font-size: 14px; }
.lg-crumb a { color: var(--ink-3); font-weight: 600; }
.lg-crumb a:hover { color: var(--brand-600); }

.lg-h1 {
  font-size: clamp(30px, 4.2vw, 44px);
  line-height: 1.14;
  font-weight: 800;
  letter-spacing: -0.028em;
  color: var(--ink);
}
html[dir="rtl"] .lg-h1 { line-height: 1.38; letter-spacing: 0; }

.lg-lead {
  margin-block: var(--s4) 0;
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink-2);
  max-width: 68ch;
}

.lg-updated {
  display: inline-flex; align-items: center; gap: 8px;
  margin-block: var(--s5) 0;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  color: var(--brand-700);
  font-size: 13px; font-weight: 650;
}

/* --------------------------------------------------------------- summary */

/* The box at the top: the whole policy in a handful of lines, for the reader
   who will not read the rest. */
.lg-tldr {
  margin-block-end: var(--s7);
  padding: var(--s6);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-2);
}
.lg-tldr h2 {
  margin-block-end: var(--s4);
  font-size: 13px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3);
}
html[dir="rtl"] .lg-tldr h2 { letter-spacing: 0; }
.lg-tldr ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.lg-tldr li {
  position: relative;
  padding-inline-start: 28px;
  font-size: 16px; line-height: 1.7; color: var(--ink-2);
}
.lg-tldr li::before {
  content: "";
  position: absolute; inset-inline-start: 6px; inset-block-start: 10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--violet));
}
.lg-tldr strong { color: var(--ink); font-weight: 700; }

/* ----------------------------------------------------------------- index */

.lg-toc {
  margin-block-end: var(--s8);
  padding: var(--s5) var(--s6);
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.lg-toc h2 {
  margin-block-end: var(--s3);
  font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3);
}
html[dir="rtl"] .lg-toc h2 { letter-spacing: 0; }
.lg-toc ol {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px var(--s6);
  counter-reset: lgtoc;
}
.lg-toc li { counter-increment: lgtoc; font-size: 15px; }
.lg-toc a { color: var(--ink-2); }
.lg-toc a::before {
  content: counter(lgtoc) ".";
  margin-inline-end: 7px;
  color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 650;
}
.lg-toc a:hover { color: var(--brand-600); }

/* -------------------------------------------------------------- sections */

.lg-sec { margin-block-end: var(--s8); scroll-margin-block-start: calc(var(--nav-h) + var(--s4)); }

.lg-sec > h2 {
  margin-block-end: var(--s4);
  padding-block-end: var(--s3);
  border-block-end: 1px solid var(--line);
  font-size: clamp(21px, 2.4vw, 26px);
  line-height: 1.3;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink);
}
html[dir="rtl"] .lg-sec > h2 { line-height: 1.5; letter-spacing: 0; }

.lg-sec h3 {
  margin-block: var(--s6) var(--s3);
  font-size: 17px; font-weight: 700; color: var(--ink);
}

.lg-sec p,
.lg-sec li { font-size: 16px; line-height: 1.8; color: var(--ink-2); }
.lg-sec p { margin-block: 0 var(--s4); max-width: 74ch; }
.lg-sec p:last-child { margin-block-end: 0; }

.lg-sec ul { margin-block: 0 var(--s4); padding-inline-start: 22px; max-width: 74ch; }
.lg-sec ul li { margin-block-end: 10px; }
.lg-sec ul li::marker { color: var(--brand-300); }

.lg-sec strong { color: var(--ink); font-weight: 700; }
.lg-sec a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------ data table */

/* What we hold, why, and for how long. A table, because that is the shape of
   the question a reader actually has. It becomes stacked cards on a phone. */
.lg-table-wrap {
  margin-block-end: var(--s5);
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--sh-1);
}
.lg-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.lg-table th, .lg-table td {
  padding: var(--s4) var(--s5);
  text-align: start;
  vertical-align: top;
  line-height: 1.7;
  border-block-end: 1px solid var(--line-soft);
}
.lg-table thead th {
  background: var(--surface-2);
  font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
html[dir="rtl"] .lg-table thead th { letter-spacing: 0; }
.lg-table tbody tr:last-child th,
.lg-table tbody tr:last-child td { border-block-end: 0; }
.lg-table tbody th { font-weight: 700; color: var(--ink); width: 30%; }
.lg-table td { color: var(--ink-2); }

/* ------------------------------------------------------------ call-outs */

.lg-note {
  margin-block: var(--s5) var(--s5);
  padding: var(--s5);
  border-radius: var(--r);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-inline-start: 4px solid var(--brand-500);
}
.lg-note p { color: var(--ink-2); }
.lg-note p:last-child { margin-block-end: 0; }

.lg-note-warn {
  background: var(--amber-soft);
  border-color: #f3d9a4;
  border-inline-start-color: var(--amber);
}

/* The one thing a reader must not miss: a link is a key. */
.lg-note-key {
  background: var(--violet-soft);
  border-color: #e2d3fb;
  border-inline-start-color: var(--violet);
}

/* --------------------------------------------------------------- contact */

.lg-contact {
  margin-block-start: var(--s8);
  padding: var(--s7);
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--brand-600) 0%, #5b4cf0 52%, var(--violet) 100%);
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(91, 76, 240, .55);
}
html[dir="rtl"] .lg-contact { background: linear-gradient(225deg, var(--brand-600) 0%, #5b4cf0 52%, var(--violet) 100%); }
.lg-contact h2 { margin-block-end: var(--s3); font-size: 22px; font-weight: 750; color: #fff; }
.lg-contact p { margin-block-end: var(--s5); color: rgba(255, 255, 255, .88); line-height: 1.75; max-width: 60ch; }
.lg-contact p:last-child { margin-block-end: 0; }
.lg-contact-mail {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 20px;
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--brand-700);
  font-weight: 700; font-size: 16px;
  text-decoration: none;
  box-shadow: var(--sh-1);
}
.lg-contact-mail:hover { background: var(--brand-50); text-decoration: none; }
.lg-contact-mail svg { width: 18px; height: 18px; flex: none; }

/* An address is Latin text: keep it left-to-right inside an Arabic sentence. */
.lg-ltr { direction: ltr; unicode-bidi: isolate; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 760px) {
  .lg-main { padding-block: var(--s6) var(--s8); }
  .lg-toc ol { grid-template-columns: minmax(0, 1fr); }
  .lg-tldr, .lg-contact { padding: var(--s5); }
  .lg-sec { margin-block-end: var(--s7); }
  .lg-sec p, .lg-sec li, .lg-tldr li { font-size: 15.5px; }

  /* The table stops being a table: each row becomes a small labelled card,
     which is the only shape three columns can take at 360px. */
  .lg-table-wrap { border: 0; background: transparent; box-shadow: none; overflow: visible; }
  .lg-table, .lg-table tbody, .lg-table tr, .lg-table th, .lg-table td { display: block; width: auto; }
  .lg-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lg-table tbody tr {
    margin-block-end: var(--s4);
    padding: var(--s4) var(--s5);
    border-radius: var(--r);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--sh-1);
  }
  .lg-table tbody th, .lg-table tbody td { padding: 0; border: 0; }
  .lg-table tbody th { width: auto; margin-block-end: 6px; font-size: 16px; }
  .lg-table tbody td { margin-block-start: 10px; font-size: 15px; }
  .lg-table tbody td::before {
    content: attr(data-label);
    display: block;
    margin-block-end: 2px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    color: var(--ink-3);
  }
  html[dir="rtl"] .lg-table tbody td::before { letter-spacing: 0; }
}

@media (max-width: 420px) {
  .lg-updated { font-size: 12.5px; }
}

/* The nav's ghost "Sign in" is the first thing to go when space is tight;
   the primary button and the language switch carry the bar on their own. */
@media (max-width: 430px) {
  .lg-signin { display: none; }
}

@media print {
  .nav, .lp-foot, .lg-toc, .lg-crumb { display: none; }
  .lg-main { padding: 0; }
  .lg-contact { background: none; color: var(--ink); box-shadow: none; border: 1px solid var(--line); }
  .lg-contact h2, .lg-contact p { color: var(--ink); }
}
