/* =============================================================
   ITM Blog Detail Page — page-blog-detail.css
   ============================================================= */

/* ============================================================
   READING PROGRESS BAR
   ============================================================ */
.bdb-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #0CAF49, #2C3E8B);
    z-index: 9999;
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

/* ============================================================
   BANNER OVERRIDES FOR BLOG DETAIL
   ============================================================ */
.blog-detail-banner {
    padding-bottom: 90px;
    text-align: left;
}

.blog-detail-banner__inner {
    max-width: 860px !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}

.blog-detail-banner .page-banner__breadcrumb {
    justify-content: flex-start;
}

/* Category badge in banner */
.bdb-cat-badge {
    display: inline-block;
    background: rgba(12, 175, 73, 0.2);
    color: #0CAF49;
    border: 1px solid rgba(12, 175, 73, 0.4);
    border-radius: 30px;
    padding: 5px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Title override */
.bdb-title {
    font-size: clamp(1.6rem, 4vw, 2.8rem) !important;
    text-align: left !important;
    margin: 0 !important;
    max-width: 800px;
    line-height: 1.2 !important;
}

/* Meta row in banner */
.bdb-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 4px;
}

.bdb-meta__item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.7);
}

.bdb-meta__item svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    opacity: 0.8;
}

/* Author pill in banner */
.bdb-author-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 8px 18px 8px 8px;
    margin-top: 8px;
    backdrop-filter: blur(6px);
}

.bdb-author-pill__avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.bdb-author-pill__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bdb-author-pill__name {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.bdb-author-pill__role {
    display: block;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.2;
}

/* ============================================================
   HERO FEATURE IMAGE
   ============================================================ */
.bdb-hero-image-wrap {
    background: #fff;
    margin-top: -60px;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.bdb-hero-image-wrap .inner-container {
    max-width: 1200px;
    margin: 0 auto;
}

.bdb-hero-image {
    border-radius: 20px;
    overflow: hidden;
    height: 480px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.bdb-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.bdb-hero-image:hover img {
    transform: scale(1.02);
}

.bdb-hero-image__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.2) 0%, transparent 60%);
    pointer-events: none;
}

/* ============================================================
   MAIN LAYOUT — ARTICLE + SIDEBAR
   ============================================================ */
.bdb-main-section {
    padding-top: 60px !important;
}

.bdb-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 48px;
    align-items: start;
}

/* ============================================================
   ARTICLE BODY
   ============================================================ */
.bdb-article {
    min-width: 0; /* prevent grid blowout */
}

/* Share bar */
.bdb-share-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 18px 24px;
    background: #f8f8fc;
    border-radius: 14px;
    border: 1px solid #e8e8f0;
    margin-bottom: 36px;
}

.bdb-share-bar--top {
    margin-bottom: 40px;
}

.bdb-share-bar__label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #555;
}

.bdb-share-bar__btns {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bdb-share-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.25s, box-shadow 0.25s;
    flex-shrink: 0;
}

.bdb-share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    text-decoration: none;
}

.bdb-share-btn svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

