/* Iterabase docs (docs.iterabase.com): technical overview. Builds on site.css tokens. */

/* nav: the app's "logo | section" pattern */
.docs .nav .wrap { gap: 0; }
.docs .nav-logo { margin-right: 20px; }
.nav-sep { width: 1px; height: 26px; background: var(--line-200); flex: none; }
.nav-section { margin: 0 28px 0 20px; color: var(--ink-700); text-decoration: none; font-size: 16px; font-weight: 500; white-space: nowrap; }
.nav-section:hover { color: var(--ink-900); }
.docs .nav-links { margin-left: 0; }

/* hero glow fades out over the page instead of ending in a hard edge */
body.docs { overflow-x: clip; }
.docs main { position: relative; overflow-x: clip; }
.docs main::before { content: ""; position: absolute; top: -260px; right: 0; width: min(760px, 100%); height: 760px; transform: translateX(28%); background: radial-gradient(closest-side, rgba(227,154,82,.16), rgba(227,154,82,0)); pointer-events: none; z-index: 0; }
.docs-hero, .docs-layout { position: relative; z-index: 1; }
.docs-hero { padding: 64px 0 40px; }
.docs-hero .wrap { position: relative; display: flex; flex-direction: column; gap: 18px; max-width: var(--wrap); }
.docs-hero .lead { max-width: 760px; }
.docs-title { font-family: var(--font-serif); font-weight: 500; letter-spacing: -.02em; line-height: 1.05; margin: 0; font-size: clamp(38px, 4.4vw, 58px); }

.docs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start; padding-bottom: 96px; }
.docs-toc { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 110px); overflow-y: auto; }
.docs-toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line-200); }
.docs-toc a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--ink-700); text-decoration: none; font-size: 14.5px; line-height: 1.35; }
.docs-toc a:hover { color: var(--ink-900); }
.docs-toc a[aria-current="true"] { color: var(--ink-900); font-weight: 600; border-left-color: var(--blue-600); }

.docs-body { max-width: 800px; min-width: 0; }
.doc-sec { padding: 40px 0 8px; border-top: 1px solid var(--line-200); }
.doc-sec:first-child { border-top: 0; padding-top: 8px; }
.doc-sec > .eyebrow { margin-bottom: 8px; }
.doc-h2 { font-family: var(--font-serif); font-weight: 500; font-size: clamp(26px, 2.6vw, 32px); letter-spacing: -.01em; line-height: 1.15; margin: 0 0 18px; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; text-wrap: balance; }
.doc-h2 .badge { font-family: var(--font-sans); letter-spacing: 0; }
.docs-body p { margin: 0 0 16px; color: var(--ink-700); font-size: 17px; line-height: 1.65; }
.docs-body ul { margin: 0 0 20px; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; color: var(--ink-700); font-size: 16.5px; line-height: 1.6; }
.docs-body li::marker { color: var(--ink-500); }
.docs-body b { color: var(--ink-900); font-weight: 600; }

.tbl { margin: 8px 0 24px; border: 1px solid var(--line-200); border-radius: 16px; background: var(--paper-50); overflow-x: auto; box-shadow: var(--shadow-sm); }
.tbl table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.55; }
.tbl th { text-align: left; font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-500); padding: 14px 18px; background: var(--paper-200); border-bottom: 1px solid var(--line-200); }
.tbl td { padding: 14px 18px; vertical-align: top; color: var(--ink-700); border-top: 1px solid var(--line-100); }
.tbl tbody tr:first-child td { border-top: 0; }
.tbl td:first-child { color: var(--ink-900); font-weight: 600; width: 28%; }
.tbl.deploy td:first-child { width: 22%; }

.fig { margin: 8px 0 28px; }
.fig figcaption { margin-top: 12px; font-size: 15px; line-height: 1.5; color: var(--ink-500); }
.fig-scroll { padding: 22px; border-radius: 18px; background: var(--paper-50); border: 1px solid var(--line-200); box-shadow: var(--shadow-sm); overflow-x: auto; }
.fig.shot img { width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--line-200); box-shadow: var(--shadow-md); background: var(--paper-50); }

