/* ============================================================
   1. VARIABLES
   ============================================================ */
:root {
    --accent: #04177b;
    --accent-hover: #0a2ad1;
    --accent-light: #eef2ff;
    --accent-mid: rgba(4, 23, 123, 0.08);

    --white: #ffffff;
    --off-white: #f8f9fc;
    --body-bg: #ffffff;

    --text-primary: #0b1220;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --text-light: #9ca3af;

    --border-default: #e5e7eb;
    --border-light: #f3f4f6;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1);

    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --font: "Poppins", sans-serif;

    --container-max: 1260px;
    --article-max: 780px;
}

/* ============================================================
   2. GLOBAL RESET (scoped — won't fight layout.app styles)
   ============================================================ */
.seo-blog-banner *,
.blog-main * {
    box-sizing: border-box;
}

.seo-blog-banner,
.blog-main {
    font-family: var(--font);
    color: var(--text-primary);
    background: var(--body-bg);
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   3. BANNER SECTION
   ============================================================ */
.seo-blog-banner {
    padding: 121px 0 0;
    background: var(--white);
    position: relative;
}

.seo-blog-container {
    width: 70%;
    max-width: var(--container-max);
    margin: 0 auto;
}

/* ---------- Title ---------- */
.seo-blog-title {
    font-family: var(--font);
    font-size: clamp(1.75rem, -0.5vw, 2.9rem);
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    color: var(--text-primary);
    max-width: 860px;
    margin: 0 auto 36px;
    letter-spacing: -0.6px;
}

/* ---------- Featured image ---------- */
.seo-blog-featured-image {
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.seo-blog-featured-image img {
    width: 100%;
    display: block;
    height: 440px;
    object-fit: fill;
}

/* ---------- Meta bar (back link + share) ---------- */
.seo-blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-bottom: 48px;
    flex-wrap: wrap;
    gap: 16px;
}

.seo-blog-back {
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.seo-blog-back:hover {
    color: var(--accent);
    text-decoration: none;
}

/* ---------- Share icons ---------- */
.seo-blog-share {
    display: flex;
    gap: 10px;
}

.seo-blog-share a {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border-default);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 15px;
    transition: all 0.22s ease;
}

.seo-blog-share a:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--white);
    transform: translateY(-2px);
    text-decoration: none;
}

/* ============================================================
   4. MAIN CONTENT LAYOUT  (sidebar + article)
   ============================================================ */
.blog-main {
    padding: 16px 0 80px;
    background: var(--white);
}

.blog-wrapper {
    max-width: var(--container-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 40px;
    align-items: flex-start;
    padding: 0 24px;
}

/* ============================================================
   5. TABLE OF CONTENTS (sidebar)
   ============================================================ */
.blog-sidebar-2 {
    position: relative;
}

.blog-toc-wrapper {
    /* height set by JS for sticky placeholder */
}

.blog-toc {
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    padding: 24px 20px;
    box-shadow: var(--shadow-md);
    max-height: 500px;
    overflow-y: auto;
    position: relative;
}

/* progress bar stripe on left edge */
.blog-toc-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 0%;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
    transition: height 0.1s linear;
    display: block;
}

.blog-toc h3 {
    font-family: var(--font);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #000000;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-default);
}

.blog-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-toc li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--border-light);
}

.blog-toc li:last-child {
    border-bottom: none;
}

.blog-toc a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 4px;
    font-family: var(--font);
    font-size: 14.5px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    line-height: 1.4;
    border-radius: var(--radius-xs);
    transition:
        color 0.18s,
        background 0.18s,
        padding-left 0.18s;
}

.blog-toc a::before {
    content: "";
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--border-default);
    flex-shrink: 0;
    transition: background 0.18s;
}

.blog-toc a:hover,
.blog-toc a.toc-active {
    color: var(--accent);
    padding-left: 8px;
    text-decoration: none;
}

.blog-toc a:hover::before,
.blog-toc a.toc-active::before {
    background: var(--accent);
}

/* sticky TOC (JS adds .is-fixed) */
@media (min-width: 1025px) {
    .blog-toc.is-fixed {
        position: fixed;
        top: 100px;
        max-height: 68vh;
        overflow-y: auto;
        box-shadow: var(--shadow-lg);
    }
}

/* custom scrollbar */
.blog-toc::-webkit-scrollbar {
    width: 4px;
}
.blog-toc::-webkit-scrollbar-track {
    background: transparent;
}
.blog-toc::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}
.blog-toc::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* ============================================================
   6. ARTICLE
   ============================================================ */