.bdb-share-btn--fb { background: #1877f2; }
.bdb-share-btn--tw { background: #000; }
.bdb-share-btn--li { background: #0A66C2; }
.bdb-share-btn--wa { background: #25D366; }

/* ── Article Typography ── */
.bdb-content {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    line-height: 1.85;
    font-size: 1rem;
}

.bdb-lead {
    font-size: 1.08rem;
    color: #444;
    line-height: 1.85;
    border-left: 4px solid #0CAF49;
    padding-left: 20px;
    margin: 0 0 32px;
    font-weight: 400;
}

.bdb-content h2 {
    font-size: clamp(1.2rem, 2.5vw, 1.55rem);
    font-weight: 800;
    color: #2C3E8B;
    margin: 48px 0 16px;
    line-height: 1.25;
    padding-top: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.bdb-content h2::before {
    content: '';
    width: 5px;
    height: 1.4em;
    background: linear-gradient(180deg, #0CAF49, #2C3E8B);
    border-radius: 4px;
    flex-shrink: 0;
}

.bdb-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111;
    margin: 28px 0 10px;
}

.bdb-content p {
    margin: 0 0 20px;
    color: #444;
    line-height: 1.85;
}

.bdb-content ul,
.bdb-content ol {
    margin: 0 0 24px;
    padding-left: 22px;
}

.bdb-content li {
    margin-bottom: 8px;
    color: #444;
    line-height: 1.75;
}

.bdb-content strong {
    color: #111;
    font-weight: 700;
}

.bdb-content code {
    background: #f0f0f8;
    color: #2C3E8B;
    padding: 2px 8px;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

.bdb-content a {
    color: #2C3E8B;
    text-decoration: underline;
    transition: color 0.2s;
}

.bdb-content a:hover {
    color: #0CAF49;
}

/* Highlight box */
.bdb-highlight-box {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: linear-gradient(135deg, #e8f8ee 0%, #f0fff5 100%);
    border: 1px solid rgba(12, 175, 73, 0.25);
    border-radius: 14px;
    padding: 20px 24px;
    margin: 24px 0 32px;
    font-size: 0.9rem;
    color: #333;
    line-height: 1.7;
}

.bdb-highlight-box__icon {
    width: 40px;
    height: 40px;
    background: #0CAF49;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bdb-highlight-box__icon svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
    fill: none;
}

/* Figure / image in content */
.bdb-figure {
    margin: 32px 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.bdb-figure img {
    width: 100%;
    height: 340px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s;
}

.bdb-figure:hover img {
    transform: scale(1.02);
}

.bdb-figure figcaption {
    background: #f8f8fc;
    padding: 12px 18px;
    font-size: 0.82rem;
    color: #777;
    text-align: center;
    font-style: italic;
    border-top: 1px solid #eee;
}

/* Blockquote */
.bdb-blockquote {
    margin: 32px 0;
    padding: 28px 32px;
    background: linear-gradient(135deg, #2C3E8B 0%, #1a1a3e 100%);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.bdb-blockquote::before {
    content: '\201C';
    position: absolute;
    top: -20px;
    left: 20px;
    font-size: 8rem;
    color: rgba(255, 255, 255, 0.08);
    font-family: Georgia, serif;
    line-height: 1;
    pointer-events: none;
}

.bdb-blockquote p {
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff !important;
    font-style: italic;
    line-height: 1.65;
    margin: 0 0 12px !important;
    position: relative;
    z-index: 1;
}

.bdb-blockquote cite {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.6);
    font-style: normal;
    font-weight: 600;
    position: relative;
    z-index: 1;
    display: block;
}

/* Key Takeaways box */
.bdb-takeaways {
    background: #E8EFFF;
    border: 1px solid rgba(44, 62, 139, 0.2);
    border-radius: 16px;
    padding: 28px;
    margin: 36px 0;
}

.bdb-takeaways__header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 800;
    color: #2C3E8B;
    margin-bottom: 18px;
}

.bdb-takeaways__header svg {
    width: 20px;
    height: 20px;
    stroke: #2C3E8B;
    fill: none;
    flex-shrink: 0;
}

.bdb-takeaways__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bdb-takeaways__list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    color: #333;
    line-height: 1.65;
}

.bdb-takeaways__list li::before {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2C3E8B;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 6L9 17l-5-5' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ── Tags ── */
.bdb-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 40px 0 32px;
    padding-top: 32px;
    border-top: 1px solid #f0f0f0;
}

.bdb-tags__label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.bdb-tag {
    display: inline-block;
    padding: 6px 16px;
    background: #f0f0f8;
    color: #555;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #e5e5f0;
    transition: all 0.2s;
}

.bdb-tag:hover {
    background: #2C3E8B;
    color: #fff;
    border-color: #2C3E8B;
    text-decoration: none;
}

/* ── Author Bio Card ── */
.bdb-author-box {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    background: #f8f8fc;
    border: 1px solid #e8e8f0;
    border-radius: 20px;
    padding: 28px;
    margin: 40px 0;
}

.bdb-author-box__avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid #2C3E8B;
    box-shadow: 0 4px 16px rgba(44, 62, 139, 0.2);
}

.bdb-author-box__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bdb-author-box__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bdb-author-box__label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #0CAF49;
}

.bdb-author-box__name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #111;
    margin: 0;
}

.bdb-author-box__role {
    font-size: 0.8rem;
    color: #2C3E8B;
    font-weight: 600;
}

.bdb-author-box__bio {
    font-size: 0.87rem;
    color: #666;
    line-height: 1.7;
    margin: 8px 0 0;
}

/* ── Post Navigation ── */
.bdb-post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}

.bdb-post-nav__btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    background: #fff;
    border: 1.5px solid #e8e8f0;
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.25s;
    min-width: 0;
}

.bdb-post-nav__btn:hover {
    border-color: #2C3E8B;
    box-shadow: 0 6px 24px rgba(44, 62, 139, 0.12);
    transform: translateY(-2px);
    text-decoration: none;
}

.bdb-post-nav__btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: #2C3E8B;
}

.bdb-post-nav__btn--next {
    justify-content: flex-end;
    text-align: right;
}

.bdb-post-nav__hint {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #0CAF49;
    margin-bottom: 4px;
}

.bdb-post-nav__title {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #111;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.bdb-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 120px;
}

/* Sidebar widget card */
.bdb-sidebar-widget {
    background: #fff;
    border: 1.5px solid #e8e8f0;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.bdb-sidebar-widget__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 800;
    color: #2C3E8B;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f0f0f8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bdb-sidebar-widget__title svg {
    width: 16px;
    height: 16px;
    stroke: #2C3E8B;
    fill: none;
    flex-shrink: 0;
}

