/* ============================================================
   BLOG CMS - Frontend Stylesheet
   JMD Fintech Blog
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Merriweather:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    --blog-primary: #0082c9;
    --blog-primary-dark: #006aa4;
    --blog-accent: #0ea5e9;
    --blog-success: #10b981;
    --blog-bg: #f8fafc;
    --blog-surface: #ffffff;
    --blog-border: #e2e8f0;
    --blog-text: #1e293b;
    --blog-text-muted: #64748b;
    --blog-text-light: #94a3b8;
    --blog-radius: 12px;
    --blog-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.04);
    --blog-shadow-hover: 0 8px 32px rgba(0,0,0,.12);
}

/* ============================================================
   BASE
   ============================================================ */
.blog-page { font-family: 'Inter', sans-serif; background: var(--blog-bg); color: var(--blog-text); }
.blog-content-area { font-family: 'Merriweather', Georgia, serif; }

/* ============================================================
   READING PROGRESS BAR
   ============================================================ */
#readingProgress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--blog-primary), var(--blog-accent));
    z-index: 9999;
    transition: width .1s linear;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.blog-breadcrumb {
    background: transparent;
    padding: 12px 0;
    font-size: 13px;
}
.blog-breadcrumb a { color: var(--blog-primary); text-decoration: none; }
.blog-breadcrumb a:hover { text-decoration: underline; }
.blog-breadcrumb .current { color: var(--blog-text-muted); }

/* ============================================================
   BLOG HERO / HOME SECTION
   ============================================================ */
.blog-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    padding: 80px 0 60px;
    position: relative;
    overflow: hidden;
}
.blog-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(0,130,201,.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(14,165,233,.1) 0%, transparent 50%);
    animation: heroAnim 15s ease infinite alternate;
}
@keyframes heroAnim { from { transform: scale(1) rotate(0deg); } to { transform: scale(1.1) rotate(5deg); } }
.blog-hero-title { color: #fff; font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.2; }
.blog-hero-title span { background: linear-gradient(135deg, #0082c9, #0ea5e9); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.blog-hero-subtitle { color: rgba(255,255,255,.7); font-size: 1.1rem; }
.blog-search-bar { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); border-radius: 50px; padding: 6px; backdrop-filter: blur(10px); }
.blog-search-bar input { background: transparent; border: none; color: #fff; padding: 10px 20px; font-size: 15px; }
.blog-search-bar input::placeholder { color: rgba(255,255,255,.5); }
.blog-search-bar input:focus { outline: none; box-shadow: none; }
.blog-search-bar button { border-radius: 40px; padding: 10px 28px; }

/* ============================================================
   BLOG CARDS
   ============================================================ */
.blog-card {
    background: var(--blog-surface);
    border-radius: var(--blog-radius);
    box-shadow: var(--blog-shadow);
    overflow: hidden;
    transition: transform .3s ease, box-shadow .3s ease;
    border: 1px solid var(--blog-border);
    height: 100%;
    display: flex;
    flex-direction: column;
}
.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--blog-shadow-hover);
}
.blog-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.blog-card:hover .blog-card-img { transform: scale(1.05); }
.blog-card-img-wrap { overflow: hidden; position: relative; }
.blog-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #fff;
}
.blog-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.blog-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--blog-text);
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card-title:hover { color: var(--blog-primary); }
.blog-card-excerpt {
    font-size: 14px;
    color: var(--blog-text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.blog-card-meta { font-size: 12px; color: var(--blog-text-light); }
.blog-card-meta span { display: inline-flex; align-items: center; gap: 4px; }

/* FEATURED CARD */
.blog-card-featured {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--blog-shadow-hover);
    min-height: 380px;
}
.blog-card-featured img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.blog-card-featured .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.3) 60%, transparent 100%);
}
.blog-card-featured .content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 28px;
    color: #fff;
}
.blog-card-featured h3 { font-size: 1.4rem; font-weight: 800; line-height: 1.3; }
.blog-card-featured h3 a { color: #fff; text-decoration: none; }
.blog-card-featured h3 a:hover { color: rgba(255,255,255,.85); }
.blog-card-featured:hover img { transform: scale(1.03); transition: transform .5s ease; }

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.blog-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}
.blog-section-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--blog-text);
    margin: 0;
}
.blog-section-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--blog-primary), transparent);
}
.blog-section-badge {
    background: var(--blog-primary);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ============================================================
   TRENDING BADGE
   ============================================================ */
.trending-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--blog-border);
    text-decoration: none;
    color: inherit;
    transition: all .2s;
}
.trending-item:hover { color: var(--blog-primary); padding-left: 4px; }
.trending-num {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--blog-bg);
    border: 2px solid var(--blog-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    color: var(--blog-primary);
}
.trending-item:nth-child(1) .trending-num { background: #fef3c7; border-color: #fbbf24; color: #d97706; }
.trending-item:nth-child(2) .trending-num { background: #f1f5f9; border-color: #94a3b8; color: #475569; }
.trending-item:nth-child(3) .trending-num { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.blog-sidebar { position: sticky; top: 80px; }
.blog-widget {
    background: var(--blog-surface);
    border-radius: var(--blog-radius);
    padding: 24px;
    box-shadow: var(--blog-shadow);
    border: 1px solid var(--blog-border);
    margin-bottom: 24px;
}
.blog-widget-title {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--blog-text-muted);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--blog-border);
}
.tag-chip {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: var(--blog-bg);
    color: var(--blog-text-muted);
    border: 1px solid var(--blog-border);
    text-decoration: none;
    transition: all .2s;
    margin: 3px;
}
.tag-chip:hover { background: var(--blog-primary); color: #fff; border-color: var(--blog-primary); }
.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--blog-border);
    text-decoration: none;
    color: var(--blog-text);
    font-size: 14px;
    transition: color .2s;
}
.category-item:hover { color: var(--blog-primary); }
.category-item .count {
    font-size: 11px;
    background: var(--blog-bg);
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--blog-text-muted);
    border: 1px solid var(--blog-border);
}

