/* Blog specific styles extending layout.css */
body[data-page="blog"], body[data-page="blog-post"] {
    background-color: var(--color-bg);
}

.blog-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 60px 20px;
    font-size: 1.15rem;
    line-height: 1.6;
    font-family: var(--font-family);
}

.blog-header {
    margin-bottom: 40px;
}

.blog-title {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.blog-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: #6b6b6b;
    font-size: 0.95rem;
    margin-bottom: 30px;
}

.blog-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.blog-meta-divider {
    color: #ccc;
}

/* Hero image */
.blog-hero-image {
    margin: 0 0 40px;
    border-radius: 16px;
    overflow: hidden;
    max-height: 480px;
}

.blog-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 50px;
    margin-bottom: 20px;
    line-height: 1.3;
}

.blog-content h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 15px;
}

.blog-content p {
    margin-bottom: 25px;
}

.blog-content ul, .blog-content ol {
    margin-bottom: 25px;
    padding-left: 20px;
}

.blog-content li {
    margin-bottom: 10px;
}

/* Charts and Tables */
.blog-chart-container {
    margin: 40px -40px;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

@media (max-width: 768px) {
    .blog-chart-container {
        margin: 40px -20px;
        padding: 20px;
        border-radius: 0;
    }
}

.blog-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.blog-table th {
    text-align: left;
    padding: 12px 15px;
    border-bottom: 2px solid #eaeaea;
    color: #555;
    font-weight: 600;
}

.blog-table td {
    padding: 15px;
    border-bottom: 1px solid #eaeaea;
    vertical-align: middle;
}

.blog-table tr:hover {
    background-color: #f9f9f9;
}

.blog-plan-block {
    margin: 40px 0;
    padding: 28px;
    border: 1px solid #dce6f2;
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.06);
}

.blog-plan-block__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.blog-plan-block__eyebrow,
.blog-ai-cta__eyebrow,
.blog-related-section__eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: #0f766e;
}

.blog-plan-block__header h3,
.blog-related-section__head h2,
.blog-ai-cta h2 {
    margin: 0 0 10px;
    font-size: 1.75rem;
    line-height: 1.2;
}

.blog-plan-block__header p,
.blog-related-section__head p,
.blog-ai-cta p {
    margin: 0;
    color: #475569;
}

.blog-plan-block__cta,
.blog-ai-cta__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.blog-plan-block__query {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 0.92rem;
    line-height: 1.5;
}

.blog-plan-block__table-wrap {
    overflow-x: auto;
}

.blog-plan-block__table {
    min-width: 760px;
}

.blog-plan-pill {
    display: inline-flex;
    align-items: center;
    margin: 0 6px 6px 0;
    padding: 4px 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 0.78rem;
    font-weight: 700;
}

.blog-plan-pill--muted {
    background: #e2e8f0;
    color: #475569;
}

.blog-plan-link,
.blog-related-card__cta {
    color: var(--color-accent);
    font-weight: 700;
    text-decoration: none;
}

.blog-article-footer {
    margin-top: 60px;
    padding-top: 20px;
}

.blog-ai-cta {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: #fff;
}

.blog-ai-cta__content {
    max-width: 620px;
}

.blog-ai-cta p {
    color: rgba(255, 255, 255, 0.82);
    font-size: 1rem;
    line-height: 1.5;
}

.blog-ai-cta__eyebrow {
    color: #bfdbfe;
    margin-bottom: 6px;
}

.blog-ai-cta h2 {
    margin-bottom: 6px;
    font-size: 1.3rem;
}

.blog-ai-cta__chat-button,
.blog-ai-cta__chat-button:visited,
.blog-ai-cta__chat-button:hover,
.blog-ai-cta__chat-button:focus {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #6c47ff, #a855f7, #ec4899);
    background-size: 200% 200%;
    animation: ai-chat-gradient 3s ease infinite, ai-chat-glow 2s ease-in-out infinite alternate;
    box-shadow: 0 0 12px rgba(108, 71, 255, 0.5);
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: box-shadow 0.3s;
}

.blog-ai-cta__chat-button:hover {
    opacity: 1;
    box-shadow: 0 0 20px rgba(108, 71, 255, 0.8), 0 0 40px rgba(168, 85, 247, 0.4);
}

.blog-related-section {
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
    margin-bottom: 18px;
}

.blog-related-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.blog-related-card {
    display: block;
    align-items: center;
    min-height: 84px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: inherit;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.blog-related-card,
.blog-related-card:visited,
.blog-related-card:hover,
.blog-related-card:focus,
.blog-related-card h3,
.blog-related-card p {
    text-decoration: none;
}

.blog-related-card:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.blog-related-card__main {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-width: 0;
}

.blog-related-card__title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    white-space: nowrap;
}

.blog-related-card__flag {
    font-size: 1.35rem;
    line-height: 1;
    flex-shrink: 0;
}

