/* Blog detail page */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --bd-navy: #173158;
    --bd-pink: #E83161;
    --bd-muted: #5D6F8A;
    --bd-light: #F7F8F9;
    --bd-border: #EDEFF2;
}

/* Breadcrumb adjustments for the long blog title */
.blog-detail-breadcrumb p {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.blog-detail-breadcrumb a {
    color: #173158;
    text-decoration: none;
}

.blog-detail-breadcrumb a:hover {
    color: var(--bd-pink);
}

.blog-detail-breadcrumb .separator {
    color: #173158;
    margin: 0 8px;
}

.blog-detail-breadcrumb .current {
    color: #E83161;
    font-weight: 500;
}

/* Section wrapper */
.blog-detail-section {
    font-family: 'Poppins', 'Inter', sans-serif;
    padding: 30px 0 150px;
    background: #fff;
}

.blog-detail-wrap {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 0;
    align-items: start;
    margin-left: 150px;
}

/* Sidebar */
.blog-detail-sidebar {
    width: 300px;
    height: 300px;
    background: #F7F8F9;
    padding: 30px 22px 24px 40px;
    border-radius: 0;
    position: sticky;
    top: 90px;
    overflow: hidden;
}

.blog-cat-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.blog-cat-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: #173158;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-cat-list .cat-arrow {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    color: var(--bd-pink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.blog-cat-list li.is-active a {
    color: var(--bd-navy);
    font-weight: 600;
}

.blog-cat-list li a:hover {
    color: var(--bd-pink);
}

.blog-cat-list li a:hover .cat-arrow {
    color: var(--bd-pink);
}

/* Article */
.blog-detail-article {
    width: 100%;
    padding-left: 20px;
}

.blog-detail-hero {
    position: relative;
    margin-bottom: 70px;
}

.blog-detail-image {
    width: 700px;
    height: 700px;
    max-width: 100%;
    background: var(--bd-light);
}

.blog-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-detail-hero .hero-arrow-chip {
    position: absolute;
    top: 0;
    left: calc(700px + 72px);
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    line-height: 0;
}

.blog-detail-hero .hero-arrow-chip svg {
    width: 56px;
    height: 56px;
    display: block;
}

.blog-detail-meta {
    display: flex;
    align-items: center;
    gap: 40px;
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 14px;
}

.blog-detail-meta .meta-date,
.blog-detail-meta-mobile .meta-date {
    color: #5D6F8A;
}

.blog-detail-meta .meta-sep {
    color: var(--bd-border);
}

.blog-detail-meta .meta-cat,
.blog-detail-meta-mobile .meta-cat {
    color: #183158;
    font-weight: 400;
}

.blog-detail-title {
    color: #173158;
    font-size: 48px;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 45px;
    letter-spacing: -0.01em;
}

.blog-detail-lead {
    color: #183158;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.7;
    margin: 0 0 28px;
}

/* Article body — styles whatever comes from CKEditor */
.blog-detail-body {
    color: #173158;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.85;
}

.blog-detail-body p {
    margin: 0 0 18px;
}

.blog-detail-body p:last-child {
    margin-bottom: 0;
}

.blog-detail-body h2,
.blog-detail-body h3,
.blog-detail-body h4 {
    color: var(--bd-navy);
    font-weight: 700;
    line-height: 1.25;
    margin: 30px 0 14px;
}

.blog-detail-body h2 {
    font-size: 24px;
}

.blog-detail-body h3 {
    font-size: 20px;
}

.blog-detail-body h4 {
    font-size: 18px;
}

.blog-detail-body strong,
.blog-detail-body b {
    color: var(--bd-navy);
    font-weight: 700;
}

.blog-detail-body a {
    color: var(--bd-pink);
    text-decoration: none;
    font-weight: 500;
}

.blog-detail-body a:hover {
    text-decoration: underline;
}

.blog-detail-body ul,
.blog-detail-body ol {
    margin: 0 0 18px;
    padding-left: 22px;
}

.blog-detail-body ul li,
.blog-detail-body ol li {
    margin-bottom: 8px;
}

.blog-detail-body img {
    max-width: 100%;
    height: auto;
    display: inline-block;
    vertical-align: top;
    margin: 0;
}

