/* =====================================================================
   Al-Saqi Payment Gateway — Developer Documentation
     ===================================================================== */

/* ----------------------------- Fonts ------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* --------------------------- Design tokens ------------------------- */
:root {
  /* Brand (extracted from official logo) */
  --brand: #087683;
  --brand-600: #0a8090;
  --brand-700: #065c66;
  --brand-800: #044a52;
  --brand-light: #0a93a3;
  --brand-tint: #eaf5f6;
  --brand-tint-2: #d6ebee;

  /* Surfaces */
  --bg: #ffffff;
  --bg-subtle: #f6f9f9;
  --bg-sidebar: #fbfcfc;
  --surface: #ffffff;
  --surface-2: #f4f7f8;

  /* Lines */
  --border: #e4eaeb;
  --border-strong: #cfd9db;

  /* Text */
  --text: #14272c;
  --text-muted: #56686d;
  --text-faint: #899699;

  /* Code surface (dark even in light mode) */
  --code-bg: #0c2226;
  --code-bg-2: #0a1c20;
  --code-text: #d6e6e6;
  --code-border: #143037;

  /* Semantic */
  --green: #15803d;
  --green-bg: #e8f6ed;
  --amber: #b45309;
  --amber-bg: #fdf3e7;
  --red: #be123c;
  --red-bg: #fdeaee;
  --blue: #0369a1;
  --blue-bg: #e8f3fb;
  --purple: #6d28d9;

  /* Method colors */
  --m-get: #15803d;
  --m-post: #087683;
  --m-put: #b45309;
  --m-delete: #be123c;

  /* Geometry */
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 16px;
  --topbar-h: 62px;
  --sidebar-w: 290px;
  --toc-w: 240px;
  --content-max: 880px;

  --shadow-sm: 0 1px 2px rgba(12, 34, 38, .06), 0 1px 3px rgba(12, 34, 38, .05);
  --shadow-md: 0 4px 14px rgba(12, 34, 38, .08);
  --shadow-lg: 0 12px 38px rgba(12, 34, 38, .14);

  --font-sans: 'Tajawal', sans-serif;
  --font-ar: 'Tajawal', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #0a1416;
  --bg-subtle: #0d1c1f;
  --bg-sidebar: #0b181b;
  --surface: #0f1f22;
  --surface-2: #122a2e;

  --border: #1c3338;
  --border-strong: #274b52;

  --text: #e7f0f1;
  --text-muted: #9db1b5;
  --text-faint: #6e8488;

  --brand: #18a7ba;
  --brand-600: #14a0b2;
  --brand-700: #2bb6c7;
  --brand-light: #34c2d3;
  --brand-tint: #0e2b30;
  --brand-tint-2: #103840;

  --code-bg: #061417;
  --code-bg-2: #040e10;
  --code-border: #15313a;

  --green-bg: #0e2a1c;
  --amber-bg: #2c2210;
  --red-bg: #2c1219;
  --blue-bg: #0c2230;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,.45);
  --shadow-lg: 0 16px 44px rgba(0,0,0,.55);
}

/* ----------------------------- Reset ------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 20px); }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .25s ease, color .25s ease;
}
[dir="rtl"] body { font-family: var(--font-ar); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
::selection { background: var(--brand-tint-2); color: var(--brand-800); }
[data-theme="dark"] ::selection { background: var(--brand-tint-2); color: var(--text); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 20px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: content-box; }

/* ============================== TOPBAR ============================= */
.topbar {
  position: fixed;
  top: 0; inset-inline: 0;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 22px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.topbar__brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.topbar__logo { height: 30px; width: auto; display: block; }
.topbar__brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.topbar__brand-name { font-weight: 700; font-size: 15px; letter-spacing: .2px; }
.topbar__brand-sub { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.topbar__badge {
  font-size: 10.5px; font-weight: 700; color: var(--brand);
  background: var(--brand-tint); border: 1px solid var(--brand-tint-2);
  padding: 2px 8px; border-radius: 20px; margin-inline-start: 4px;
}

.topbar__spacer { flex: 1; }

.search {
  position: relative;
  width: min(360px, 34vw);
  flex-shrink: 1;
}
.search input {
  width: 100%;
  height: 38px;
  padding-inline: 38px 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search input:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.search__icon {
  position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-faint); pointer-events: none;
}
.search__kbd {
  position: absolute; inset-inline-end: 9px; top: 50%; transform: translateY(-50%);
  font-size: 11px; font-family: var(--font-mono); color: var(--text-faint);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; background: var(--bg);
}

.topbar__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text-muted);
  cursor: pointer; transition: all .15s;
}
.iconbtn:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-tint); }
.iconbtn svg { width: 18px; height: 18px; }

