/* ═══════════════════════════════════════════
   Houston Developers — Design System
   Mirrors the Learn section (globals.css)
   ═══════════════════════════════════════════ */

:root {
  --background: #ffffff;
  --foreground: #0d0d0d;
  --secondary: #f9f9f9;
  --muted-foreground: #5d5d5d;
  --border: #e5e5e5;
  --gray-50: #f9f9f9;
  --gray-100: #ececec;
  --gray-200: #e3e3e3;
  --gray-300: #cdcdcd;
  --gray-400: #b4b4b4;
  --gray-500: #9b9b9b;
  --gray-600: #676767;
  --gray-700: #424242;
  --gray-900: #1a1a1a;
  --gray-950: #0d0d0d;
  --success: #00a240;
  --info: #2964aa;
  --warning: #e0ac00;
  --danger: #e02e2a;
  --border-light: rgba(13, 13, 13, 0.05);
  --border-medium: rgba(0, 0, 0, 0.12);
  --border-heavy: rgba(13, 13, 13, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: ui-sans-serif, -apple-system, system-ui, "Segoe UI", Helvetica,
    Arial, sans-serif;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.6;
}

code,
.mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ═══════════════════════════════════════════
   Top Nav (mirrors landing page)
   ═══════════════════════════════════════════ */

body {
  padding-top: 65px;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-logo {
  font-family: 'General Sans', sans-serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--gray-950);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-short-text { display: none; }

.nav-burger {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--gray-700);
  transition: background 0.2s;
}
.nav-burger:hover { background: var(--gray-50); }
.nav-burger svg { width: 20px; height: 20px; }

.nav-dropdown {
  display: none;
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  z-index: 99;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  padding: 8px 20px 16px;
  flex-direction: column;
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.nav-dropdown.open { display: flex; }
.nav-dropdown a {
  font-size: 15px;
  color: var(--gray-700);
  text-decoration: none;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-dropdown a:last-child { border-bottom: none; }
.nav-dropdown a svg { width: 16px; height: 16px; opacity: 0.5; }

.nav-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-center a {
  font-size: 14px;
  color: var(--gray-600);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-center a:hover { color: var(--gray-950); }

.nav-right {
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav-right a:not(.btn) {
  color: var(--gray-600);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-right a:not(.btn):hover { color: var(--gray-950); }

nav .btn {
  height: 36px;
  padding: 0 16px;
  font-size: 14px;
  gap: 8px;
}

@media (max-width: 900px) {
  nav { padding: 16px 20px; }
  .nav-center { display: none; }
  .nav-burger { display: flex; }
  .nav-right a:not(.btn) { display: none !important; }
  .nav-right .btn .btn-full-text { display: none; }
  .nav-right .btn .btn-short-text { display: inline; }
}

/* ═══════════════════════════════════════════
   Layout
   ═══════════════════════════════════════════ */

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  max-width: 1280px;
  margin: 0 auto;
  gap: 48px;
  padding: 48px 32px 120px;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 32px 24px 80px;
  }
}

/* ═══════════════════════════════════════════
   Sidebar
   ═══════════════════════════════════════════ */

.sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 8px;
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
    max-height: none;
    margin-bottom: 32px;
    padding-right: 0;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
  }
}

.sidebar-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  margin-bottom: 12px;
  padding: 0 10px;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--gray-700);
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav a:hover {
  background: var(--gray-50);
  color: var(--gray-950);
}

.sidebar-nav a.active {
  background: var(--gray-100);
  color: var(--gray-950);
  font-weight: 500;
}

.sidebar-nav .num {
  color: var(--gray-400);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  min-width: 18px;
}

.sidebar-nav a.active .num { color: var(--gray-600); }

/* ═══════════════════════════════════════════
   Content
   ═══════════════════════════════════════════ */

.content {
  max-width: 760px;
  min-width: 0;
}

.content-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  margin-bottom: 16px;
}

.content h1 {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--gray-950);
  margin-bottom: 20px;
}

.content .lead {
  font-size: 19px;
  line-height: 1.55;
  color: var(--muted-foreground);
  margin-bottom: 48px;
  max-width: 660px;
}

.content h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--gray-950);
  margin-top: 56px;
  margin-bottom: 16px;
  scroll-margin-top: 88px;
}

.content h2:first-of-type { margin-top: 0; }

.content h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--gray-950);
  margin-top: 32px;
  margin-bottom: 10px;
  scroll-margin-top: 88px;
}

.content p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--gray-700);
  margin-bottom: 16px;
}

.content p strong { color: var(--gray-950); font-weight: 600; }

.content ul,
.content ol {
  margin-bottom: 20px;
  padding-left: 22px;
  color: var(--gray-700);
}

.content li { margin-bottom: 8px; line-height: 1.65; }
.content li::marker { color: var(--gray-400); }

.content a.link {
  color: var(--info);
  text-decoration: none;
}
.content a.link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.content code {
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--gray-950);
}

/* ═══════════════════════════════════════════
   Code blocks (with copy button)
   ═══════════════════════════════════════════ */

.codeblock {
  position: relative;
  margin-bottom: 24px;
}

.codeblock pre {
  background: var(--gray-950);
  color: #f0f0f0;
  padding: 20px 24px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
}

.codeblock pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 13.5px;
}

.content pre {
  background: var(--gray-950);
  color: #f0f0f0;
  padding: 20px 24px;
  border-radius: 12px;
  overflow-x: auto;
  margin-bottom: 24px;
  font-size: 13.5px;
  line-height: 1.65;
}