/* Table of Contents */
.bdb-toc ol {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bdb-toc ol li {
    margin: 0;
}

.bdb-toc a {
    font-size: 0.82rem;
    color: #555;
    text-decoration: none;
    line-height: 1.5;
    display: block;
    padding: 5px 0;
    transition: color 0.2s, padding-left 0.2s;
    border-left: 2px solid transparent;
    padding-left: 8px;
    margin-left: -8px;
}

.bdb-toc a:hover,
.bdb-toc a.active {
    color: #2C3E8B;
    border-left-color: #0CAF49;
    padding-left: 10px;
    text-decoration: none;
}

.bdb-toc a.active {
    font-weight: 700;
}

/* Article Stats widget */
.bdb-stats-widget .bdb-sidebar-widget__title {
    margin-bottom: 16px;
}

.bdb-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.bdb-stats-item {
    background: #f8f8fc;
    border-radius: 12px;
    padding: 14px 12px;
    text-align: center;
    border: 1px solid #eeeef8;
}

.bdb-stats-item__value {
    display: block;
    font-size: 1.1rem;
    font-weight: 900;
    color: #2C3E8B;
    line-height: 1.2;
    margin-bottom: 4px;
}

.bdb-stats-item__label {
    display: block;
    font-size: 0.7rem;
    color: #999;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Sidebar CTA widget */
.bdb-sidebar-cta {
    background: linear-gradient(135deg, #2C3E8B 0%, #1a1a3e 100%);
    border-radius: 20px;
    padding: 28px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.bdb-sidebar-cta::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    top: -80px;
    right: -60px;
    pointer-events: none;
}

.bdb-sidebar-cta__icon {
    width: 56px;
    height: 56px;
    background: rgba(12, 175, 73, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    border: 2px solid rgba(12, 175, 73, 0.4);
}

.bdb-sidebar-cta__icon svg {
    width: 24px;
    height: 24px;
    stroke: #0CAF49;
    fill: none;
}

.bdb-sidebar-cta h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 10px;
    line-height: 1.3;
    position: relative;
    z-index: 1;
}

.bdb-sidebar-cta p {
    font-size: 0.83rem;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.6;
    margin: 0 0 20px;
    position: relative;
    z-index: 1;
}

/* Popular Posts */
.bdb-popular-post {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    transition: all 0.2s;
}

.bdb-popular-post:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.bdb-popular-post:first-of-type {
    padding-top: 0;
}

.bdb-popular-post:hover {
    text-decoration: none;
}

.bdb-popular-post:hover .bdb-popular-post__title {
    color: #2C3E8B;
}

.bdb-popular-post__num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #2C3E8B;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bdb-popular-post__thumb {
    width: 64px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #E8EFFF;
}

.bdb-popular-post__info {
    flex: 1;
    min-width: 0;
}

.bdb-popular-post__cat {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    color: #0CAF49;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 3px;
}

.bdb-popular-post__title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #111;
    line-height: 1.4;
    margin: 0 0 4px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color 0.2s;
}

.bdb-popular-post__date {
    font-size: 0.7rem;
    color: #aaa;
}

/* ============================================================
   RELATED ARTICLES GRID
   ============================================================ */
.bdb-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.bdb-related-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
    transition: transform 0.3s, box-shadow 0.3s;
}

.bdb-related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 36px rgba(44, 62, 139, 0.12);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
    .bdb-layout {
        grid-template-columns: 1fr 300px;
        gap: 36px;
    }

    .bdb-post-nav {
        grid-template-columns: 1fr;
    }

    .bdb-post-nav__btn--next {
        justify-content: flex-start;
        text-align: left;
    }
}

@media (max-width: 900px) {
    .bdb-layout {
        grid-template-columns: 1fr;
    }

    .bdb-sidebar {
        position: static;
    }

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

    .bdb-hero-image {
        height: 340px;
    }

    .blog-detail-banner {
        padding-bottom: 80px;
    }
}

@media (max-width: 768px) {
    .bdb-hero-image {
        height: 260px;
        border-radius: 14px;
    }

    .bdb-hero-image-wrap {
        padding: 0 16px;
        margin-top: -40px;
    }

    .bdb-main-section {
        padding-top: 40px !important;
    }

    .bdb-author-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .bdb-author-box__info {
        align-items: center;
    }

    .bdb-post-nav {
        grid-template-columns: 1fr;
    }

    .bdb-post-nav__btn--next {
        justify-content: flex-start;
        text-align: left;
    }

    .blog-detail-banner {
        padding-left: 16px;
        padding-right: 16px;
    }

    .bdb-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .bdb-related-grid {
        grid-template-columns: 1fr;
    }

    .bdb-share-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .bdb-figure img {
        height: 220px;
    }

    .bdb-meta {
        gap: 14px;
    }

    .bdb-blockquote p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .blog-detail-banner__inner {
        gap: 12px;
    }

    .bdb-title {
        font-size: clamp(1.4rem, 6vw, 2rem) !important;
    }

    .bdb-author-pill {
        padding: 6px 14px 6px 6px;
    }

    .bdb-hero-image {
        height: 210px;
    }

    .bdb-content h2 {
        font-size: 1.15rem;
    }

    .bdb-content {
        font-size: 0.94rem;
    }

    .bdb-highlight-box {
        flex-direction: column;
        gap: 12px;
    }
}
