/* Flusso User Guide — Shared Stylesheet */

/* ─── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.75;
  color: #1e293b;
  background: #f8fafc;
}

/* ─── Page Layout ───────────────────────────────────────────────────── */
.page {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 40px 80px;
  background: #ffffff;
  min-height: 100vh;
}

/* ─── Print / PDF ───────────────────────────────────────────────────── */
@media print {
  body { background: #fff; font-size: 11pt; }
  .page { max-width: 100%; padding: 0; }
  .no-print { display: none !important; }
  h2 { page-break-before: always; }
  h2:first-of-type { page-break-before: avoid; }
  pre, table, .callout, .screenshot-box { page-break-inside: avoid; }
  a { color: #1e293b; text-decoration: none; }
}

/* ─── Cover / Title ─────────────────────────────────────────────────── */
.cover {
  text-align: center;
  padding: 80px 0 60px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 60px;
}
.cover .logo {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #4f46e5;
  margin-bottom: 12px;
}
.cover .subtitle {
  font-size: 1.1rem;
  color: #64748b;
  margin-bottom: 6px;
}
.cover .version {
  font-size: 0.85rem;
  color: #94a3b8;
}

/* ─── Breadcrumb ────────────────────────────────────────────────────── */
.breadcrumb {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-bottom: 36px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.breadcrumb a { color: #6366f1; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: #cbd5e1; }

/* ─── Headings ──────────────────────────────────────────────────────── */
h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 12px;
}
h1 .section-number {
  color: #6366f1;
  margin-right: 8px;
}
h1 .section-number svg.node-icon {
  display: inline-block;
  vertical-align: middle;
  width: 1.6rem;
  height: 1.6rem;
  margin-top: -3px;
}
.ne-icon svg.node-icon {
  display: block;
  width: 1.3rem;
  height: 1.3rem;
}
.page-intro {
  font-size: 1.05rem;
  color: #475569;
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid #e2e8f0;
}
h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e2e8f0;
}
h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #334155;
  margin-top: 32px;
  margin-bottom: 12px;
}
h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #475569;
  margin-top: 20px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── Paragraphs & Lists ────────────────────────────────────────────── */
p { margin-bottom: 16px; }
ul, ol {
  margin: 0 0 16px 20px;
}
li { margin-bottom: 6px; }
li::marker { color: #6366f1; }

/* ─── Callout Boxes ─────────────────────────────────────────────────── */
.callout {
  border-left: 4px solid;
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 0.95rem;
}
.callout.info {
  border-color: #6366f1;
  background: #eef2ff;
  color: #312e81;
}
.callout.tip {
  border-color: #10b981;
  background: #ecfdf5;
  color: #065f46;
}
.callout.warning {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}
.callout.danger {
  border-color: #ef4444;
  background: #fef2f2;
  color: #991b1b;
}
.callout strong { font-weight: 700; }

/* ─── Tables ────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 24px 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
thead th {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
}
tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
code { background: #f1f5f9; color: #4f46e5; padding: 2px 6px; border-radius: 4px; font-size: 0.88em; font-family: 'Fira Code', 'Cascadia Code', monospace; }

/* ─── Screenshot (real image) ───────────────────────────────────────── */
figure.screenshot {
  margin: 28px 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  background: #1e1e2e;
}
figure.screenshot img {
  display: block;
  width: 100%;
  height: auto;
}
figure.screenshot figcaption {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 8px 14px;
  font-size: 0.8rem;
  color: #64748b;
  text-align: center;
  font-style: italic;
}
@media print {
  figure.screenshot { box-shadow: none; border: 1px solid #cbd5e1; }
}

/* ─── Screenshot Placeholder (fallback) ────────────────────────────── */
.screenshot-box {
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 40px 20px;
  text-align: center;
  margin: 24px 0;
  color: #94a3b8;
  font-size: 0.9rem;
}
.screenshot-box .icon { font-size: 2rem; margin-bottom: 8px; }
.screenshot-box .label { font-weight: 600; color: #64748b; }
.screenshot-box .desc { font-size: 0.82rem; margin-top: 4px; }

/* ─── Step Instructions ─────────────────────────────────────────────── */
.steps {
  counter-reset: step-counter;
  list-style: none;
  margin: 24px 0;
  padding: 0;
}
.steps li {
  counter-increment: step-counter;
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: flex-start;
}
.steps li::before {
  content: counter(step-counter);
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: #6366f1;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 2px;
}
.steps li .step-content { flex: 1; }
.steps li .step-content strong { display: block; margin-bottom: 4px; color: #0f172a; }

/* ─── Badge / Tag ───────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge.indigo { background: #e0e7ff; color: #3730a3; }
.badge.green  { background: #dcfce7; color: #15803d; }
.badge.amber  { background: #fef9c3; color: #92400e; }
.badge.red    { background: #fee2e2; color: #991b1b; }
.badge.gray   { background: #f1f5f9; color: #475569; }
.badge.blue   { background: #dbeafe; color: #1d4ed8; }

/* ─── Node Card Grid ────────────────────────────────────────────────── */
.node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.node-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.node-card .node-icon { font-size: 1.4rem; margin-bottom: 8px; }
.node-card .node-name { font-weight: 700; font-size: 0.95rem; color: #0f172a; margin-bottom: 4px; }
.node-card .node-desc { font-size: 0.83rem; color: #64748b; line-height: 1.5; }
.node-card .node-type { display: inline-block; margin-top: 10px; }

/* ─── UI Mockup (inline visual) ─────────────────────────────────────── */
.ui-mockup {
  background: #1e1e2e;
  border-radius: 10px;
  overflow: hidden;
  margin: 24px 0;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  font-family: monospace;
  font-size: 0.8rem;
}
.ui-mockup .mockup-bar {
  background: #2a2a3e;
  padding: 8px 14px;
  display: flex;
  gap: 6px;
  align-items: center;
  border-bottom: 1px solid #3a3a52;
}
.ui-mockup .mockup-dot { width: 10px; height: 10px; border-radius: 50%; }
.ui-mockup .mockup-dot.red { background: #ef4444; }
.ui-mockup .mockup-dot.yellow { background: #f59e0b; }
.ui-mockup .mockup-dot.green { background: #10b981; }
.ui-mockup .mockup-url { color: #94a3b8; font-size: 0.75rem; margin-left: 10px; }
.ui-mockup .mockup-body { padding: 20px; color: #e2e8f0; line-height: 1.6; }

/* ─── Navigation / TOC ──────────────────────────────────────────────── */
.toc {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 24px 28px;
  margin: 32px 0;
}
.toc h2 { margin-top: 0; border-bottom: none; font-size: 1.1rem; color: #6366f1; }
.toc ol { margin: 0; padding: 0 0 0 20px; }
.toc li { margin-bottom: 4px; font-size: 0.92rem; }
.toc a { color: #4338ca; text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.toc .toc-sub { margin-top: 4px; margin-left: 16px; list-style: disc; }
.toc .toc-sub li { margin-bottom: 2px; font-size: 0.85rem; }

/* ─── Section Divider ───────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 48px 0 40px;
}

/* ─── Footer ────────────────────────────────────────────────────────── */
.doc-footer {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
  font-size: 0.82rem;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.doc-footer a { color: #6366f1; text-decoration: none; }

/* ─── Language Switcher ─────────────────────────────────────────────── */
.lang-switcher {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  gap: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 600;
}
.lang-switcher a,
.lang-switcher span {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  text-decoration: none;
  color: #64748b;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.lang-switcher a:hover {
  background: #f1f5f9;
  color: #1e293b;
}
.lang-switcher .active {
  background: #4f46e5;
  color: #fff;
  cursor: default;
}
.lang-switcher .sep {
  width: 1px;
  background: #e2e8f0;
}
@media print {
  .lang-switcher { display: none !important; }
}

/* ─── Inline code example ───────────────────────────────────────────── */
.variable-syntax {
  background: #1e1e2e;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 16px 0;
  font-family: 'Fira Code', monospace;
  font-size: 0.88rem;
  color: #a5d6ff;
  overflow-x: auto;
}
.variable-syntax .comment { color: #6a9955; }
.variable-syntax .token { color: #ce9178; }
