/* hiddengallery — stylesheet for the support pages of SafeCalc+ Private Album
   (App Store) / Hidden Gallery (Google Play). Plain CSS, no build step, no
   external fonts, no scripts. Works as a file:// document and on GitHub Pages.

   The palette is the app's default accent (indigo, lib/shared/theme/
   app_theme.dart) on a cool paper ground in light, lightened on deep ink in
   dark. The rest is Cafe Jadval's sheet, unchanged. */

:root {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --border: #e2e3ee;
  --ink: #1d2033;
  --ink-soft: #50546a;
  --ink-faint: #74788d;
  --accent: #4450c8;
  --accent-soft: #eceefc;
  --warn-bg: #fdf1da;
  --warn-border: #e4b763;
  --warn-ink: #6b4e05;
  --ok: #2e8b57;
  --radius: 12px;
  --measure: 44rem;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sans-fa: "Vazirmatn", "IRANSans", "Sahel", "Noto Naskh Arabic", "Geeza Pro", Tahoma, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11131f;
    --surface: #1a1d2e;
    --border: #2f3350;
    --ink: #eceef6;
    --ink-soft: #a9adc4;
    --ink-faint: #8b8fa8;
    --accent: #aab2ff;
    --accent-soft: #252a48;
    --warn-bg: #3a3116;
    --warn-border: #8a6f22;
    --warn-ink: #f0b94a;
    --ok: #5dbb85;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  overflow-wrap: break-word;
}

/* ── Persian / Dari ───────────────────────────────────────────────────── */

[dir="rtl"] body,
body[dir="rtl"],
.fa {
  font-family: var(--sans-fa);
  line-height: 1.95;
}

[dir="rtl"] body { font-size: 18px; }

.fa {
  direction: rtl;
  text-align: right;
  unicode-bidi: isolate;
}

/* Latin words and identifiers inside a Persian sentence stay left-to-right. */
.ltr { unicode-bidi: isolate; direction: ltr; }

/* ── Layout ───────────────────────────────────────────────────────────── */

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.15rem;
}

header.site {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.9rem 1.15rem;
  max-width: 60rem;
  margin: 0 auto;
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.brand span { color: var(--ink-faint); font-weight: 400; }

nav.langs { display: flex; gap: 0.85rem; font-size: 0.92rem; flex-wrap: wrap; }

nav.langs a { color: var(--ink-soft); }

nav.langs a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

main { padding: 2rem 0 3rem; }

section { margin: 0 0 2.4rem; }

footer.site {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 1.6rem 0 2.6rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

footer.site a { color: var(--ink-soft); }

/* ── Type ─────────────────────────────────────────────────────────────── */

h1 {
  font-size: 1.85rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0 0 0.6rem;
}

h2 {
  font-size: 1.22rem;
  line-height: 1.35;
  margin: 2.2rem 0 0.6rem;
  padding-top: 0.2rem;
}

h3 { font-size: 1.02rem; margin: 1.5rem 0 0.4rem; }

p, ul, ol, dl { margin: 0 0 0.9rem; }

ul, ol { padding-inline-start: 1.35rem; }

li { margin-bottom: 0.35rem; }

a { color: var(--accent); }

.small { font-size: 0.9rem; color: var(--ink-soft); }

.meta {
  font-size: 0.88rem;
  color: var(--ink-faint);
  margin-bottom: 1.6rem;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--accent-soft);
  color: var(--ink);
  padding: 0.08em 0.34em;
  border-radius: 5px;
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

/* ── Blocks ───────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.05rem 1.15rem;
  margin: 0 0 1rem;
}

.summary {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.05rem 1.15rem;
  margin: 0 0 1.8rem;
}

.summary ul { margin-bottom: 0; }

.summary h2 { margin-top: 0; font-size: 1.05rem; }

.note {
  border-inline-start: 3px solid var(--border);
  padding-inline-start: 0.9rem;
  color: var(--ink-soft);
}

.flag {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-ink);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin: 0.5rem 0 1.1rem;
  font-size: 0.94rem;
}

.flag a { color: inherit; }

/* Tables scroll rather than push the page sideways. */

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

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.93rem;
  min-width: 30rem;
}

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

th { color: var(--ink-faint); font-weight: 600; font-size: 0.85rem; }

/* Anchor offset so a linked heading is not glued to the top edge. */
:target { scroll-margin-top: 1.2rem; }

.toc {
  list-style: none;
  padding: 0;
  columns: 2;
  column-gap: 1.6rem;
  font-size: 0.94rem;
}

@media (max-width: 34rem) {
  .toc { columns: 1; }
  h1 { font-size: 1.6rem; }
}

.toc li { margin-bottom: 0.3rem; break-inside: avoid; }
