/* doc.parsinabot.ir — developer docs of the external booking API (PM-1287).
   Tokens are Parsina's (docs/design/DESIGN_SYSTEM.md §1, §2, §4): azure primary, teal
   accent, Vazirmatn, radius 10 for controls / 14 for cards, three shadows. Light only —
   DESIGN_SYSTEM §1.1 «No dark mode, product-wide». Logical properties only (§11): the
   same sheet serves the RTL Persian page and the LTR English page. Colour literals live
   in :root and nowhere else. */

@font-face { font-family: "Vazirmatn"; src: url("/assets/fonts/Vazirmatn-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/assets/fonts/Vazirmatn-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/assets/fonts/Vazirmatn-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --navy: #0173BE;
  --navy-dark: #015E9C;
  --navy-50: #EAF4FC;
  --teal: #00BEB2;
  --teal-light: #DFF8F6;
  --green-light: #E6F5EF;
  --good-ink: #166534;
  --amber: #F59E0B;
  --amber-light: #FEF3C7;
  --warn-ink: #92400E;
  --bg: #F5F7FA;
  --card: #FFFFFF;
  --border: #EEF0F3;
  --border-2: #E3E7ED;
  --text: #1A2332;
  --text-2: #5A6780;
  --text-muted: #9AA3B0;
  --shadow-card: 0 1px 6px rgba(0, 0, 0, .05);
  --shadow-float: 0 8px 24px rgba(0, 0, 0, .12);
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --font: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Vazirmatn", monospace;
  --topbar: 3.5rem;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.75;
}
:root[lang="fa"] body { line-height: 1.95; }

[id] { scroll-margin-top: calc(var(--topbar) + 1rem); }

a { color: var(--navy); text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--navy-dark); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--teal); outline-offset: 1px; box-shadow: 0 0 0 1px var(--navy-dark); border-radius: 4px; }

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -4rem;
  z-index: 100;
  padding: .5rem 1rem;
  background: var(--navy);
  color: var(--card);
  border-radius: var(--r-md);
}
.skip-link:focus { top: .5rem; color: var(--card); }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon { flex: none; }

/* ── Top bar ──────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: .75rem;
  height: var(--topbar);
  padding-inline: 1rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand img { width: 2rem; height: 2rem; }
.brand-name { font-weight: 700; font-size: 1.0625rem; }
.brand-sub { color: var(--text-2); font-size: .9375rem; }
.chip {
  display: inline-flex; align-items: center; padding: 0 .5rem; min-height: 1.375rem;
  border-radius: 999px; background: var(--navy-50); color: var(--navy-dark);
  font-size: .75rem; font-weight: 700; direction: ltr; unicode-bidi: isolate;
}
.lang-nav { margin-inline-start: auto; }
.lang-switch {
  display: inline-flex; align-items: center; gap: .375rem; min-height: 2.75rem; padding-inline: .75rem;
  border: 1px solid var(--border-2); border-radius: var(--r-md); color: var(--text); text-decoration: none; font-size: .9375rem;
}
.lang-switch:hover { background: var(--bg); color: var(--text); }
.menu-btn {
  display: none; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem;
  border: 1px solid var(--border-2); border-radius: var(--r-md); background: var(--card); color: var(--text); cursor: pointer;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.layout { display: grid; grid-template-columns: 16.5rem minmax(0, 1fr); max-width: 90rem; margin-inline: auto; }

.sidebar {
  position: sticky;
  top: var(--topbar);
  align-self: start;
  height: calc(100vh - var(--topbar));
  overflow-y: auto;
  padding: 1.25rem .75rem 3rem;
  border-inline-end: 1px solid var(--border);
}
.sidebar ul { list-style: none; margin: 0 0 1rem; padding: 0; }
.sidebar a {
  display: block; padding: .3rem .75rem; border-radius: var(--r-sm);
  color: var(--text-2); text-decoration: none; font-size: .9375rem; line-height: 1.6;
}
.sidebar a:hover { background: var(--card); color: var(--text); }
.sidebar a[aria-current] { background: var(--navy-50); color: var(--navy-dark); font-weight: 500; }
.sidebar .sub a { padding-inline-start: 1.5rem; font-size: .875rem; }
.nav-group {
  margin: .75rem .75rem .25rem; color: var(--text-muted); font-size: .75rem; font-weight: 700; letter-spacing: .02em;
}
:root[lang="en"] .nav-group { text-transform: uppercase; }

main {
  min-width: 0;
  max-width: 54rem;
  padding: 2rem 2.5rem 4rem;
  background: var(--card);
  border-inline-end: 1px solid var(--border);
  min-height: calc(100vh - var(--topbar));
}
main:focus { outline: none; }

/* ── Content ──────────────────────────────────────────────────────────────── */
.hero { padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
h1 { margin: 0 0 .5rem; font-size: 1.875rem; line-height: 1.35; font-weight: 700; }
.lead { margin: 0 0 1.25rem; color: var(--text-2); font-size: 1.0625rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .75rem; margin: 0; }
.facts > div { padding: .75rem 1rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); }
.facts dt { color: var(--text-2); font-size: .8125rem; }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