/* Image grids inside body — admins can wrap images in <figure class="bd-grid bd-grid-2"></figure> etc. */
.blog-detail-body figure,
.blog-detail-body .bd-grid {
    margin: 22px 0;
}

.blog-detail-body figure img {
    width: 100%;
}

.blog-detail-body .bd-grid {
    display: grid;
    gap: 14px;
}

.blog-detail-body .bd-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.blog-detail-body .bd-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* Tablet */
@media (max-width: 1199.98px) {
    .blog-detail-wrap {
        grid-template-columns: 260px 1fr;
        gap: 32px;
        margin-left: 0;
    }

    .blog-detail-sidebar {
        width: 260px;
        height: auto;
        padding: 22px 18px;
    }

    .blog-detail-article {
        padding-left: 0;
    }

    .blog-detail-image {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .blog-detail-title {
        font-size: 30px;
    }

    .blog-detail-hero .hero-arrow-chip {
        width: 48px;
        height: 48px;
    }

    .blog-detail-hero .hero-arrow-chip svg {
        width: 48px;
        height: 48px;
    }
}

/* Mobile */
@media (max-width: 711.98px) {
    .blog-detail-section {
        padding: 20px 0 50px;
    }

    .blog-detail-wrap {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .blog-detail-sidebar {
        width: 100%;
        height: auto;
        position: static;
        padding: 18px 16px;
    }

    .blog-cat-list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px 14px;
    }

    .blog-detail-title {
        font-size: 24px;
        margin-bottom: 18px;
    }

    .blog-detail-hero .hero-arrow-chip {
        width: 40px;
        height: 40px;
    }

    .blog-detail-hero .hero-arrow-chip svg {
        width: 40px;
        height: 40px;
    }

    .blog-detail-lead {
        font-size: 14px;
    }
}

@media (min-width: 712px) {

    .blog-detail-meta,
    .blog-detail-title,
    .blog-detail-lead,
    .blog-detail-body {
        max-width: 700px;
        width: 100%;
    }
}

/* Laptop Screen Overrides (992px to 1639.98px) */
@media (min-width: 992px) and (max-width: 1639.98px) {

    /* 1. Container fluid adjustment */
    .kp-container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 40px !important;
        padding-right: 40px !important;
    }

    /* 2. Grid Wrap & Layout */
    .blog-detail-wrap {
        grid-template-columns: 260px minmax(0, 1fr) !important;
        margin-left: 0 !important;
        gap: 40px !important;
    }

    /* 3. Sidebar */
    .blog-detail-sidebar {
        width: 260px !important;
        padding: 30px 22px 24px 30px !important;
        height: auto;
    }

    /* 4. Article Image & Arrow Chip */
    .blog-detail-image {
        width: 100% !important;
        max-width: 700px !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
    }

    .blog-detail-hero .hero-arrow-chip {
        /* Prevent overflow on narrower widths by positioning the chip as an inset watermark badge */
        right: 20px !important;
        /* left: auto !important; */
        /* top: 20px !important; */
    }

    /* For wider laptop viewports where there is enough whitespace to place the chip on the right */
    /* @media (min-width: 1400px) {
        .blog-detail-hero .hero-arrow-chip {
            right: auto !important;
            left: calc(100% + 24px) !important;
            top: 0 !important;
        }
    } */

    /* 5. Typography Scaling */
    .blog-detail-title {
        font-size: 38px !important;
        margin-bottom: 20px !important;
    }

    .blog-detail-lead {
        font-size: 20px !important;
        margin-bottom: 24px !important;
        line-height: 1.5 !important;
    }

    .blog-detail-body {
        font-size: 15px !important;
        line-height: 1.75 !important;
    }
}

/* ───────── Shift Breakpoint for Blog Details Page (apply mobile until 712px, then tablet) ───────── */
@media (min-width: 712px) and (max-width: 767.98px) {

    /* Hide Mobile Layout */
    .d-md-none {
        display: none !important;
    }

    /* Show Tablet/Desktop Layout */
    .d-none.d-md-block {
        display: block !important;
    }

    .d-none.d-md-flex {
        display: flex !important;
    }

    .d-none.d-md-inline {
        display: inline !important;
    }
}

