/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font: 16px/1.6 -apple-system, system-ui, sans-serif;
  margin: 0;
  padding: 0;
  color: #1a1a1a;
  background: #fff;
}

a { color: #1a1a1a; }
a:hover { color: #555; }

/* ── Layout ── */
.docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid #e5e5e5;
  padding: 1.5rem 0;
  background: #fafafa;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.25rem 1.25rem;
  text-decoration: none;
  color: #1a1a1a;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 0.75rem;
}
.sidebar-brand img { border-radius: 22%; }
.sidebar-brand span { font-weight: 600; font-size: 1rem; }

.sidebar-section {
  padding: 0.5rem 0 0;
}

.sidebar-heading {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #999;
  padding: 0.25rem 1.25rem 0.35rem;
}

.sidebar-link {
  display: block;
  padding: 0.35rem 1.25rem;
  font-size: 0.9rem;
  text-decoration: none;
  color: #555;
  border-left: 3px solid transparent;
  transition: background 0.1s, color 0.1s;
}
.sidebar-link:hover {
  background: #f0f0f0;
  color: #1a1a1a;
}
.sidebar-link.active {
  color: #1a1a1a;
  font-weight: 500;
  background: #efefef;
  border-left-color: #1a1a1a;
}

.sidebar-footer {
  padding: 1rem 1.25rem 0;
  margin-top: auto;
  border-top: 1px solid #e5e5e5;
  padding-top: 0.75rem;
}

.sidebar-footer a {
  display: block;
  font-size: 0.8rem;
  color: #888;
  text-decoration: none;
  padding: 0.15rem 0;
}
.sidebar-footer a:hover { color: #1a1a1a; }

/* ── Mobile toggle ── */
.menu-toggle { display: none; }
.menu-label { display: none; }

/* ── Content ── */
.content {
  max-width: 48rem;
  padding: 2.5rem 3rem 4rem;
}

.content h1 { font-size: 1.75rem; margin: 0 0 0.25rem; }

.subtitle {
  color: #555;
  font-size: 1.05rem;
  margin: 0 0 2rem;
}

.content h2 {
  font-size: 1.25rem;
  margin: 2.25rem 0 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid #eee;
}
.content h2:first-of-type { border-top: none; padding-top: 0; }

.content h3 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }

.changelog-date {
  font-weight: 400;
  color: #888;
  font-size: 0.9em;
}

.content p { margin: 0.75rem 0; }

code {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 0.9em;
  background: #f5f5f5;
  padding: 0.15em 0.35em;
  border-radius: 4px;
}

pre {
  background: #0d0d0d;
  color: #e0e0e0;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.5;
}
pre code { background: none; padding: 0; color: inherit; }

.comment { color: #6a737d; }
.string { color: #79b8ff; }
.key { color: #b392f0; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}

th {
  text-align: left;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid #e5e5e5;
}

td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}

td:first-child { white-space: nowrap; }

kbd {
  font-family: -apple-system, system-ui, sans-serif;
  font-size: 0.85em;
  background: #f5f5f5;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  padding: 0.1em 0.4em;
  box-shadow: 0 1px 0 #d0d0d0;
}

ul, ol { padding-left: 1.5rem; }
li { margin: 0.3rem 0; }

.field-table td:first-child code { font-weight: 600; }

.note {
  background: #f8f8f8;
  border-left: 3px solid #d0d0d0;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  font-size: 0.95rem;
  color: #555;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #e5e5e5;
    padding: 0;
    overflow: visible;
  }

  .sidebar-brand {
    padding: 0.75rem 1rem;
    margin-bottom: 0;
    border-bottom: none;
  }

  /* Hamburger toggle */
  .menu-label {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0.65rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    cursor: pointer;
    border-radius: 6px;
    z-index: 2;
  }
  .menu-label:hover { background: #eee; }
  .menu-label svg { display: block; }

  .sidebar-section {
    display: none;
    padding: 0 0 0.5rem;
    border-top: 1px solid #e5e5e5;
  }

  .sidebar-footer {
    display: none;
    border-top: 1px solid #e5e5e5;
    padding: 0.5rem 1.25rem 0.75rem;
    margin-top: 0;
  }

  .menu-toggle:checked ~ .sidebar-section,
  .menu-toggle:checked ~ .sidebar-footer {
    display: block;
  }

  .sidebar-link { padding: 0.4rem 1.25rem; }

  .content {
    padding: 1.5rem 1rem 3rem;
  }

  .content h1 { font-size: 1.4rem; }
  table { font-size: 0.85rem; }
  td, th { padding: 0.4rem 0.5rem; }
}
