/* Blog Post Styles */
:root {
    --green: #10B981;
    --green-dark: #059669;
    --green-light: #D1FAE5;
    --red: #DC2626;
    --red-light: #FEE2E2;
    --dark: #18181B;
    --grey-900: #27272A;
    --grey-600: #52525B;
    --grey-500: #71717A;
    --grey-400: #A1A1AA;
    --grey-300: #D4D4D8;
    --grey-200: #E4E4E7;
    --grey-100: #F4F4F5;
    --white: #FFFFFF;
    --purple: #7C3AED;
    --purple-light: #EDE9FE;
    --blue: #2563EB;
    --blue-light: #DBEAFE;
    --gold: #D97706;
    --gold-light: #FEF3C7;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--grey-600);
    background: var(--white);
    overflow-x: hidden;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 800px; margin: 0 auto; padding: 0 24px; }

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 20px 0;
    transition: all 0.3s ease;
}
.nav.scrolled {
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 14px 0;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--white);
    font-weight: 800;
    font-size: 1.375rem;
}
.nav.scrolled .logo { color: var(--dark); }
.logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.logo-icon svg { width: 22px; height: 22px; color: white; }
.nav-links { display: none; list-style: none; gap: 28px; }
.nav-links a {
    text-decoration: none;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: color 0.2s;
}
.nav.scrolled .nav-links a { color: var(--grey-600); }
.nav-links a:hover, .nav-links a.active { color: var(--green); }
.nav-cta { display: none; }
.mobile-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--white);
}
.nav.scrolled .mobile-menu-btn { color: var(--dark); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}
.btn-primary {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}
.btn-large { padding: 18px 40px; font-size: 1rem; }

.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--dark);
    z-index: 200;
    display: flex;
    flex-direction: column;
    padding: 24px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 48px; }
.mobile-menu-close { background: none; border: none; color: var(--white); cursor: pointer; padding: 8px; }
.mobile-menu-links { list-style: none; }
.mobile-menu-links li { margin-bottom: 24px; }
.mobile-menu-links a { color: var(--white); text-decoration: none; font-size: 1.25rem; font-weight: 600; }

/* Blog Hero */
.blog-hero {
    position: relative;
    padding: 180px 0 100px;
    background: linear-gradient(135deg, var(--dark) 0%, var(--grey-900) 100%);
    overflow: hidden;
}
.blog-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.3;
}
.blog-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(24,24,27,0.95) 0%, rgba(39,39,42,0.9) 100%);
}
.blog-hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}
.blog-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--grey-400);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 24px;
    transition: color 0.2s;
}
.blog-back-link:hover { color: var(--green); }
.blog-back-link svg { transition: transform 0.2s; }
.blog-back-link:hover svg { transform: translateX(-4px); }

.blog-category {
    display: inline-block;
    background: var(--green-light);
    color: var(--green-dark);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 100px;
    margin-bottom: 20px;
}
.blog-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--white);
    line-height: 1.2;
    margin-bottom: 20px;
}
.blog-meta {
    display: flex;
    align-items: center;
    gap: 24px;
    color: var(--grey-400);
    font-size: 0.9375rem;
}
.blog-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
}
.blog-meta svg { width: 18px; height: 18px; }

/* Hero Color Variations */
.blog-hero-alt { background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%); }
.blog-hero-purple { background: linear-gradient(135deg, #2d1f4e 0%, #4c2d8c 100%); }
.blog-hero-purple .blog-category { background: var(--purple-light); color: var(--purple); }
.blog-hero-blue { background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%); }
.blog-hero-blue .blog-category { background: var(--blue-light); color: var(--blue); }
.blog-hero-gold { background: linear-gradient(135deg, #442a14 0%, #92400e 100%); }
.blog-hero-gold .blog-category { background: var(--gold-light); color: var(--gold); }
.blog-hero-red { background: linear-gradient(135deg, #4a1515 0%, #991b1b 100%); }
.blog-hero-red .blog-category { background: var(--red-light); color: var(--red); }

/* Article Styles */
.blog-article {
    padding: 80px 0 120px;
}
.article-section {
    margin-bottom: 48px;
}
.article-lead {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--dark);
    margin-bottom: 24px;
}
.article-section p {
    font-size: 1.0625rem;
    line-height: 1.8;
    margin-bottom: 20px;
}
.article-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    margin-top: 48px;
    margin-bottom: 20px;
    line-height: 1.3;
}
.article-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
    margin-top: 32px;
    margin-bottom: 16px;
}
.article-list {
    list-style: none;
    margin: 24px 0;
    padding: 0;
}
.article-list li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 14px;
    font-size: 1.0625rem;
    line-height: 1.7;
}
.article-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
}

/* Article Components */
.article-quote {
    border-left: 4px solid var(--green);
    padding: 20px 28px;
    margin: 32px 0;
    background: var(--grey-100);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    font-size: 1.125rem;
    color: var(--grey-600);
    line-height: 1.7;
}
.article-stat {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px;
    background: var(--green-light);
    border-radius: 16px;
    margin: 32px 0;
}
.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--green-dark);
    flex-shrink: 0;
}
.stat-text {
    font-size: 1rem;
    color: var(--grey-600);
    line-height: 1.5;
}
.article-highlight {
    padding: 24px;
    background: var(--grey-100);
    border-radius: 12px;
    margin: 24px 0;
}
.article-highlight h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dark);
    margin: 0 0 12px 0;
}
.article-highlight p {
    font-size: 1rem;
    color: var(--grey-600);
    margin: 0;
}
.article-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 24px 0;
}
.article-grid-item {
    padding: 24px;
    background: var(--grey-100);
    border-radius: 12px;
}
.article-grid-item h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    margin: 0 0 10px 0;
}
.article-grid-item p {
    font-size: 0.9375rem;
    color: var(--grey-600);
    margin: 0;
    line-height: 1.6;
}

