/* DPE Waitlist Knowledge Base — Styles
   Mirrors the main site aesthetic: Geist font, blue-600 primary, zinc neutrals,
   glass-morphism nav, rounded corners, dark mode support. */

/* ============================================================
   RESET & BASE
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800;900&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --bg-subtle: #f4f4f5;       /* zinc-100 */
  --bg-card: rgba(255,255,255,0.9);
  --bg-sidebar: #fafafa;
  --fg: #18181b;               /* zinc-900 */
  --fg-muted: #71717a;         /* zinc-500 */
  --fg-subtle: #a1a1aa;        /* zinc-400 */
  --border: #e4e4e7;           /* zinc-200 */
  --border-subtle: rgba(228,228,231,0.5);
  --blue: #2563eb;             /* blue-600 */
  --blue-light: #dbeafe;       /* blue-100 */
  --blue-dark: #1d4ed8;        /* blue-700 */
  --purple: #9333ea;
  --purple-light: #f3e8ff;
  --emerald: #059669;
  --emerald-light: #d1fae5;
  --cyan: #0891b2;
  --cyan-light: #cffafe;
  --amber: #d97706;
  --amber-light: #fef3c7;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-lg: 24px;
  --max-w: 1280px;
  --sidebar-w: 280px;
  --nav-h: 64px;
  --feedback-green: #059669;
  --feedback-red: #dc2626;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b;              /* zinc-950 */
    --bg-subtle: #18181b;       /* zinc-900 */
    --bg-card: rgba(24,24,27,0.9);
    --bg-sidebar: #111113;
    --fg: #fafafa;              /* zinc-50 */
    --fg-muted: #a1a1aa;        /* zinc-400 */
    --fg-subtle: #71717a;       /* zinc-500 */
    --border: #27272a;          /* zinc-800 */
    --border-subtle: rgba(39,39,42,0.5);
    --blue-light: rgba(37,99,235,0.15);
    --purple-light: rgba(147,51,234,0.15);
    --emerald-light: rgba(5,150,105,0.15);
    --cyan-light: rgba(8,145,178,0.15);
    --amber-light: rgba(217,119,6,0.15);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4);
  }
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--blue-dark); }

img { max-width: 100%; display: block; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-h);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center;
}
.nav-inner {
  max-width: var(--max-w); width: 100%;
  margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); }
.nav-brand svg { width: 28px; height: 28px; }
.nav-brand span { font-weight: 800; font-size: 1.125rem; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a {
  font-size: 0.8125rem; font-weight: 700;
  color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.08em;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--blue); }
.nav-links .btn-primary {
  background: var(--blue); color: #fff; padding: 8px 18px; border-radius: 999px;
  font-size: 0.8125rem; font-weight: 700; text-transform: none; letter-spacing: 0;
  transition: background 0.15s, transform 0.1s;
}
.nav-links .btn-primary:hover { background: var(--blue-dark); color: #fff; }
.nav-links .btn-primary:active { transform: scale(0.97); }

/* ============================================================
   LAYOUT
   ============================================================ */
.page { padding-top: var(--nav-h); min-height: 100vh; display: flex; flex-direction: column; }

/* Two-column layout (sidebar + content) */
.layout { display: flex; max-width: var(--max-w); margin: 0 auto; width: 100%; flex: 1; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  padding: 32px 24px; border-right: 1px solid var(--border);
  background: var(--bg-sidebar);
  position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.content {
  flex: 1; min-width: 0;
  padding: 40px 48px 80px;
}

/* ============================================================
   SIDEBAR NAVIGATION
   ============================================================ */
.sidebar-section { margin-bottom: 28px; }
.sidebar-section-title {
  font-size: 0.6875rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--fg-subtle); margin-bottom: 8px;
  padding: 0 8px;
}
.sidebar-topic { margin-bottom: 4px; }
.sidebar-topic-link {
  display: block; padding: 6px 8px; border-radius: 6px;
  font-size: 0.875rem; font-weight: 600; color: var(--fg-muted);
  transition: background 0.15s, color 0.15s;
}
.sidebar-topic-link:hover { background: var(--bg-subtle); color: var(--fg); }
.sidebar-topic-link.active { background: var(--blue-light); color: var(--blue); }

.sidebar-articles { padding-left: 12px; margin-top: 2px; }
.sidebar-article-link {
  display: block; padding: 4px 8px; border-radius: 4px;
  font-size: 0.8125rem; font-weight: 500; color: var(--fg-subtle);
  transition: background 0.15s, color 0.15s;
}
.sidebar-article-link:hover { background: var(--bg-subtle); color: var(--fg); }
.sidebar-article-link.active { color: var(--blue); font-weight: 600; }

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumbs {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 0.8125rem; font-weight: 500; color: var(--fg-subtle);
  margin-bottom: 24px;
}
.breadcrumbs a { color: var(--fg-muted); }
.breadcrumbs a:hover { color: var(--blue); }
.breadcrumbs .sep { color: var(--fg-subtle); }

/* ============================================================
   HEADINGS & TYPOGRAPHY
   ============================================================ */
h1 { font-size: 2.25rem; font-weight: 900; letter-spacing: -0.025em; line-height: 1.1; color: var(--fg); margin-bottom: 16px; }
h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; color: var(--fg); margin-top: 40px; margin-bottom: 12px; }
h3 { font-size: 1.125rem; font-weight: 700; color: var(--fg); margin-top: 28px; margin-bottom: 8px; }

