/* Highlight.js Theme (Atom One Dark) */
pre code.hljs {
    display: block;
    overflow-x: auto;
    padding: 1em
}

code.hljs {
    padding: 3px 5px
}

.hljs {
    color: #abb2bf;
    background: #282c34
}

.hljs-comment,
.hljs-quote {
    color: #5c6370;
    font-style: italic
}

.hljs-doctag,
.hljs-formula,
.hljs-keyword {
    color: #c678dd
}

.hljs-deletion,
.hljs-name,
.hljs-section,
.hljs-selector-tag,
.hljs-subst {
    color: #e06c75
}

.hljs-literal {
    color: #56b6c2
}

.hljs-addition,
.hljs-attribute,
.hljs-meta .hljs-string,
.hljs-regexp,
.hljs-string {
    color: #98c379
}

.hljs-attr,
.hljs-number,
.hljs-selector-attr,
.hljs-selector-class,
.hljs-selector-id,
.hljs-variable {
    color: #d19a66
}

.hljs-bullet,
.hljs-link,
.hljs-meta,
.hljs-selector-bullet,
.hljs-symbol,
.hljs-title {
    color: #61afef
}

.hljs-built_in,
.hljs-class .hljs-title,
.hljs-title.class_ {
    color: #e6c07b
}

.hljs-emphasis {
    font-style: italic
}

.hljs-strong {
    font-weight: 700
}

.hljs-link {
    text-decoration: underline
}

/* ===== Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* ===== Navbar ===== */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 0.75rem 1.5rem;
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #2563eb;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.navbar-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.navbar-links a {
    color: #475569;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.navbar-links a:hover {
    color: #2563eb;
}

.navbar-cta {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff !important;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.navbar-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ===== Hero (article) ===== */
.hero {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
    color: #fff;
    padding: 4rem 1.5rem 3rem;
}

.hero-inner {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
}

.hero-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.12);
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    font-size: 0.8rem;
    color: #64748b;
}

.breadcrumb a {
    color: #2563eb;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 0.4rem;
}

/* ===== Article ===== */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

.article-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);
    padding: 2.5rem;
    border: 1px solid #e2e8f0;
}

/* ===== Prose (article content) ===== */
.prose {
    font-size: 1.05rem;
    color: #334155;
}

.prose h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #1e40af;
    margin: 2rem 0 1rem;
    line-height: 1.25;
    border-bottom: 2px solid #dbeafe;
    padding-bottom: 0.5rem;
}

.prose h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e40af;
    margin: 2.5rem 0 1rem;
    line-height: 1.3;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #e2e8f0;
}

.prose h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2563eb;
    margin: 2rem 0 0.75rem;
    position: relative;
    padding-left: 1rem;
}

.prose h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.25rem;
    height: 1.25rem;
    width: 3px;
    background: #60a5fa;
    border-radius: 3px;
}

.prose h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #3b82f6;
    margin: 1.5rem 0 0.5rem;
}

.prose p {
    margin: 1rem 0;
    line-height: 1.8;
}

.prose a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #bfdbfe;
    transition: border-color 0.2s, color 0.2s;
}

.prose a:hover {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
}

.prose strong {
    color: #1e293b;
    font-weight: 600;
}

.prose ul,
.prose ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.prose li {
    margin: 0.5rem 0;
    line-height: 1.7;
}

.prose ul li {
    list-style: disc;
}

.prose ol li {
    list-style: decimal;
}

.prose ul li::marker {
    color: #3b82f6;
}

.prose ol li::marker {
    color: #3b82f6;
    font-weight: 600;
}

.prose blockquote {
    border-left: 4px solid #3b82f6;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    background: #f0f9ff;
    border-radius: 0 8px 8px 0;
    color: #475569;
    font-style: italic;
}

.prose blockquote p {
    margin: 0;
}

.prose code {
    background: #f1f5f9;
    color: #2563eb;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Fira Code', 'Courier New', monospace;
    border: 1px solid #e2e8f0;
}

.prose pre {
    background: #1e293b;
    color: #f8fafc;
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    border: 1px solid #334155;
}

.prose pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border: none;
    font-size: 0.9em;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.prose th {
    background: #f1f5f9;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.prose td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.prose tr:hover td {
    background: #f8fafc;
}

.prose hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 2rem 0;
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5rem 0;
}

/* ===== Share ===== */
.share-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 0 0;
    border-top: 1px solid #e2e8f0;
    margin-top: 2rem;
}

.share-bar span {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.share-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}

/* ===== Related Articles ===== */
.related-section {
    margin-top: 4rem;
}

.related-section h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.related-section h3::before {
    content: '';
    width: 4px;
    height: 1.5rem;
    background: #2563eb;
    border-radius: 4px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.related-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #bfdbfe;
}

.related-card h4 {
    color: #1e293b;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.related-card p {
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-card .read-more {
    margin-top: auto;
    color: #2563eb;
    font-weight: 600;
    font-size: 0.8rem;
}

/* ===== CTA ===== */
.cta-section {
    max-width: 800px;
    margin: 0 auto 4rem;
    padding: 0 1.5rem;
}

.cta-card {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    border-radius: 16px;
    padding: 3rem 2.5rem;
    text-align: center;
    color: #fff;
}

.cta-card h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.cta-card p {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    color: #1e40af;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.85rem 2rem;
    border-radius: 9999px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* ===== Footer ===== */
.footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 3rem 1.5rem;
    text-align: center;
    font-size: 0.85rem;
}

.footer a {
    color: #60a5fa;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* ===== Blog Home ===== */
.blog-hero {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
    color: #fff;
    padding: 4rem 1.5rem 3rem;
    text-align: center;
}

.blog-hero-inner {
    max-width: 700px;
    margin: 0 auto;
}

.blog-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.blog-hero p {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 500px;
    margin: 0 auto;
}

.blog-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

.blog-section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.blog-section-title::before {
    content: '';
    width: 4px;
    height: 1.5rem;
    background: #2563eb;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Featured Article */
.featured-article {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin-bottom: 3rem;
    text-decoration: none;
    transition: box-shadow 0.2s, transform 0.2s;
}

.featured-article:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.featured-image {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.3);
    font-size: 4rem;
}

.featured-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-content h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.featured-content p {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.article-preview-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: all 0.2s;
}

.article-preview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    border-color: #bfdbfe;
}

.article-preview-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
    margin-bottom: 0.6rem;
}

.article-preview-card p {
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.55;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.article-preview-meta {
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.article-tag {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    margin-bottom: 0.75rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #94a3b8;
}

.empty-state p {
    font-size: 1rem;
}

/* ===== Hamburger / Mobile menu ===== */
.navbar-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
}

.navbar-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #475569;
    border-radius: 2px;
    transition: all 0.25s;
}

.navbar-mobile-menu {
    display: none;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 0.5rem 0;
}

.navbar-mobile-menu a {
    color: #475569;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}

.navbar-mobile-menu a:hover {
    background: #f8fafc;
    color: #2563eb;
}

.navbar-mobile-menu a.navbar-cta {
    margin: 0.75rem 1.5rem 0.5rem;
    text-align: center;
    border-radius: 9999px;
    border-bottom: none;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff !important;
    padding: 0.6rem 1.25rem;
}

.navbar-mobile-menu.open {
    display: flex;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .article-card {
        padding: 1.5rem;
        border-radius: 0;
    }

    .hero {
        padding: 2.5rem 1rem 2rem;
    }

    .navbar-links {
        display: none;
    }

    .navbar-hamburger {
        display: flex;
    }

    .featured-article {
        grid-template-columns: 1fr;
    }

    .featured-image {
        min-height: 140px;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