.content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 13.5px;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #d4d4d4;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  font-family: ui-sans-serif, -apple-system, system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  opacity: 0;
}

.codeblock:hover .copy-btn { opacity: 1; }
.copy-btn:focus-visible { opacity: 1; outline: none; }
.copy-btn:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.copy-btn.copied { color: #6fe39a; border-color: rgba(111, 227, 154, 0.4); }

@media (max-width: 900px) {
  .copy-btn { opacity: 1; }
}

/* ═══════════════════════════════════════════
   Endpoint header (method + path)
   ═══════════════════════════════════════════ */

.endpoint {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--gray-50);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 20px 0;
  overflow-x: auto;
}

.method {
  flex: none;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 9px;
  border-radius: 6px;
  color: #fff;
}

.method.get { background: var(--info); }
.method.post { background: var(--success); }
.method.delete { background: var(--danger); }

.endpoint .path {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 14px;
  color: var(--gray-950);
  white-space: nowrap;
}

.endpoint .path b { color: var(--info); font-weight: 600; }

/* ═══════════════════════════════════════════
   Field / reference tables
   ═══════════════════════════════════════════ */

.fields-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 28px;
  font-size: 14px;
}

.fields-table th {
  text-align: left;
  font-weight: 600;
  color: var(--gray-950);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--gray-50);
  font-size: 13px;
}

.fields-table th:first-child { border-top-left-radius: 8px; }
.fields-table th:last-child { border-top-right-radius: 8px; }

.fields-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--gray-700);
  vertical-align: top;
  line-height: 1.55;
}

.fields-table td:first-child { white-space: nowrap; }

.fields-table code {
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--gray-950);
}

.fields-table .req { color: var(--danger); font-weight: 600; font-size: 12px; }
.fields-table .opt { color: var(--gray-500); font-size: 12px; }

.table-scroll { overflow-x: auto; }

/* ═══════════════════════════════════════════
   On-this-page TOC
   ═══════════════════════════════════════════ */

.toc {
  background: var(--gray-50);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 48px;
}

.toc-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  margin-bottom: 12px;
}

.toc ol {
  list-style: none;
  padding: 0;
  counter-reset: toc;
  margin: 0;
}

.toc li {
  counter-increment: toc;
  margin-bottom: 6px;
  font-size: 14px;
  padding-left: 0;
}

.toc li::before {
  content: counter(toc) ".";
  color: var(--gray-400);
  margin-right: 10px;
  font-variant-numeric: tabular-nums;
}

.toc a { color: var(--gray-700); transition: color 0.15s; }
.toc a:hover {
  color: var(--gray-950);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ═══════════════════════════════════════════
   Callouts
   ═══════════════════════════════════════════ */

.callout {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 24px 0;
  background: var(--gray-50);
}

.callout-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
}

.callout p { margin-bottom: 0; font-size: 15px; color: var(--gray-700); }
.callout p + p { margin-top: 10px; }
.callout code {
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--gray-950);
}

.callout-info {
  background: color-mix(in oklch, var(--info) 6%, white);
  border-color: color-mix(in oklch, var(--info) 20%, transparent);
}
.callout-info .callout-label { color: var(--info); }

.callout-warning {
  background: color-mix(in oklch, var(--warning) 6%, white);
  border-color: color-mix(in oklch, var(--warning) 20%, transparent);
}
.callout-warning .callout-label { color: var(--warning); }

.callout-success {
  background: color-mix(in oklch, var(--success) 6%, white);
  border-color: color-mix(in oklch, var(--success) 20%, transparent);
}
.callout-success .callout-label { color: var(--success); }

/* ═══════════════════════════════════════════
   Surface cards (overview)
   ═══════════════════════════════════════════ */

.hero { padding-top: 8px; }
.hero h1 {
  font-size: clamp(36px, 5vw, 52px);
  margin-bottom: 24px;
}
.hero .lead { font-size: 20px; margin-bottom: 36px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 28px 0;
}

.surface-card {
  display: block;
  padding: 22px 24px;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  background: white;
  transition: border-color 0.15s, box-shadow 0.2s, transform 0.15s;
}

.surface-card:hover {
  border-color: var(--border-medium);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 8px 24px rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}

.surface-card .surface-kicker {
  font-size: 12px;
  font-weight: 600;
  color: var(--info);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.surface-card .surface-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-950);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.surface-card .surface-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted-foreground);
}

/* ═══════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════ */

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary { background: var(--gray-950); color: white; }
.btn-primary:hover { background: var(--gray-700); }
.btn-secondary {
  background: white;
  color: var(--gray-950);
  border: 1px solid var(--border-medium);
}
.btn-secondary:hover { background: var(--gray-50); }

/* ═══════════════════════════════════════════
   Prev / Next
   ═══════════════════════════════════════════ */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 72px;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
}

.pager a {
  display: flex;
  flex-direction: column;
  padding: 18px 22px;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  transition: border-color 0.15s, background 0.15s;
}

.pager a:hover { border-color: var(--border-medium); background: var(--gray-50); }
.pager .pager-label {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 4px;
  font-weight: 500;
}
.pager .pager-title { font-size: 15px; font-weight: 600; color: var(--gray-950); }
.pager .next { text-align: right; }
.pager .spacer { border: none; background: transparent; }
.pager .spacer:hover { background: transparent; border: none; }

/* ═══════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════ */

.footer {
  border-top: 1px solid var(--border-light);
  padding: 32px;
  text-align: center;
  color: var(--gray-500);
  font-size: 13px;
}
