/* FPDS Docs — documentation section styles
   Layout: fixed sidebar (270px) + scrollable content area.
   Palette: navy (#000080) as the sole accent, slate blue-greys, paper canvas.
   Spacing: follows --space token scale (4,8,12,16,24,32,48,80).
   Typography: follows STYLE.md (body lh 1.55-1.60, display lh 1.05-1.10).
   Canvas: renders on the site-wide PageCanvas paper + blueprint grid so the
   docs feel like a continuation of the marketing surface, not a separate app. */

/* ============================================================
   LAYOUT
   ============================================================ */

.docs-shell {
  display: flex;
  min-height: calc(100vh - 68px);
  margin-top: 68px;
  background: transparent;  /* let PageCanvas paper show through */
}

.docs-sidebar {
  width: 280px;
  min-width: 280px;
  position: sticky;
  top: 68px;
  align-self: flex-start;
  max-height: calc(100vh - 68px);
  overflow-y: auto;
  border-right: 1px solid #E2E8F0;
  background: linear-gradient(180deg, rgba(0,0,128,0.015) 0%, rgba(248,250,252,0.72) 120px);
  padding: 28px 24px 56px;
  z-index: 10;
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
}

.docs-sidebar::before {
  content: '';
  display: block;
  height: 3px;
  margin: 0 0 22px 0;
  background: linear-gradient(90deg, #000080 0%, #1E3A8A 70%, transparent 100%);
}

.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 2px; }

.docs-content {
  flex: 1;
  min-width: 0;
  padding: var(--space-7) 48px var(--space-8);
  max-width: 920px;
  position: relative;
  z-index: 1;
}

/* ============================================================
   SIDEBAR NAVIGATION
   ============================================================ */

.docs-sidebar-section {
  padding: 0 0 8px 0;
}

.docs-sidebar-section + .docs-sidebar-section {
  border-top: 1px solid #E2E8F0;
  padding-top: 12px;
  margin-top: 8px;
}

.docs-sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 12px;
  margin: 0;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: #64748B;
  cursor: pointer;
  border-radius: 7px;
  transition: all 0.15s;
  text-align: left;
}

.docs-sidebar-heading:hover {
  background: rgba(0,0,128,0.04);
  color: #000080;
}

.docs-sidebar-heading svg.chevron {
  transition: transform 0.22s ease;
  flex-shrink: 0;
  opacity: 0.35;
  color: #94A3B8;
}

.docs-sidebar-heading:hover svg.chevron { opacity: 0.6; }

.docs-sidebar-heading--open svg.chevron {
  transform: rotate(90deg);
  opacity: 0.65;
}

.docs-sidebar-children {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.28s ease;
}

.docs-sidebar-children--open {
  max-height: 900px;
}

.docs-sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 24px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.50;
  color: #475569;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s;
  margin: 1px 0;
  border-left: 2px solid transparent;
}

.docs-sidebar-link:hover {
  color: #0F172A;
  background: rgba(0,0,128,0.06);
  border-left-color: #000080;
}

.docs-sidebar-link--active {
  color: #000080;
  background: rgba(0,0,128,0.07);
  border-left-color: #000080;
  font-weight: 600;
}

/* Top-level link (no children) */
.docs-sidebar-link--top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  border-radius: 7px;
  margin: 3px 0 3px 0;
  border-left: 2px solid transparent;
  text-decoration: none;
  transition: all 0.15s;
}

.docs-sidebar-link--top:hover {
  color: #000080;
  background: rgba(0,0,128,0.06);
  border-left-color: #000080;
}

.docs-sidebar-link--top.docs-sidebar-link--active {
  color: #000080;
  background: rgba(0,0,128,0.08);
  border-left-color: #000080;
  box-shadow: inset 0 0 0 1px rgba(0,0,128,0.06);
}

/* Sidebar icons */
.docs-sidebar-icon {
  flex-shrink: 0;
  opacity: 0.45;
  width: 15px;
  height: 15px;
  stroke-width: 1.8;
}

.docs-sidebar-link--active .docs-sidebar-icon { opacity: 0.85; }
.docs-sidebar-link--top.docs-sidebar-link--active .docs-sidebar-icon { opacity: 0.9; }

/* ============================================================
   MOBILE SIDEBAR TOGGLE
   ============================================================ */

.docs-mobile-nav-toggle {
  display: none;
  position: fixed;
  top: 76px;
  left: 12px;
  z-index: 30;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #475569;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* ============================================================
   BREADCRUMB
   ============================================================ */

.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--space-5);
  font-size: 13px;
  color: #94A3B8;
  flex-wrap: wrap;
}

.docs-breadcrumb a {
  color: #64748B;
  text-decoration: none;
  transition: color 0.15s;
}

.docs-breadcrumb a:hover {
  color: #000080;
}

.docs-breadcrumb-sep {
  color: #CBD5E1;
  font-size: 11px;
}

.docs-breadcrumb-current {
  color: #334155;
  font-weight: 600;
}

/* ============================================================
   CONTENT TYPOGRAPHY
   ============================================================ */

