/* ── PesaScope Manual / Docs ──────────────────────────────────────────────
   Restyled to match the black + emerald landing page (index.html):
   Poppins, black nav/footer + hero, clean light canvas, emerald accent.
   Loaded AFTER ../styles.css, so the overrides below win.                    */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --m-primary: #12A67C;          /* emerald accent */
    --m-primary-bright: #22C592;   /* brighter emerald (on black) */
    --m-primary-dark: #0B0D0C;     /* ink */
    --m-primary-tint: #E7F4EF;     /* soft green wash */
    --m-text: #0B0D0C;
    --m-text-muted: #5B6067;
    --m-text-subtle: #8A8F96;
    --m-border: #E7E8EA;
    --m-bg-soft: #F5F6F7;          /* light canvas */
    --m-surface: #FFFFFF;          /* raised card */
    --m-ink-deep: #000000;         /* black (nav/footer/hero) */
    --m-success: #12A67C;
    --m-warning: #C77A0A;
    --m-danger: #C2410C;
}

/* Match the landing typeface everywhere on the manual */
body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--m-bg-soft);
}

/* ── Landing nav/footer helper classes (the mirrored markup uses inline
   styles + these classes, exactly like index.html) ── */
.navl { transition: color 0.15s ease; }
.navl:hover { color: #fff !important; }
.cta { transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease; }
.cta:hover { transform: translateY(-2px); }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* ── Page wrapper (nav is sticky and sits in normal flow) ── */
.manual-wrap {
    background: var(--m-bg-soft);
    min-height: 100vh;
}

/* ── Manual hero (hub) → true-black band ── */
.manual-hero {
    position: relative;
    overflow: hidden;
    background: #000;
    color: #fff;
    padding: 76px 0 64px;
    text-align: center;
}
.manual-hero::before {
    content: '';
    position: absolute;
    left: 50%; top: 46%;
    width: 760px; height: 760px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(18, 166, 124, 0.22) 0%, rgba(18, 166, 124, 0) 62%);
    filter: blur(12px);
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.manual-hero > * { position: relative; z-index: 2; }
.manual-hero .eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: rgba(34, 197, 146, 0.1);
    border: 1px solid rgba(34, 197, 146, 0.22);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--m-primary-bright);
    margin-bottom: 18px;
}
.manual-hero h1 {
    font-size: 46px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.025em;
    margin-bottom: 14px;
}
.manual-hero p {
    font-size: 17px;
    color: #AEBAB4;
    opacity: 1;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Search box (hub) ── */
.manual-search { max-width: 520px; margin: 28px auto 0; position: relative; }
.manual-search input {
    width: 100%;
    padding: 14px 18px 14px 44px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 15px;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    box-shadow: 0 18px 44px -22px rgba(0, 0, 0, 0.6);
}
.manual-search input::placeholder { color: #8A9E95; }
.manual-search input:focus { outline: 2px solid var(--m-primary); outline-offset: 2px; }
.manual-search svg {
    position: absolute;
    left: 16px; top: 50%;
    transform: translateY(-50%);
    color: #8A9E95;
}

/* ── Section grid (hub) ── */
.manual-sections { padding: 56px 0 80px; }
.manual-section-label {
    font-size: 12px;
    font-weight: 800;
    color: var(--m-primary);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    margin-bottom: 12px;
}
.manual-section-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--m-text);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}
.manual-section-desc { font-size: 14px; color: var(--m-text-muted); margin-bottom: 28px; }
.topic-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 40px;
}
.topic-card {
    background: var(--m-surface);
    border: 1px solid var(--m-border);
    border-radius: 18px;
    padding: 26px;
    display: block;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    color: inherit;
}
.topic-card:hover {
    border-color: #CFE6DA;
    box-shadow: 0 18px 44px -22px rgba(20, 28, 22, 0.45);
    transform: translateY(-3px);
}
.topic-card .topic-icon {
    width: 46px;
    height: 46px;
    background: var(--m-primary-tint);
    color: var(--m-primary);
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.topic-card h3 { font-size: 17px; font-weight: 800; color: var(--m-text); margin-bottom: 6px; letter-spacing: -0.01em; }
.topic-card p { font-size: 13.5px; color: var(--m-text-muted); line-height: 1.55; margin: 0; }

/* ── Docs layout (topic pages) ── */
.docs-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 40px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 36px 24px 80px;
}
.docs-sidebar {
    position: sticky;
    top: 92px;
    align-self: start;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding-right: 8px;
}
.docs-sidebar h4 {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--m-text-subtle);
    margin: 16px 0 10px;
}
.docs-sidebar h4:first-child { margin-top: 0; }
.docs-sidebar ul { list-style: none; padding: 0; margin: 0 0 8px; }
.docs-sidebar li { margin: 0; }
.docs-sidebar a {
    display: block;
    padding: 7px 12px;
    font-size: 13.5px;
    color: var(--m-text-muted);
    border-radius: 8px;
    border-left: 2px solid transparent;
    transition: all 0.15s;
}
.docs-sidebar a:hover { background: var(--m-primary-tint); color: var(--m-primary-dark); }
.docs-sidebar a.active {
    color: var(--m-primary);
    background: var(--m-primary-tint);
    border-left-color: var(--m-primary);
    font-weight: 700;
}

