/* ============================================
   layout.css — Grid, sidebar chrome, footer
   ============================================ */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 24px 20px 40px;
}

.main {
  grid-column: 2;
  padding: 40px 48px 120px;
  max-width: calc(var(--max-content) + 96px);
}

.content {
  max-width: var(--max-content);
}

/* ============================================
   Brand
   ============================================ */

.brand {
  display: block;
  margin-bottom: 36px;
  padding: 0 4px;
  text-decoration: none;
  color: var(--text);
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand-version {
  display: inline-block;
  margin-top: 4px;
  padding: 1.5px 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--accent-dark);
  background: var(--accent-bg);
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--accent-soft);
}

/* ============================================
   Sidebar navigation
   ============================================ */

.nav-group {
  margin-bottom: 22px;
}

.nav-group-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-subtle);
  padding: 0 10px;
  margin-bottom: 8px;
}

.nav-item {
  display: block;
  padding: 5px 10px;
  font-size: 13.5px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 4px;
  margin-bottom: 1px;
  border-left: 2px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.nav-item:hover {
  background: rgba(217, 119, 87, 0.08);
  color: var(--text);
}

.nav-item.active {
  color: var(--text);
  background: transparent;
  border-left-color: var(--accent);
  font-weight: 600;
  border-radius: 0;
}

/* ============================================
   Search bar (cosmetic — ⌘K style)
   ============================================ */

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 28px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

.search-bar:hover {
  border-color: var(--accent-soft);
  background: var(--bg-elevated);
}

.search-icon {
  color: var(--text-subtle);
  flex-shrink: 0;
}

.search-placeholder {
  flex: 1;
  font-size: 12.5px;
  color: var(--text-subtle);
  font-family: var(--font-sans);
}

.search-kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  padding: 1.5px 5px;
  line-height: 1;
  font-weight: 500;
}

/* ============================================
   Document footer
   ============================================ */

.doc-footer {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12.5px;
  color: var(--text-subtle);
  font-family: var(--font-sans);
}

.doc-footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.doc-footer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(217, 119, 87, 0.5);
}

.doc-footer-right {
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.doc-footer a {
  color: var(--text-muted);
  text-decoration-color: var(--border-strong);
}

.doc-footer a:hover {
  color: var(--accent-dark);
  text-decoration-color: var(--accent);
}

/* ============================================
   Responsive — structural
   ============================================ */

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .main {
    grid-column: 1;
    padding: 24px 20px 80px;
  }
}
