/* jibital.ir/docs/: the integration guide. Builds on site.css (fonts, colours, buttons, code, footer);
   needs no script. */

.doc-top { position: sticky; top: 0; z-index: 50; background: rgba(7, 11, 30, 0.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--brass-line); }
.doc-top .wrap { display: flex; align-items: center; gap: 20px; min-height: 68px; flex-wrap: wrap; }
.doc-top .brand b { font-size: 24px; }
.doc-links { display: flex; flex-wrap: wrap; gap: 2px; margin-inline-start: auto; }
.doc-links a { color: var(--sand-2); text-decoration: none; font-size: 14.5px; padding: 6px 10px; border-radius: 8px; transition: color 0.2s, background-color 0.2s; }
.doc-links a:hover { color: var(--sand); background: rgba(212, 170, 94, 0.09); }
.doc-links a[aria-current] { color: var(--saffron); }

.doc-hero { padding: clamp(40px, 6vw, 72px) 0 clamp(28px, 4vw, 44px); border-bottom: 1px solid rgba(212, 170, 94, 0.14); background: radial-gradient(ellipse at 70% 0, rgba(36, 49, 106, 0.55), transparent 60%); }
.doc-hero h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(38px, 5.5vw, 62px); line-height: 1.3; margin: 10px 0 14px; color: var(--sand); }
.doc-hero .lead { max-width: 820px; color: var(--sand-2); font-size: clamp(16.5px, 1.6vw, 19px); margin: 0; }
.addresses { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin-top: 28px; max-width: 980px; }
.addresses div { background: var(--night-2); border: 1px solid var(--brass-line); border-radius: 12px; padding: 12px 16px; }
.addresses small { display: block; color: var(--sand-3); font-size: 13px; line-height: 1.6; }
.addresses a { font-family: var(--font-mono); font-size: 14px; direction: ltr; unicode-bidi: isolate; overflow-wrap: anywhere; }

.doc-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); padding-block: 40px 80px; }
.toc { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); overflow-y: auto; font-size: 14.5px; }
.toc summary { cursor: pointer; color: var(--brass); font-weight: 700; margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.toc a { display: block; color: var(--sand-2); text-decoration: none; padding: 3px 12px; border-inline-start: 2px solid rgba(212, 170, 94, 0.18); line-height: 1.75; }
.toc a:hover { color: var(--sand); border-color: var(--saffron); }

.doc { max-width: 860px; min-width: 0; }
.doc section { margin-bottom: 52px; scroll-margin-top: 84px; }
.doc h2 { font-family: var(--font-display); font-weight: 800; font-size: clamp(28px, 3.2vw, 38px); line-height: 1.4; margin: 0 0 14px; color: var(--sand); }
.doc h2 .n { color: var(--brass); margin-inline-end: 10px; }
.doc h3 { font-size: 20px; font-weight: 800; line-height: 1.6; margin: 30px 0 8px; color: var(--sand); scroll-margin-top: 84px; }
.doc p, .doc li, .doc td { color: #e6dbc0; }
.doc p { margin: 0 0 14px; }
.doc ul, .doc ol { margin: 0 0 16px; padding-inline-start: 22px; display: grid; gap: 6px; }
.doc ul.ticks { padding: 0; }
.doc li::marker { color: var(--brass); }
.doc strong { color: var(--sand); }
.doc a { text-decoration-color: rgba(242, 169, 59, 0.45); text-underline-offset: 3px; }
/* Code reads left to right even inside a Persian sentence ("201 Created", not "Created 201"). */
.doc code { direction: ltr; white-space: normal; overflow-wrap: break-word; }

.doc pre { direction: ltr; text-align: left; margin: 0 0 18px; padding: 16px 20px; background: #060b20; border: 1px solid rgba(212, 170, 94, 0.3); border-radius: 12px; overflow-x: auto; font-family: var(--font-mono), var(--font-body); font-size: 13.4px; line-height: 1.7; color: #d8d1bd; tab-size: 2; }
.doc pre code { all: unset; white-space: pre; font-family: inherit; }

.table-wrap { overflow-x: auto; margin: 0 0 20px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; }
.doc th, .doc td { text-align: start; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid rgba(212, 170, 94, 0.16); line-height: 1.8; }
.doc th { color: var(--brass); font-size: 13.5px; font-weight: 700; white-space: nowrap; border-bottom-color: var(--brass-line); }
.doc td:first-child code { white-space: nowrap; }

.note { border: 1px solid rgba(75, 201, 183, 0.35); background: rgba(75, 201, 183, 0.06); border-radius: 12px; padding: 14px 18px; margin: 0 0 18px; }
.note.warn { border-color: rgba(229, 102, 75, 0.5); background: rgba(229, 102, 75, 0.07); }
.note > :last-child { margin-bottom: 0; }
.note .t { display: block; color: var(--turq); font-weight: 800; }
.note.warn .t { color: var(--pom); }

@media (max-width: 980px) {
  .doc-layout { grid-template-columns: 1fr; padding-top: 28px; }
  .toc { position: static; max-height: none; background: var(--night-2); border: 1px solid var(--brass-line); border-radius: 12px; padding: 12px 14px; }
  .toc summary { margin-bottom: 0; }
  .toc[open] summary { margin-bottom: 8px; }
}
@media (max-width: 640px) {
  .doc-top .wrap { padding-block: 10px; }
  .doc-links { margin-inline-start: 0; }
  .doc pre { font-size: 12.6px; padding: 14px; }
}