section { padding-top: .5rem; }
h2 { margin: 2.5rem 0 1rem; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: 1.4375rem; line-height: 1.45; font-weight: 700; }
.hero + section > h2 { border-top: 0; }
h3 { margin: 1.75rem 0 .75rem; font-size: 1.125rem; line-height: 1.5; font-weight: 700; }
h4 { margin: 1.25rem 0 .5rem; font-size: 1rem; font-weight: 700; }
.sub-section > h3 { margin-top: 2.25rem; padding-top: 1rem; border-top: 1px dashed var(--border-2); overflow-wrap: anywhere; }
p, ul, ol { margin: 0 0 1rem; }
ul, ol { padding-inline-start: 1.5rem; }
li { margin-bottom: .35rem; }
li > .code { margin-top: .5rem; }
strong { font-weight: 700; }
.muted { color: var(--text-2); font-size: .9375rem; }

.ltr { direction: ltr; unicode-bidi: isolate; }

code {
  direction: ltr;
  unicode-bidi: isolate;
  padding: .05em .4em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: .875em;
  overflow-wrap: anywhere;
}
a code { color: inherit; }

.method {
  display: inline-block; min-width: 3.25rem; padding: .05rem .5rem; border-radius: var(--r-sm);
  font-family: var(--mono); font-size: .8125rem; font-weight: 700; text-align: center; direction: ltr; unicode-bidi: isolate;
}
.method-get { background: var(--green-light); color: var(--good-ink); }
.method-post { background: var(--navy-50); color: var(--navy-dark); }
code.path { font-size: .9375rem; background: transparent; border: 0; padding: 0; }
.scope-line { color: var(--text-2); font-size: .9375rem; }

/* Code blocks — always LTR, wide content scrolls inside its own box. */
.code { margin: .75rem 0 1.25rem; border: 1px solid var(--border-2); border-radius: var(--r-md); background: var(--bg); overflow: hidden; }
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  min-height: 2.5rem; padding-inline: .875rem .375rem; border-bottom: 1px solid var(--border-2); background: var(--card);
}
.code-label { color: var(--text-2); font-size: .8125rem; font-weight: 500; }
pre {
  margin: 0;
  padding: .875rem 1rem;
  overflow-x: auto;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
  font-family: var(--mono);
  font-size: .8125rem;
  line-height: 1.65;
  tab-size: 2;
}
pre code { padding: 0; border: 0; background: transparent; font-size: inherit; overflow-wrap: normal; white-space: pre; }
.copy {
  display: inline-flex; align-items: center; gap: .375rem; min-height: 2rem; padding-inline: .625rem;
  border: 1px solid transparent; border-radius: var(--r-md); background: transparent; color: var(--text-2);
  font: inherit; font-size: .8125rem; cursor: pointer;
}
.copy:hover { background: var(--bg); border-color: var(--border-2); color: var(--text); }
.copy[data-state="copied"] { color: var(--good-ink); }