/* ── Article content ── */
.docs-article {
    background: var(--m-surface);
    border: 1px solid var(--m-border);
    border-radius: 18px;
    padding: 44px 48px;
    min-width: 0;
    box-shadow: 0 18px 44px -30px rgba(20, 28, 22, 0.4);
}
.breadcrumb { font-size: 13px; color: var(--m-text-subtle); margin-bottom: 16px; }
.breadcrumb a { color: var(--m-primary); font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 6px; color: var(--m-text-subtle); }

.docs-article h1 {
    font-size: 34px;
    font-weight: 800;
    color: var(--m-text);
    letter-spacing: -0.025em;
    margin-bottom: 8px;
}
.docs-article .lede { font-size: 16px; color: var(--m-text-muted); line-height: 1.7; margin-bottom: 28px; }
.docs-article h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--m-text);
    margin: 40px 0 14px;
    padding-top: 16px;
    border-top: 1px solid var(--m-border);
    letter-spacing: -0.02em;
    scroll-margin-top: 92px;
}
.docs-article h2:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.docs-article h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--m-text);
    margin: 24px 0 10px;
    scroll-margin-top: 92px;
}
.docs-article p { font-size: 15px; color: var(--m-text); line-height: 1.75; margin-bottom: 14px; }
.docs-article ul, .docs-article ol { margin: 0 0 16px 24px; padding: 0; }
.docs-article li { font-size: 15px; color: var(--m-text); line-height: 1.7; margin-bottom: 6px; }
.docs-article a:not(.btn) { color: var(--m-primary); font-weight: 600; }
.docs-article a:not(.btn):hover { text-decoration: underline; }

.docs-article ol.steps { counter-reset: step; list-style: none; margin-left: 0; }
.docs-article ol.steps > li {
    counter-increment: step;
    position: relative;
    padding: 0 0 18px 44px;
    margin-bottom: 0;
}
.docs-article ol.steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0; top: 0;
    width: 28px; height: 28px;
    background: var(--m-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 6px 14px -6px rgba(18, 166, 124, 0.7);
}
.docs-article ol.steps > li:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 13px; top: 32px; bottom: 4px;
    width: 2px;
    background: var(--m-border);
}

.docs-article strong { color: var(--m-text); font-weight: 700; }
.docs-article code {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 13px;
    padding: 2px 6px;
    background: #EEF2EC;
    border: 1px solid var(--m-border);
    border-radius: 5px;
    color: #15403A;
}

/* In-text path / menu trail (e.g., Settings → Currency) */
.path {
    display: inline-block;
    padding: 2px 8px;
    background: var(--m-primary-tint);
    color: #0C7E5F;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
}

