/* Shared styling for the Amazonat Libya public policy pages.
   No build step and no framework: these are dropped on a server as-is.
   The type pairing mirrors the app — Plus Jakarta Sans for Latin, IBM Plex
   Sans Arabic for Arabic — with system fallbacks if the webfonts are blocked. */

:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --sunken: #f4f2ee;
  --hairline: #e7e3dc;
  --text: #1c1a17;
  --text-secondary: #56514a;
  --text-muted: #8a837a;
  --brand: #1f6f4a;
  --brand-contrast: #ffffff;
  --radius: 18px;
  --maxw: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14130f;
    --surface: #1c1b17;
    --sunken: #232119;
    --hairline: #33302a;
    --text: #f2efe9;
    --text-secondary: #bdb7ad;
    --text-muted: #8f887e;
    --brand: #6fbf92;
    --brand-contrast: #10221a;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", "IBM Plex Sans Arabic", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.75;
}

html[lang="ar"] body {
  font-family: "IBM Plex Sans Arabic", "Plus Jakarta Sans", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ── Header ─────────────────────────────────────────────── */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1.25rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--hairline);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand .mark {
  width: 2.25rem;
  height: 2.25rem;
  display: block;
  object-fit: contain;
  /* The artwork is a transparent PNG drawn in the brand green, so it sits
     directly on the page rather than in a chip. */
}

/* That green (#3F7D24) is drawn for a light ground; on the dark palette it
   falls to roughly 3.7:1 against the background. Lift it rather than boxing
   the mark in a white tile, which would read as a sticker. */
@media (prefers-color-scheme: dark) {
  .brand .mark { filter: brightness(1.38) saturate(1.05); }
}

.langswitch {
  display: inline-flex;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}

.langswitch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.95rem;
  cursor: pointer;
}

.langswitch button[aria-pressed="true"] {
  background: var(--brand);
  color: var(--brand-contrast);
}

/* ── Document ───────────────────────────────────────────── */

h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  line-height: 1.35;
  margin: 0 0 0.35rem;
}

.updated {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.intro {
  color: var(--text-secondary);
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.05rem;
  line-height: 1.5;
  margin: 2rem 0 0.6rem;
}

p { color: var(--text-secondary); margin: 0 0 0.75rem; }

ul { margin: 0 0 0.75rem; padding-inline-start: 1.15rem; }

li { color: var(--text-secondary); margin-bottom: 0.45rem; }

li::marker { color: var(--brand); }

a { color: var(--brand); text-underline-offset: 3px; }

strong { color: var(--text); }

/* Latin tokens — email, dates, version numbers — keep their own direction
   inside Arabic text, or the bidi algorithm reorders them. */
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* Section label above a run of same-level headings — without it the FAQ's
   "Common questions" reads as just another question. */
h2.section-label {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2.5rem;
  margin-bottom: 0.25rem;
}

html[lang="ar"] h2.section-label { letter-spacing: 0; }

/* ── Callout ────────────────────────────────────────────── */

.callout {
  background: var(--sunken);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 1.5rem 0;
}

.callout h2 { margin-top: 0; }

.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }

/* ── Steps ──────────────────────────────────────────────── */

ol.steps { margin: 0 0 0.75rem; padding-inline-start: 1.3rem; }

ol.steps li { margin-bottom: 0.55rem; }

ol.steps li::marker { font-weight: 700; color: var(--brand); }

/* ── Table ──────────────────────────────────────────────── */

.table-scroll { overflow-x: auto; margin: 0 0 1rem; }

table {
  width: 100%;
  min-width: 26rem;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  text-align: start;
  vertical-align: top;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--hairline);
  color: var(--text-secondary);
}

th {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

/* ── Footer ─────────────────────────────────────────────── */

footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer a { color: var(--text-muted); }

.docnav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

/* Language panes. Visibility is driven by <html lang>, which the inline head
   script sets before the body paints — the `hidden` attributes in the markup
   are the no-JavaScript fallback, which leaves the Arabic version showing. */
html[lang="ar"] [data-lang="en"] { display: none; }
html[lang="en"] [data-lang="ar"] { display: none; }
[data-lang][hidden] { display: none; }

@media print {
  .langswitch, .docnav { display: none; }
  body { background: #fff; color: #000; }
}