/* Tables — scroll inside their own box on a phone. */
.table-wrap { margin: .75rem 0 1.25rem; overflow-x: auto; border: 1px solid var(--border-2); border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th, td { padding: .625rem .75rem; text-align: start; vertical-align: top; border-bottom: 1px solid var(--border); }
th { background: var(--bg); color: var(--text-2); font-size: .8125rem; font-weight: 700; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.err-table td:nth-child(1), .err-table td:nth-child(2), .ref-table td:nth-child(1) { white-space: nowrap; }
.ref-table td:nth-child(2) { min-width: 18rem; }
.err-table td:nth-child(3) { min-width: 14rem; }
.err-table td:nth-child(4) { min-width: 14rem; }

/* Callouts */
.callout {
  display: flex; gap: .75rem; margin: 1rem 0 1.25rem; padding: .875rem 1rem;
  border-radius: var(--r-md); border: 1px solid var(--border-2); border-inline-start-width: 4px;
}
.callout > div > :last-child { margin-bottom: 0; }
.callout-title { margin: 0 0 .25rem; font-weight: 700; }
.callout-note { background: var(--navy-50); border-color: var(--navy-50); border-inline-start-color: var(--navy); }
.callout-note .icon { color: var(--navy); }
.callout-warn { background: var(--amber-light); border-color: var(--amber-light); border-inline-start-color: var(--amber); }
.callout-warn .icon, .callout-warn .callout-title { color: var(--warn-ink); }

ol.steps { padding-inline-start: 1.75rem; }
ol.steps > li { margin-bottom: 1rem; }

ul.errs { padding-inline-start: 1.25rem; }
ul.errs li { margin-bottom: .2rem; }

ul.checklist { list-style: none; padding-inline-start: 0; }
ul.checklist li { position: relative; padding-inline-start: 2rem; margin-bottom: .6rem; }
ul.checklist li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .35em;
  width: 1.25rem; height: 1.25rem; border-radius: var(--r-sm); background: var(--teal-light); border: 1px solid var(--teal);
}
ul.checklist li::after {
  content: ""; position: absolute; inset-inline-start: .45rem; top: .55em;
  width: .35rem; height: .65rem; border: solid var(--navy-dark); border-width: 0 2px 2px 0; transform: rotate(45deg);
}

blockquote.sample {
  margin: .75rem 0 1.25rem; padding: .875rem 1.125rem; background: var(--bg);
  border: 1px solid var(--border-2); border-inline-start: 4px solid var(--teal); border-radius: var(--r-md);
  font-family: var(--font); line-height: 2;
}
blockquote.sample p { margin: 0; }

.page-footer { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--border); color: var(--text-2); font-size: .875rem; }

/* ── Phone (≤ 768, DESIGN_SYSTEM §12) ─────────────────────────────────────── */
@media (max-width: 768px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-flex; }
  .brand-sub { display: none; }
  .sidebar {
    display: none;
    position: fixed;
    top: var(--topbar);
    bottom: 0;
    inset-inline: 0;
    z-index: 30;
    height: auto;
    padding-bottom: 2rem;
    background: var(--card);
    border: 0;
    box-shadow: var(--shadow-float);
  }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { display: block; }
  .sidebar a { padding-block: .55rem; }
  main { padding: 1.25rem .875rem 3rem; border: 0; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  pre { font-size: .75rem; }
}

@media print {
  .topbar, .sidebar, .copy, .skip-link { display: none !important; }
  .layout { display: block; }
  main { max-width: none; padding: 0; border: 0; }
  pre { white-space: pre-wrap; }
}
