/* ===========================
   NOVENTIA.XYZ — Whitepaper Styles
   ========================== */

/* --- Layout --- */
.wp-layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* --- Sidebar --- */
.wp-sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 16px;
}
.wp-sidebar::-webkit-scrollbar { width: 3px; }
.wp-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.wp-sidebar-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.wp-version {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: block;
}
.wp-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  padding: 8px 16px;
  background: none;
  border: 1px solid var(--accent-dim);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
  justify-content: center;
}
.wp-download:hover {
  background: var(--accent-dim);
}

/* --- Nav items --- */
.wp-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wp-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  cursor: pointer;
  text-decoration: none;
}
.wp-nav-item:hover {
  color: var(--text);
  background: rgba(255,255,255,0.03);
}
.wp-nav-item.active {
  color: var(--accent);
  background: var(--accent-dim);
}
.wp-nav-num {
  font-weight: 700;
  min-width: 20px;
  color: var(--text-muted);
  opacity: 0.5;
}
.wp-nav-item.active .wp-nav-num {
  color: var(--accent);
  opacity: 1;
}

/* --- Content --- */
.wp-content {
  min-width: 0;
}
.wp-chapter {
  margin-bottom: 56px;
  scroll-margin-top: 100px;
}
.wp-chapter:last-child {
  margin-bottom: 0;
}
.wp-chapter-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  opacity: 0.5;
  margin-bottom: 8px;
  display: block;
}
.wp-content h2 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 28px;
  margin-bottom: 20px;
  color: var(--text);
}
.wp-content h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 20px;
  margin: 32px 0 12px;
  color: var(--text);
}
.wp-content p {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.85;
  margin-bottom: 18px;
}
.wp-content strong {
  color: var(--text);
}
.wp-content ul,
.wp-content ol {
  margin: 16px 0;
  padding-left: 24px;
}
.wp-content li {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 6px;
  list-style: disc;
}
.wp-content ol li {
  list-style: decimal;
}
.wp-content a {
  color: var(--accent);
}
.wp-content a:hover {
  text-decoration: underline;
}

/* --- Formula blocks --- */
.wp-formula {
  text-align: center;
  margin: 28px 0;
}
.wp-formula code {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(0,229,199,0.06);
  border: 1px solid rgba(0,229,199,0.15);
  border-radius: var(--radius-sm);
  padding: 16px 28px;
  display: inline-block;
  text-shadow: 0 0 20px rgba(0,229,199,0.1);
}

/* --- Code blocks --- */
.wp-code {
  margin: 24px 0;
  padding: 20px;
  background: #0c1117;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.7;
}

/* --- Terminal boxes --- */
.wp-terminal {
  margin: 24px 0;
  background: #0c1117;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.wp-terminal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.wp-terminal-header span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.wp-terminal-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}
.wp-terminal-body {
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-dim);
  white-space: pre-wrap;
}

/* --- Tables --- */
.wp-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 24px 0;
  font-size: 13px;
}
.wp-content th,
.wp-content td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.wp-content th {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-card);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.wp-content td {
  color: var(--text-dim);
}

/* --- Mobile sidebar toggle --- */
.wp-sidebar-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  padding: 12px 0;
  cursor: pointer;
  border: none;
  background: none;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .wp-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .wp-sidebar {
    position: relative;
    top: 0;
    max-height: none;
    padding-right: 0;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
  }
  .wp-sidebar-toggle {
    display: flex;
  }
  .wp-nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
  }
  .wp-nav.open {
    max-height: 600px;
  }
  .wp-content h2 { font-size: 24px; }
  .wp-formula code { font-size: 15px; padding: 12px 20px; }
}
@media (max-width: 480px) {
  .wp-content h2 { font-size: 20px; }
  .wp-content h3 { font-size: 17px; }
  .wp-content p { font-size: 14px; }
}

/* --- Print styles --- */
@media print {
  body { background: #fff; color: #111; }
  .nav, .mobile-menu, .scan-line, .glow-orbs, .page-hero,
  .wp-sidebar, .legal-disclaimer, .footer, .wp-download,
  script, ion-icon { display: none !important; }
  .wp-layout { grid-template-columns: 1fr; display: block; }
  .wp-content { max-width: 100%; padding: 0; color: #111; }
  .wp-content h2 { color: #111; font-size: 22px; page-break-after: avoid; }
  .wp-content h3 { color: #333; font-size: 17px; page-break-after: avoid; }
  .wp-content p, .wp-content li, .wp-content td { color: #222; font-size: 13px; }
  .wp-content th { color: #111; background: #eee; }
  .wp-content table { border: 1px solid #ccc; }
  .wp-content td, .wp-content th { border-bottom: 1px solid #ddd; }
  .wp-formula code { color: #111; background: #f0f0f0; border-color: #ccc; text-shadow: none; }
  .wp-terminal, .wp-code { background: #f5f5f5; border-color: #ccc; color: #222; }
  .wp-chapter { page-break-inside: avoid; }
  a { color: #111; text-decoration: none; }
}
