/* Learn / wiki page layout — a two-column reference doc, not a landing page. */

body.learn .wrap {
    max-width: none;
    padding: 0;
}

.learn-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 0;
    align-items: start;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

/* ---------------------------------------------------------------- sidebar */

.learn-nav {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding: 4px 18px 24px 0;
    font-size: 13.5px;
}

.learn-nav-group {
    margin-bottom: 18px;
}

.learn-nav-group h3 {
    margin: 0 0 6px;
    font-size: 11px;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 650;
}

.learn-nav a {
    display: block;
    color: var(--text);
    padding: 5px 10px;
    border-radius: 7px;
    line-height: 1.35;
}

.learn-nav a:hover { background: var(--panel-2); color: var(--text); }
.learn-nav a.active { background: rgba(255, 122, 26, .14); color: var(--accent-hover); font-weight: 600; }

/* ---------------------------------------------------------------- content */

.learn-main {
    min-width: 0;
    padding: 4px 0 0 32px;
    border-left: 1px solid var(--border);
}

.learn-hero {
    padding: 6px 0 30px;
}
.learn-hero h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: -.01em; }
.learn-hero p { margin: 0; color: var(--muted); font-size: 15px; max-width: 640px; }

.learn-search {
    margin: 18px 0 0;
    max-width: 420px;
}
.learn-search input {
    width: 100%;
    min-width: 0;
}

.learn-section {
    padding: 34px 0;
    border-top: 1px solid var(--border);
    scroll-margin-top: 84px;
}
.learn-section:first-of-type { border-top: none; padding-top: 0; }

.learn-section h2 {
    margin: 0 0 6px;
    font-size: 22px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.learn-section h2 .tag {
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 2px 7px;
}
.learn-section > .lede { color: var(--muted); margin: 0 0 20px; max-width: 680px; }

.learn-section h3 {
    font-size: 16.5px;
    margin: 26px 0 8px;
}
.learn-section h3:first-of-type { margin-top: 4px; }

.learn-section p { margin: 0 0 14px; max-width: 720px; }
.learn-section ul, .learn-section ol { margin: 0 0 14px; padding-left: 22px; max-width: 700px; }
.learn-section li { margin-bottom: 5px; }
.learn-section code {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1.5px 5px;
    font-size: .9em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.callout {
    background: var(--panel);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 12px 16px;
    margin: 0 0 18px;
    max-width: 700px;
    font-size: 13.5px;
}
.callout b { color: var(--accent-hover); }
.callout.warn { border-left-color: var(--danger); }

/* kind legend, reused from the viewer's own link-colour list */
.kind-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    max-width: 900px;
    margin: 0 0 20px;
}
.kind-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 10px 12px;
    font-size: 13px;
}
.kind-row .dot {
    flex: none;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-top: 3px;
}
.kind-row b { display: block; font-size: 13px; }
.kind-row span { color: var(--muted); font-size: 12.5px; }

/* key/shortcut table */
.key-table {
    display: grid;
    grid-template-columns: minmax(160px, 220px) 1fr;
    max-width: 720px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 0 0 20px;
}
.key-table > div {
    padding: 9px 14px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--border);
}
.key-table > div:nth-child(4n+1),
.key-table > div:nth-child(4n+2) { background: var(--panel); }
.key-table > div:last-child, .key-table > div:nth-last-child(2) { border-bottom: none; }
.key-table kbd {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 5px;
    padding: 1.5px 6px;
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* pipeline step cards */
.step-flow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    max-width: 980px;
    margin: 4px 0 22px;
}
.step-flow .step {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 15px;
}
.step-flow .step .n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}
.step-flow .step h4 { margin: 0 0 5px; font-size: 14.5px; }
.step-flow .step p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* env var / table-ish definition list for admin section */
.def-list dt {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    color: var(--accent-hover);
    margin-top: 12px;
}
.def-list dd { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; max-width: 680px; }

.back-to-top {
    display: inline-block;
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--muted);
}

@media (max-width: 880px) {
    .learn-shell { grid-template-columns: 1fr; }
    .learn-nav {
        position: static;
        max-height: none;
        border-bottom: 1px solid var(--border);
        padding: 12px 0 18px;
        margin-bottom: 10px;
    }
    .learn-main { padding-left: 0; border-left: none; }
}
