/* Money Printer Pro — Learn Section Styles */
/* Brand: teal accent (#0D9488), Inter font, dark theme default */

:root {
    --bg: #0f1117;
    --bg-card: #1a1d28;
    --bg-card-hover: #222636;
    --text: #e4e4e7;
    --text-muted: #a1a1aa;
    --text-dim: #71717a;
    --accent: #0D9488;
    --accent-hover: #0f766e;
    --accent-light: rgba(13, 148, 136, 0.15);
    --border: #2a2d3a;
    --radius: 8px;
    --max-width: 1100px;
    --max-article: 760px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ─── Main layout ─────────────────────────────── */

.learn-main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 24px 60px;
    /* Leave room for nav-widget bar */
    margin-top: 60px;
}

/* ─── Hero ────────────────────────────────────── */

.learn-hero {
    text-align: center;
    margin-bottom: 40px;
}

.learn-hero h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.learn-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ─── Category pills ─────────────────────────── */

.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 36px;
}

.pill {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.pill:hover {
    color: var(--text);
    border-color: var(--accent);
}

.pill.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

/* ─── Article grid ───────────────────────────── */

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.article-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
}

.article-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.card-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 10px;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}

.card-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex: 1;
    margin-bottom: 16px;
}

.card-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* ─── Article page ───────────────────────────── */

.article-header {
    max-width: var(--max-article);
    margin: 0 auto 32px;
}

.back-link {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    margin-bottom: 16px;
}

.back-link:hover {
    text-decoration: underline;
}

.article-header h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.meta-category {
    color: var(--accent);
    font-weight: 500;
}

.meta-sep {
    color: var(--text-dim);
}

/* ─── Article body (rendered markdown) ───────── */

.article-body {
    max-width: var(--max-article);
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text);
}

.article-body h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 40px 0 16px;
    color: var(--text);
}

.article-body h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 32px 0 12px;
    color: var(--text);
}

.article-body p {
    margin-bottom: 20px;
}

.article-body ul, .article-body ol {
    margin: 0 0 20px 24px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-body strong {
    color: #fff;
    font-weight: 600;
}

.article-body em {
    color: var(--text-muted);
}

.article-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 12px 20px;
    margin: 20px 0;
    background: var(--accent-light);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-muted);
    font-style: italic;
}

.article-body code {
    background: var(--bg-card);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent);
}

.article-body pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    overflow-x: auto;
    margin: 20px 0;
}

.article-body pre code {
    background: none;
    padding: 0;
    color: var(--text);
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.article-body th, .article-body td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
    font-size: 0.9rem;
}

.article-body th {
    background: var(--bg-card);
    font-weight: 600;
    color: var(--text);
}

.article-body td {
    color: var(--text-muted);
}

.article-body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-body a:hover {
    color: var(--accent-hover);
}

.article-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}

/* ─── Article prev/next nav ──────────────────── */

.article-nav {
    max-width: var(--max-article);
    margin: 48px auto 24px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.nav-prev, .nav-next {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    max-width: 48%;
}

.nav-prev:hover, .nav-next:hover {
    border-color: var(--accent);
}

.nav-next {
    text-align: right;
    margin-left: auto;
}

.nav-label {
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 4px;
}

.nav-title {
    font-size: 0.9rem;
    font-weight: 500;
}

.back-to-all {
    max-width: var(--max-article);
    margin: 0 auto;
    text-align: center;
    padding: 24px 0;
}

.back-to-all a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.back-to-all a:hover {
    color: var(--accent);
}

/* ─── Empty state ────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* ─── Footer ─────────────────────────────────── */

.learn-footer {
    text-align: center;
    padding: 24px;
    font-size: 0.8rem;
    color: var(--text-dim);
    border-top: 1px solid var(--border);
}

/* ─── Mobile responsive ──────────────────────── */

@media (max-width: 768px) {
    .learn-main {
        padding: 24px 16px 40px;
    }

    .learn-hero h1 {
        font-size: 1.7rem;
    }

    .article-grid {
        grid-template-columns: 1fr;
    }

    .article-header h1 {
        font-size: 1.5rem;
    }

    .article-body {
        font-size: 1rem;
    }

    .article-nav {
        flex-direction: column;
    }

    .nav-prev, .nav-next {
        max-width: 100%;
    }

    .nav-next {
        text-align: left;
    }
}
