/* ===== BLOG DETAIL STYLES ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    color: #1a1a1a;
    background: #fff;
}

/* HEADER */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 16px 80px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.logo img {
    width: 95px;
}

.nav {
    display: flex;
    gap: 26px;
}

.nav a {
    color: #000;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.btn-login {
    font-size: 14px;
    color: #000;
    text-decoration: none;
    font-weight: 600;
}

.btn-demo {
    background: linear-gradient(90deg, #02c3ef 0%, #015bf8 100%);
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

/* BREADCRUMB */
.breadcrumb {
    padding: 100px 80px 20px;
    max-width: 1240px;
    margin: 0 auto;
}

.breadcrumb-links {
    display: flex;
    gap: 8px;
    font-size: 14px;
}

.breadcrumb-links a {
    color: #0077cc;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-links span {
    color: #999;
}

/* MAIN GRID: SIDEBAR STARTS HERE! */
.main-content-grid {
    max-width: 1240px;
    margin: 0 auto;
    padding: 20px 80px 60px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 60px;
    align-items: start;
}

/* LEFT: ARTICLE */
.article-column {
    max-width: 720px;
}

.article-header h1 {
    font-size: 52px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 16px;
}

.article-header .subtitle {
    font-size: 20px;
    color: #666;
    margin-bottom: 24px;
    line-height: 1.4;
}

.article-header .meta {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: #666;
    margin-bottom: 40px;
}

.article-header .featured-img {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 40px;
}

.article-header .featured-img img {
    width: 100%;
    display: block;
}

/* ARTICLE CONTENT */
.key-takeaways {
    background: #f1f1f2;
    padding: 32px;
    border-radius: 12px;
    margin-bottom: 40px;
}

.key-takeaways h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.key-takeaways ul {
    padding-left: 24px;
}

.key-takeaways li {
    margin-bottom: 14px;
    font-size: 16px;
    line-height: 1.65;
}

.article-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin: 60px 0 20px;
}

.article-content h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 40px 0 16px;
}

.article-content p {
    font-size: 18px;
    margin-bottom: 28px;
    line-height: 1.75;
}

.article-content ul {
    margin: 24px 0 28px 32px;
}

.article-content li {
    font-size: 18px;
    margin-bottom: 14px;
    line-height: 1.75;
}

.article-content strong {
    font-weight: 700;
}

.article-content img {
    width: 100%;
    border-radius: 12px;
    margin: 40px 0;
    height: 550px;
    object-fit: cover;
}

/* ABOUT AUTHOR */
.about-author {
    margin-top: 80px;
    padding-top: 60px;
    border-top: 2px solid #f1f1f2;
}

.about-author h3 {
    font-size: 14px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 24px;
}

.author-flex {
    display: flex;
    gap: 24px;
}

.author-flex img {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    flex-shrink: 0;
}

.author-flex h4 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.author-flex .role {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px !important;
}

.author-flex p:last-child {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin: 0 !important;
}

/* RIGHT: SIDEBAR */
.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-box {
    /* background: #f1f1f2; */
    padding: 28px;
    border-radius: 12px;
    margin-bottom: 24px;
}

/* AUTHOR BOX (FIRST - ROUNDED!) */
/* .author-box {
    text-align: center;
} */

.author-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    /* ROUNDED! */
    margin-bottom: 12px;
}

.by-line {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.author-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.author-role {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    margin: 0;
}

/* TOC BOX (SECOND) */
.toc-box h4 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    margin-bottom: 20px;
}

.toc-box ul {
    list-style: none;
}

.toc-box li {
    margin-bottom: 14px;
}

.toc-box a {
    color: #1a1a1a;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.toc-box a:hover {
    color: #0077cc;
}

/* VIDEO BOX (THIRD) */
.video-box {
    padding: 0;
    overflow: hidden;
}

.video-thumb {
    position: relative;
}

.video-thumb img {
    width: 100%;
    display: block;
}

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
}

.video-text {
    padding: 20px 24px;
}

.video-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
}

.video-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* BACK TO CATEGORY */
.back-section {
    text-align: center;
    padding: 80px 80px 60px;
}

.back-section a {
    display: inline-block;
    color: #0077cc;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 28px;
    border: 2px solid #0077cc;
    border-radius: 8px;
    transition: all 0.3s;
}

.back-section a:hover {
    background: #0077cc;
    color: #fff;
}

/* RELATED ARTICLES */
.related {
    padding: 80px;
    background: #f1f1f2;
}

.related-inner {
    max-width: 1240px;
    margin: 0 auto;
}

.related-inner h2 {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 48px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.related-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: #000;
    transition: all 0.3s;
}

.related-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

.related-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.card-content {
    padding: 28px;
}

.badge {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}

.related-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 14px;
    line-height: 1.4;
}

.card-meta {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: #999;
}

/* CTA BANNER */
.cta-banner {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 100px 80px;
    text-align: center;
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 48px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 32px;
    line-height: 1.2;
}

.cta-btn {
    display: inline-block;
    background: linear-gradient(90deg, #02c3ef 0%, #015bf8 100%);
    color: #fff;
    padding: 16px 40px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
}

/* FOOTER */
.footer {
    background: #1a1a1a;
    color: #fff;
    padding: 80px 80px 40px;
}

.footer-grid {
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 60px;
    margin-bottom: 60px;
}

.footer-logo {
    width: 95px;
    margin-bottom: 16px;
}

.footer-tag {
    font-size: 14px;
    color: #999;
}

.footer-col h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 12px;
}

.footer-col a {
    color: #999;
    text-decoration: none;
    font-size: 14px;
}

.footer-col a:hover {
    color: #fff;
}

.footer-bottom {
    max-width: 1240px;
    margin: 0 auto;
    padding-top: 40px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-bottom p {
    font-size: 12px;
    color: #666;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    font-size: 12px;
    color: #666;
    text-decoration: none;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .main-content-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .header,
    .breadcrumb,
    .main-content-grid,
    .back-section,
    .related,
    .cta-banner,
    .footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .article-header h1 {
        font-size: 36px;
    }

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

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

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .cta-content h2 {
        font-size: 32px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 1024px) {
    .sidebar-box.video-box {
        position: static;
        /* sticky off on mobile/tablet */
        top: auto;
    }
}

/* ✅ Sidebar container should NOT be sticky */
.sidebar {
    position: relative;
    /* was sticky in your code */
    top: auto;
    align-self: start;
}

/* ✅ Only the LAST card stays sticky (Owner-like) */
.sidebar-box.video-box {
    position: sticky;
    top: 100px;
    /* header height + spacing */
    z-index: 5;
}

.main-content-grid,
.article-column,
body {
    overflow: visible;
}

.article-content h2,
.article-content h3 {
    scroll-margin-top: 110px;
    /* fixed header offset */
}

.toc-box a.active {
    color: #0077cc;
    font-weight: 700;
}