/* Tablet Screen Overrides (712px to 991.98px) */
@media (min-width: 712px) and (max-width: 991.98px) {
    .kp-container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 24px !important;
        padding-right: 24px !important;
    }

    .blog-detail-wrap {
        grid-template-columns: 220px minmax(0, 1fr) !important;
        gap: 24px !important;
        margin-left: 0 !important;
    }

    .blog-detail-sidebar {
        width: 220px !important;
        padding: 20px 14px !important;
        height: auto !important;
    }

    .blog-detail-hero .hero-arrow-chip {
        left: auto !important;
        right: 16px !important;
        top: 16px !important;
        width: 48px !important;
        height: 48px !important;
    }

    .blog-detail-hero .hero-arrow-chip svg {
        width: 48px !important;
        height: 48px !important;
    }

    .blog-detail-lead {
        font-size: 18px !important;
        line-height: 1.5 !important;
        margin-bottom: 20px !important;
    }

    .blog-detail-body {
        font-size: 15px !important;
        line-height: 1.75 !important;
    }
}

/* ═══════════════════════════════════════════
   Blog Mobile Category Filter Dropdown
   ═══════════════════════════════════════════ */
.blog-mobile-cat-filter {
    --cat-font: 'Poppins', sans-serif;
}

.blog-mobile-cat-filter .cat-filter-toggle {
    transition: border-color 0.2s;
}

.blog-mobile-cat-filter .cat-filter-toggle.is-open {
    border-bottom-color: transparent !important;
    z-index: 601;
}

/* Plus/Minus icon toggle */
.blog-mobile-cat-filter .cat-icon-minus { display: none; }
.blog-mobile-cat-filter .cat-filter-toggle.is-open .cat-icon-plus { display: none; }
.blog-mobile-cat-filter .cat-filter-toggle.is-open .cat-icon-minus { display: inline-block; }

/* Dropdown panel */
.blog-mobile-cat-filter .cat-filter-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    min-width: 100%;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-top: none;
    border-radius: 0;
    z-index: 600;
}

/* Meta row */
.blog-mobile-cat-filter .cat-fdd-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: #F7F8F9;
    margin: 12px 16px 8px;
}

.blog-mobile-cat-filter .cat-fdd-count-text {
    font-size: 14px;
    color: #183158;
    font-family: var(--cat-font);
}

.blog-mobile-cat-filter .cat-fdd-count {
    font-weight: 500;
    color: #E83161;
    font-size: 16px;
    margin-right: 2px;
}

.blog-mobile-cat-filter .cat-fdd-reset {
    font-size: 14px;
    font-weight: 500;
    color: #E83161;
    font-family: var(--cat-font);
}

/* List */
.blog-mobile-cat-filter .cat-fdd-list {
    max-height: 260px;
    overflow-y: auto;
    padding: 4px 0 6px;
}

.blog-mobile-cat-filter .cat-fdd-list::-webkit-scrollbar { width: 4px; }
.blog-mobile-cat-filter .cat-fdd-list::-webkit-scrollbar-track { background: #F7F8F9; }
.blog-mobile-cat-filter .cat-fdd-list::-webkit-scrollbar-thumb { background: #E83161; }

/* Item row */
.blog-mobile-cat-filter .cat-fdd-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 16px;
    cursor: pointer;
    margin: 0;
    font-weight: normal;
    transition: background 0.12s;
}

.blog-mobile-cat-filter .cat-fdd-item:hover { background: #F7F8F9; }
.blog-mobile-cat-filter .cat-fdd-item:hover .cat-fdd-item-label { color: #E83161; }

/* Hidden native checkbox */
.blog-mobile-cat-filter .cat-fdd-checkbox {
    position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}

/* Custom checkbox box */
.blog-mobile-cat-filter .cat-fdd-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 1.5px solid #BAC2CD;
    background: #fff;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.blog-mobile-cat-filter .cat-fdd-checkbox:checked + .cat-fdd-box {
    background: #fff;
    border-color: #E83161;
}

.blog-mobile-cat-filter .cat-fdd-checkbox:checked + .cat-fdd-box::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: #E83161;
}

.blog-mobile-cat-filter .cat-fdd-item-label {
    font-size: 14px;
    color: #183158;
    font-family: var(--cat-font);
    transition: color 0.15s;
    line-height: 1.45;
    flex: 1;
}