/* Sana legal pages — palette lifted from the app's asset catalog
   (bg #FAF7F2, ink #2B2420, accentInk #785151, accentSoft #E9D6D6).
   The app ships Light-only (UIUserInterfaceStyle=Light); these pages match. */

:root {
  /* Opts out of Chrome's Auto Dark Theme on Android, which would otherwise
     invert this palette despite the light-only intent above. */
  color-scheme: light;

  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --ink: #2B2420;
  --ink2: #5C5247;
  --ink3: #6E665A;
  --accent-ink: #785151;
  --accent-soft: #E9D6D6;
  --line: #E8E1D6;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Sans", sans-serif;
  font-size: 17px;
  line-height: 1.85;
}

/* Latin copy sets slightly tighter than Arabic. Scoped to whole-page and
   whole-block contexts only — a bare [lang="en"] would also hit the small
   footer links and the header language button. */
html[lang="en"] body,
.lang-block[lang="en"] { font-size: 16.5px; line-height: 1.7; }

.wrap {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

/* The footer sits OUTSIDE <main> so it keeps its contentinfo landmark; this
   wrapper only re-establishes the column. <main> gives up its bottom gutter
   so the footer's own margin-top isn't added to it. */
main.wrap { padding-bottom: 0; }
/* The 3.5rem gap is padding here, NOT .site-foot's margin: a margin would
   collapse out of this wrapper and silently move if it ever gains a border,
   background, or its own padding. */
.wrap--foot { padding-top: 3.5rem; }

/* Header band */
.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}
.wordmark {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent-ink);
  text-decoration: none;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.wordmark:hover, .wordmark:focus-visible { color: var(--ink); }
.head-spacer { flex: 1; }
.lang-switch {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-ink);
  text-decoration: none;
  border: 1px solid var(--accent-soft);
  background: var(--surface);
  border-radius: 999px;
  /* Explicit min-height, not padding + inherited line-height: the AR and EN
     pages set different line-heights, which made derived heights disagree. */
  padding: 0 0.95rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.lang-switch:hover { background: var(--accent-soft); }

/* Document */
h1 {
  font-size: 1.7rem;
  line-height: 1.35;
  font-weight: 700;
  margin: 2.2rem 0 0.4rem;
  text-wrap: balance;
}
.updated {
  color: var(--ink3);
  font-size: 0.88rem;
  margin: 0 0 1.6rem;
}
.intro { color: var(--ink); }

h2 {
  font-size: 1.12rem;
  font-weight: 700;
  margin: 2rem 0 0.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  text-wrap: balance;
}
section:first-of-type h2 { border-top: 0; padding-top: 0; }

p { margin: 0 0 0.9rem; }

ul {
  margin: 0 0 0.9rem;
  padding-inline-start: 1.4rem;
}
li { margin-bottom: 0.55rem; }
li::marker { color: var(--accent-ink); }

a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
/* .lang-switch / .wordmark are anchors too — listing them here as well would
   out-specify their own border-radius and square off the focused pill. */
a:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
  border-radius: 3px;
}
.lang-switch:focus-visible { border-radius: 999px; }

.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin: 0.4rem 0 1rem;
}
.contact-card .mail {
  font-weight: 600;
  font-size: 1.05rem;
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.contact-card .hint { color: var(--ink2); font-size: 0.92rem; margin: 0.3rem 0 0; }

/* Landing page */
.landing { text-align: center; padding-top: 4rem; }
.landing .mark {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--accent-ink);
  margin: 0 0 0.3rem;
}
.landing .tagline { color: var(--ink2); margin-bottom: 2.4rem; }
.link-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 26rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.link-list a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1.2rem;
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
}
.link-list a:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
.link-list .sub { display: block; font-weight: 400; font-size: 0.85rem; color: var(--ink3); margin-top: 0.15rem; }

/* Footer */
.site-foot {
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
  color: var(--ink3);
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.4rem;
}
.site-foot--center { justify-content: center; }
.site-foot a, .site-foot > span {
  color: var(--ink3);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.site-foot a:hover { color: var(--accent-ink); }

/* Support page language blocks */
.lang-block + .lang-block {
  margin-top: 3rem;
  border-top: 2px solid var(--accent-soft);
  padding-top: 1.5rem;
}
.block-switch {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
}
.block-switch a { display: inline-flex; align-items: center; min-height: 44px; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
/* The support page's two in-page jumps land silently otherwise. */
.lang-block:target h1 {
  outline: 2px solid var(--accent-soft);
  outline-offset: 6px;
  border-radius: 4px;
}
