/* ============================================================================
   bAIbel AV — User Guide stylesheet
   Shared by every guide page (01-core-flow.html, 02-sectionizing-mt.html, ...).
   Palette + typography mirror the app (IWorkflow/JSONConnection/app.css) so the
   guides feel native to the product.
   ----------------------------------------------------------------------------
   Translation note: this file carries NO user-readable copy. All prose lives in
   the HTML. Keep it that way so localisation never has to touch CSS.
   ========================================================================== */

:root {
    /* Primary palette (from app.css) */
    --primary: #4f6df5;
    --primary-hover: #3b57d9;
    --primary-light: #eef1fe;

    /* Accent / status colours */
    --accent: #10b981;
    --accent-light: #ecfdf5;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --warning: #f59e0b;
    --warning-light: #fffbeb;

    /* Privacy thread — its own accent so the confidentiality story is visually
       traceable across both guides. */
    --privacy: #7c3aed;
    --privacy-light: #f5f3ff;

    /* Neutrals */
    --bg-body: #f0f2f7;
    --bg-surface: #ffffff;
    --bg-surface-raised: #f8f9fc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --content-width: 820px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    margin: 0;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ----------------------------------------------------------------------------
   Page shell
   -------------------------------------------------------------------------- */
.page {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 24px 96px;
}

/* ----------------------------------------------------------------------------
   Masthead + logo placeholder
   The logo is a CSS-referenced image with NO baked-in text. Finalising the
   brand later is a one-file swap (images/logo-placeholder.png) — no HTML edits,
   nothing for a translator to touch.
   -------------------------------------------------------------------------- */
.masthead {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 28px 0 22px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
}

.brand-logo {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--primary-light) url("images/logo-placeholder.png") center / contain no-repeat;
    border: 1px dashed var(--border-strong);
}

.masthead-text { display: flex; flex-direction: column; }
.masthead-text .app-name { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.masthead-text .doc-kicker { font-size: 13px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.08em; }
.masthead-meta { margin-left: auto; text-align: right; font-size: 13px; color: var(--text-muted); }

/* ----------------------------------------------------------------------------
   Headings & text
   -------------------------------------------------------------------------- */
h1 { font-size: 32px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 12px; }
h2 {
    font-size: 23px;
    letter-spacing: -0.01em;
    margin: 56px 0 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
h3 { font-size: 18px; margin: 32px 0 10px; }
.lede { font-size: 18px; color: var(--text-secondary); margin: 0 0 8px; }
p { margin: 0 0 16px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .ui {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.88em;
}

/* A reference to an on-screen label, e.g. the “Create New Project” button. */
.ui {
    background: var(--bg-surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1px 6px;
    color: var(--text-primary);
    white-space: nowrap;
}

/* A keyboard shortcut. */
.keycap {
    display: inline-block;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.82em;
    background: #fff;
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: var(--radius-sm);
    padding: 1px 6px;
    color: var(--text-primary);
    white-space: nowrap;
}

/* First use of a glossary term. */
.term { font-weight: 600; color: var(--privacy); }

/* ----------------------------------------------------------------------------
   Step lists
   -------------------------------------------------------------------------- */
ol.steps { counter-reset: step; list-style: none; padding-left: 0; margin: 0 0 20px; }
ol.steps > li {
    position: relative;
    padding: 4px 0 14px 44px;
    margin: 0;
}
ol.steps > li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0; top: 2px;
    width: 28px; height: 28px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    display: flex; align-items: center; justify-content: center;
}

/* ----------------------------------------------------------------------------
   Figures
   Screenshots carry NO baked-in text. Every explanatory string lives in the
   <figcaption>, which is a discrete, translatable unit.
   -------------------------------------------------------------------------- */
figure {
    margin: 28px 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
figure img {
    display: block;
    width: 100%;
    height: auto;
    background: var(--bg-surface-raised);
}
/* Placeholder styling while real screenshots are pending. */
figure img[data-placeholder] {
    min-height: 240px;
    border-bottom: 1px dashed var(--border-strong);
    object-fit: contain;
}
figcaption {
    padding: 12px 18px;
    font-size: 14.5px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    background: var(--bg-surface-raised);
}
figcaption .fig-num { font-weight: 700; color: var(--text-primary); margin-right: 6px; }

/* ----------------------------------------------------------------------------
   Callouts
   -------------------------------------------------------------------------- */
.callout {
    position: relative;
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--radius-md);
    padding: 14px 18px 14px 18px;
    margin: 22px 0;
    background: var(--bg-surface);
    font-size: 15.5px;
}
.callout .callout-title {
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.callout p:last-child { margin-bottom: 0; }

.callout.privacy { border-left-color: var(--privacy); background: var(--privacy-light); }
.callout.privacy .callout-title { color: var(--privacy); }

.callout.tip { border-left-color: var(--accent); background: var(--accent-light); }
.callout.tip .callout-title { color: var(--accent); }

.callout.caution { border-left-color: var(--warning); background: var(--warning-light); }
.callout.caution .callout-title { color: #b45309; }

/* ----------------------------------------------------------------------------
   Tables (context maps, glossary, terminology)
   -------------------------------------------------------------------------- */
table.guide {
    width: 100%;
    border-collapse: collapse;
    margin: 22px 0;
    font-size: 15px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
table.guide th, table.guide td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
table.guide th {
    background: var(--bg-surface-raised);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}
table.guide tr:last-child td { border-bottom: none; }
table.guide td:first-child { font-weight: 600; white-space: nowrap; }

/* ----------------------------------------------------------------------------
   "Where next" footer nav
   -------------------------------------------------------------------------- */
.next-nav {
    display: flex;
    gap: 14px;
    margin-top: 48px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.next-nav a {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    background: var(--bg-surface);
    transition: border-color 150ms, box-shadow 150ms;
}
.next-nav a:hover { border-color: var(--primary); box-shadow: var(--shadow-md); text-decoration: none; }
.next-nav .nav-kicker { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); }
.next-nav .nav-title { font-weight: 600; color: var(--text-primary); }

/* ----------------------------------------------------------------------------
   Table of contents (index.html)
   -------------------------------------------------------------------------- */
ol.toc, ul.toc { list-style: none; padding: 0; margin: 24px 0; display: flex; flex-direction: column; gap: 12px; }
.toc a {
    display: flex;
    gap: 16px;
    align-items: baseline;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    background: var(--bg-surface);
    transition: border-color 150ms, box-shadow 150ms;
}
.toc a:hover { border-color: var(--primary); box-shadow: var(--shadow-md); text-decoration: none; }
.toc .toc-num {
    flex: 0 0 auto;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    display: flex; align-items: center; justify-content: center;
}
.toc .toc-body { display: flex; flex-direction: column; }
.toc .toc-title { font-weight: 600; color: var(--text-primary); font-size: 17px; }
.toc .toc-desc { color: var(--text-secondary); font-size: 14.5px; }

/* ----------------------------------------------------------------------------
   Glossary list
   -------------------------------------------------------------------------- */
dl.glossary { margin: 18px 0; }
dl.glossary dt { font-weight: 700; margin-top: 14px; color: var(--text-primary); }
dl.glossary dd { margin: 2px 0 0; color: var(--text-secondary); }

@media (max-width: 680px) {
    body { font-size: 15px; }
    .next-nav { flex-direction: column; }
    .masthead-meta { display: none; }
}

/* Print — for the eventual PDF/info-sheet route. */
@media print {
    body { background: #fff; }
    .page { max-width: none; }
    figure, .callout, table.guide { break-inside: avoid; }
    .next-nav { display: none; }
}