/* diagrams: inline svg in the site's palette */
.dg { display: block; width: 100%; height: auto; min-width: 640px; font-family: var(--font-sans); font-size: 13px; }
.dg text { fill: var(--ink-900); }
.dg text.n { font-weight: 600; }
.dg text.s { font-size: 11.5px; fill: var(--ink-500); }
.dg text.s.ink { fill: var(--ink-900); }
.dg text.h { font-size: 11.5px; fill: var(--ink-500); font-family: var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }
.dg .b { fill: var(--paper-50); stroke: var(--line-300); stroke-width: 1.25; }
.dg .b.tint { fill: var(--paper-200); }
.dg .b.accent { fill: var(--blue-100); stroke: var(--blue-600); stroke-width: 2; }
.dg .b.good { stroke: var(--green-500); stroke-width: 1.75; }
.dg .b.bad { stroke: var(--red-500); stroke-width: 1.75; }
.dg .ln { fill: none; stroke: #B9B1A4; stroke-width: 1.25; }
.dg .ln.dash { stroke-dasharray: 4 4; }
.dg .ah { fill: #B9B1A4; }
.dg .gem { fill: #B9B1A4; }
.dg .gem.accent { fill: var(--blue-600); }

/* phone layout of each diagram: stacked cards that wrap, shown instead of the svg */
.mflow { display: none; }
.mflow { flex-direction: column; gap: 8px; padding: 16px; border-radius: 18px; background: var(--paper-50); border: 1px solid var(--line-200); box-shadow: var(--shadow-sm); }
.mc { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--paper-50); border: 1px solid var(--line-300); }
.mc b { font-size: 15px; font-weight: 600; color: var(--ink-900); }
.mc span { font-size: 14px; line-height: 1.45; color: var(--ink-500); }
.mc.accent { background: var(--blue-100); border: 2px solid var(--blue-600); }
.mc.accent span { color: var(--ink-700); }
.mc.good { border: 1.5px solid var(--green-500); }
.mc.bad { border: 1.5px solid var(--red-500); }
.mc.plain { background: var(--paper-200); }
.mg { display: flex; flex-direction: column; gap: 8px; }
.mg.tint { padding: 12px; border-radius: 14px; background: var(--paper-200); border: 1px solid var(--line-200); }
.mflow > *, .mg > * { min-width: 0; max-width: 100%; }
.mchip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mg-t { overflow-wrap: anywhere; margin: 0 !important; font-family: var(--font-mono); font-size: 11.5px !important; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-500) !important; line-height: 1.4 !important; }
.mchip { padding: 7px 12px; border-radius: 10px; background: var(--paper-50); border: 1px solid var(--line-300); font-size: 14px; color: var(--ink-900); }
.ma { display: flex; align-items: center; gap: 10px; padding-left: 18px; min-height: 22px; }
.ma i { width: 1.5px; height: 22px; background: #B9B1A4; position: relative; flex: none; }
.ma i::after { content: ""; position: absolute; left: -4px; bottom: -2px; border: 4.75px solid transparent; border-top: 6px solid #B9B1A4; border-bottom: 0; }
.ma span { font-size: 13.5px; color: var(--ink-500); }
.mnote { margin: 4px 0 0 !important; font-size: 14px !important; line-height: 1.5 !important; color: var(--ink-500) !important; }

.docs-cta { margin-top: 48px; padding: 28px 28px 28px 32px; border-radius: 22px; background: var(--ink-900); color: #FBF8F2; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; box-shadow: var(--shadow-lg); }
.docs-cta .docs-cta-title { display: block; font-family: var(--font-serif); font-weight: 500; font-size: 24px; letter-spacing: -.01em; margin-bottom: 4px; }
.docs-body .docs-cta p { margin: 0; color: #C9C4BA; font-size: 16px; }

@media (max-width: 1080px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .docs-toc { display: none; }
}
@media (max-width: 760px) {
  .docs-hero { padding: 32px 0 8px; gap: 14px; }
  .docs .nav-logo { margin-right: 14px; }
  .nav-section { margin: 0 0 0 14px; font-size: 15px; }
  .doc-sec { padding-top: 32px; }
  .doc-sec:first-child { padding-top: 28px; }
  .docs-body p { font-size: 16.5px; }
  .docs-body ul { font-size: 16px; }
  /* tables become one card per row */
  .tbl { overflow: visible; }
  .tbl table, .tbl tbody, .tbl tr, .tbl td { display: block; width: auto !important; }
  .tbl thead { display: none; }
  .tbl tr { padding: 14px 16px; border-top: 1px solid var(--line-200); }
  .tbl tbody tr:first-child { border-top: 0; }
  .tbl td { padding: 0; border: 0; }
  .tbl td:first-child { margin-bottom: 4px; }
  .tbl.deploy td + td { margin-top: 10px; }
  .tbl.deploy td[data-label]::before { content: attr(data-label); display: block; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-500); margin-bottom: 2px; }
  /* diagrams switch to their stacked phone layout */
  .fig-scroll { display: none; }
  .mflow { display: flex; }
  .fig figcaption { font-size: 14.5px; }
  .docs-cta { padding: 24px; }
  .docs-cta .btn { width: 100%; }
}

/* phones get the phone-sized product screens */
@media (max-width: 760px) {
  .fig.shot picture { display: block; width: min(300px, 80%); margin: 0 auto; }
  .fig.shot img { border-radius: 28px; border: 6px solid var(--ink-900); box-shadow: var(--shadow-lg); }
}
