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

/* Site-wide theme (matches blog index) + article-specific variables */
:root {
    /* Global theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #6c757d;
    --accent: #000000;
    --border: #e9ecef;

    /* Article-specific system */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --text-dark: #1e293b;
    --text-medium: #475569;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --accent-color: #f59e0b;
}

[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --text-primary: #f8f9fa;
    --text-secondary: #adb5bd;
    --accent: #ffffff;
    --border: #2d2d2d;

    /* Article-specific overrides for dark mode */
    --text-dark: #f8f9fa;
    --text-medium: #ced4da;
    --text-light: #adb5bd;
    --bg-light: #1a1a1a;
    --bg-white: #0a0a0a;
    --border-color: #2d2d2d;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
}

/* Shared layout container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================
   HEADER / NAV (from index)
   ========================= */

nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: all 0.3s;
}

nav.scrolled {
    box-shadow: 0 2px 20px rgba(0,0,0,0.05);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-text-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    margin: 0;
    line-height: 1;
}

.logo-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1;
    margin-top: 2px;
}

.navbar img {
    height: 48px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}


.demo-content {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 40px;
    }

    .demo-content img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
        transition: transform 0.3s ease;
    }

    .demo-content img:hover {
        transform: scale(1.02);
    }

.theme-toggle:hover {
    background: var(--bg-secondary);
}

.cta-button {
    background: var(--accent);
    color: var(--bg-primary);
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.3s;
    border: 2px solid var(--accent);
}

.cta-button:not(.secondary) {
    color: white;
}

[data-theme="dark"] .cta-button:not(.secondary) {
    color: black;
}

[data-theme="dark"] .cta-button:not(.secondary):hover {
    color: white;
}

.cta-button:hover {
    background: transparent;
    color: var(--accent);
}

/* Mobile nav */
.mobile-menu-btn {
    display: none;
    background: none;
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.mobile-actions {
    display: none;
}

/* =========================
   ARTICLE LAYOUT & TYPO
   ========================= */

.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 140px 20px 60px; /* extra top padding for fixed nav */
}

.article-header {
    margin-bottom: 3rem;
    text-align: center;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.article-excerpt {
    font-size: 1.25rem;
    color: var(--text-medium);
    line-height: 1.6;
    max-width: 650px;
    margin: 0 auto;
}

.article-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-dark);
    background: transparent;
}

.article-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 2.5rem 0 1.25rem;
    color: var(--text-dark);
    line-height: 1.3;
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--text-dark);
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content strong {
    font-weight: 600;
    color: var(--text-dark);
}

.article-content em {
    font-style: italic;
}

.article-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid var(--primary-color);
    transition: border-color 0.3s ease;
}

.article-content a:hover {
    border-bottom-color: var(--primary-dark);
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-medium);
}

.article-content ul,
.article-content ol {
    margin: 1.5rem 0 1.5rem 2rem;
}

.article-content li {
    margin-bottom: 0.75rem;
}

.article-content code {
    background: var(--bg-light);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

/* CTA Section inside article */
.article-cta {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 3rem;
    border-radius: 1rem;
    text-align: center;
    margin: 4rem 0;
}

.article-cta h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.article-cta p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.article-cta .cta-button {
    display: inline-block;
    background: white;
    color: var(--primary-color);
    padding: 0.875rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    border: none;
}

.article-cta .cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Related Posts */
.related-posts {
    margin: 4rem 0;
    padding-top: 3rem;
    border-top: 2px solid var(--border-color);
}

.related-posts h3 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    text-align: center;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.related-post-card {
    text-decoration: none;
    color: var(--text-dark);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: var(--bg-white);
}

.related-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.related-post-card h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.related-post-card p {
    color: var(--text-medium);
    font-size: 0.95rem;
}

/* =========================
   FOOTER (from index)
   ========================= */

footer {
    background: var(--bg-secondary);
    padding: 60px 0 30px;
    margin-top: 100px;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    margin-bottom: 20px;
}

.footer-section a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 10px;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--text-primary);
}

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

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 768px) {
    /* Nav */
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--border);
        z-index: 999;
    }

    .nav-links.active {
        display: flex;
    }

    .demo-image-mobile {
        max-width: 100%; /* Ensures the image doesn't exceed its parent's width */
  height: auto;    /* Maintains the image's aspect ratio */
  display: block;
    }

    .nav-links .cta-button,
    .nav-links .theme-toggle {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .mobile-actions {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .mobile-actions .cta-button {
        padding: 10px 16px;
        font-size: 14px;
    }

    .mobile-actions .theme-toggle {
        display: flex;
    }

    /* Article */
    .article-container {
        padding: 120px 16px 40px;
    }

    .article-title {
        font-size: 2rem;
    }

    .article-excerpt {
        font-size: 1.1rem;
    }

    .article-content {
        font-size: 1rem;
    }

    .article-content h2 {
        font-size: 1.5rem;
    }

    /* Footer grid */
    .footer-content {
        grid-template-columns: 1fr;
    }
}