/* ══════════════════════════════════════════════════════════════
   LovBot Blog — Shared Styles
   Include via: <link rel="stylesheet" href="blog-shared.css">
   Also requires: <link rel="stylesheet" href="shared.css">
   ══════════════════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
    --primary: #6366F1;
    --accent: #22D3EE;
    --dark-bg: #0F172A;
    --fg: #F8FAFC;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --border: #E2E8F0;
    --border-light: #E2E8F0;
    --bg-secondary: #F1F5F9;
    --bg-light: #F8FAFC;
    --bg-tertiary: #F8FAFC;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
}

/* ── Reset & Base ──────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background-color: #FFFFFF;
}

/* Nav & footer — let components.js handle styling */
#footer-root {
    margin-top: 80px;
}

/* ── Blog Hero ─────────────────────────────────────────────── */
.blog-hero {
    background: linear-gradient(135deg, #F8FAFC 0%, #EEF2FF 100%);
    padding: 60px 20px;
    margin-bottom: 60px;
}

.blog-hero-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 48px;
}

.blog-hero-text {
    flex: 1;
    min-width: 0;
}

.blog-hero-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    border-radius: 999px;
    padding: 5px 14px;
    margin-bottom: 16px;
}

.blog-hero h1 {
    font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark-bg);
    margin-bottom: 16px;
}

.blog-hero-desc {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.blog-hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.reading-time {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.blog-hero-image {
    flex-shrink: 0;
    width: 280px;
    height: 280px;
    border-radius: 20px;
    overflow: hidden;
}

.blog-hero-image img {
    width: 110%;
    height: 110%;
    object-fit: cover;
    object-position: center 10%;
    margin-left: -5%;
}

/* ── Article Layout with Sidebar TOC ───────────────────────── */
.article-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 60px;
}

.toc-sidebar {
    width: 240px;
    flex-shrink: 0;
    position: relative;
}

.toc-sidebar .toc-inner {
    position: sticky;
    top: 90px;
    padding: 20px 0;
}

.toc-sidebar .toc-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 12px;
    transition: color 0.2s;
}

.toc-sidebar .toc-back:hover {
    color: var(--primary);
}

.toc-sidebar .toc-inner h3 {
    font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 16px;
    margin-top: 0;
}

.toc-sidebar .toc-inner ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-sidebar .toc-inner li {
    margin-bottom: 0;
}

.toc-sidebar .toc-inner a {
    display: block;
    padding: 8px 0 8px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 2px solid var(--border);
    transition: all 0.2s;
    line-height: 1.4;
}

.toc-sidebar .toc-inner a:hover {
    color: var(--primary);
}

.toc-sidebar .toc-inner a.active {
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.article-main {
    flex: 1;
    min-width: 0;
}

/* ── Article Typography ────────────────────────────────────── */
article {
    line-height: 1.8;
    font-size: 16px;
    color: var(--text-primary);
}

article h2,
h2 {
    font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 32px;
    font-weight: 700;
    margin: 50px 0 25px 0;
    color: var(--dark-bg);
    padding-top: 40px;
    scroll-margin-top: 80px;
}

article h3,
h3 {
    font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 22px;
    font-weight: 600;
    margin: 35px 0 18px 0;
    color: var(--dark-bg);
}

article p,
p {
    margin-bottom: 20px;
    color: var(--text-primary);
    line-height: 1.8;
}

article ul, article ol,
ul, ol {
    margin: 20px 0 20px 30px;
}

article li,
li {
    margin-bottom: 12px;
    color: var(--text-primary);
    line-height: 1.8;
}

article strong,
strong {
    color: var(--primary);
    font-weight: 600;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ── Callout / Highlight Boxes ─────────────────────────────── */
.callout,
.callout-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(34, 211, 238, 0.05) 100%);
    border-left: 4px solid var(--primary);
    padding: 25px;
    margin: 30px 0;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.7;
}

.callout strong,
.callout-box strong {
    color: var(--primary);
}

.callout-warning,
.callout-box.callout-warning {
    border-left-color: var(--warning);
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.05) 0%, rgba(249, 115, 22, 0.03) 100%);
}

