/* ════════════════════════════════════════════════════════
   CloudToAILearn — Modern Design System
   Light mode default, Dark mode toggle
   ════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ── */
:root {
    /* Light mode (default) - Lighter Blue theme */
    --bg-base: #f5f7fb;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f8faff;
    --bg-elevated: #ffffff;
    --bg-nav: rgba(255,255,255,0.85);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    --accent: #3b82f6;
    --accent-light: #60a5fa;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.12);
    --accent-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6, #0ea5e9);
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --shadow-sm: 0 1px 3px rgba(15,23,42,0.06);
    --shadow-md: 0 4px 16px rgba(15,23,42,0.08);
    --shadow-lg: 0 8px 32px rgba(15,23,42,0.12);
    --shadow-glow: 0 0 24px rgba(59, 130, 246, 0.15);
    --radius: 14px;
    --radius-sm: 8px;
    --radius-pill: 50px;
    --glass: rgba(255,255,255,0.7);
    --glass-border: rgba(255,255,255,0.5);
    --code-bg: #1e1e2e;
    --code-text: #cdd6f4;
    --hero-bg: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 40%, #0ea5e9 100%);
    --tag-bg: #eff6ff;
    --tag-text: #2563eb;
    --cat-badge-bg: #fef3c7;
    --cat-badge-text: #b45309;
    --progress-bar: linear-gradient(90deg, #3b82f6, #8b5cf6);
}

[data-theme="dark"] {
    /* Dark mode - Lighter Blue theme */
    --bg-base: #0b0d17;
    --bg-surface: #131625;
    --bg-surface-hover: #1a1e35;
    --bg-elevated: #1a1e35;
    --bg-nav: rgba(11,13,23,0.92);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;
    --accent: #60a5fa;
    --accent-light: #93c5fd;
    --accent-hover: #3b82f6;
    --accent-glow: rgba(96, 165, 250, 0.15);
    --accent-gradient: linear-gradient(135deg, #60a5fa, #c084fc, #38bdf8);
    --border: #1e293b;
    --border-hover: #334155;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 30px rgba(96, 165, 250, 0.2);
    --glass: rgba(19,22,37,0.8);
    --glass-border: rgba(30,41,59,0.5);
    --hero-bg: linear-gradient(135deg, #1e3a8a 0%, #4c1d95 40%, #0c4a6e 100%);
    --tag-bg: rgba(59, 130, 246, 0.15);
    --tag-text: #93c5fd;
    --cat-badge-bg: rgba(245,158,11,0.15);
    --cat-badge-text: #fbbf24;
}

/* ── BASE RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-primary);
    background: var(--bg-base);
    transition: background 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

/* ── READING PROGRESS BAR ── */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--progress-bar);
    z-index: 9999;
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

/* ── TOP NAV ── */
.topnav {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--bg-nav);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    transition: background 0.3s, box-shadow 0.3s;
}
.topnav.scrolled {
    box-shadow: var(--shadow-md);
}

.nav-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.4px;
    transition: opacity 0.2s;
}
.nav-brand:hover { opacity: 0.8; }
.nav-brand span { 
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-right { display: flex; align-items: center; gap: 1.5rem; }

.nav-links { display: flex; gap: 0.3rem; list-style: none; }
.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.nav-links a:hover {
    color: var(--accent);
    background: var(--accent-glow);
}

/* Nav Search */
.nav-search-wrap { position: relative; }
.nav-search {
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 0.4rem 1rem 0.4rem 2.2rem;
    font-size: 0.82rem;
    width: 180px;
    outline: none;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s;
}
.nav-search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    width: 240px;
}
.nav-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
    pointer-events: none;
}

/* Theme Toggle */
.theme-toggle {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    transition: all 0.3s;
    color: var(--text-primary);
}
.theme-toggle:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Mobile Hamburger */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ── CATEGORY BAR ── */
.cat-bar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    gap: 0.3rem;
    align-items: center;
    height: 46px;
    position: sticky;
    top: 60px;
    z-index: 190;
    overflow-x: auto;
    scrollbar-width: none;
    transition: background 0.3s;
}
.cat-bar::-webkit-scrollbar { display: none; }

