/* /learn/ guide and error pages. Layout: left-aligned docs header, article + right-hand table of
   contents, code blocks with a header bar. Colors and type follow the tool pages' inline styles. */

.learn-page {
    --ink: #064e3b;
    --text: #374151;
    --muted: #6b7280;
    --rule: rgba(6, 78, 59, 0.10);
    --accent: #059669;
    --code-bg: #0f2a22;
    --code-bar: #0b201a;
    --mono: 'SFMono-Regular', Consolas, Menlo, monospace;
    padding-top: 72px; /* fixed site header */
    background: linear-gradient(180deg, #ffffff 0%, #f5f9f6 420px, #ffffff 900px);
}
.learn-wrap { max-width: 1080px; margin: 0 auto; padding: 56px 24px 64px; display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 48px; }

/* Header */
.learn-crumbs { font-size: .875rem; color: var(--muted); margin-bottom: 16px; }
.learn-crumbs a { color: var(--accent); text-decoration: none !important; }
.learn-crumbs a:hover { text-decoration: underline !important; }
.learn-crumbs .sep { color: #9ca3af; margin: 0 8px; }
.learn-header h1 { font-weight: 700; font-size: 2.25rem; line-height: 1.2; color: var(--ink); margin: 0 0 12px; overflow-wrap: anywhere; }
.learn-lede { font-size: 1.125rem; line-height: 1.65; color: #4b5563; margin: 0 0 8px; }
.learn-meta { font-size: .82rem; color: var(--muted); margin: 0 0 8px; }
.learn-meta .dot { margin: 0 6px; }

/* Article */
.learn-article { min-width: 0; }
.learn-article h2 { font-weight: 700; font-size: 1.5rem; line-height: 1.3; color: var(--ink); margin: 48px 0 16px; scroll-margin-top: 96px; }
.learn-article h3 { font-weight: 700; font-size: 1.15rem; color: var(--ink); margin: 28px 0 10px; }
.learn-article p, .learn-article li { font-size: 1.03rem; line-height: 1.75; color: var(--text); }
.learn-article p { margin: 0 0 16px; }
.learn-article ul, .learn-article ol { margin: 0 0 18px; padding-left: 22px; }
.learn-article ul { list-style: disc; }
.learn-article ol { list-style: decimal; }
.learn-article li { margin: 4px 0; }
.learn-article li::marker { color: #10b981; }
.learn-article strong { color: #1f2937; }
.learn-article a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.learn-article :not(pre) > code { background: #eef4f0; color: #047857; padding: 1px 6px; border-radius: 5px; font-family: var(--mono); font-size: .86em; overflow-wrap: anywhere; }

/* Code blocks: header bar with copy + language label */
.learn-code { margin: 0 0 20px; border-radius: 11px; overflow: hidden; background: var(--code-bg); }
.learn-code-bar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; height: 30px; padding: 0 14px; background: var(--code-bar); border-bottom: 1px solid rgba(255,255,255,.06); }
.learn-code-bar span { font-family: Arial, Helvetica, sans-serif; font-size: .7rem; color: #6ee7b7; text-transform: uppercase; letter-spacing: .06em; }
.learn-code-bar button { font-size: .72rem; color: #a7f3d0; background: none; border: 0; cursor: pointer; padding: 2px 4px; opacity: .75; }
.learn-code-bar button:hover { opacity: 1; }
.learn-article pre { margin: 0; padding: 14px 18px; background: var(--code-bg); overflow-x: auto; border-radius: 0; }
.learn-article pre code { font-family: var(--mono); font-size: .86rem; line-height: 1.6; color: #d1fae5; white-space: pre; background: none; }
.learn-article pre:not(.learn-code pre) { border-radius: 11px; margin-bottom: 20px; }
/* Prism tokens in the site's green palette */
.learn-article .token.comment, .learn-article .token.prolog { color: #6b9a88; font-style: italic; }
.learn-article .token.keyword, .learn-article .token.boolean, .learn-article .token.important { color: #6ee7b7; }
.learn-article .token.string, .learn-article .token.char, .learn-article .token.attr-value { color: #fde68a; }
.learn-article .token.number { color: #fca5a5; }
.learn-article .token.function, .learn-article .token.class-name { color: #93c5fd; }
.learn-article .token.property, .learn-article .token.variable { color: #a7f3d0; }
.learn-article .token.operator, .learn-article .token.punctuation { color: #9fbfb2; }

/* Tables: plain rows */
.learn-table { overflow-x: auto; margin: 0 0 20px; }
.learn-table table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.learn-table th { text-align: left; color: var(--ink); font-weight: 700; padding: 9px 12px 9px 0; border-bottom: 2px solid rgba(6,78,59,.15); }
.learn-table td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--rule); color: var(--text); vertical-align: top; }

/* Callouts */
.learn-note { display: flex; gap: 12px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 11px; padding: 14px 16px; margin: 0 0 20px; }
.learn-note i { color: #d97706; margin-top: 5px; }
.learn-note > div { min-width: 0; flex: 1; }
.learn-note p { color: #78350f; }
.learn-note p:last-child { margin-bottom: 0; }

.learn-findings { border: 1px solid rgba(16,185,129,.30); border-left: 4px solid #10b981; background: #f7fdfa; border-radius: 12px; padding: 4px 22px 6px; margin: 44px 0 8px; }
.learn-findings h2 { margin-top: 18px !important; }
.learn-findings h2::before { content: "\f0c3"; font-family: "Font Awesome 6 Free"; font-weight: 900; color: #10b981; margin-right: 10px; font-size: .9em; }

/* Related + pager */
.learn-related { columns: 2; column-gap: 32px; }
.learn-related li { break-inside: avoid; margin: 0 0 6px !important; }
.learn-pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: .92rem; font-weight: 600; }
.learn-pager a { text-decoration: none !important; }
.learn-pager a:hover { text-decoration: underline !important; }

/* Table of contents */
.learn-aside { position: sticky; top: 104px; align-self: start; padding-top: 4px; }
.learn-aside > p { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.learn-toc { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--rule); }
.learn-toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; font-size: .85rem; line-height: 1.35; color: #4b5563; }
.learn-toc li a:hover { color: var(--accent); }
.learn-toc li a.active { color: var(--ink); font-weight: 700; border-left-color: #10b981; }

/* Hubs */
.learn-hub { grid-template-columns: minmax(0, 1fr); }
.learn-group h2 { margin-top: 40px; }
.learn-group ul { list-style: none !important; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.learn-group li { margin: 0 !important; }
.learn-group li a { display: flex; justify-content: space-between; gap: 8px; padding: 12px 14px; border: 1px solid rgba(6,78,59,.12); border-radius: 10px; background: #fbfdfc; color: #1f2937; text-decoration: none; font-weight: 600; font-size: .95rem; }
.learn-group li a:hover { border-color: #10b981; color: var(--accent); }
.learn-group li span { font-size: .72rem; color: #b45309; font-weight: 400; align-self: center; }

.learn-draft-banner { position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999; background: #b45309; color: #fff; text-align: center; font-weight: 700; padding: 6px; font-size: .85rem; }

@media (max-width: 900px) {
    .learn-wrap { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 32px 16px 48px; }
    .learn-aside { display: none; }
    .learn-header h1 { font-size: 1.8rem; }
    .learn-article h2 { font-size: 1.3rem; }
    .learn-article p, .learn-article li { font-size: 1rem; }
    .learn-related { columns: 1; }
}
