/* =================================================
   learn-ai.css — the "Learn AI" course posts
   Flat, hairline-separated components: formula, code,
   output, quick check (quiz), fun fact, course map.
   Loaded after blog.css / blog-components.css.
   ================================================= */
:root {
    --la-sep: rgba(60, 60, 67, 0.16);
    --la-sub: #6B7280;
    --la-ink: #111827;
    --la-blue: #2563EB;
    --la-green: #16A34A;
    --la-orange: #F59E0B;
    --la-purple: #7C3AED;
    --la-red: #DC2626;
    --la-teal: #0D9488;
    --la-code-bg: #F6F7F9;
}

/* ── Series strip above the title ───────────────── */
.la-strip {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    font-size: 13px; color: var(--la-sub); margin: 0 0 10px;
}
.la-strip a { color: var(--la-blue); font-weight: 600; text-decoration: none; }
.la-strip .la-dot { opacity: .5; }
.la-bar { flex: 1 1 120px; max-width: 220px; height: 4px; background: #E5E7EB; border-radius: 99px; overflow: hidden; }
.la-bar > i { display: block; height: 100%; background: var(--la-blue); }

/* ── Writer's note / lead ──────────────────────── */
.la-lead { font-size: 19px; line-height: 1.7; color: #1F2937; }

/* ── Formula ────────────────────────────────────── */
.la-formula {
    margin: 26px 0;
    border-top: 1px solid var(--la-sep);
    border-bottom: 1px solid var(--la-sep);
    padding: 14px 0 12px;
}
.la-formula-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.la-formula-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--la-sub); }
.la-copy-row { display: flex; gap: 8px; flex-wrap: wrap; }
.la-copy {
    font: 600 12px/1 inherit; font-family: inherit;
    color: var(--la-blue); background: transparent; border: 0; padding: 6px 2px; cursor: pointer;
}
.la-copy:hover { text-decoration: underline; }
.la-copy.done { color: var(--la-green); }
.la-formula-eq { overflow-x: auto; padding: 10px 0 4px; font-size: 1.15em; text-align: center; -webkit-overflow-scrolling: touch; }
.la-formula-eq .katex-display { margin: .4em 0; }
.la-formula-note { font-size: 15px; color: #374151; line-height: 1.7; margin: 6px 0 0; }
.la-formula-note p { margin: 0 0 8px; }
.la-formula-py { margin: 10px 0 0; }
.la-inline-math .katex { font-size: 1.05em; }

/* ── Code block ─────────────────────────────────── */
.la-code { margin: 22px 0; position: relative; }
.la-code-bar {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12px; color: var(--la-sub); padding: 0 2px 6px;
}
.la-code-bar b { font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.la-code pre {
    margin: 0; background: var(--la-code-bg); color: #1F2937;
    border: 0; border-top: 1px solid var(--la-sep); border-bottom: 1px solid var(--la-sep);
    border-radius: 0; padding: 14px 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.65;
    font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace; -webkit-overflow-scrolling: touch;
}
.la-code pre code { font-family: inherit; background: none; padding: 0; color: inherit; }
.la-out { margin: -1px 0 22px; }
.la-out pre {
    margin: 0; background: #FFFFFF; color: #374151; border: 0; border-bottom: 1px solid var(--la-sep);
    padding: 12px 16px; font-size: 13px; line-height: 1.6; overflow-x: auto;
    font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
}
.la-out-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--la-green); padding: 8px 2px 0; display: block; }
.la-code pre, .la-out pre { tab-size: 4; }
/* Pygments (light, flat) */
.hl .c, .hl .c1, .hl .cm { color: #6B7280; font-style: italic; }
.hl .k, .hl .kn, .hl .kd, .hl .kc { color: #7C3AED; }
.hl .nb, .hl .bp { color: #0E7490; }
.hl .s, .hl .s1, .hl .s2, .hl .sa, .hl .sb { color: #B45309; }
.hl .mi, .hl .mf, .hl .mh { color: #0369A1; }
.hl .nf, .hl .nc { color: #1D4ED8; }
.hl .o, .hl .ow { color: #6B7280; }
.hl .nd { color: #BE185D; }

/* ── Figures ────────────────────────────────────── */
.la-fig { margin: 26px 0; }
.la-fig img { width: 100%; height: auto; display: block; border-radius: 10px; background: #F3F4F6; }
.la-fig figcaption { font-size: 13px; color: var(--la-sub); text-align: left; margin-top: 8px; line-height: 1.5; }
.la-fig.la-small { max-width: 560px; }

/* ── Quick check (quiz) ─────────────────────────── */
.la-quiz {
    margin: 30px 0;
    border-top: 1px solid var(--la-sep); border-bottom: 1px solid var(--la-sep);
    padding: 16px 0 14px;
}
.la-quiz-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--la-purple); display: flex; align-items: center; gap: 6px; }
.la-quiz-q { font-size: 17px; font-weight: 600; color: var(--la-ink); margin: 6px 0 10px; line-height: 1.5; }
.la-opts { list-style: none; margin: 0; padding: 0; }
.la-opts li { margin: 0; padding: 0; border-top: 1px solid var(--la-sep); }
.la-opt {
    width: 100%; display: flex; align-items: flex-start; gap: 12px; text-align: left;
    background: transparent; border: 0; padding: 11px 2px; cursor: pointer;
    font: inherit; font-size: 16px; color: #1F2937; line-height: 1.5;
}
.la-opt:hover { background: #F9FAFB; }
.la-opt .la-radio { flex: 0 0 20px; height: 20px; border-radius: 50%; border: 1.5px solid #9CA3AF; margin-top: 2px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; }
.la-opts.done .la-opt { cursor: default; }
.la-opts.done .la-opt:hover { background: transparent; }
.la-opt.right .la-radio { background: var(--la-green); border-color: var(--la-green); }
.la-opt.wrong .la-radio { background: var(--la-red); border-color: var(--la-red); }
.la-opt.right .la-radio::after { content: "\2713"; }
.la-opt.wrong .la-radio::after { content: "\2715"; }
.la-opt.right { color: #166534; font-weight: 600; }
.la-opt.wrong { color: #991B1B; }
.la-why { display: none; margin: 10px 0 0; font-size: 15px; color: #374151; line-height: 1.65; padding-top: 10px; border-top: 1px solid var(--la-sep); }
.la-why.show { display: block; }
.la-why b { color: var(--la-ink); }

/* ── Fun fact (one line, flat icon) ─────────────── */
.la-fact { display: flex; align-items: center; gap: 12px; margin: 24px 0; padding: 10px 0; border-top: 1px solid var(--la-sep); border-bottom: 1px solid var(--la-sep); }
.la-fact-ico { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; }
.la-fact-ico svg { width: 20px; height: 20px; fill: currentColor; }
.la-fact-ico.c-blue   { background: #DBEAFE; color: var(--la-blue); }
.la-fact-ico.c-green  { background: #DCFCE7; color: var(--la-green); }
.la-fact-ico.c-orange { background: #FEF3C7; color: #D97706; }
.la-fact-ico.c-purple { background: #EDE9FE; color: var(--la-purple); }
.la-fact-ico.c-red    { background: #FEE2E2; color: var(--la-red); }
.la-fact-ico.c-teal   { background: #CCFBF1; color: var(--la-teal); }
.la-fact p { margin: 0 !important; font-size: 15px; line-height: 1.5; color: #1F2937; }
.la-fact p b { color: var(--la-ink); }
.la-fact small { display: block; color: var(--la-sub); font-size: 12px; margin-top: 2px; }

/* ── Key points / callouts ──────────────────────── */
.la-note { margin: 24px 0; padding: 12px 0 12px 14px; border-left: 3px solid var(--la-blue); font-size: 16px; line-height: 1.7; }
.la-note.tip { border-left-color: var(--la-green); }
.la-note.warn { border-left-color: var(--la-orange); }
.la-note > b:first-child { display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--la-sub); margin-bottom: 2px; }
.la-note p { margin: 0 0 8px; }
.la-note p:last-child { margin: 0; }

/* ── Prev / next ────────────────────────────────── */
.la-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin: 40px 0 8px; border-top: 1px solid var(--la-sep); }
.la-pn a { display: block; padding: 16px 0; text-decoration: none !important; color: inherit; }
.la-pn a small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--la-sub); }
.la-pn a span { display: block; font-size: 16px; font-weight: 600; color: var(--la-ink); line-height: 1.4; margin-top: 2px; }
.la-pn a:hover span { color: var(--la-blue); }
.la-pn .next { text-align: right; }
@media (max-width: 560px) { .la-pn { grid-template-columns: 1fr; } .la-pn .next { text-align: left; border-top: 1px solid var(--la-sep); } }

/* ── Course map (sidebar list + bottom sheet) ───── */
.la-map h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--la-sub); margin: 0 0 6px; display: flex; justify-content: space-between; }
.la-map-prog { font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--la-blue); }
.la-map details { border-top: 1px solid var(--la-sep); }
.la-map summary { list-style: none; cursor: pointer; padding: 10px 0; font-size: 14px; font-weight: 700; color: var(--la-ink); display: flex; justify-content: space-between; align-items: center; }
.la-map summary::-webkit-details-marker { display: none; }
.la-map summary::after { content: "+"; color: var(--la-sub); font-weight: 400; }
.la-map details[open] summary::after { content: "\2212"; }
.la-map summary small { color: var(--la-sub); font-weight: 500; font-size: 12px; margin-left: 6px; }
.la-map ol { list-style: none; margin: 0 0 8px; padding: 0; }
.la-map li { margin: 0; padding: 0; }
.la-map li a, .la-map li span.soon {
    display: flex; gap: 10px; align-items: baseline; padding: 6px 0; font-size: 14px; line-height: 1.4;
    color: #374151; text-decoration: none;
}
.la-map li a:hover { color: var(--la-blue); }
.la-map li .n { flex: 0 0 24px; font-variant-numeric: tabular-nums; color: var(--la-sub); font-size: 12px; }
.la-map li.cur a { color: var(--la-blue); font-weight: 700; }
.la-map li span.soon { color: #9CA3AF; }
.la-map li span.soon em { font-style: normal; font-size: 11px; margin-left: auto; }
.la-map li.read .n::before { content: "\2713"; color: var(--la-green); font-weight: 700; }
.la-map li.read .n { font-size: 0; }
.la-map li.read .n::before { font-size: 13px; }
.la-map-all { display: block; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--la-blue); text-decoration: none; }

.la-fab {
    position: fixed; left: 16px; bottom: 16px; z-index: 900; display: none;
    background: #111827; color: #fff; border: 0; border-radius: 999px; padding: 10px 16px;
    font: 600 13px/1 inherit; font-family: inherit; cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.la-sheet-bg { position: fixed; inset: 0; background: rgba(17,24,39,.45); z-index: 1000; display: none; }
.la-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001; max-height: 80vh; overflow-y: auto;
    background: #fff; border-radius: 16px 16px 0 0; padding: 14px 20px 28px; display: none;
    max-width: 640px; margin: 0 auto;
}
.la-sheet.open, .la-sheet-bg.open { display: block; }
.la-sheet-grab { width: 40px; height: 4px; background: #D1D5DB; border-radius: 99px; margin: 0 auto 12px; }
.la-sheet-close { float: right; background: none; border: 0; font-size: 22px; color: var(--la-sub); cursor: pointer; line-height: 1; }
@media (max-width: 980px) { .la-fab { display: block; } }

/* ── Hub (roadmap) page ─────────────────────────── */
.la-hub-part { margin: 36px 0 8px; }
.la-hub-part h2 { margin-top: 0 !important; }
.la-hub-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--la-sep); }
.la-hub-list li { margin: 0; padding: 0; border-bottom: 1px solid var(--la-sep); }
.la-hub-list a, .la-hub-list .soon { display: grid; grid-template-columns: 34px 1fr auto; gap: 0 10px; align-items: baseline; padding: 12px 0; text-decoration: none !important; color: inherit; }
.la-hub-list .n { font-variant-numeric: tabular-nums; color: var(--la-sub); font-weight: 600; font-size: 14px; }
.la-hub-list .t { font-size: 17px; font-weight: 600; color: var(--la-ink); line-height: 1.35; }
.la-hub-list .d { grid-column: 2; font-size: 14px; color: var(--la-sub); line-height: 1.5; margin-top: 2px; }
.la-hub-list .st { font-size: 12px; font-weight: 600; color: var(--la-green); }
.la-hub-list .soon .t { color: #9CA3AF; }
.la-hub-list .soon .st { color: #9CA3AF; }
.la-hub-list li.read .st { color: var(--la-green); }
.la-hub-list a:hover .t { color: var(--la-blue); }

/* ── Toast ──────────────────────────────────────── */
.la-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #111827; color: #fff; font-size: 13px; padding: 8px 14px; border-radius: 999px; z-index: 1200; opacity: 0; pointer-events: none; transition: opacity .2s; }
.la-toast.show { opacity: 1; }

/* article width tweak for long technical pages */
.la-post .article-content h2 { scroll-margin-top: 80px; }
.la-post .article-content table { font-size: 15px; }

/* inline code in prose */
.la-post .article-content :not(pre) > code {
    font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace; font-size: .88em;
    background: #F3F4F6; padding: 1px 5px; border-radius: 4px; color: #1F2937;
    font-variant-ligatures: none; word-break: break-word;
}
.la-post .article-content pre, .la-post .la-code pre, .la-out pre { font-variant-ligatures: none; }

/* markdown tables in course posts */
.la-table { overflow-x: auto; margin: 22px 0; -webkit-overflow-scrolling: touch; }
.la-post .article-content table { width: 100%; border-collapse: collapse; margin: 0; font-size: 15px; line-height: 1.5; }
.la-post .article-content table th,
.la-post .article-content table td { padding: 10px 14px 10px 0; text-align: left; vertical-align: top; }
.la-post .article-content table th:last-child,
.la-post .article-content table td:last-child { padding-right: 0; }
.la-post .article-content table th { font-weight: 700; color: var(--navy); white-space: nowrap; }