.cat-btn {
    border: none;
    background: none;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s;
    font-family: inherit;
}
.cat-btn:hover { background: var(--accent-glow); color: var(--accent); }
.cat-btn.active {
    background: var(--accent);
    color: var(--text-inverse);
    box-shadow: var(--shadow-sm);
}

/* Dropdown */
.cat-group { position: relative; display: flex; align-items: center; }
.cat-group-btn {
    border: none;
    background: none;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.cat-group-btn:hover, .cat-group-btn.open { background: var(--accent-glow); color: var(--accent); }
.cat-group-btn.active { background: var(--accent); color: var(--text-inverse); }
.cat-group-btn .caret { font-size: 0.55rem; transition: transform 0.2s; }
.cat-group-btn.open .caret { transform: rotate(180deg); }
.cat-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    z-index: 300;
    padding: 6px;
    animation: dropIn 0.2s ease;
}
.cat-dropdown.open { display: block; }
.cat-dropdown a {
    display: block;
    padding: 0.5rem 0.9rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.15s;
    white-space: nowrap;
}
.cat-dropdown a:hover { background: var(--accent-glow); color: var(--accent); }
.cat-dropdown a.active { background: var(--accent-glow); color: var(--accent); }

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── PAGE WRAPPER ── */
.page-wrap {
    max-width: 1380px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: grid;
    grid-template-columns: 250px 1fr 230px;
    gap: 2rem;
    align-items: start;
}

/* ── SIDEBAR ── */
.sidebar {
    position: sticky;
    top: 120px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.3rem;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
    transition: background 0.3s, border-color 0.3s;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 4px; }

.sb-search-wrap { position: relative; margin-bottom: 1.2rem; }
.sb-search {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.8rem 0.45rem 2rem;
    font-size: 0.82rem;
    outline: none;
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.2s;
}
.sb-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.sb-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.75rem;
    pointer-events: none;
}
.search-results {
    display: none;
    list-style: none;
    margin-top: 0.4rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    max-height: 220px;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
}
.search-results li a {
    display: block;
    padding: 0.5rem 0.8rem;
    font-size: 0.82rem;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: all 0.15s;
}
.search-results li a:hover { background: var(--accent-glow); color: var(--accent); }
.search-results li:last-child a { border-bottom: none; }
.search-no-result { padding: 0.5rem 0.8rem; font-size: 0.82rem; color: var(--text-muted); }

.sb-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.7rem;
}

/* Month accordion */
.month-group { margin-bottom: 0.3rem; }
.month-toggle {
    width: 100%;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: background 0.15s;
}
.month-toggle:hover { background: var(--accent-glow); }
.month-toggle .badge {
    background: var(--tag-bg);
    color: var(--tag-text);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    margin-left: auto;
    margin-right: 6px;
}
.month-toggle .arrow {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.25s;
}
.month-toggle.open .arrow { transform: rotate(90deg); }
.month-posts {
    display: none;
    list-style: none;
    padding: 2px 0 4px 12px;
}
.month-posts.open { display: block; }
.month-posts li a {
    display: block;
    padding: 0.3rem 0.6rem;
    font-size: 0.79rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    line-height: 1.4;
    transition: all 0.15s;
}
.month-posts li a:hover { background: var(--accent-glow); color: var(--accent); }

/* Sidebar tags */
.sb-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.sb-tag {
    display: inline-block;
    background: var(--tag-bg);
    color: var(--tag-text);
    font-size: 0.72rem;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}
.sb-tag:hover { background: var(--accent); color: var(--text-inverse); transform: translateY(-1px); }

.sb-divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

/* Author section */
.author-section {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}
.author-photo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    padding: 2px;
    transition: transform 0.3s;
}
.author-photo:hover { transform: scale(1.08); }
.author-info strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary);
}
.author-info p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 0.1rem 0 0 0;
}

/* Newsletter */
.newsletter { margin-top: 1rem; }
.newsletter p { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.newsletter-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.7rem;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    outline: none;
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color 0.2s;
}
.newsletter-input:focus { border-color: var(--accent); }
.newsletter-btn {
    width: 100%;
    background: var(--accent);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s;
}
.newsletter-btn:hover { background: var(--accent-hover); box-shadow: var(--shadow-glow); }

