/* TermBlade Component Documentation — Page-Specific Styles */

/* ---- Hero (compact) ---- */
.components-hero {
  padding: 6rem 0 2.5rem;
}
.components-hero .hero-title { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }

/* ---- Docs Layout ---- */
.docs-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  max-width: var(--max-width);
}

/* ---- Sidebar ---- */
.docs-sidebar {
  position: sticky;
  top: 76px;
  width: 220px;
  flex-shrink: 0;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
}
.sidebar-card {
  padding: 1.25rem !important;
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.sidebar-card h2 {
  font-size: 1rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0;
}
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.sidebar-toggle span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text-secondary);
  margin: 4px 0;
  transition: transform .25s, opacity .25s;
}
.sidebar-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.sidebar-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.sidebar-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.sidebar-group {
  margin-bottom: 1.25rem;
}
.sidebar-group h3 {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
.sidebar-group a {
  display: block;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: background .15s, color .15s;
}
.sidebar-group a:hover,
.sidebar-group a.active {
  background: rgba(63, 185, 80, 0.1);
  color: var(--accent);
}

/* ---- Content area ---- */
.docs-content {
  flex: 1;
  min-width: 0;
}

/* ---- Component sections ---- */
.component-section {
  padding: 2rem !important;
  margin-bottom: 2rem;
  scroll-margin-top: 76px;
}
.component-header {
  margin-bottom: 1.5rem;
}
.component-header .hero-tagline {
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
  color: var(--accent);
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.component-header h2 {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}
.component-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ---- Component blocks ---- */
.component-block {
  margin-bottom: 1.5rem;
}
.component-block h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-weight: 600;
}

/* ---- Terminal preview ---- */
.component-preview {
  max-width: 100%;
  margin: 0;
}
.component-preview .terminal-body {
  font-family: "Symbols Nerd Font", "Hack Nerd Font", "FiraCode Nerd Font", "JetBrainsMono Nerd Font", var(--font-mono);
  color: var(--text-secondary);
  min-height: 270px;
  font-size: 14px;
  line-height: normal;
  font-kerning: none;
  white-space: pre;
  letter-spacing: 0.0021089px
}

/* ---- Syntax colors for Razor code blocks ---- */
.component-section .code-block .tag   { color: #7ee787; }
.component-section .code-block .attr  { color: #d2a8ff; }
.component-section .code-block .str   { color: #a5d6ff; }
.component-section .code-block .kw    { color: #ff7b72; }
.component-section .code-block .punct { color: #8b949e; }
.component-section .code-block .num   { color: #79c0ff; }
.component-section .code-block .razor { color: #ffa657; }
.component-section .code-block .type  { color: #d2a8ff; }
.component-section .code-block .fn    { color: #d2a8ff; }

/* ---- Parameter tables ---- */
.component-section .components-table {
  font-size: 0.88rem;
}
.component-section .components-table th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.component-section .components-table td {
  vertical-align: top;
}
.component-section .components-table td:nth-child(1) code {
  font-weight: 600;
}
.component-section .components-table td:nth-child(2) code {
  color: var(--text-secondary);
  background: none;
  border: none;
  padding: 0;
}
.component-section .components-table td:nth-child(3) code {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ---- Common parameters toggle ---- */
.common-parameters {
  margin-top: 0.5rem;
}
.common-parameters summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.5rem 0;
  user-select: none;
  list-style: none;
}
.common-parameters summary::before {
  content: "▶ ";
  font-size: 0.7rem;
  display: inline-block;
  transition: transform .2s;
}
.common-parameters[open] summary::before {
  transform: rotate(90deg);
}
.common-parameters summary:hover {
  color: var(--accent);
}
.common-parameters .table-wrapper {
  padding-top: 0.5rem;
}

/* ---- Active nav link ---- */
.nav-links a.active {
  color: var(--accent) !important;
  font-weight: 600;
}

/* ---- Responsive: tablet ---- */
@media (max-width: 900px) {
  .docs-layout {
    flex-direction: column;
  }
  .docs-sidebar {
    position: static;
    width: 100%;
    max-height: none;
    overflow-y: visible;
  }
  .sidebar-toggle { display: block; }
  .sidebar-body {
    display: none;
    margin-top: 0.75rem;
  }
  .sidebar-body.open { display: block; }
}

/* ---- Responsive: mobile ---- */
@media (max-width: 768px) {
  .components-hero { padding: 5rem 0 1.5rem; }
  .components-hero .hero-title { font-size: 2rem; }
  .component-section { padding: 1.25rem !important; }
  .component-header h2 { font-size: 1.35rem; }
}

@media (max-width: 480px) {
  .component-section { padding: 1rem !important; }
  .component-section .components-table { font-size: 0.8rem; }
  .component-section .components-table th,
  .component-section .components-table td { padding: 0.5rem 0.6rem; }
}

/* ---- Live WASM + xterm.js previews ---- */
.component-preview-live .terminal-body {
  padding: 0;
  height: 210px;
  min-height: 210px;
  overflow: hidden;
  background: #1a1b26;
}

.component-preview-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #1a1b26;
}
