/* ============================================
   BLOG SIDEBAR & CTA ENHANCEMENT — LegaliaPro
   Injected dynamically by blog-enhance.js
   ============================================ */

/* ── Layout wrapper ── */
.blog-enhanced-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 48px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
    align-items: start;
}

.blog-enhanced-main {
    min-width: 0;
}

/* ── Sticky Sidebar ── */
.blog-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(30,58,110,0.2) transparent;
}

.blog-sidebar::-webkit-scrollbar {
    width: 4px;
}

.blog-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(30,58,110,0.2);
    border-radius: 4px;
}

/* ── Sidebar Cards ── */
.sidebar-widget {
    background: #ffffff;
    border: 1px solid #e8ecf2;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    transition: box-shadow 0.3s ease;
}

.sidebar-widget:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.sidebar-widget-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e3a6e;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #edf0f7;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Table of Contents ── */
.toc-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-nav li {
    margin-bottom: 2px;
}

.toc-nav a {
    display: block;
    padding: 8px 12px;
    font-size: 13.5px;
    line-height: 1.4;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: all 0.25s ease;
}

.toc-nav a:hover {
    background: rgba(30,58,110,0.06);
    color: #1e3a6e;
    border-left-color: #3b82f6;
}

.toc-nav a.toc-active {
    background: rgba(30,58,110,0.08);
    color: #1e3a6e;
    font-weight: 600;
    border-left-color: #1e3a6e;
}

/* ── CTA Card ── */
.sidebar-cta-card {
    background: linear-gradient(135deg, #1e3a6e 0%, #2d5599 100%);
    border: none;
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.sidebar-cta-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.sidebar-cta-card .sidebar-widget-title {
    color: rgba(255,255,255,0.85);
    border-bottom-color: rgba(255,255,255,0.15);
    justify-content: center;
}

.sidebar-cta-card p {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255,255,255,0.9);
    margin: 0 0 18px 0;
}

.sidebar-cta-btn {
    display: inline-block;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(245,158,11,0.35);
    text-align: center;
}

.sidebar-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245,158,11,0.45);
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

/* ── Related Articles ── */
.related-articles-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-articles-list li {
    margin-bottom: 3px;
}

.related-articles-list a {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    font-size: 13.5px;
    line-height: 1.45;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.25s ease;
}

.related-articles-list a::before {
    content: '→';
    flex-shrink: 0;
    color: #3b82f6;
    font-weight: 700;
    margin-top: 1px;
}

.related-articles-list a:hover {
    background: rgba(30,58,110,0.06);
    color: #1e3a6e;
}

/* ── Bottom CTA Banner (inside article) ── */
.blog-bottom-cta {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a6e 50%, #1e40af 100%);
    color: #fff;
    padding: 40px 36px;
    border-radius: 16px;
    margin: 48px 0 24px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.blog-bottom-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.blog-bottom-cta h3 {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 12px 0;
    color: #fbbf24;
    position: relative;
}

.blog-bottom-cta p {
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255,255,255,0.9);
    margin: 0 0 24px 0;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

.blog-bottom-cta .cta-buttons-row {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

.blog-bottom-cta .btn-cta-primary {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(245,158,11,0.35);
}

.blog-bottom-cta .btn-cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245,158,11,0.5);
}

.blog-bottom-cta .btn-cta-secondary {
    display: inline-block;
    padding: 14px 32px;
    background: transparent;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.3);
    transition: all 0.3s ease;
}

.blog-bottom-cta .btn-cta-secondary:hover {
    border-color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.1);
}

/* ── Reading Progress Bar ── */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #1e3a6e, #3b82f6, #f59e0b);
    z-index: 9999;
    transition: width 0.15s linear;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .blog-enhanced-layout {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0;
    }

    .blog-sidebar {
        position: static;
        display: none;
    }

    .blog-enhanced-main {
        padding: 40px 20px;
    }
}

@media (max-width: 768px) {
    .blog-bottom-cta {
        padding: 28px 20px;
    }
    
    .blog-bottom-cta h3 {
        font-size: 20px;
    }
    
    .blog-bottom-cta .cta-buttons-row {
        flex-direction: column;
        align-items: center;
    }
}