/* Affiliate links */
.affiliates { margin-top: 1rem; }
.affiliate-link {
    display: block;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    padding: 0.3rem 0;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.affiliate-link:hover { background: var(--accent-glow); padding-left: 0.5rem; }
.affiliate-link span { float: right; color: var(--text-muted); }

/* ── MAIN CONTENT ── */
.main-content { min-width: 0; }

/* HERO */
.hero {
    background: var(--hero-bg);
    padding: 2rem 2rem;
    margin-bottom: 2rem;
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    animation: heroShimmer 8s ease infinite;
    background-size: 200% 200%;
}
@keyframes heroShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}
.hero h1 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
    position: relative;
    z-index: 1;
}
.hero p {
    color: rgba(255,255,255,0.85);
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

/* SECTION HEADING */
.section-heading {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.section-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* POST LIST */
.post-list { list-style: none; }
.post-item {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.6rem;
    margin-bottom: 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.post-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s;
}
.post-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}
.post-item:hover::before { opacity: 1; }
.post-item.hidden { display: none; }

.post-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    display: flex;
    gap: 0.8rem;
    align-items: center;
}
.post-cat-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    background: var(--cat-badge-bg);
    color: var(--cat-badge-text);
}
.post-item h2 { font-size: 1.15rem; margin-bottom: 0.4rem; line-height: 1.4; }
.post-item h2 a {
    text-decoration: none;
    color: var(--text-primary);
    transition: color 0.2s;
}
.post-item h2 a:hover { color: var(--accent); }
.post-summary { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 0.7rem; }
.read-more {
    font-size: 0.82rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.read-more:hover { gap: 0.5rem; }

/* TAGS */
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0 0.7rem; }
.tag {
    display: inline-block;
    background: var(--tag-bg);
    color: var(--tag-text);
    font-size: 0.72rem;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.25s;
}
.tag:hover {
    background: var(--accent);
    color: var(--text-inverse);
    transform: translateY(-1px);
}

/* ── SINGLE POST ── */
.post-header { margin-bottom: 2rem; }
.post-header h1 {
    font-size: 2rem;
    line-height: 1.3;
    margin-bottom: 0.8rem;
    letter-spacing: -0.02em;
}
.post-cover {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: var(--radius);
    margin: 1.2rem 0 1.8rem;
    box-shadow: var(--shadow-md);
}

.post-content h2 {
    font-size: 1.35rem;
    margin: 2.2rem 0 0.7rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}
.post-content h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
.post-content p { margin-bottom: 1.1rem; }
.post-content ul, .post-content ol { margin: 0 0 1.1rem 1.5rem; }
.post-content li { margin-bottom: 0.35rem; }
.post-content a { color: var(--accent); transition: opacity 0.2s; }
.post-content a:hover { opacity: 0.8; }
.post-content blockquote {
    border-left: 4px solid var(--accent);
    padding: 0.8rem 1.2rem;
    background: var(--accent-glow);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-style: italic;
}
.post-content code {
    background: var(--tag-bg);
    color: var(--accent);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.86em;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}
.post-content pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1.2rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.86rem;
    position: relative;
    border: 1px solid var(--border);
}
.post-content pre code { background: none; color: inherit; padding: 0; }

/* Code copy button */
.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.6);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.72rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.code-copy-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }

.post-content img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s;
    cursor: zoom-in;
}
.post-content img:hover { transform: scale(1.02); }
.post-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.88rem; }
.post-content th {
    background: var(--bg-surface);
    padding: 0.6rem 1rem;
    text-align: left;
    border: 1px solid var(--border);
    font-weight: 600;
}
.post-content td { padding: 0.6rem 1rem; border: 1px solid var(--border); }

/* TOC */
.toc-container {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    margin-bottom: 2rem;
}
.toc-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.7rem;
}
.toc-list {
    list-style: none;
    padding: 0;
}
.toc-list li {
    margin-bottom: 0.3rem;
}
.toc-list a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
    display: block;
    padding: 0.15rem 0;
}
.toc-list a:hover { color: var(--accent); }
.toc-list .toc-h3 { padding-left: 1rem; font-size: 0.82rem; }