.langbtn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text-muted);
  cursor: pointer; font-family: inherit; font-weight: 600; font-size: 13px;
  transition: all .15s;
}
.langbtn:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-tint); }
.langbtn svg { width: 16px; height: 16px; }

.btn-cta {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 16px;
  background: var(--brand); color: #fff;
  border: 1px solid var(--brand); border-radius: var(--radius);
  font-weight: 600; font-size: 13.5px; cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn-cta:hover { background: var(--brand-700); text-decoration: none; }
.btn-cta:active { transform: translateY(1px); }
.btn-cta svg { width: 15px; height: 15px; }

.menu-toggle { display: none; }

/* ============================== LAYOUT ============================ */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  margin: 0 auto;
}

/* ============================== SIDEBAR =========================== */
.sidebar {
  grid-column: 1;
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 22px 14px 60px;
  border-inline-end: 1px solid var(--border);
  background: var(--bg-sidebar);
}
.nav-group { margin-bottom: 6px; }
.nav-group__title {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  font-size: 15.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase;
  color: var(--text-faint);
  padding: 10px 12px 6px;
  background: none; border: none; cursor: pointer;
  font-family: inherit;
  text-align: start;
}
.nav-group__title .chev {
  margin-inline-start: auto; width: 13px; height: 13px;
  transition: transform .2s; color: var(--text-faint);
}
.nav-group.collapsed .chev { transform: rotate(-90deg); }
[dir="rtl"] .nav-group.collapsed .chev { transform: rotate(90deg); }
.nav-group__items { display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.nav-group.collapsed .nav-group__items { display: none; }

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 16px; font-weight: 700;
  position: relative;
  transition: background .12s, color .12s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active {
  background: var(--brand-tint);
  color: var(--brand);
  font-weight: 600;
}
.nav-link.active::before {
  content: ""; position: absolute; inset-inline-start: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; background: var(--brand); border-radius: 0 3px 3px 0;
}
[dir="rtl"] .nav-link.active::before { border-radius: 3px 0 0 3px; }
.nav-link .verb {
  font-size: 9.5px; font-weight: 800; letter-spacing: .3px;
  padding: 1px 5px; border-radius: 4px; font-family: var(--font-mono);
  flex-shrink: 0;
}
.verb.post { color: var(--m-post); background: color-mix(in srgb, var(--m-post) 14%, transparent); }
.verb.get  { color: var(--m-get);  background: color-mix(in srgb, var(--m-get) 14%, transparent); }
.nav-link .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0;
}
.nav-link.active .dot { background: var(--brand); }

.nav-empty { padding: 12px; font-size: 13px; color: var(--text-faint); text-align: center; }

/* ============================== CONTENT =========================== */
.content {
  grid-column: 2;
  min-width: 0;
  padding: 40px clamp(24px, 4vw, 64px) 120px;
}
.content__inner { margin: 0 auto; }

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-faint); margin-bottom: 18px; }
.breadcrumb svg { width: 13px; height: 13px; }

/* Sections */
.doc-section { scroll-margin-top: calc(var(--topbar-h) + 20px); padding-top: 8px; }
.doc-section + .doc-section { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--border); }

h1, h2, h3, h4 { color: var(--text); font-weight: 700; line-height: 1.25; scroll-margin-top: calc(var(--topbar-h) + 20px); }
h1 { font-size: 33px; letter-spacing: -.4px; margin: 0 0 10px; }
h2 { font-size: 25px; letter-spacing: -.3px; margin: 0 0 14px; }
h3 { font-size: 19px; margin: 34px 0 12px; }
h4 { font-size: 15.5px; margin: 24px 0 8px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }

.anchor {
  margin-inline-start: 8px; opacity: 0; color: var(--brand);
  font-weight: 400; transition: opacity .15s; text-decoration: none;
}
h1:hover .anchor, h2:hover .anchor, h3:hover .anchor { opacity: .8; }

.lead { font-size: 17.5px; color: var(--text-muted); line-height: 1.6; margin: 0 0 22px; }
p { margin: 0 0 14px; }
.content ul, .content ol { margin: 0 0 16px; padding-inline-start: 24px; }
.content li { margin-bottom: 7px; }
.content li::marker { color: var(--brand); }
strong { color: var(--text); font-weight: 650; }
hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 40px 38px;
  background:
    radial-gradient(900px 300px at 100% -10%, color-mix(in srgb, var(--brand) 26%, transparent), transparent 60%),
    linear-gradient(135deg, var(--brand-800), var(--brand));
  color: #eafafb;
  margin-bottom: 34px;
}
[dir="rtl"] .hero { background:
    radial-gradient(900px 300px at 0% -10%, color-mix(in srgb, var(--brand) 26%, transparent), transparent 60%),
    linear-gradient(225deg, var(--brand-800), var(--brand)); }
.hero h1 { color: #fff; font-size: 36px; margin-bottom: 12px; }
.hero p { color: #d8f1f3; font-size: 17px; max-width: 620px; margin-bottom: 22px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__ring {
    position: absolute;
    inset-inline-end: -149px;
    top: -125px;
    width: 280px;
    height: 280px;
    opacity: 0.6;
    pointer-events: none;
    transform: scale(4);
}
.hero .btn-cta { background: #fff; color: var(--brand-800); border-color: #fff; }
.hero .btn-cta:hover { background: #eafafb; }
.hero .btn-ghost {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px;
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.4);
  border-radius: var(--radius); font-weight: 600; font-size: 13.5px;
}
.hero .btn-ghost:hover { background: rgba(255,255,255,.22); text-decoration: none; }

/* Feature cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 26px 0; }
.card {
  display: block;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.card:hover { border-color: var(--brand); box-shadow: var(--shadow-md); text-decoration: none; transform: translateY(-2px); }
.card__icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-tint); color: var(--brand); margin-bottom: 14px;
}
.card__icon svg { width: 21px; height: 21px; }
.card h3 { margin: 0 0 6px; font-size: 16px; color: var(--text); }
.card p { margin: 0; font-size: 13.5px; color: var(--text-muted); }

/* Callouts / admonitions */
.callout {
  display: flex; gap: 13px;
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--brand);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 14px 16px; margin: 20px 0;
}
.callout__icon { flex-shrink: 0; width: 20px; height: 20px; margin-top: 2px; color: var(--brand); }
.callout__body { font-size: 14px; }
.callout__body > *:last-child { margin-bottom: 0; }
.callout__title { font-weight: 700; margin-bottom: 3px; display: block; }
.callout.note    { border-inline-start-color: var(--blue);  background: var(--blue-bg); }
.callout.note .callout__icon { color: var(--blue); }
.callout.warn    { border-inline-start-color: var(--amber); background: var(--amber-bg); }
.callout.warn .callout__icon { color: var(--amber); }
.callout.danger  { border-inline-start-color: var(--red);   background: var(--red-bg); }
.callout.danger .callout__icon { color: var(--red); }
.callout.tip     { border-inline-start-color: var(--green); background: var(--green-bg); }
.callout.tip .callout__icon { color: var(--green); }

/* Endpoint header */
.endpoint {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--code-bg); border: 1px solid var(--code-border);
  border-radius: var(--radius); padding: 11px 14px; margin: 16px 0 22px;
}
.method {
  font-family: var(--font-mono); font-weight: 800; font-size: 12px; letter-spacing: .5px;
  padding: 5px 11px; border-radius: 6px; color: #fff; flex-shrink: 0;
}
.method.post { background: var(--m-post); }
.method.get { background: var(--m-get); }
.method.put { background: var(--m-put); }
.method.delete { background: var(--m-delete); }
.endpoint__url {
  font-family: var(--font-mono); font-size: 13.5px; color: var(--code-text);
  word-break: break-all; flex: 1; min-width: 0; direction: ltr; text-align: left;
}
.endpoint__url .host { color: #6fb9c4; }
.endpoint__url .path { color: #e8f3f3; }
.endpoint__url .param { color: #f0b95f; }
.endpoint__copy {
  flex-shrink: 0; background: transparent; border: 1px solid var(--code-border);
  color: #9fc4c9; border-radius: 6px; width: 30px; height: 30px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: all .15s;
}
.endpoint__copy:hover { color: #fff; border-color: var(--brand); background: rgba(255,255,255,.06); }
.endpoint__copy svg { width: 15px; height: 15px; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); margin: 18px 0; }
table { width: 100%; border-collapse: collapse; font-size: 13.8px; }
thead th {
  text-align: start; font-weight: 700; color: var(--text);
  background: var(--surface-2);
  padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text-muted); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
td code, .content p code, li code, .callout code {
  font-family: var(--font-mono); font-size: 12.5px;
  background: var(--brand-tint); color: var(--brand-700);
  padding: 1.5px 6px; border-radius: 5px; border: 1px solid var(--brand-tint-2);
  direction: ltr; display: inline-block;
}
[data-theme="dark"] td code, [data-theme="dark"] .content p code,
[data-theme="dark"] li code, [data-theme="dark"] .callout code { color: var(--brand-700); }
.field-name { color: var(--text) !important; font-weight: 600; }

.badge {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  display: inline-block; white-space: nowrap;
}
.badge.req { color: var(--red); background: var(--red-bg); }
.badge.opt { color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); }
.badge.type { color: var(--purple); background: color-mix(in srgb, var(--purple) 12%, transparent); font-family: var(--font-mono); }

/* Status pills */
.status-pill { font-family: var(--font-mono); font-weight: 700; font-size: 12px; padding: 3px 9px; border-radius: 6px; display: inline-block; }
.status-pill.ok { color: var(--green); background: var(--green-bg); }
.status-pill.warn { color: var(--amber); background: var(--amber-bg); }
.status-pill.err { color: var(--red); background: var(--red-bg); }
.status-pill.neutral { color: var(--text-muted); background: var(--surface-2); }

/* ============================ CODE BLOCKS ========================= */
.code {
  background: var(--code-bg); border: 1px solid var(--code-border);
  border-radius: var(--radius); margin: 18px 0; overflow: hidden;
}
.code__tabs {
  display: flex; align-items: center; gap: 2px;
  background: var(--code-bg-2); border-bottom: 1px solid var(--code-border);
  padding: 6px 8px; overflow-x: auto;
}
.code__tab {
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 600;
  color: #8fb0b5; background: transparent; border: none; cursor: pointer;
  padding: 6px 12px; border-radius: 6px; white-space: nowrap; transition: all .12s;
}
.code__tab:hover { color: #d6e6e6; background: rgba(255,255,255,.05); }
.code__tab.active { color: #fff; background: rgba(255,255,255,.10); }
.code__spacer { flex: 1; }
.code__copy {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-sans); font-size: 12px; font-weight: 600;
  color: #9fc4c9; background: transparent; border: 1px solid var(--code-border);
  border-radius: 6px; padding: 5px 10px; cursor: pointer; transition: all .12s; flex-shrink: 0;
}
.code__copy:hover { color: #fff; border-color: var(--brand); }
.code__copy svg { width: 13px; height: 13px; }
.code__copy.copied { color: #6ee7a8; border-color: #1c6e44; }

.code__panel { display: none; }
.code__panel.active { display: block; }
.code pre {
  margin: 0; padding: 16px 18px; overflow-x: auto;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.7;
  color: var(--code-text); direction: ltr; text-align: left;
}
.code pre code { font-family: inherit; background: none; border: none; padding: 0; color: inherit; }

/* Minimal token highlighting */
.tok-key { color: #7fd4e0; }
.tok-str { color: #b8e6a0; }
.tok-num { color: #f0b95f; }
.tok-bool { color: #e88bb0; }
.tok-null { color: #9aa7aa; }
.tok-punc { color: #7b9499; }
.tok-cmd { color: #f0b95f; }
.tok-flag { color: #7fd4e0; }
.tok-comment { color: #6b8489; font-style: italic; }

/* response label */
.io-label {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  color: var(--text-muted); margin: 20px 0 -8px;
}
.io-label .dotc { width: 8px; height: 8px; border-radius: 50%; }
.io-label.req .dotc { background: var(--brand); }
.io-label.res-ok .dotc { background: var(--green); }
.io-label.res-err .dotc { background: var(--red); }

/* ============================== TOC ============================== */
.toc {
  grid-column: 3;
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 40px 18px 60px;
}
.toc__title { font-size: 11.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px; }
.toc__list { list-style: none; margin: 0; padding: 0; border-inline-start: 1px solid var(--border); }
.toc__list a {
  display: block; padding: 5px 14px; font-size: 13px; color: var(--text-muted);
  border-inline-start: 2px solid transparent; margin-inline-start: -1px; line-height: 1.4;
}
.toc__list a:hover { color: var(--text); text-decoration: none; }
.toc__list a.active { color: var(--brand); border-inline-start-color: var(--brand); font-weight: 600; }
.toc__list a.sub { padding-inline-start: 26px; font-size: 12.5px; }
.toc__foot { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-faint); }
.toc__foot a { display: inline-flex; align-items: center; gap: 6px; }
.toc__foot svg { width: 13px; height: 13px; }

/* footer inside content */
.page-nav { display: flex; gap: 16px; margin-top: 60px; }
.page-nav a {
  flex: 1; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
  transition: border-color .15s, box-shadow .15s;
}
.page-nav a:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); text-decoration: none; }
.page-nav .dir { font-size: 12px; color: var(--text-faint); }
.page-nav .ttl { font-weight: 600; color: var(--text); margin-top: 3px; }
.page-nav .next { text-align: end; }

.foot {
  margin-top: 50px; padding-top: 24px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-faint); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}

/* backdrop for mobile sidebar */
.backdrop {
  display: none; position: fixed; inset: 0; background: rgba(7,18,20,.5);
  z-index: 90; backdrop-filter: blur(2px);
}

/* lang visibility helpers */
[data-lang-only="ar"] { display: none; }
[data-lang-only="en"] { display: block; }
html[lang="ar"] [data-lang-only="ar"] { display: block; }
html[lang="ar"] [data-lang-only="en"] { display: none; }
span[data-lang-only], a[data-lang-only], code[data-lang-only] { display: inline; }

/* ========================= RESPONSIVE ============================ */
@media (max-width: 1200px) {
  :root { --toc-w: 0px; }
  .layout { grid-template-columns: var(--sidebar-w) minmax(0,1fr); }
  .toc { display: none; }
}
@media (max-width: 920px) {
  :root { --sidebar-w: 0px; }
  .layout { grid-template-columns: minmax(0,1fr); }
  .menu-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; top: var(--topbar-h); inset-inline-start: 0;
    width: 300px; max-width: 86vw; z-index: 95;
    transform: translateX(-105%);
    transition: transform .26s cubic-bezier(.4,0,.2,1);
    box-shadow: var(--shadow-lg);
  }
  [dir="rtl"] .sidebar { transform: translateX(105%); }
  .sidebar.open { transform: translateX(0); }
  body.nav-open .backdrop { display: block; }
  .content { grid-column: 1; padding: 28px 20px 100px; }
  .search { display: none; }
  .topbar__brand-sub { display: none; }
  .topbar__brand-name { display: none; }
}
@media (max-width: 560px) {
  .hero { padding: 28px 22px; }
  .hero h1 { font-size: 27px; }
  h1 { font-size: 27px; }
  h2 { font-size: 21px; }
  .topbar { gap: 10px; padding: 0 14px; }
  .btn-cta span { display: none; }
  .topbar__badge { display: none; }
  .hero__ring {transform: scale(2);}
}
.skip-link {
    position: absolute;
    inset-block-start: -60px;
    inset-inline-start: 12px;
    z-index: 200;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    transition: inset-block-start .2s;
}
.skip-link:focus { inset-block-start: 12px; }
