/* =============================================
   Strux CMS — Subpage Styles
   Shared by: features.html, docs.html, 
   getting-started.html, demo.html
   ============================================= */

/* --- Page Layout --- */
.page {
  padding: calc(var(--nav-h) + 4rem) 0 4rem;
  min-height: 100vh;
}

.page-header {
  text-align: center;
  margin-bottom: 5rem;
}

.page-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.page-subtitle {
  font-size: 1.125rem;
  color: var(--fg-muted);
  max-width: 580px;
  margin: 0 auto;
}

/* --- Active Nav Link --- */
.nav-link--active {
  color: var(--fg) !important;
}

/* --- Feature Deep Dives --- */
.feature-deep {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin-bottom: 4rem;
}

.deep-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
}

.deep-card--reverse {
  direction: rtl;
}

.deep-card--reverse > * {
  direction: ltr;
}

.deep-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.deep-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0.5rem 0 0.75rem;
}

.deep-content p {
  font-size: 0.9375rem;
  color: var(--fg-muted);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.deep-content code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.deep-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.deep-list li {
  font-size: 0.875rem;
  color: var(--fg-muted);
  padding-left: 1.25rem;
  position: relative;
}

.deep-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

.deep-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.deep-visual .code-block {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
}

/* --- Git Visualization --- */
.git-viz {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  padding: 1.5rem;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

.git-branch {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.git-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-faint);
  background: var(--bg-card);
  padding: 0.25rem 0.625rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  min-width: 80px;
  text-align: center;
}

.git-branch--data .git-label {
  color: var(--accent);
  border-color: hsla(210, 100%, 55%, 0.3);
}

.git-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
}

.git-branch--data .git-line {
  background: var(--accent);
  opacity: 0.4;
}

.git-commits {
  display: flex;
  gap: 0.75rem;
}

.git-commit {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* --- Relationship Diagram --- */
.rel-diagram {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

.rel-node {
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.875rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.rel-lines {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.rel-arrow {
  font-size: 1.5rem;
  color: var(--accent);
}

.rel-type {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--fg-faint);
}

/* --- Dynamic Zone Preview --- */
.dz-preview {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  padding: 1.5rem;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

.dz-block {
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-align: center;
  transition: border-color var(--duration) var(--ease);
}

.dz-block:hover {
  border-color: var(--accent);
  border-style: solid;
}

.dz-block--alt {
  background: hsla(210, 100%, 55%, 0.04);
  border-color: hsla(210, 100%, 55%, 0.15);
}

/* --- RBAC Grid --- */
.rbac-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem 1.5rem;
  align-items: center;
  padding: 2rem;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  width: 100%;
}

.rbac-role {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 100px;
  text-align: center;
}

.rbac-admin {
  background: hsla(210, 100%, 55%, 0.12);
  color: var(--accent);
}

.rbac-editor {
  background: hsla(142, 70%, 50%, 0.12);
  color: hsl(142, 70%, 50%);
}

.rbac-public {
  background: hsla(30, 80%, 55%, 0.12);
  color: hsl(30, 80%, 55%);
}

.rbac-perms {
  font-size: 0.875rem;
  color: var(--fg-muted);
}

/* --- Performance Bars --- */
.perf-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  padding: 2rem;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

.perf-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.perf-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fg-faint);
  min-width: 50px;
}

.perf-fill {
  height: 28px;
  background: var(--gradient);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 0.75rem;
  min-width: 60px;
}

.perf-fill--write {
  background: linear-gradient(135deg, hsl(142, 70%, 45%) 0%, hsl(170, 70%, 45%) 100%);
}

.perf-fill--boot {
  background: linear-gradient(135deg, hsl(30, 80%, 50%) 0%, hsl(45, 80%, 50%) 100%);
}

.perf-val {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: #fff;
}

/* --- Docs Page --- */
.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 2rem);
  align-self: start;
  max-height: calc(100vh - var(--nav-h) - 4rem);
  overflow-y: auto;
}

.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.docs-nav-link {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--fg-muted);
  border-radius: var(--radius);
  border-left: 2px solid transparent;
  transition: all var(--duration) var(--ease);
}

.docs-nav-link:hover,
.docs-nav-link.active {
  color: var(--fg);
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.docs-nav-section {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-faint);
  padding: 1rem 0.75rem 0.375rem;
}

.docs-content {
  min-width: 0;
}

.docs-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 3rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
}

.docs-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.docs-content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

.docs-content p {
  font-size: 0.9375rem;
  color: var(--fg-muted);
  line-height: 1.75;
  margin-bottom: 1rem;
}

.docs-content code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.docs-content pre {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1rem 0 1.5rem;
  overflow-x: auto;
}

.docs-content pre code {
  background: none;
  padding: 0;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--fg-muted);
}

.docs-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.docs-content li {
  font-size: 0.9375rem;
  color: var(--fg-muted);
  line-height: 1.7;
  margin-bottom: 0.375rem;
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.875rem;
}

.docs-content th {
  text-align: left;
  padding: 0.75rem;
  font-weight: 600;
  color: var(--fg-faint);
  border-bottom: 1px solid var(--border);
}

.docs-content td {
  padding: 0.75rem;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border-soft);
}

.docs-callout {
  padding: 1rem 1.25rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1rem 0 1.5rem;
}

.docs-callout p {
  color: var(--fg);
  margin: 0;
}

/* --- Getting Started --- */
.steps {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 720px;
  margin: 0 auto;
}

.step {
  display: flex;
  gap: 1.5rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: var(--gradient);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 50%;
}

.step-body h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.step-body p {
  font-size: 0.9375rem;
  color: var(--fg-muted);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.step-body pre {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
}

.step-body pre code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

/* --- Demo Page --- */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.demo-card {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
}

.demo-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.demo-card p {
  font-size: 0.875rem;
  color: var(--fg-muted);
  line-height: 1.65;
}

.demo-placeholder {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-faint);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .deep-card {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .deep-card--reverse {
    direction: ltr;
  }

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

  .docs-sidebar {
    position: static;
    max-height: none;
  }

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

  .step {
    flex-direction: column;
    gap: 1rem;
  }
}