/* ============================================================
   BLOG DETAIL PAGE
   ============================================================ */
.blog-detail-hero {
    background: #0f172a;
    padding: 60px 0 80px;
    position: relative;
}
.blog-detail-hero img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .25;
}
.blog-detail-meta { color: rgba(255,255,255,.8); font-size: 14px; }
.blog-detail-meta a { color: rgba(255,255,255,.8); text-decoration: none; }
.blog-detail-meta a:hover { color: #fff; }
.blog-detail-title { font-size: clamp(1.5rem, 4vw, 2.5rem); font-weight: 900; color: #fff; line-height: 1.25; }

/* Table of Contents */
.blog-toc {
    background: #f8fafc;
    border: 1px solid var(--blog-border);
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 28px;
}
.blog-toc-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--blog-text-muted); margin-bottom: 12px; }
.blog-toc ol { padding-left: 20px; margin: 0; }
.blog-toc li { margin-bottom: 6px; }
.blog-toc a { color: var(--blog-primary); font-size: 14px; text-decoration: none; }
.blog-toc a:hover { text-decoration: underline; }
.blog-toc a.active { font-weight: 700; }

/* Blog Content */
.blog-content { font-family: 'Merriweather', serif; font-size: 17px; line-height: 1.85; color: var(--blog-text); }
.blog-content h1, .blog-content h2, .blog-content h3, .blog-content h4 { font-family: 'Inter', sans-serif; font-weight: 800; margin-top: 2em; margin-bottom: .5em; color: var(--blog-text); }
.blog-content h2 { font-size: 1.5rem; border-bottom: 2px solid var(--blog-border); padding-bottom: 8px; }
.blog-content h3 { font-size: 1.25rem; }
.blog-content p { margin-bottom: 1.2em; }
.blog-content a { color: var(--blog-primary); }
.blog-content img { max-width: 100%; border-radius: 10px; margin: 20px 0; }
.blog-content blockquote { border-left: 4px solid var(--blog-primary); background: #f8f9ff; padding: 16px 20px; border-radius: 0 8px 8px 0; margin: 24px 0; color: var(--blog-text-muted); font-style: italic; }
.blog-content code { background: #f1f5f9; padding: 2px 8px; border-radius: 4px; font-size: .9em; }
.blog-content pre { background: #1e293b; color: #e2e8f0; padding: 20px; border-radius: 10px; overflow-x: auto; margin: 20px 0; }
.blog-content ul, .blog-content ol { padding-left: 28px; margin-bottom: 1.2em; }
.blog-content li { margin-bottom: 6px; }
.blog-content table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.blog-content th, .blog-content td { border: 1px solid var(--blog-border); padding: 10px 14px; }
.blog-content th { background: #f8fafc; font-family: 'Inter', sans-serif; font-weight: 700; font-size: 14px; }

/* Author Box */
.blog-author-box {
    background: linear-gradient(135deg, #f8f9ff, #fff);
    border: 1px solid #e0e7ff;
    border-radius: 16px;
    padding: 28px;
}
.blog-author-box img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--blog-primary); }
.blog-author-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--blog-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    flex-shrink: 0;
}

/* Social Share */
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s;
}
.share-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.share-fb { background: #1877f2; color: #fff; }
.share-tw { background: #000; color: #fff; }
.share-wa { background: #25d366; color: #fff; }
.share-li { background: #0a66c2; color: #fff; }
.share-copy { background: #f1f5f9; color: var(--blog-text); border: 1px solid var(--blog-border); }

/* Comments */
.blog-comment {
    background: var(--blog-surface);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--blog-border);
    margin-bottom: 16px;
}
.blog-comment-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blog-primary), var(--blog-accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
}
.blog-comment-reply { margin-left: 60px; }
.blog-comment-form { background: var(--blog-surface); border: 1px solid var(--blog-border); border-radius: 12px; padding: 24px; }

/* FAQ */
.blog-faq .accordion-button { font-weight: 700; font-family: 'Inter', sans-serif; font-size: 15px; }
.blog-faq .accordion-button:not(.collapsed) { color: var(--blog-primary); background: #f8f9ff; }
.blog-faq .accordion-button::after { filter: none; }

/* Prev/Next Nav */
.blog-prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 576px) { .blog-prev-next { grid-template-columns: 1fr; } }
.blog-nav-card {
    background: var(--blog-surface);
    border: 1px solid var(--blog-border);
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: var(--blog-text);
    transition: all .2s;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.blog-nav-card:hover { border-color: var(--blog-primary); color: var(--blog-primary); transform: translateY(-2px); }

/* Author Profile Page */
.author-hero {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    padding: 60px 0;
    color: #fff;
}
.author-avatar-lg { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 4px solid rgba(255,255,255,.3); }

/* ============================================================
   PAGINATION
   ============================================================ */
.blog-pagination .page-link {
    border-radius: 8px !important;
    margin: 0 2px;
    color: var(--blog-primary);
    border-color: var(--blog-border);
    font-weight: 600;
    font-size: 14px;
}
.blog-pagination .page-item.active .page-link {
    background: var(--blog-primary);
    border-color: var(--blog-primary);
    color: #fff;
}
.blog-pagination .page-link:hover {
    background: var(--blog-primary);
    border-color: var(--blog-primary);
    color: #fff;
}

/* ============================================================
   FILTER BAR (Listing Page)
   ============================================================ */
.blog-filters {
    background: var(--blog-surface);
    border-radius: var(--blog-radius);
    padding: 20px;
    box-shadow: var(--blog-shadow);
    border: 1px solid var(--blog-border);
    margin-bottom: 24px;
}
.sort-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    border-radius: 20px;
    border: 1.5px solid var(--blog-border);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: var(--blog-text-muted);
    transition: all .2s;
}
.sort-pill:hover, .sort-pill.active {
    background: var(--blog-primary);
    color: #fff;
    border-color: var(--blog-primary);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.blog-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--blog-text-muted);
}
.blog-empty-icon { font-size: 64px; margin-bottom: 20px; opacity: .4; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .blog-hero { padding: 50px 0 40px; }
    .blog-sidebar { position: static; }
    .blog-content { font-size: 16px; }
    .blog-prev-next { grid-template-columns: 1fr; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp .5s ease forwards; }
.blog-card { animation: fadeInUp .4s ease forwards; }
