/* ─────────────────────────────────────────────────────────────────────────
   LocalContact API docs — design system
   Mirrors the landing tokens from frontend-main/src/index.css:
   Archivo (variable wdth), yellow paper #F6CE3C + ink #111008, square
   corners, 3px ink borders, hard rules, grain overlay. No rounded-*,
   no soft shadows, no foreign palette.
   ───────────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wdth,wght@0,62..125,400..900;1,62..125,400..700&display=swap');

:root {
  --yellow-paper: #F6CE3C;
  --yellow-deep: #E5BC1B;
  --ink: #111008;
  --ink-2: #2A2718;
  --rule: rgba(17, 16, 8, 0.28);
  --rule-soft: rgba(17, 16, 8, 0.16);
  --sheet-max: 1180px;
  --mono: ui-monospace, 'Cascadia Code', 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--yellow-paper);
  color: var(--ink);
  font-family: 'Archivo', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

::selection { background: var(--ink); color: var(--yellow-paper); }

a { color: var(--ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

/* grain overlay — same SVG noise as the landing */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.19'/%3E%3C/svg%3E");
}

/* ── type tokens ─────────────────────────────────────────────────────── */
.lc-display {
  font-family: 'Archivo', system-ui, sans-serif;
  font-variation-settings: 'wdth' 68;
  font-weight: 800;
  letter-spacing: -0.012em;
  line-height: 0.88;
  text-transform: uppercase;
}

.lc-display-wide {
  font-family: 'Archivo', system-ui, sans-serif;
  font-variation-settings: 'wdth' 78;
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
}

.lc-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

code, pre { font-family: var(--mono); font-size: 13.5px; }

/* inline code chip */
code:not(pre code) {
  background: var(--ink);
  color: var(--yellow-paper);
  padding: 1px 6px 2px;
  font-size: 0.86em;
}

/* ── layout ──────────────────────────────────────────────────────────── */
.sheet { max-width: var(--sheet-max); margin: 0 auto; padding: 0 24px; }
@media (min-width: 1024px) { .sheet { padding: 0 32px; } }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ink);
  color: var(--yellow-paper);
  border-bottom: 3px solid var(--ink);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand .lc-display { color: var(--yellow-paper); font-size: 22px; }
.brand .lc-label { color: rgba(246, 206, 60, 0.7); }

.topbar a { color: var(--yellow-paper); }

/* mobile nav toggle */
#nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--yellow-paper);
  color: var(--yellow-paper);
  font-family: inherit;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 14px;
  cursor: pointer;
}
#nav-toggle:focus-visible { outline: 3px solid var(--yellow-paper); outline-offset: 2px; }
@media (max-width: 1023px) { #nav-toggle { display: inline-flex; } }

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
@media (min-width: 1024px) {
  .layout { grid-template-columns: 260px minmax(0, 1fr); gap: 48px; }
}

/* ── sidebar / TOC ───────────────────────────────────────────────────── */
.sidebar {
  display: none;
  border-right: 3px solid var(--ink);
  padding: 24px 0 48px;
}
@media (min-width: 1024px) { .sidebar { display: block; } }
@media (max-width: 1023px) {
  .sidebar.open { display: block; border-right: none; border-bottom: 3px solid var(--ink); }
}

.sidebar nav { position: sticky; top: 96px; }

.sidebar .toc-group { margin-bottom: 20px; }

.sidebar a {
  display: block;
  padding: 6px 12px 6px 0;
  text-decoration: none;
  border-left: 3px solid transparent;
  padding-left: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(17, 16, 8, 0.75);
}
.sidebar a:hover { color: var(--ink); border-left-color: var(--rule); text-decoration: none; }
/* Active marker follows the family vocabulary (React apps use solid bg-ink
   text-paper fills for active nav): ink fill, paper text. */
.sidebar a.active { background: var(--ink); color: var(--yellow-paper); border-left-color: var(--ink); font-weight: 800; }
.sidebar a.active:hover { color: var(--yellow-paper); border-left-color: var(--ink); }
.sidebar .toc-title { margin: 0 0 6px; padding-left: 10px; color: rgba(17,16,8,0.5); }

/* ── content ─────────────────────────────────────────────────────────── */
.content { padding: 32px 0 96px; min-width: 0; }

section { margin-bottom: 72px; scroll-margin-top: 84px; }

h1.lc-display { font-size: clamp(40px, 7vw, 84px); margin: 8px 0 12px; }
h2.lc-display { font-size: clamp(26px, 4vw, 40px); margin: 0 0 6px; }
h3.lc-display-wide { font-size: 19px; margin: 40px 0 8px; }
h4 { font-size: 15px; margin: 24px 0 6px; }

.running-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.running-head::after { content: ''; flex: 1; border-top: 3px solid var(--ink); }

.lede { font-size: 17.5px; max-width: 68ch; }

p { max-width: 72ch; }

/* ── cards & callouts ────────────────────────────────────────────────── */
.card {
  border: 3px solid var(--ink);
  background: var(--yellow-paper);
  padding: 20px;
  margin: 20px 0;
}
.card > .card-head {
  border-bottom: 3px solid var(--ink);
  margin: -20px -20px 16px;
  padding: 10px 20px;
}

.callout {
  border: 3px solid var(--ink);
  padding: 14px 18px;
  margin: 20px 0;
}
.callout .lc-label { display: block; margin-bottom: 6px; }
.callout p { margin: 0; max-width: none; }
.callout p + p { margin-top: 8px; }
.callout.warn { background: rgba(17, 16, 8, 0.06); }

/* ── method chips + endpoint headers ─────────────────────────────────── */
.endpoint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border: 3px solid var(--ink);
  padding: 12px 16px;
  margin: 36px 0 16px;
  background: var(--yellow-paper);
}
.endpoint code { background: none; color: var(--ink); font-weight: 700; font-size: 14.5px; }