.blog-related-card h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.15;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

.blog-related-card p {
    margin: 0;
    color: #64748b;
    font-size: 0.86rem;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

.blog-related-section__head h2 {
    margin-bottom: 4px;
    font-size: 1.3rem;
}

.blog-related-section__head p {
    font-size: 0.96rem;
    line-height: 1.45;
}

.blog-suggested-section {
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
}

.blog-suggested-section__head h2 {
    margin-bottom: 4px;
    font-size: 1.3rem;
}

.blog-suggested-section__head p {
    font-size: 0.96rem;
    line-height: 1.45;
}

.blog-suggested-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.blog-suggested-card {
    display: block;
    min-height: 144px;
    padding: 14px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: inherit;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.blog-suggested-card,
.blog-suggested-card:visited,
.blog-suggested-card:hover,
.blog-suggested-card:focus,
.blog-suggested-card h3,
.blog-suggested-card p {
    text-decoration: none;
}

.blog-suggested-card:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.blog-suggested-card__eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.blog-suggested-card h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    line-height: 1.3;
    color: #0f172a;
}

.blog-suggested-card p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #64748b;
}

.tag-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 5px;
    margin-bottom: 5px;
}

/* Blog List Styles */
.blog-list-header {
    text-align: center;
    margin-bottom: 60px;
    padding-top: 80px;
}

.blog-list-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    font-family: var(--font-family);
    letter-spacing: -0.02em;
}

.blog-list-subtitle {
    font-size: 1.25rem;
    color: var(--color-muted);
    max-width: 600px;
    margin: 0 auto;
    font-family: var(--font-family);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto 80px;
    padding: 0 20px;
}

.blog-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--color-border);
    font-family: var(--font-family);
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.blog-card-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-meta {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
}

.blog-card-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
    color: var(--color-text);
}

.blog-card-excerpt {
    font-size: 1rem;
    color: var(--color-text);
    line-height: 1.5;
    margin-bottom: 20px;
    flex: 1;
}

.blog-card-readmore {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-accent);
    margin-top: auto;
}

/* Blog card featured image */
.blog-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.03);
}

/* ── Quill-produced HTML in blog articles ─────────────────────────── */
/* Quill wraps content without any container class; we target via
   the .ql-editor-content class we add to the <article> element.    */

.ql-editor-content h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-top: 60px;
    margin-bottom: 20px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.ql-editor-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 50px;
    margin-bottom: 20px;
    line-height: 1.3;
}

.ql-editor-content h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 15px;
}

.ql-editor-content h4 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 12px;
}

.ql-editor-content p {
    margin-bottom: 25px;
}

.ql-editor-content ul,
.ql-editor-content ol {
    margin-bottom: 25px;
    padding-left: 24px;
}

.ql-editor-content li {
    margin-bottom: 10px;
}

/* Quill wraps list items in a <li data-list="bullet|ordered"> inside <ul>/<ol> */
.ql-editor-content ul > li::marker { color: var(--color-accent, #4f46e5); }

.ql-editor-content blockquote {
    border-left: 4px solid var(--color-accent, #4f46e5);
    margin: 30px 0;
    padding: 12px 20px;
    background: #f5f7ff;
    border-radius: 0 8px 8px 0;
    color: #444;
    font-style: italic;
}

.ql-editor-content pre,
.ql-editor-content pre.ql-syntax {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px 20px;
    border-radius: 10px;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    margin-bottom: 25px;
    white-space: pre-wrap;
}

.ql-editor-content code {
    background: #f1f5f9;
    color: #be185d;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9em;
}

.ql-editor-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 16px 0;
    display: block;
}

.ql-editor-content a {
    color: var(--color-accent, #4f46e5);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Quill text-align classes */
.ql-editor-content .ql-align-center { text-align: center; }
.ql-editor-content .ql-align-right  { text-align: right; }
.ql-editor-content .ql-align-justify { text-align: justify; }

/* Quill indent levels */
.ql-editor-content .ql-indent-1 { padding-left: 2em; }
.ql-editor-content .ql-indent-2 { padding-left: 4em; }
.ql-editor-content .ql-indent-3 { padding-left: 6em; }

/* Quill inline highlight (mark) */
.ql-editor-content mark { background: #fef9c3; padding: 0 2px; }

@media (max-width: 768px) {
    .blog-plan-block,
    .blog-ai-cta,
    .blog-related-section {
        padding: 16px;
        border-radius: 16px;
    }

    .blog-plan-block__header,
    .blog-ai-cta {
        flex-direction: column;
        align-items: flex-start;
    }

    .blog-related-grid {
        grid-template-columns: 1fr;
    }

    .blog-suggested-grid {
        grid-template-columns: 1fr;
    }

    .blog-related-card {
        min-height: 80px;
    }
}