.blog-article {
    min-width: 0; /* prevent grid overflow */
    max-width: var(--article-max);
}

/* ---------- Intro paragraph ---------- */
.blog-intro p {
    font-family: var(--font);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.85;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* ---------- Section headings ---------- */
.blog-article h2 {
    font-family: var(--font);
    font-size: clamp(18px, 2.2vw, 22px);
    font-weight: 700;
    color: var(--accent);
    margin: 44px 0 14px;
    line-height: 1.3;
    letter-spacing: -0.2px;
    scroll-margin-top: 140px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-light);
}

/* ---------- Body paragraphs ---------- */
.blog-article p {
    font-family: var(--font);
    font-size: 15.5px;
    font-weight: 400;
    line-height: 1.85;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* ---------- Lists ---------- */
.blog-article ul,
.blog-article ol {
    padding-left: 0;
    margin: 0 0 24px;
    list-style: none;
}

.blog-article ul li,
.blog-article ol li {
    font-family: var(--font);
    font-size: 16.5px;
    font-weight: 500;
    line-height: 1.8;
    color: #000000;
    margin-bottom: 14px;
    padding-left: 28px;
    position: relative;
}

.blog-article ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: transparent;
}

.blog-article ol {
    counter-reset: ol-counter;
}

.blog-article ol li {
    counter-increment: ol-counter;
}

.blog-article ol li::before {
    content: counter(ol-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-top: 2px;
}

/* ---------- Bold inside lists ---------- */
.blog-article li strong,
.blog-article p strong {
    font-weight: 700;
    color: var(--text-primary);
}

/* ---------- Inline links ---------- */
.blog-article a {
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid rgba(4, 23, 123, 0.25);
    transition:
        border-color 0.18s,
        color 0.18s;
}

.blog-article a:hover {
    color: var(--accent-hover);
    border-color: var(--accent-hover);
    text-decoration: none;
}

/* ============================================================
   7. DOUBLE IMAGE ROW
   ============================================================ */
.blog-image-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 36px 0;
}

.blog-image-row img {
    width: 100%;
    height: 240px;
    border-radius: var(--radius-md);
    object-fit: fill;
    display: block;
    box-shadow: var(--shadow-sm);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.blog-image-row img:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* ============================================================
   8. PULL QUOTE / BLOCKQUOTE
   ============================================================ */
.blog-quote-block {
    margin: 44px 0;
    padding: 32px 32px 32px 28px;
    background: var(--off-white);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    position: relative;
    overflow: hidden;
}

.blog-quote-block::before {
    content: "\201C";
    position: absolute;
    top: -10px;
    right: 20px;
    font-size: 100px;
    font-weight: 900;
    line-height: 1;
    color: rgba(4, 23, 123, 0.06);
    font-family: var(--font);
    pointer-events: none;
}

.blog-quote-block p {
    font-family: var(--font);
    font-size: 17px !important;
    font-weight: 600 !important;
    font-style: italic;
    color: var(--text-primary) !important;
    line-height: 1.7 !important;
    margin-bottom: 12px !important;
    padding-left: 0;
}

/* override list bullet for blockquote p */
.blog-quote-block p::before {
    display: none;
}

.blog-quote-block cite {
    display: block;
    font-family: var(--font);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--accent);
    font-style: normal;
}

/* ============================================================
   9. CTA SECTION
   ============================================================ */
.blog-cta {
    margin-top: 56px;
    padding: 44px 40px;
    background: var(--off-white);
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--border-default);
    position: relative;
    overflow: hidden;
}

.blog-cta::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.blog-cta h3 {
    font-family: var(--font);
    font-size: clamp(18px, 2.5vw, 24px);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 14px;
    line-height: 1.3;
}

.blog-cta h3 a {
    color: var(--accent);
    border-bottom: 2px solid rgba(4, 23, 123, 0.3);
    transition: border-color 0.2s;
    font-weight: 700;
}

.blog-cta h3 a:hover {
    border-color: var(--accent);
}

.blog-cta p {
    font-family: var(--font);
    font-size: 15.5px;
    line-height: 1.75;
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto 28px;
    text-align: center;
}

.blog-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 32px;
    background: var(--accent);
    color: #ffffff !important;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition:
        background 0.22s ease,
        transform 0.22s ease,
        box-shadow 0.22s ease;
    letter-spacing: 0.2px;
}

.blog-cta-btn:hover {
    background: var(--accent-hover);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(4, 23, 123, 0.25);
    text-decoration: none !important;
}

