/* CB.VU Main Stylesheet */
:root {
    --bg: #0a0a0a;
    --bg-surface: #111;
    --bg-card: #1a1a1a;
    --bg-input: #222;
    --border: #333;
    --text: #e0e0e0;
    --text-muted: #888;
    --text-dim: #666;
    --accent: #00ffff;
    --accent-dim: rgba(0,255,255,0.15);
    --accent-hover: #00cccc;
    --green: #00ff00;
    --green-dim: rgba(0,255,0,0.1);
    --red: #ff4444;
    --orange: #ffaa00;
    --font-sans: 'Segoe UI', Arial, Helvetica, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
    --max-width: 1200px;
    --nav-height: 56px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; height: auto; }

/* Layout */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.content-wrapper { margin-top: calc(var(--nav-height) + 24px); padding-bottom: 60px; }

/* Nav */
.site-nav {
    position: fixed; top: 0; left: 0; right: 0;
    background: rgba(17,17,17,0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    height: var(--nav-height);
}
.site-nav .container {
    display: flex; align-items: center; height: 100%;
}
.nav-logo {
    text-decoration: none; font-weight: 800; font-size: 22px;
    display: flex; align-items: center; gap: 1px; margin-right: 32px;
    font-family: var(--font-sans);
}
.nav-logo-text { color: #fff; letter-spacing: 1px; text-transform: uppercase; }
.nav-logo-dot { color: var(--accent); font-weight: 900; margin: 0 2px; text-shadow: 0 0 10px rgba(0,255,255,0.5); }

.nav-spacer { display: none; }

.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.nav-links a {
    color: #ccc; text-decoration: none; padding: 6px 14px; font-size: 14px;
    border-radius: 4px; transition: all 0.2s; white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: #fff; background: rgba(255,255,255,0.08); }

.nav-dropdown { position: relative; }
.nav-dropdown-btn {
    background: none; border: none; color: #ccc; cursor: pointer;
    padding: 6px 14px; font-size: 14px; border-radius: 4px; transition: all 0.2s;
}
.nav-dropdown-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-dropdown-menu {
    display: none; position: absolute; top: 100%; right: 0;
    background: #222; border: 1px solid var(--border); border-radius: 6px;
    padding: 8px 0; min-width: 220px; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.nav-dropdown-menu.active { display: block; }
.nav-dropdown-menu a { display: block; padding: 8px 16px; color: #ccc; font-size: 14px; }
.nav-dropdown-menu a:hover { background: rgba(255,255,255,0.06); color: #fff; }

/* Mobile nav */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: #fff; margin: 5px 0; transition: 0.3s; }

@media (max-width: 900px) {
    /* Logo left, hamburger right */
    .nav-spacer { display: block; flex: 1; }
    .nav-toggle { display: block; order: 3; }
    .nav-logo { order: 1; margin-right: 0; }

    .nav-links {
        display: none; position: fixed; top: var(--nav-height); left: 0; right: 0;
        bottom: 0; flex-direction: column; background: #111; padding: 0;
        gap: 0; overflow-y: auto; z-index: 999;
    }
    .nav-links.active { display: flex; }
    .nav-links li { width: 100%; }
    .nav-links a {
        padding: 14px 20px; font-size: 16px;
        border-bottom: 1px solid var(--border); border-radius: 0;
        display: block; width: 100%;
    }
    .nav-dropdown { width: 100%; }
    .nav-dropdown-btn {
        width: 100%; text-align: left; padding: 14px 20px; font-size: 16px;
        border-bottom: 1px solid var(--border); border-radius: 0;
    }
    .nav-dropdown-menu {
        position: static; box-shadow: none; border: none;
        background: #1a1a1a; border-radius: 0;
    }
    .nav-dropdown-menu a { padding: 12px 36px; }

    /* Content padding */
    .container { padding: 0 16px; }
    .content-wrapper { margin-top: calc(var(--nav-height) + 16px); }

    /* Article content mobile */
    .article-content { padding: 20px; }
    .article-content h1 { font-size: 1.5em; }
    .article-content h2 { font-size: 1.25em; margin-top: 28px; }
    .article-content pre { font-size: 0.8em; padding: 12px; }
    .article-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Grids go single column on small screens */
    .spoke-grid { grid-template-columns: 1fr; }
    .pillar-grid { grid-template-columns: 1fr; }
    .latest-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }

    /* Terminal smaller on mobile */
    .hero-terminal-body { min-height: 180px; font-size: 13px; padding: 16px; }

    /* Sidebar below content on mobile */
    .sidebar { position: static; }
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex; align-items: center; gap: 8px; padding: 12px 0;
    font-size: 14px; color: var(--text-muted); flex-wrap: wrap;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { color: var(--text-dim); }

/* Article layout */
.article-layout { display: grid; grid-template-columns: 1fr 300px; gap: 40px; }
@media (max-width: 900px) { .article-layout { grid-template-columns: 1fr; } }

.article-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 40px;
    line-height: 1.8;
}
.article-content h1 { font-size: 2em; margin: 0 0 16px; color: #fff; line-height: 1.3; }
.article-content h2 { font-size: 1.5em; margin: 40px 0 16px; color: #fff; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.article-content h3 { font-size: 1.2em; margin: 32px 0 12px; color: #ddd; }
.article-content p { margin: 0 0 16px; }
.article-content ul, .article-content ol { margin: 0 0 16px; padding-left: 24px; }
.article-content li { margin-bottom: 6px; }
.article-content code {
    background: var(--bg-input); padding: 2px 6px; border-radius: 3px;
    font-family: var(--font-mono); font-size: 0.9em; color: var(--accent);
}
.article-content pre {
    background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px;
    padding: 16px; overflow-x: auto; margin: 0 0 16px;
    font-family: var(--font-mono); font-size: 0.9em; line-height: 1.5;
}
.article-content pre code { background: none; padding: 0; color: var(--text); }
.article-content blockquote {
    border-left: 3px solid var(--accent); margin: 0 0 16px; padding: 12px 20px;
    background: var(--accent-dim); border-radius: 0 6px 6px 0;
}
.article-content table { width: 100%; border-collapse: collapse; margin: 0 0 16px; }
.article-content th, .article-content td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.article-content th { background: var(--bg-input); color: #fff; }
.article-content hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.article-content img { border-radius: 6px; }

/* Sidebar */
.sidebar { position: sticky; top: calc(var(--nav-height) + 24px); }

.sidebar-card {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: 8px; padding: 20px; margin-bottom: 20px;
}
.sidebar-card h3 {
    font-size: 14px; text-transform: uppercase; letter-spacing: 1px;
    color: var(--text-muted); margin: 0 0 12px; padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.sidebar-card ul { list-style: none; padding: 0; margin: 0; }
.sidebar-card li { margin-bottom: 8px; }
.sidebar-card li a { color: var(--text); font-size: 14px; display: block; padding: 4px 0; }
.sidebar-card li a:hover { color: var(--accent); }

/* Hub page */
.hub-spokes { margin-top: 40px; }
.hub-spokes h2 {
    font-size: 1.3em; color: #fff; margin-bottom: 20px;
    padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.spoke-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.spoke-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
    padding: 20px; transition: border-color 0.2s, transform 0.2s;
}
.spoke-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.spoke-card h3 { margin: 0 0 8px; font-size: 1.05em; }
.spoke-card h3 a { color: #fff; }
.spoke-card h3 a:hover { color: var(--accent); }
.spoke-card p { margin: 0; font-size: 14px; color: var(--text-muted); line-height: 1.5; }

/* Homepage */
.hero-terminal {
    background: #000; border: 1px solid var(--border); border-radius: 8px;
    margin: 0 0 48px; overflow: hidden;
}
.hero-terminal-bar {
    background: #1a1a1a; padding: 8px 16px; display: flex; align-items: center; gap: 8px;
    border-bottom: 1px solid var(--border);
}
.hero-terminal-dot { width: 12px; height: 12px; border-radius: 50%; }
.hero-terminal-dot.red { background: #ff5f56; }
.hero-terminal-dot.yellow { background: #ffbd2e; }
.hero-terminal-dot.green { background: #27c93f; }
.hero-terminal-body {
    padding: 20px; min-height: 250px; font-family: var(--font-mono);
    color: var(--green); font-size: 14px;
}
.hero-terminal-body #output { white-space: pre-wrap; margin-bottom: 16px; }
.hero-terminal-body .input-line { display: flex; align-items: center; }
.hero-terminal-body #prompt { margin-right: 8px; color: var(--accent); }
.hero-terminal-body #input {
    background: transparent; border: none; color: var(--green);
    font-family: var(--font-mono); font-size: inherit; flex-grow: 1; outline: none;
}

/* Pillar cards */
.pillars { margin-bottom: 48px; }
.pillars h2 { font-size: 1.6em; color: #fff; margin-bottom: 24px; text-align: center; }
.pillar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }

.pillar-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
    padding: 24px; transition: border-color 0.3s, transform 0.2s;
    text-decoration: none; display: block;
}
.pillar-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.pillar-card h3 { color: #fff; margin: 0 0 8px; font-size: 1.1em; }
.pillar-card p { color: var(--text-muted); margin: 0; font-size: 14px; line-height: 1.5; }

/* Latest articles */
.latest-articles { margin-bottom: 48px; }
.latest-articles h2 { font-size: 1.6em; color: #fff; margin-bottom: 24px; text-align: center; }
.latest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }

.latest-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
    padding: 20px; transition: border-color 0.2s;
}
.latest-card:hover { border-color: var(--accent); }
.latest-card .category-tag {
    font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
    color: var(--accent); margin-bottom: 8px;
}
.latest-card h3 { margin: 0 0 8px; font-size: 1em; }
.latest-card h3 a { color: #fff; }
.latest-card h3 a:hover { color: var(--accent); }
.latest-card p { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* Footer */
.site-footer {
    background: var(--bg-surface); border-top: 1px solid var(--border);
    padding: 48px 0 32px; color: var(--text-muted); font-size: 14px;
}
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}
.footer-col h4 {
    color: #fff; font-size: 14px; text-transform: uppercase;
    letter-spacing: 1px; margin: 0 0 14px; padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col li a { font-size: 13px; line-height: 1.4; display: block; }

.footer-bottom {
    text-align: center; padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* Latest page */
.page-header { margin-bottom: 32px; }
.page-header h1 { color: #fff; font-size: 2em; margin: 0 0 8px; }
.page-header p { color: var(--text-muted); margin: 0; font-size: 1.05em; }

/* Flash messages */
.flash { padding: 12px 20px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.flash-success { background: var(--green-dim); border: 1px solid #2a5a2a; color: #6f6; }
.flash-error { background: rgba(255,0,0,0.1); border: 1px solid #5a2a2a; color: #f66; }