/* Social sharing */
.social-share {
    margin: 2rem 0;
    padding: 1.2rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.social-share p { font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: 0.7rem;
    padding: 0.5rem 1.2rem;
    background: var(--accent);
    color: var(--text-inverse);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.25s;
}
.share-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.share-btn.twitter { background: #1da1f2; }
.share-btn.linkedin { background: #0077b5; }

/* Related posts */
.related-posts {
    margin: 2rem 0;
    padding: 1.2rem 0;
    border-top: 1px solid var(--border);
}
.related-posts h3 { font-size: 1.05rem; color: var(--text-primary); margin-bottom: 0.7rem; }
.related-posts ul { list-style: none; padding: 0; }
.related-posts li { margin-bottom: 0.4rem; }
.related-posts a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}
.related-posts a:hover { opacity: 0.8; text-decoration: underline; }

/* Comments */
.comments-section {
    margin: 2rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.comments-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Ad placeholder */
.ad-placeholder {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 1rem;
    text-align: center;
    margin: 1rem 0;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Donate */
.donate-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #ffdd00;
    color: #000;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.25s;
}
.donate-btn:hover { background: #ffc800; transform: translateY(-1px); }

/* Back to top */
#back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: none;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 12px 14px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
    z-index: 100;
}
#back-to-top:hover { background: var(--accent-hover); transform: translateY(-3px); box-shadow: var(--shadow-glow); }

/* ── FOOTER ── */
footer {
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 3rem;
    background: var(--bg-surface);
    transition: background 0.3s;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── RIGHT PANEL ── */
.right-panel {
    position: sticky;
    top: 120px;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}
.right-panel::-webkit-scrollbar { width: 3px; }
.right-panel::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 4px; }

.rp-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}
.rp-section:hover { box-shadow: var(--shadow-md); }
.rp-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.3rem;
}
.rp-subtitle { font-size: 0.65rem; color: var(--text-muted); margin-bottom: 0.7rem; }
.rp-divider { display: none; }

/* Heatmap */
.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}
.hm-tile {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 3px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-height: 44px;
    justify-content: center;
}
.hm-tile:hover { transform: scale(1.08); box-shadow: var(--shadow-glow); z-index: 1; }
.hm-label { font-size: 0.56rem; font-weight: 600; line-height: 1.2; word-break: break-word; color: inherit; }
.hm-count { font-size: 0.58rem; font-weight: 700; opacity: 0.7; color: inherit; }

/* Tech Facts */
.tech-fact-card {
    background: var(--accent-glow);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 1rem 1rem;
    margin: 0.8rem 0;
    min-height: 80px;
}
.fact-text { font-size: 0.85rem; color: var(--text-primary); line-height: 1.6; margin-bottom: 0.6rem !important; }
.fact-source {
    font-size: 0.68rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.fact-source:hover { text-decoration: underline; }
.spotlight-counter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}
.spotlight-nav { display: flex; justify-content: space-between; margin-top: 0.5rem; }
.fact-nav-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.72rem;
    color: var(--accent);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    padding: 3px 8px;
    transition: all 0.15s;
}
.fact-nav-btn:hover { background: var(--accent-glow); }
.fact-nav-btn:disabled { color: var(--text-muted); border-color: var(--border); cursor: default; background: none; }

/* Auth links */
.auth-links { 
    list-style: none; 
    max-height: 180px; 
    overflow-y: auto; 
    padding-right: 5px;
}
.auth-links::-webkit-scrollbar { width: 3px; }
.auth-links::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 4px; }
.auth-links li { margin-bottom: 0.35rem; }
.auth-links a {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    display: block;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border);
    transition: all 0.15s;
    line-height: 1.4;
}
.auth-links a:hover { color: var(--accent); padding-left: 0.3rem; }

/* ── SCROLL ANIMATION ── */
.animate-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.animate-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
    .page-wrap { grid-template-columns: 250px 1fr; }
    .right-panel { display: none; }
}
@media (max-width: 768px) {
    .page-wrap { grid-template-columns: 1fr; padding: 1rem; }
    .sidebar { position: static; max-height: none; }
    .cat-bar { top: 60px; }
    .topnav { padding: 0 1rem; }
    .nav-links { display: none; }
    .nav-links.mobile-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-elevated);
        border-bottom: 1px solid var(--border);
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        z-index: 999;
    }
    .hamburger { display: flex; }
    .hero h1 { font-size: 1.3rem; }
    .post-header h1 { font-size: 1.5rem; }
}