.docs-content h1 {
  font-size: clamp(28px, 3.8vw, 44px);
  font-weight: 800;
  line-height: 1.10;
  letter-spacing: -0.020em;
  color: #0F172A;
  margin: 0 0 var(--space-3);
}

.docs-content h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  color: #0F172A;
  margin: var(--space-7) 0 var(--space-3);
  padding-bottom: 8px;
  border-bottom: 2px solid #E2E8F0;
  position: relative;
}

.docs-content h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: #000080;
  border-radius: 1px;
}

.docs-content h3 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.40;
  color: #1E293B;
  margin: var(--space-6) 0 var(--space-2);
}

.docs-content h4 {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  color: #334155;
  margin: var(--space-5) 0 var(--space-2);
}

.docs-content p {
  font-size: 17px;
  line-height: 1.55;
  color: #475569;
  margin: 0 0 var(--space-4);
}

.docs-content a {
  color: #000080;
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,128,0.18);
  transition: border-color 0.15s, color 0.15s;
}

.docs-content a:hover {
  color: #000080;
  border-bottom-color: #000080;
}

.docs-content ul,
.docs-content ol {
  margin: 0 0 var(--space-4);
  padding-left: 24px;
  font-size: 17px;
  line-height: 1.55;
  color: #475569;
}

.docs-content li { margin-bottom: 5px; }
.docs-content li > ul, .docs-content li > ol { margin-bottom: 0; margin-top: 5px; }

.docs-content strong { color: #1E293B; font-weight: 600; }

.docs-content hr {
  border: none;
  border-top: 1px solid #E2E8F0;
  margin: var(--space-6) 0;
}

.docs-content code {
  background: #F1F5F9;
  color: #000080;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid #E2E8F0;
}

/* ============================================================
   CODE BLOCKS — with language labels
   ============================================================ */

.docs-code-block {
  margin: 0 0 var(--space-5);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #1E293B;
  background: #0B1222;
  box-shadow:
    0 4px 24px rgba(0,0,128,0.10),
    0 1px 3px rgba(0,0,0,0.20),
    inset 0 1px 0 rgba(255,255,255,0.03);
}

.docs-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  background: #0F1929;
  border-bottom: 1px solid rgba(0,0,128,0.12);
}

