/* ============================================================
   Vector Foundry User Guide
   Builds on styles.css custom properties
   ============================================================ */

/* --- Guide Hero (shorter, no canvas) --- */
.guide-hero {
  padding: 140px 24px 48px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.guide-hero h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.guide-hero p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* --- Layout: sidebar + content --- */
.guide-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 120px;
  display: flex;
  gap: 48px;
}

/* --- Sidebar TOC --- */
.guide-toc {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  align-self: flex-start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 16px;
  border-right: 1px solid var(--border);
}

.guide-toc-link {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  line-height: 1.4;
}

.guide-toc-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.guide-toc-link.active {
  color: var(--primary);
  background: var(--primary-a20);
}

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

/* --- Sections --- */
.guide-section {
  scroll-margin-top: 80px;
  margin-bottom: 64px;
}

.guide-section:last-child {
  margin-bottom: 0;
}

.guide-section h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.guide-section h3 {
  font-size: 18px;
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 10px;
}

.guide-section p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.guide-section ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

.guide-section li {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* --- Keyboard key styling --- */
.guide-key {
  display: inline-block;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 12px;
  font-family: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
  color: var(--text);
  line-height: 1.6;
  white-space: nowrap;
  vertical-align: baseline;
}

/* --- Tip box --- */
.guide-tip {
  background: rgba(234, 88, 12, 0.06);
  border: 1px solid var(--primary-a30);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.guide-tip strong {
  color: var(--primary);
  font-weight: 600;
}

/* --- Layer cards (2-col grid) --- */
.guide-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 20px 0;
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: border-color 0.2s;
}

.guide-card:hover {
  border-color: var(--border-hover);
}

.guide-card h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.guide-card p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* --- Definition list for controls --- */
.guide-dl {
  margin: 16px 0;
}

.guide-dl dt {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-top: 16px;
  margin-bottom: 4px;
}

.guide-dl dt:first-child {
  margin-top: 0;
}

.guide-dl dd {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-left: 0;
  padding-left: 16px;
  border-left: 2px solid var(--border);
}

/* --- Shortcuts table --- */
.guide-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.guide-table th,
.guide-table td {
  text-align: left;
  padding: 10px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.guide-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.guide-table td {
  color: var(--text-secondary);
}

.guide-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* --- Numbered steps --- */
.guide-steps {
  counter-reset: guide-step;
  margin: 20px 0;
}

.guide-step {
  counter-increment: guide-step;
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.guide-step::before {
  content: counter(guide-step);
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-a20);
  border: 1px solid var(--primary-a30);
  border-radius: 50%;
}

.guide-step div {
  padding-top: 4px;
}

.guide-step h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.guide-step p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .guide-toc {
    display: none;
  }

  .guide-layout {
    padding: 32px 24px 80px;
  }
}

@media (max-width: 768px) {
  .guide-card-grid {
    grid-template-columns: 1fr;
  }

  .guide-hero {
    padding: 120px 24px 32px;
  }

  .guide-table th,
  .guide-table td {
    padding: 8px 10px;
    font-size: 13px;
  }
}