/* Steps */
.article-steps {
    margin: 32px 0;
}
.article-step {
    display: flex;
    gap: 20px;
    margin-bottom: 28px;
}
.step-number {
    width: 40px;
    height: 40px;
    background: var(--green);
    color: var(--white);
    font-weight: 700;
    font-size: 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.step-content h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--dark);
    margin: 0 0 8px 0;
}
.step-content p {
    font-size: 0.9375rem;
    color: var(--grey-600);
    margin: 0;
    line-height: 1.6;
}

/* Comparison Table */
.comparison-table {
    border: 1px solid var(--grey-200);
    border-radius: 12px;
    overflow: hidden;
    margin: 32px 0;
}
.comparison-header {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    background: var(--dark);
    color: var(--white);
    font-weight: 600;
    font-size: 0.875rem;
}
.comparison-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    border-bottom: 1px solid var(--grey-200);
    font-size: 0.9375rem;
}
.comparison-row:last-child { border-bottom: none; }
.comparison-col {
    padding: 14px 16px;
    display: flex;
    align-items: center;
}
.comparison-header .comparison-col { padding: 14px 16px; }
.comparison-row:nth-child(even) { background: var(--grey-100); }

/* Article Conclusion */
.article-conclusion {
    background: var(--grey-100);
    padding: 40px;
    border-radius: 20px;
    margin-top: 60px;
}
.article-conclusion h2 {
    margin-top: 0;
}

/* Related Section */
.related-section {
    margin-top: 80px;
    padding-top: 48px;
    border-top: 1px solid var(--grey-200);
}
.related-section h3 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 28px;
}
.related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
.related-card {
    display: flex;
    gap: 20px;
    background: var(--white);
    border: 1px solid var(--grey-200);
    border-radius: 16px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}
.related-card:hover {
    border-color: var(--green);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    transform: translateY(-4px);
}
.related-card img {
    width: 100px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}
.related-card-content { flex: 1; }
.related-category {
    display: inline-block;
    background: var(--green-light);
    color: var(--green-dark);
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 100px;
    margin-bottom: 8px;
}
.related-card-content h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
    line-height: 1.4;
}
.related-card-content p {
    font-size: 0.8125rem;
    color: var(--grey-500);
    margin: 0;
    line-height: 1.5;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    padding: 100px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
}
.cta-content { position: relative; z-index: 1; max-width: 650px; margin: 0 auto; }
.cta-section h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--white);
    margin-bottom: 16px;
}
.cta-section p {
    color: rgba(255,255,255,0.9);
    font-size: 1.125rem;
    margin-bottom: 32px;
}

/* Footer */
.footer {
    background: var(--dark);
    padding: 80px 0 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    padding-bottom: 56px;
    border-bottom: 1px solid var(--grey-800);
}
.footer-brand .logo { color: var(--white); margin-bottom: 20px; }
.footer-brand p { color: var(--grey-400); font-size: 0.9375rem; margin-bottom: 8px; }
.footer-brand .tagline { color: var(--green); font-weight: 600; }
.footer-col h4 { color: var(--white); font-size: 1rem; font-weight: 700; margin-bottom: 24px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 14px; }
.footer-col a { color: var(--grey-400); text-decoration: none; font-size: 0.9375rem; transition: color 0.2s; }
.footer-col a:hover { color: var(--green); }
.footer-contact p { color: var(--grey-400); font-size: 0.9375rem; margin-bottom: 14px; display: flex; align-items: center; gap: 12px; }
.footer-contact svg { width: 18px; height: 18px; color: var(--green); flex-shrink: 0; }
.footer-bottom { padding: 32px 0; }
.footer-bottom p { color: var(--grey-500); font-size: 0.875rem; }

/* Responsive */
@media (min-width: 640px) {
    .article-grid { grid-template-columns: repeat(2, 1fr); }
    .related-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
    .nav-links { display: flex; }
    .nav-cta { display: block; }
    .mobile-menu-btn { display: none; }
    .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
    .comparison-table { font-size: 0.875rem; }
    .comparison-col { padding: 12px; }
}

@media (min-width: 1024px) {
    .blog-article { padding: 120px 0; }
    .related-grid { grid-template-columns: repeat(3, 1fr); }
    .related-card { flex-direction: column; }
    .related-card img { width: 100%; height: 140px; }
}

/* ============================================
   STABLE RENDERING - Prevent flickering
   ============================================ */
.nav {
    contain: layout style;
}

.blog-article {
    contain: layout style;
}

/* Image loading state */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Fixed dimensions for images to prevent layout shift */
.article-section img,
.related-card img,
.gallery-item img {
    background: var(--grey-100);
}

/* Ensure cards have consistent dimensions */
.related-card,
.gallery-item {
    contain: layout style;
}

/* ============================================
   PRELOADER - Smooth page load
   ============================================ */
#preloader {
    position: fixed;
    inset: 0;
    background: var(--dark);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#preloader .loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--grey-700);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