/* ============================================================
   10. RESPONSIVE — Tablet  (max 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .blog-wrapper {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 0 20px;
    }

    .blog-sidebar-2 {
        order: -1; /* TOC above article on tablet/mobile */
    }

    .blog-toc {
        max-height: none !important;
        overflow: visible !important;
    }

    /* disable sticky on tablet */
    .blog-toc.is-fixed {
        position: static !important;
        width: auto !important;
        top: auto !important;
        box-shadow: var(--shadow-md);
    }

    .blog-article {
        max-width: 100%;
    }

    .blog-article h2 {
        scroll-margin-top: 90px;
    }
}

/* ============================================================
   11. RESPONSIVE — Banner  (max 991px)
   ============================================================ */
@media (max-width: 991px) {
    .seo-blog-banner {
        padding: 36px 0 0;
    }

    .seo-blog-title {
        font-size: clamp(1.45rem, 4vw, 2rem);
        letter-spacing: -0.3px;
        margin-bottom: 28px;
    }

    .seo-blog-featured-image img {
        height: 340px;
    }
}

/* ============================================================
   12. RESPONSIVE — Mobile  (max 768px)
   ============================================================ */
@media (max-width: 768px) {
    /* --- Banner --- */
    .seo-blog-banner {
        padding: 115px 0 0;
    }

    .seo-blog-container {
        width: 94%;
    }

    .seo-blog-title {
        font-size: 1.5rem;
        letter-spacing: -0.2px;
        margin-bottom: 22px;
        text-align: left;
    }

    .seo-blog-featured-image {
        border-radius: var(--radius-md);
    }

    .seo-blog-featured-image img {
        height: 220px;
    }

    .seo-blog-meta {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding-bottom: 32px;
        margin-top: 16px;
    }

    .seo-blog-share a {
        width: 38px;
        height: 38px;
        font-size: 13px;
    }

    /* --- Layout --- */
    .blog-main {
        padding: 12px 0 56px;
    }

    .blog-wrapper {
        padding: 0 16px;
        gap: 20px;
    }

    /* --- TOC --- */
    .blog-toc {
        padding: 18px 16px;
        border-radius: var(--radius-sm);
    }

    .blog-toc h3 {
        font-size: 10px;
        letter-spacing: 2px;
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .blog-toc a {
        font-size: 13px;
        padding: 8px 4px;
    }

    /* --- Article headings --- */
    .blog-article h2 {
        font-size: 17px;
        margin: 36px 0 12px;
        padding-bottom: 8px;
        scroll-margin-top: 80px;
    }

    /* --- Body text --- */
    .blog-intro p,
    .blog-article p,
    .blog-article li {
        font-size: 14.5px;
        line-height: 1.8;
    }

    /* --- Image row --- */
    .blog-image-row {
        grid-template-columns: 1fr;
        gap: 14px;
        margin: 24px 0;
    }

    .blog-image-row img {
        height: 200px;
    }

    /* --- Blockquote --- */
    .blog-quote-block {
        padding: 24px 20px 24px 20px;
        margin: 32px 0;
    }

    .blog-quote-block p {
        font-size: 15px !important;
    }

    /* --- CTA --- */
    .blog-cta {
        padding: 32px 20px;
        margin-top: 40px;
    }

    .blog-cta h3 {
        font-size: 18px;
    }

    .blog-cta p {
        font-size: 14.5px;
    }

    .blog-cta-btn {
        padding: 12px 24px;
        font-size: 14px;
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================
   13. RESPONSIVE — Small mobile  (max 480px)
   ============================================================ */
@media (max-width: 480px) {
    .seo-blog-title {
        font-size: 1.3rem;
    }

    .seo-blog-featured-image img {
        height: 185px;
    }

    .seo-blog-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .seo-blog-share {
        gap: 8px;
    }

    .seo-blog-share a {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .blog-toc a {
        font-size: 12.5px;
        padding: 7px 4px;
    }

    .blog-article h2 {
        font-size: 16px;
    }

    .blog-article p,
    .blog-article li,
    .blog-intro p {
        font-size: 14px;
        line-height: 1.75;
    }

    .blog-image-row img {
        height: 170px;
        border-radius: var(--radius-sm);
    }

    .blog-quote-block {
        padding: 20px 16px;
    }

    .blog-quote-block p {
        font-size: 14px !important;
    }

    .blog-cta {
        padding: 28px 16px;
    }

    .blog-cta h3 {
        font-size: 17px;
    }

    .blog-cta p {
        font-size: 14px;
        text-align: left;
    }
}