.method {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--yellow-paper);
}
.method.get { background: var(--yellow-paper); color: var(--ink); }

/* ── code blocks ─────────────────────────────────────────────────────── */
.code-block {
  position: relative;
  border: 3px solid var(--ink);
  margin: 16px 0;
  background: var(--ink);
}
.code-block .code-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 2px solid rgba(246, 206, 60, 0.3);
  color: rgba(246, 206, 60, 0.75);
}
.code-block .copy-btn {
  background: none;
  border: 2px solid rgba(246, 206, 60, 0.6);
  color: var(--yellow-paper);
  font-family: 'Archivo', sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  cursor: pointer;
}
.code-block .copy-btn:hover { border-color: var(--yellow-paper); }
.code-block .copy-btn:focus-visible { outline: 2px solid var(--yellow-paper); outline-offset: 2px; }
.code-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  color: var(--yellow-paper);
  line-height: 1.5;
}

/* ── tables (hairline grid, like the landing) ────────────────────────── */
.table-wrap { overflow-x: auto; margin: 16px 0; }
table {
  width: 100%;
  border-collapse: collapse;
  border: 3px solid var(--ink);
  min-width: 560px;
}
th {
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--yellow-paper);
  padding: 9px 14px;
}
td {
  border-top: 1px solid var(--rule);
  padding: 9px 14px;
  vertical-align: top;
  font-size: 14px;
}
td code { font-size: 12px; }

/* status pill inside tables */
.status {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  border: 2px solid var(--ink);
  padding: 0 8px;
}

/* ── lifecycle diagram ───────────────────────────────────────────────── */
.lifecycle {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  margin: 18px 0;
}
.lifecycle .stage {
  border: 3px solid var(--ink);
  padding: 10px 14px;
  background: var(--yellow-paper);
  font-weight: 800;
  font-size: 13px;
}
.lifecycle .arrow {
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-weight: 800;
}

/* ── steps ───────────────────────────────────────────────────────────── */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 16px 0; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 22px 56px;
  border-left: 3px solid var(--ink);
  margin-left: 18px;
}
.steps > li:last-child { border-left-color: transparent; }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: -18px;
  top: -2px;
  width: 33px;
  height: 33px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--yellow-paper);
  font-weight: 800;
  font-size: 15px;
}
.steps > li > strong:first-child, .steps > li > .lc-label:first-child { display: block; margin-bottom: 4px; }

/* ── misc ────────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.footer {
  border-top: 3px solid var(--ink);
  padding: 24px 0 48px;
}

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--yellow-paper);
  padding: 8px 14px;
  z-index: 100;
}
.skip-link:focus { left: 0; }
