/* Kit Workflows — Guides Template
   Matches the docs.html layout exactly: left sidebar + white card content.
   -------------------------------------------------------------------- */

/* === Tokens (from kit-web) ======================================== */
:root {
  --app-bg:       #F6F8F7;
  --surface:      #FFFFFF;
  --surface-2:    #EFF3F1;
  --surface-3:    #E6ECE8;
  --border:       #D3DBD6;

  --text-primary:   #0A1628;
  --text-secondary: #3B4A5C;
  --text-muted:     #64748B;
  --text-disabled:  #94A3B8;

  --moss-50:  #F1F8F3;
  --moss-100: #DFF1E3;
  --moss-200: #BFE3C7;
  --moss-300: #93CFA1;
  --moss-400: #5FB37A;
  --moss-500: #3F8F5F;
  --moss-600: #2F6F4A;
  --moss-700: #24563A;
  --moss-800: #1B3F2B;

  --success: #15803D;
  --success-soft: #DCFCE7;
  --warning: #CA8A04;
  --warning-soft: #FEF9C3;
  --error: #DC2626;
  --error-soft: #FEE2E2;
  --info: #1E40AF;
  --info-soft: #DBEAFE;

  --font: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* === Reset ======================================================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--app-bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.docs-container { flex: 1; }
img { display: block; max-width: 100%; }
a { color: var(--moss-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Header ======================================================= */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { display: flex; align-items: center; }
.logo-image { height: 28px; width: auto; display: block; }
.header-nav { display: flex; gap: 2rem; align-items: center; }
.header-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .2s;
}
.header-nav a:hover { color: var(--moss-500); text-decoration: none; }

/* === Buttons ====================================================== */
.btn-primary {
  background: var(--moss-500);
  color: white !important;
  padding: .625rem 1.5rem;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  transition: all .2s;
  border: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(10,22,40,.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
}
.btn-primary:hover {
  background: var(--moss-600);
  box-shadow: 0 4px 6px rgba(10,22,40,.07);
  transform: translateY(-1px);
}

/* === Docs layout ================================================== */
.docs-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 2rem;
  padding: 2rem;
}

/* === Left sidebar ================================================= */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.sidebar-section {
  margin-bottom: 1.5rem;
}
.sidebar-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: .5rem;
  padding: 0 .75rem;
}
.sidebar-links { list-style: none; padding-left: .75rem; }
.sidebar-links li { margin-bottom: .25rem; }
.sidebar-links a {
  display: block;
  padding: .5rem .75rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  border-radius: 8px;
  transition: all .2s;
}
.sidebar-links a:hover { background: var(--surface-3); color: var(--text-primary); text-decoration: none; }
.sidebar-links a.active { background: var(--moss-50); color: var(--moss-600); font-weight: 500; }
.sidebar-links .sub { padding-left: 1.5rem; font-size: 13px; }

/* Product CTA card in sidebar */
.sidebar-cta {
  background: var(--moss-50);
  border: 1px solid var(--moss-200);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.sidebar-cta-headline {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: .5rem;
  line-height: 1.3;
}
.sidebar-cta-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}
.sidebar-cta .btn-primary {
  width: 100%;
  font-size: 13px;
  padding: .5rem 1rem;
}
.sidebar-cta-microcopy {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: .5rem;
}

/* === Main content card ============================================ */
.main-content {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 3rem;
}

/* Breadcrumb inside the card */
.content-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.content-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.content-breadcrumb a:hover { color: var(--moss-600); }
.content-breadcrumb-sep { color: var(--text-disabled); }

/* Typography inside the card */
.main-content h1 {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.2;
}
.main-content h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}
.main-content h2:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
.main-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: .75rem;
}
.main-content h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: .5rem;
}
.main-content p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.7;
}
.main-content ul, .main-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}
.main-content li {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: .5rem;
  line-height: 1.6;
}
.main-content strong { color: var(--text-primary); font-weight: 600; }
.main-content a { color: var(--moss-600); }
.main-content a:hover { text-decoration: underline; }