.callout-success {
    border-left-color: var(--success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.03) 100%);
}

/* ── Blockquote ────────────────────────────────────────────── */
blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 25px;
    margin: 30px 0;
    font-style: italic;
    color: var(--text-secondary);
    font-size: 17px;
}

/* ── Section Backgrounds ───────────────────────────────────── */
.section-light {
    background: #FFFFFF;
}

.section-grey {
    background: var(--bg-tertiary);
    padding: 60px 20px;
    margin: 60px 0;
}

.section-grey > * {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Table ─────────────────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

table th {
    background: var(--primary);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

table td {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-primary);
}

table tr:last-child td {
    border-bottom: none;
}

table tr:nth-child(even) {
    background: var(--bg-tertiary);
}

.table-box {
    background-color: #FFFFFF;
    border-radius: 8px;
    overflow: hidden;
    margin: 24px 0;
    border: 1px solid var(--border);
}

.table-box table {
    box-shadow: none;
    margin: 0;
}

/* ── Checklist ─────────────────────────────────────────────── */
.checklist {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 8px;
    margin: 30px 0;
}

.checklist-item {
    display: flex;
    gap: 16px;
    margin-bottom: 15px;
    align-items: flex-start;
}

.checklist-item:last-child {
    margin-bottom: 0;
}

.checklist-check,
.checklist-number {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-top: 2px;
}

.checklist-text,
.checklist-content {
    flex: 1;
}

.checklist-text strong,
.checklist-content strong {
    color: var(--dark-bg);
}

.checklist-text p,
.checklist-content p {
    margin: 5px 0;
    font-size: 15px;
}

/* ── CTA Section ───────────────────────────────────────────── */
.cta-section,
.cta-box {
    background: linear-gradient(135deg, #EEF2FF 0%, #F0F9FF 100%);
    color: var(--dark-bg);
    padding: 50px 30px;
    border-radius: 12px;
    text-align: center;
    margin: 60px 0;
}

.cta-section h3,
.cta-box h3 {
    color: var(--dark-bg);
    margin-top: 0;
    font-size: 28px;
}

.cta-section h2,
.cta-box h2 {
    color: var(--dark-bg);
    margin-top: 0;
}

.cta-section p,
.cta-box p {
    font-size: 16px;
    margin: 15px 0 25px 0;
    color: var(--text-primary);
}

.cta-button {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 14px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
    text-decoration: none;
    color: white;
}

/* ── SVG Icons ─────────────────────────────────────────────── */
.svg-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

.svg-section {
    width: 100%;
    max-width: 500px;
    margin: 30px auto;
    display: flex;
    justify-content: center;
}

/* ── Author Info ───────────────────────────────────────────── */
.author-info {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 8px;
    margin-top: 60px;
    border-left: 4px solid var(--accent);
}

.author-info strong {
    color: var(--dark-bg);
    display: block;
    margin-bottom: 8px;
}

.author-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 5px 0;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .article-layout {
        flex-direction: column;
        gap: 0;
    }
    .toc-sidebar {
        width: 100%;
        margin-bottom: 30px;
    }
    .toc-sidebar .toc-inner {
        position: static;
        background: var(--bg-secondary);
        border-left: 4px solid var(--primary);
        padding: 24px;
        border-radius: 8px;
    }
}

@media (max-width: 768px) {
    .blog-hero-inner {
        flex-direction: column;
        text-align: center;
        gap: 32px;
    }
    .blog-hero h1 {
        font-size: 32px;
    }
    .blog-hero-meta {
        justify-content: center;
    }
    .blog-hero-image {
        width: 200px;
        height: 200px;
        order: -1;
    }

    article h2, h2 {
        font-size: 26px;
    }

    article h3, h3 {
        font-size: 20px;
    }

    article {
        font-size: 15px;
    }

    .cta-section, .cta-box {
        padding: 40px 20px;
    }

    .section-grey {
        padding: 40px 20px;
    }
}

@media (max-width: 480px) {
    .blog-hero {
        padding: 40px 20px;
    }

    .blog-hero h1 {
        font-size: 28px;
    }

    article h2, h2 {
        font-size: 22px;
    }
}