/* Callouts */
.callout {
    border-radius: 12px;
    padding: 14px 18px;
    margin: 18px 0;
    font-size: 14px;
    line-height: 1.65;
    border-left: 4px solid var(--m-primary);
    background: var(--m-primary-tint);
    color: var(--m-text);
}
.callout strong { color: inherit; }
.callout.tip { border-color: var(--m-success); background: #E6F4EC; }
.callout.warn { border-color: var(--m-warning); background: #FBF1DE; }
.callout.danger { border-color: var(--m-danger); background: #FBEAE1; }
.callout-title {
    display: block;
    font-weight: 800;
    margin-bottom: 4px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Page TOC at top of article */
.toc-card {
    background: var(--m-bg-soft);
    border: 1px solid var(--m-border);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 28px;
}
.toc-card h4 {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--m-text-subtle);
    margin-bottom: 10px;
}
.toc-card ol { list-style: decimal; margin: 0 0 0 20px; padding: 0; columns: 2; column-gap: 32px; }
.toc-card li { font-size: 13.5px; margin-bottom: 4px; line-height: 1.5; break-inside: avoid; }
.toc-card a { color: var(--m-text); }
.toc-card a:hover { color: var(--m-primary); text-decoration: underline; }

/* Tables */
.docs-article table { width: 100%; border-collapse: collapse; margin: 16px 0 20px; font-size: 14px; }
.docs-article th, .docs-article td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--m-border);
    vertical-align: top;
}
.docs-article th { background: var(--m-bg-soft); font-weight: 700; font-size: 13px; color: var(--m-text); }

/* Screenshots / figures */
.docs-article figure.screenshot { margin: 22px 0 26px; }
.docs-article figure.screenshot img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--m-border);
    border-radius: 14px;
    background: var(--m-bg-soft);
    box-shadow: 0 18px 44px -28px rgba(20, 28, 22, 0.45);
}
.docs-article figure.screenshot figcaption {
    margin-top: 10px;
    font-size: 13px;
    color: var(--m-text-muted);
    line-height: 1.55;
    text-align: center;
    font-style: italic;
}

/* Page footer nav */
.page-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--m-border);
}
.page-nav a {
    flex: 1 1 0;
    padding: 16px 20px;
    border: 1px solid var(--m-border);
    border-radius: 14px;
    transition: all 0.15s;
}
.page-nav a:hover { border-color: #CFE6DA; background: var(--m-primary-tint); }
.page-nav .label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--m-text-subtle);
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}
.page-nav .title { font-size: 14px; font-weight: 700; color: var(--m-text); }
.page-nav .next { text-align: right; }

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none;
    width: 100%;
    padding: 12px 16px;
    background: var(--m-surface);
    border: 1px solid var(--m-border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--m-text);
    text-align: left;
    cursor: pointer;
    margin-bottom: 16px;
}
.sidebar-toggle::after { content: '▾'; float: right; color: var(--m-text-subtle); }

/* ── Responsive ── */
@media (max-width: 880px) {
    .nav-links { display: none !important; }
    .grid-foot { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 520px) {
    .grid-foot { grid-template-columns: 1fr !important; }
}
@media (max-width: 1024px) {
    .topic-grid { grid-template-columns: repeat(2, 1fr); }
    .docs-layout { grid-template-columns: 1fr; gap: 0; padding: 24px 20px 60px; }
    .docs-sidebar {
        position: static;
        max-height: none;
        display: none;
        background: var(--m-surface);
        border: 1px solid var(--m-border);
        border-radius: 12px;
        padding: 16px;
        margin-bottom: 16px;
    }
    .docs-sidebar.open { display: block; }
    .sidebar-toggle { display: block; }
}

@media (max-width: 640px) {
    .manual-hero { padding: 56px 0 44px; }
    .manual-hero h1 { font-size: 32px; }
    .manual-hero p { font-size: 15px; }
    .manual-sections { padding: 40px 0 60px; }
    .topic-grid { grid-template-columns: 1fr; }
    .docs-article { padding: 28px 22px; }
    .docs-article h1 { font-size: 26px; }
    .docs-article h2 { font-size: 19px; }
    .toc-card ol { columns: 1; }
    .page-nav { flex-direction: column; }
    .page-nav .next { text-align: left; }
}