/* Article intro (meta description shown below h1) */
.article-intro {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

/* Tables */
.main-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.main-content thead { background: var(--surface-2); }
.main-content th {
  text-align: left;
  padding: .75rem 1rem;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}
.main-content td {
  padding: .75rem 1rem;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.main-content tbody tr:last-child td { border-bottom: none; }
.main-content tbody tr:hover { background: var(--surface-3); }

/* Citation source links */
.main-content .citation-source {
  font-size: 12px;
  color: var(--text-muted);
  margin: -.5rem 0 1.25rem .75rem;
}
.main-content .citation-source a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.main-content .citation-source a::after { content: " ↗"; }
.main-content blockquote {
  background: var(--surface-2);
  border-left: 3px solid var(--border);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-secondary);
}

/* Info boxes */
.main-content .info-box {
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border: 1px solid;
}
.main-content .info-box p { color: inherit; margin-bottom: 0; }
.main-content .info-box.success { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.main-content .info-box.warning { background: var(--warning-soft); border-color: var(--warning); color: #92400E; }
.main-content .info-box.info    { background: var(--info-soft);    border-color: var(--info);    color: var(--info); }
.main-content .info-box.moss    { background: var(--moss-50);      border-color: var(--moss-200); color: var(--moss-700); }
.main-content .info-box.error   { background: var(--error-soft);   border-color: var(--error);   color: var(--error); }

/* FAQ Section */
.main-content .faq-section { margin-top: 2.5rem; padding-top: 2.5rem; border-top: 1px solid var(--border); }
.main-content .faq-section > h2 { font-size: 24px; font-weight: 600; margin-bottom: 1.5rem; margin-top: 0; padding-top: 0; border-top: none; }
.main-content .faq-list { display: flex; flex-direction: column; gap: 1rem; }
.main-content .faq-item { background: var(--surface-2); border-radius: 8px; padding: 1.25rem 1.5rem; }
.main-content .faq-question { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 0 0 .5rem; }
.main-content .faq-answer { font-size: 14px; color: var(--text-secondary); margin: 0; line-height: 1.6; }

/* Code */
.main-content code {
  background: var(--surface-2);
  color: var(--text-primary);
  padding: .125rem .375rem;
  border-radius: 4px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: .9em;
}
.main-content pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}
.main-content pre code { background: none; padding: 0; }

/* === Sidebar search =============================================== */
.search-box {
  margin-bottom: 1.5rem;
  padding: 0 .75rem;
}
.search-input {
  width: 100%;
  padding: .625rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font);
}
.search-input:focus {
  outline: none;
  border-color: var(--moss-500);
  box-shadow: 0 0 0 3px rgba(63,143,95,.12);
}

/* === Guides Index ================================================= */
.guides-index {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem;
}
.guides-index-header { margin-bottom: 2.5rem; }
.guides-index-header h1 {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: .75rem;
}
.guides-index-header p { font-size: 16px; color: var(--text-secondary); }

.guides-search { margin-bottom: 2rem; }
.guides-search input {
  width: 100%;
  max-width: 480px;
  padding: .625rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text-primary);
}
.guides-search input:focus {
  outline: none;
  border-color: var(--moss-500);
  box-shadow: 0 0 0 3px rgba(63,143,95,.12);
}

.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: all .2s;
  color: inherit;
}
.guide-card:hover {
  border-color: var(--moss-300);
  box-shadow: 0 4px 6px rgba(10,22,40,.07);
  transform: translateY(-2px);
  text-decoration: none;
}
.guide-card-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: .5rem;
}
.guide-card-description {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1rem;
}
.guide-card-meta { font-size: 12px; color: var(--text-disabled); }

/* === Footer ======================================================= */
footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 4rem;
}
.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-links { display: flex; gap: 2rem; }
footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
footer a:hover { color: var(--text-primary); }
.copyright { font-size: 14px; color: var(--text-muted); }

/* === Responsive =================================================== */
@media (max-width: 1024px) {
  .docs-container { flex-direction: column; }
  .sidebar { width: 100%; position: static; max-height: none; }
  .main-content { padding: 2rem; }
  .sidebar-cta { display: none; }
}
@media (max-width: 640px) {
  .header-content { padding: 1rem; }
  .header-nav { display: none; }
  .docs-container { padding: 1rem; gap: 1rem; }
  .main-content { padding: 1.5rem; }
  .main-content h1 { font-size: 24px; }
  .main-content h2 { font-size: 20px; padding-top: 1.5rem; margin-top: 1.5rem; }
  .guides-index { padding: 1.5rem 1rem; }
  .guides-search input { max-width: 100%; }
}
