/* ============================================
   VIBESHIP KNOWLEDGE BASE - LAYOUT
   Matches vibeship design system - sharp edges
   ============================================ */

/* ============================================
   MAIN LAYOUT - Sidebar + Content
   ============================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ============================================
   TOP HEADER
   ============================================ */
.top-header {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.top-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Theme toggle - sharp edges */
.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.theme-toggle:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

/* ============================================
   CONTENT AREA
   ============================================ */
.content-wrapper {
  flex: 1;
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  overflow-x: hidden;
}

.content-main {
  flex: 1;
  padding: 2.5rem;
  max-width: 800px;
  overflow-x: hidden;
}

.content-wide {
  max-width: 1000px;
}

/* ============================================
   TABLE OF CONTENTS SIDEBAR (Right)
   ============================================ */
.content-toc {
  width: 240px;
  padding: 2.5rem 2rem 2.5rem 0;
  position: sticky;
  top: 80px;
  height: fit-content;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

/* ============================================
   ARTICLE LAYOUT
   ============================================ */
.article-header {
  margin-bottom: 2rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.article-meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  font-family: 'JetBrains Mono', monospace;
}

.article-section {
  margin-bottom: 3rem;
}

.article-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* ============================================
   QUICK ANSWER BOX - Sharp edges
   ============================================ */
.quick-answer {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green-dim);
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.quick-answer-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green-dim);
  margin-bottom: 0.75rem;
}

.quick-answer-text {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 0;
}

/* ============================================
   STATS ROW
   ============================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

/* ============================================
   HUB PAGE GRID
   ============================================ */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.hub-grid a.card {
  text-decoration: none;
  color: inherit;
}

.hub-grid a.card:hover {
  text-decoration: none;
}

.hub-grid a.card h3 {
  color: var(--text-primary);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
}

.footer-brand {
  max-width: 300px;
}

.footer-brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.footer-brand-description {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  line-height: 1.6;
}

.footer-column-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
  .content-toc {
    display: none;
  }
}

@media (max-width: 1024px) {
  .footer-content {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
    width: 100%;
    max-width: 100vw;
  }

  .content-wrapper {
    max-width: 100%;
  }

  .content-main {
    padding: 1.5rem;
    max-width: 100%;
    width: 100%;
  }

  .top-header {
    padding: 0 1rem;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }

  /* Article header - tighter on mobile */
  .article-header {
    margin-bottom: 1.5rem;
  }

  .article-meta {
    gap: 0.75rem;
    font-size: 0.75rem;
  }

  .article-meta-item {
    font-size: 0.7rem;
  }

  .article-section {
    margin-bottom: 2rem;
  }

  .article-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
  }

  /* Quick answer box - tighter mobile */
  .quick-answer {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }

  .quick-answer-label {
    font-size: 0.65rem;
  }

  .quick-answer-text {
    font-size: 0.9rem;
  }

  /* Stats row - already handled but ensure 2 columns */
  .stats-row {
    gap: 0.75rem;
  }
}

/* Overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 10, 0.8);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}
