/* ═══════════════════════════════════════════════════════════════════════════
   PRIMER SYSTEMS DOCS - Light Mode
   Based on Primer Design System
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --lime: #7a9a1a;
  --lime-bright: #baea2a;
  --charcoal: #4A4543;
  --charcoal-light: #5a5553;
  --rust: #B7410E;
  --black: #09090b;
  --white: #fafafa;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
}

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

body {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-700);
  background: var(--white);
}

/* ═══════════════════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════════════════ */

.header {
  background: var(--charcoal);
  border-bottom: 1px solid var(--charcoal-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  display: block;
}

.nav {
  display: flex;
  gap: 8px;
}

.nav-link {
  color: var(--white);
  text-decoration: none;
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 3px;
  transition: border-color 0.15s;
}

.nav-link:hover {
  border-color: var(--lime-bright);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

.layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  min-height: calc(100vh - 120px);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════════════════ */

.sidebar {
  width: 260px;
  flex-shrink: 0;
  padding: 24px;
  border-right: 1px solid var(--gray-200);
  background: var(--gray-50);
}

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

.sidebar-section {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-section-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-700);
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 3px;
  transition: background 0.15s;
  user-select: none;
}

.sidebar-section-title:hover {
  background: var(--gray-100);
}

.sidebar-section-title::after {
  content: '▼';
  font-size: 8px;
  color: var(--gray-500);
  transition: transform 0.2s;
}

.sidebar-section.collapsed .sidebar-section-title::after {
  transform: rotate(-90deg);
}

.sidebar-section-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 12px;
  overflow: hidden;
  max-height: 500px;
  transition: max-height 0.2s ease-out;
}

.sidebar-section.collapsed .sidebar-section-items {
  max-height: 0;
}

.sidebar-link {
  color: var(--gray-700);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 3px;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}

.sidebar-link:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.sidebar-link.active {
  background: rgba(122, 154, 26, 0.1);
  color: var(--lime);
  border-left-color: var(--lime);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTENT
   ═══════════════════════════════════════════════════════════════════════════ */

.content {
  flex: 1;
  padding: 40px 60px;
  max-width: 860px;
}

.article h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 12px;
}

.article h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}

.article h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  margin: 24px 0 12px;
}

.article p {
  margin-bottom: 16px;
}

.article .lead {
  font-size: 15px;
  color: var(--gray-500);
}

.article a {
  color: var(--lime);
  text-decoration: none;
}

.article a:hover {
  text-decoration: underline;
}

.divider {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 32px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CODE BLOCKS
   ═══════════════════════════════════════════════════════════════════════════ */

.article code {
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
  color: var(--rust);
}

.article pre {
  background: var(--black);
  border: 1px solid var(--charcoal);
  border-radius: 4px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 16px 0;
  position: relative;
}

.article pre code {
  background: none;
  padding: 0;
  color: var(--white);
  font-size: 13px;
  line-height: 1.6;
}

/* Syntax highlighting */
.tk { color: var(--rust); }           /* keyword */
.ts { color: var(--lime-bright); }    /* string */
.tc { color: var(--charcoal-light); } /* comment */
.tf { color: #60a5fa; }               /* function */
.tp { color: #f472b6; }               /* property */
.tn { color: #c084fc; }               /* number */

/* Code block header */
.code-header {
  background: var(--charcoal);
  padding: 8px 16px;
  font-size: 11px;
  color: var(--gray-500);
  border-radius: 4px 4px 0 0;
  margin-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-header + pre {
  border-radius: 0 0 4px 4px;
  margin-top: 0;
}

.code-lang {
  color: var(--lime-bright);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════════════════════ */

.next-page {
  margin-top: 40px;
  text-align: right;
}

.next-page a {
  color: var(--lime);
  text-decoration: none;
  font-weight: 500;
}

.next-page a:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════════════ */

.footer {
  border-top: 1px solid var(--gray-200);
  padding: 20px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--gray-500);
}

.footer-links {
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--lime);
  text-decoration: none;
  margin: 0 12px;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CALLOUTS / ALERTS
   ═══════════════════════════════════════════════════════════════════════════ */

.callout {
  padding: 16px 20px;
  border-radius: 4px;
  margin: 16px 0;
  font-size: 13px;
}

.callout-info {
  background: rgba(122, 154, 26, 0.08);
  border: 1px solid var(--lime);
}

.callout-warning {
  background: rgba(183, 65, 14, 0.08);
  border: 1px solid var(--rust);
}

.callout strong {
  color: var(--gray-900);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════════════════ */

.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
}

.article th {
  text-align: left;
  padding: 10px 12px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  font-weight: 600;
  color: var(--gray-900);
}

.article td {
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LISTS
   ═══════════════════════════════════════════════════════════════════════════ */

.article ul, .article ol {
  margin: 16px 0;
  padding-left: 24px;
}

.article li {
  margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   IMAGES
   ═══════════════════════════════════════════════════════════════════════════ */

.flow-diagram {
  width: 100%;
  border-radius: 8px;
  margin: 16px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════════════════ */

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 3px;
  margin-right: 6px;
}

.badge-npm {
  background: #cb3837;
  color: white;
}

.badge-pypi {
  background: #3775a9;
  color: white;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FEATURE GRID
   ═══════════════════════════════════════════════════════════════════════════ */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.feature-card {
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 16px;
}

.feature-card h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 12px;
  color: var(--gray-500);
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .content {
    padding: 24px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }
}