.subtitle { font-size: 1.125rem; font-weight: 500; color: var(--fg-muted); line-height: 1.6; margin-bottom: 32px; }

/* ============================================================
   ARTICLE STUB CONTENT
   ============================================================ */
.stub-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--amber-light); color: var(--amber);
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 4px 12px; border-radius: 999px; margin-bottom: 24px;
}

.stub-section { margin-top: 32px; }
.stub-section h2 { font-size: 1.25rem; margin-top: 0; }

.stub-list { list-style: none; padding: 0; margin: 12px 0; }
.stub-list li {
  position: relative; padding: 8px 0 8px 20px;
  font-size: 0.9375rem; color: var(--fg-muted); line-height: 1.5;
}
.stub-list li::before {
  content: ''; position: absolute; left: 0; top: 16px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue);
}
.stub-list.considerations li::before { background: var(--amber); }

/* ============================================================
   ARTICLE BODY (published articles)
   ============================================================ */
.article-body { margin-top: 8px; line-height: 1.7; color: var(--fg); }
.article-body h2 { font-size: 1.375rem; font-weight: 700; margin: 40px 0 16px; }
.article-body h3 { font-size: 1.125rem; font-weight: 600; margin: 32px 0 12px; }
.article-body p { margin: 0 0 16px; font-size: 0.9375rem; }
.article-body ul, .article-body ol { margin: 0 0 16px; padding-left: 24px; font-size: 0.9375rem; }
.article-body li { margin-bottom: 6px; }
.article-body strong { font-weight: 600; }
.article-body .tip {
  background: var(--blue-light, #eff6ff); border-left: 3px solid var(--blue);
  padding: 12px 16px; border-radius: 6px; margin: 16px 0 24px; font-size: 0.9375rem;
}
.article-body .note {
  background: var(--amber-light); border-left: 3px solid var(--amber);
  padding: 12px 16px; border-radius: 6px; margin: 16px 0 24px; font-size: 0.9375rem;
}
@media (prefers-color-scheme: dark) {
  .article-body .tip { background: rgba(37,99,235,0.1); }
  .article-body .note { background: rgba(245,158,11,0.1); }
}

/* Dark/light mode images: show only the variant matching the color scheme */
.article-body picture img { border-radius: var(--radius); border: 1px solid var(--border); }
.article-body .img-light { display: block; }
.article-body .img-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .article-body .img-light { display: none; }
  .article-body .img-dark { display: block; }
}

.related-articles { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); }
.related-articles h3 { margin-top: 0; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--fg-subtle); margin-bottom: 12px; }
.related-list { list-style: none; padding: 0; }
.related-list li { margin-bottom: 8px; }
.related-list a { font-size: 0.9375rem; font-weight: 600; }

.article-meta {
  margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: 0.8125rem; color: var(--fg-subtle);
  display: flex; align-items: center; gap: 16px;
}

/* ============================================================
   FEEDBACK WIDGET
   ============================================================ */
.feedback-widget {
  margin-top: 48px; padding: 24px; border-radius: var(--radius);
  background: var(--bg-subtle); border: 1px solid var(--border);
  text-align: center;
}
.feedback-widget p { font-size: 0.9375rem; font-weight: 600; color: var(--fg-muted); margin-bottom: 12px; }
.feedback-buttons { display: flex; justify-content: center; gap: 12px; }
.feedback-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 20px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg); color: var(--fg-muted); font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.feedback-btn:hover { border-color: var(--blue); color: var(--blue); }
.feedback-btn.selected-yes { background: var(--emerald-light); border-color: var(--emerald); color: var(--emerald); }
.feedback-btn.selected-no { background: rgba(220,38,38,0.1); border-color: var(--feedback-red); color: var(--feedback-red); }
.feedback-thanks { font-size: 0.875rem; color: var(--fg-subtle); margin-top: 8px; display: none; }
.feedback-thanks.visible { display: block; }

/* ============================================================
   CARDS (for section/topic landing pages)
   ============================================================ */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-top: 24px; }

.card {
  padding: 24px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-card); backdrop-filter: blur(4px);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  text-decoration: none; color: inherit; display: block;
}
.card:hover {
  box-shadow: var(--shadow-md); border-color: var(--blue);
  transform: translateY(-2px); color: inherit;
}
.card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px; font-size: 1.25rem;
}
.card-icon.blue { background: var(--blue-light); color: var(--blue); }
.card-icon.purple { background: var(--purple-light); color: var(--purple); }
.card-icon.emerald { background: var(--emerald-light); color: var(--emerald); }
.card-icon.cyan { background: var(--cyan-light); color: var(--cyan); }
.card-icon.amber { background: var(--amber-light); color: var(--amber); }