.docs-code-lang {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.docs-code-lang--curl   { color: #60A5FA; }
.docs-code-lang--python { color: #34D399; }
.docs-code-lang--json   { color: #FBBF24; }
.docs-code-lang--bash   { color: #F87171; }
.docs-code-lang--text   { color: #CBD5E1; }
.docs-code-lang--js     { color: #C084FC; }

.docs-code-lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.docs-code-dot--blue   { background: #60A5FA; color: #60A5FA; }
.docs-code-dot--green  { background: #34D399; color: #34D399; }
.docs-code-dot--yellow { background: #FBBF24; color: #FBBF24; }
.docs-code-dot--red    { background: #F87171; color: #F87171; }
.docs-code-dot--gray   { background: #CBD5E1; color: #CBD5E1; }
.docs-code-dot--purple { background: #C084FC; color: #C084FC; }

.docs-code-copy {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 5px;
  background: transparent;
  color: #64748B;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s;
}

.docs-code-copy:hover {
  background: rgba(0,0,128,0.15);
  color: #000080;
  border-color: rgba(0,0,128,0.3);
}

.docs-code-copy--done {
  color: #34D399 !important;
  border-color: rgba(52,211,153,0.3) !important;
  background: rgba(52,211,153,0.08) !important;
}

.docs-code-body {
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.60;
  color: #E2E8F0;
  overflow-x: auto;
  white-space: pre;
  word-break: normal;
  tab-size: 2;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.10) transparent;
}

.docs-code-body::-webkit-scrollbar { height: 6px; }
.docs-code-body::-webkit-scrollbar-track { background: transparent; }
.docs-code-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 3px; }

/* ============================================================
   API ENDPOINT TABLES
   ============================================================ */

.docs-table-wrap {
  margin: 0 0 var(--space-5);
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.50;
}

.docs-table thead {
  background: linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%);
  border-bottom: 2px solid #CBD5E1;
}

.docs-table th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
}

.docs-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #F1F5F9;
  color: #475569;
  vertical-align: top;
}

.docs-table tbody tr:nth-child(even) { background: rgba(0,0,128,0.025); }
.docs-table tbody tr:last-child td { border-bottom: none; }
.docs-table tbody tr:hover { background: rgba(0,0,128,0.03); }

.docs-table td:first-child {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #1E293B;
  white-space: nowrap;
}

.docs-table td:first-child strong {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748B;
  margin-right: 6px;
}

/* ============================================================
   TIER BADGES
   ============================================================ */

.docs-tier {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.0;
}

.docs-tier--public  { background: #F1F5F9; color: #64748B; border: 1px solid #E2E8F0; }
.docs-tier--t05    { background: #E0F2FE; color: #0369A1; border: 1px solid #BAE6FD; }
.docs-tier--t1     { background: #DCFCE7; color: #15803D; border: 1px solid #BBF7D0; }
.docs-tier--t2     { background: #F3E8FF; color: #6D28D9; border: 1px solid #DDD6FE; }
.docs-tier--t3     { background: #FCE7F3; color: #BE185D; border: 1px solid #FBCFE8; }
.docs-tier--custom { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }

/* ============================================================
   CALLOUT / NOTE BOXES
   ============================================================ */

.docs-note {
  border-left: 3px solid #000080;
  background: linear-gradient(90deg, rgba(0,0,128,0.06) 0%, rgba(0,0,128,0.02) 100%);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin: 0 0 var(--space-5);
  font-size: 14px;
  line-height: 1.55;
  color: #475569;
}

.docs-note strong { color: #000080; }

.docs-note--warn {
  border-left-color: #F59E0B;
  background: linear-gradient(90deg, rgba(245,158,11,0.06) 0%, rgba(245,158,11,0.02) 100%);
}
.docs-note--warn strong { color: #B45309; }

.docs-note--danger {
  border-left-color: #EF4444;
  background: linear-gradient(90deg, rgba(239,68,68,0.06) 0%, rgba(239,68,68,0.02) 100%);
}
.docs-note--danger strong { color: #DC2626; }

.docs-note--tip {
  border-left-color: #7C3AED;
  background: linear-gradient(90deg, rgba(124,58,237,0.05) 0%, rgba(124,58,237,0.01) 100%);
}
.docs-note--tip strong { color: #6D28D9; }

.docs-note code { background: rgba(0,0,128,0.05); border-color: rgba(0,0,128,0.10); }

/* ============================================================
   CARD GRID (for quickstart tiles, overview cards)
   ============================================================ */

.docs-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
  margin: 0 0 var(--space-6);
}

.docs-card {
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 20px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.33,1,0.68,1);
  color: inherit;
  background: #FFFFFF;
  border-top: 3px solid transparent;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.docs-card:hover {
  border-color: #CBD5E1;
  border-top-color: #000080;
  box-shadow: 0 8px 24px rgba(0,0,128,0.06);
  transform: translateY(-2px);
}

.docs-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
  margin: 0;
}

.docs-card p {
  font-size: 13px;
  line-height: 1.50;
  color: #64748B;
  margin: 0;
}

/* ============================================================
   PREV / NEXT NAVIGATION (at bottom of pages)
   ============================================================ */

.docs-prevnext {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid #E2E8F0;
}

.docs-prevnext-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  border: 1px solid #E2E8F0;
  border-radius: 9px;
  text-decoration: none;
  transition: all 0.15s;
  max-width: 48%;
  background: #FFFFFF;
}

.docs-prevnext-link:hover {
  border-color: #000080;
  background: rgba(0,0,128,0.04);
  box-shadow: 0 4px 12px rgba(0,0,128,0.04);
}

.docs-prevnext-link--prev { align-items: flex-start; }
.docs-prevnext-link--next { align-items: flex-end; text-align: right; margin-left: auto; }

.docs-prevnext-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94A3B8;
}

.docs-prevnext-title {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin-top: 2px;
}

.docs-prevnext-link:hover .docs-prevnext-title { color: #000080; }

/* ============================================================
   PAGE HERO
   ============================================================ */

.docs-hero {
  padding-bottom: var(--space-6);
  margin-bottom: var(--space-6);
  border-bottom: 1px solid #E2E8F0;
  background: linear-gradient(180deg, rgba(0,0,128,0.015) 0%, transparent 80%);
  padding-top: 4px;
}

.docs-hero h1 { margin-bottom: 16px; }

.docs-hero p {
  font-size: 18px;
  line-height: 1.55;
  color: #64748B;
  max-width: 660px;
}

/* ============================================================
   STEP NUMBERS (for getting started guide)
   ============================================================ */

.docs-step {
  display: flex;
  gap: 18px;
  margin-bottom: 28px;
  align-items: flex-start;
}

.docs-step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #000080 0%, #1E3A8A 100%);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  box-shadow: 0 2px 8px rgba(0,0,128,0.20);
}

.docs-step-body { flex: 1; min-width: 0; }
.docs-step-body p { margin-bottom: 10px; }
.docs-step-body h2,
.docs-step-body h3 { margin-top: 0; }

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 1024px) {
  .docs-mobile-nav-toggle { display: flex; }
  .docs-sidebar { display: none; }

  .docs-content {
    padding: 28px 24px 80px;
  }

  .docs-content h1 { font-size: clamp(24px, 5.5vw, 34px); }
  .docs-content h2 { font-size: 20px; }
  .docs-content p, .docs-content li { font-size: 15px; }

  .docs-card-grid { grid-template-columns: 1fr; }

  .docs-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .docs-table { min-width: 600px; }

  .docs-prevnext { flex-direction: column; }
  .docs-prevnext-link { max-width: 100%; }
  .docs-prevnext-link--next { margin-left: 0; }
}

@media (max-width: 720px) {
  .docs-content { padding: 22px 16px 64px; }
  .docs-mobile-nav-toggle { top: 72px; left: 8px; }
  .docs-code-body { font-size: 12px; padding: 12px 14px; }
}