.card-title { font-size: 1.0625rem; font-weight: 700; color: var(--fg); margin-bottom: 6px; }
.card-desc { font-size: 0.875rem; color: var(--fg-muted); line-height: 1.5; }
.card-count { font-size: 0.75rem; font-weight: 600; color: var(--fg-subtle); margin-top: 8px; }

/* Section landing cards (larger) */
.section-card { padding: 32px; border-radius: var(--radius-lg); }
.section-card .card-icon { width: 56px; height: 56px; border-radius: 16px; font-size: 1.5rem; margin-bottom: 16px; }
.section-card .card-title { font-size: 1.25rem; font-weight: 800; }
.section-card .card-desc { font-size: 1rem; }

/* ============================================================
   SEARCH
   ============================================================ */
.search-container { position: relative; margin-bottom: 32px; }
.search-input {
  width: 100%; padding: 14px 20px 14px 48px;
  border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--fg);
  font-size: 1rem; font-weight: 500; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.search-input::placeholder { color: var(--fg-subtle); }
.search-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }

.search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--fg-subtle); pointer-events: none;
}

.search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 480px; overflow-y: auto; z-index: 100;
  display: none;
}
.search-results.visible { display: block; }

.search-result {
  display: block; padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s; color: inherit; text-decoration: none;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--bg-subtle); }
.search-result-title { font-size: 0.9375rem; font-weight: 600; color: var(--fg); }
.search-result-path { font-size: 0.75rem; color: var(--fg-subtle); margin-top: 2px; }
.search-result-desc { font-size: 0.8125rem; color: var(--fg-muted); margin-top: 4px; line-height: 1.4; }
.search-result mark { background: var(--blue-light); color: var(--blue); border-radius: 2px; padding: 0 2px; }
.search-no-results { padding: 24px 20px; text-align: center; color: var(--fg-subtle); font-size: 0.9375rem; }

.search-shortcut {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  padding: 2px 8px; border-radius: 4px; border: 1px solid var(--border);
  font-size: 0.6875rem; font-weight: 600; color: var(--fg-subtle);
  pointer-events: none;
}

/* ============================================================
   HERO (landing page)
   ============================================================ */
.hero {
  text-align: center; padding: 80px 24px 48px;
  max-width: 800px; margin: 0 auto;
}
.hero h1 { font-size: 3rem; letter-spacing: -0.04em; margin-bottom: 16px; }
.hero h1 .accent { color: var(--blue); }
.hero .subtitle { font-size: 1.25rem; max-width: 600px; margin: 0 auto 40px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px; text-align: center;
  background: var(--bg-card); backdrop-filter: blur(8px);
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.footer-links { display: flex; gap: 24px; }
.footer-links a {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--fg-subtle);
}
.footer-links a:hover { color: var(--blue); }
.footer-copy { font-size: 0.75rem; color: var(--fg-subtle); }

/* ============================================================
   TOPIC LIST (for section pages)
   ============================================================ */
.topic-list { margin-top: 24px; }
.topic-group { margin-bottom: 40px; }
.topic-group-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 16px; color: var(--fg); }
.article-list { list-style: none; padding: 0; }
.article-list-item {
  display: block; padding: 14px 16px; border-radius: 8px;
  border: 1px solid transparent; transition: all 0.15s;
  margin-bottom: 4px; text-decoration: none; color: inherit;
}
.article-list-item:hover { background: var(--bg-subtle); border-color: var(--border); color: inherit; }
.article-list-item-title { font-size: 0.9375rem; font-weight: 600; color: var(--fg); }
.article-list-item-desc { font-size: 0.8125rem; color: var(--fg-muted); margin-top: 2px; }

/* ============================================================
   MOBILE
   ============================================================ */
.mobile-menu-btn {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--fg); padding: 8px;
}
.mobile-menu-btn svg { width: 24px; height: 24px; }

@media (max-width: 768px) {
  .mobile-menu-btn { display: block; }
  .nav-links a:not(.btn-primary) { display: none; }

  .sidebar {
    position: fixed; top: var(--nav-h); left: 0; bottom: 0;
    width: 280px; z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    border-right: 1px solid var(--border);
    background: var(--bg);
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-overlay {
    display: none; position: fixed; inset: 0; top: var(--nav-h);
    background: rgba(0,0,0,0.3); z-index: 39;
  }
  .sidebar-overlay.visible { display: block; }

  .content { padding: 24px 16px 60px; }

  h1 { font-size: 1.75rem; }
  .hero h1 { font-size: 2rem; }
  .hero { padding: 48px 16px 32px; }
  .card-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   404 PAGE
   ============================================================ */
.not-found {
  text-align: center; padding: 120px 24px;
  max-width: 500px; margin: 0 auto;
}
.not-found h1 { font-size: 6rem; color: var(--fg-subtle); margin-bottom: 8px; }
.not-found p { color: var(--fg-muted); font-size: 1.125rem; margin-bottom: 24px; }
.not-found a {
  display: inline-block; padding: 10px 24px; border-radius: 999px;
  background: var(--blue); color: #fff; font-weight: 700;
  transition: background 0.15s;
}
.not-found a:hover { background: var(--blue-dark); color: #fff; }
