/* Template 8 ONLY — Nest blog cards (listing + related) */
body.al_body_template_eight .main-blog-section {
    overflow: visible !important;
    padding-bottom: 12px !important;
}

body.al_body_template_eight .main-blog-section > .row:last-of-type,
body.al_body_template_eight .main-blog-section .row {
    overflow: visible !important;
}

body.al_body_template_eight .main-blog-section .col-lg-4,
body.al_body_template_eight .main-blog-section .col-md-6 {
    display: flex !important;
    overflow: visible !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

body.al_body_template_eight .blog-card {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    background: #fff !important;
    border: 1px solid #e6ece9 !important;
    border-radius: 20px !important;
    overflow: visible !important;
    box-shadow:
        0 2px 4px rgba(37, 61, 78, 0.03),
        0 10px 28px rgba(37, 61, 78, 0.07) !important;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease !important;
}

body.al_body_template_eight .blog-card > a {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    color: inherit !important;
    text-decoration: none !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    background: #fff !important;
}

body.al_body_template_eight .blog-card:hover {
    transform: translateY(-8px) !important;
    -webkit-transform: translateY(-8px) !important;
    box-shadow:
        0 8px 16px rgba(59, 183, 126, 0.08),
        0 20px 40px rgba(37, 61, 78, 0.12) !important;
    border: 1px solid #b6e4c8 !important;
}

body.al_body_template_eight .blog-card .blog-img-container {
    position: relative !important;
    height: 220px !important;
    overflow: hidden !important;
    background:
        radial-gradient(ellipse at 50% 20%, rgba(222, 249, 236, 0.45) 0%, transparent 62%),
        linear-gradient(180deg, #f4faf7 0%, #ffffff 100%) !important;
    border-radius: 0 !important;
}

body.al_body_template_eight .blog-card .blog-img-container img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

body.al_body_template_eight .blog-card:hover .blog-img-container img {
    transform: scale(1.06) !important;
}

body.al_body_template_eight .blog-card .blog-content {
    padding: 18px 18px 20px !important;
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
}

body.al_body_template_eight .blog-card .blog-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
    font-size: 12px !important;
    color: #6f8f7f !important;
    font-weight: 600 !important;
}

body.al_body_template_eight .blog-card .blog-meta span {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: #eef8f2 !important;
    border: 1px solid #d7efe2 !important;
    border-radius: 999px !important;
    padding: 4px 10px !important;
    color: #6f8f7f !important;
    margin: 0 !important;
}

body.al_body_template_eight .blog-card .blog-meta .ml-3 {
    margin-left: 0 !important;
}

body.al_body_template_eight .blog-card .blog-meta i {
    color: var(--theme-deafult) !important;
    font-size: 12px !important;
}

body.al_body_template_eight .blog-card .blog-title {
    font-size: 18px !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
    letter-spacing: -0.01em !important;
    color: #1f3344 !important;
    margin: 0 0 10px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

body.al_body_template_eight .blog-card:hover .blog-title {
    color: var(--theme-deafult) !important;
}

body.al_body_template_eight .blog-card .blog-excerpt {
    color: #6b7580 !important;
    font-size: 14px !important;
    line-height: 1.55 !important;
    margin-bottom: 16px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    flex: 1 1 auto !important;
}

body.al_body_template_eight .blog-card .read-more-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    align-self: flex-start !important;
    margin-top: auto !important;
    padding: 9px 16px !important;
    border-radius: 999px !important;
    background: linear-gradient(180deg, #e8fbf1 0%, #def9ec 100%) !important;
    border: 1px solid #bfe9d2 !important;
    color: var(--theme-deafult) !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    box-shadow: 0 4px 10px rgba(59, 183, 126, 0.12) !important;
    transition: background 0.22s ease, color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease, border-color 0.22s ease !important;
}

body.al_body_template_eight .blog-card:hover .read-more-btn {
    background: linear-gradient(180deg, #47c989 0%, #3BB77E 100%) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 10px 20px rgba(59, 183, 126, 0.35) !important;
    transform: translateY(-1px) !important;
}

body.al_body_template_eight .blog-card .read-more-btn i {
    font-size: 13px !important;
}

/* Related posts sidebar cards on blog detail */
body.al_body_template_eight .related-blogs {
    overflow: visible !important;
}

body.al_body_template_eight .related-blog-card {
    background: #fff !important;
    border: 1px solid #e6ece9 !important;
    border-radius: 16px !important;
    padding: 12px !important;
    margin-bottom: 14px !important;
    overflow: visible !important;
    box-shadow:
        0 2px 4px rgba(37, 61, 78, 0.03),
        0 8px 20px rgba(37, 61, 78, 0.06) !important;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease !important;
}

body.al_body_template_eight .related-blog-card:hover {
    background: #fff !important;
    transform: translateY(-6px) !important;
    border-color: #b6e4c8 !important;
    box-shadow:
        0 8px 16px rgba(59, 183, 126, 0.08),
        0 18px 32px rgba(37, 61, 78, 0.12) !important;
}

body.al_body_template_eight .related-blog-card .related-blog-img {
    height: 88px !important;
    border-radius: 12px !important;
    object-fit: cover !important;
    background: #f4faf7 !important;
}

body.al_body_template_eight .related-blog-card .related-title {
    color: #1f3344 !important;
    font-weight: 800 !important;
    font-size: 14px !important;
}

body.al_body_template_eight .related-blog-card:hover .related-title {
    color: var(--theme-deafult) !important;
}

body.al_body_template_eight .related-blog-card .text-muted.small {
    color: #6f8f7f !important;
    font-weight: 600 !important;
}

/* ==========================================================================
   Blog listing + detail banners (Template 8 only)
   ========================================================================== */
body.al_body_template_eight .nest-blog-listing-page,
body.al_body_template_eight .nest-blog-detail-page {
    background: linear-gradient(180deg, #f6faf8 0%, #ffffff 42%) !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    padding-bottom: 60px !important;
    overflow: visible !important;
}

body.al_body_template_eight .nest-blog-listing-page .main-blog-section {
    padding-top: 8px !important;
}

body.al_body_template_eight .nest-blog-detail-page > .container {
    padding-top: 8px !important;
}

body.al_body_template_eight .nest-blog-detail-page .blog-detail-content > .blog-detail-meta {
    margin-top: 22px !important;
}

/* ==========================================================================
   Blog detail page (Template 8 only)
   ========================================================================== */
body.al_body_template_eight .section-b-space:has(.blog-detail-content),
body.al_body_template_eight .nest-blog-detail-page {
    background: linear-gradient(180deg, #f6faf8 0%, #ffffff 42%) !important;
    padding-bottom: 60px !important;
    overflow: visible !important;
}

body.al_body_template_eight .nest-blog-detail-page {
    padding-top: 0 !important;
}

body.al_body_template_eight .section-b-space:has(.blog-detail-content):not(.nest-blog-detail-page) {
    padding-top: 36px !important;
}

body.al_body_template_eight .section-b-space:has(.blog-detail-content) > .container > .row,
body.al_body_template_eight .nest-blog-detail-page > .container > .row {
    overflow: visible !important;
    align-items: stretch !important;
}

/* Right sidebar column — sticky Related Posts only */
body.al_body_template_eight .section-b-space:has(.blog-detail-content) > .container > .row > .col-lg-4,
body.al_body_template_eight .nest-blog-detail-page > .container > .row > .col-lg-4 {
    position: sticky !important;
    top: 110px !important;
    align-self: flex-start !important;
    height: fit-content !important;
    z-index: 5 !important;
    overflow: visible !important;
}

body.al_body_template_eight .section-b-space:has(.blog-detail-content) > .container > .row > .col-lg-8,
body.al_body_template_eight .nest-blog-detail-page > .container > .row > .col-lg-8 {
    overflow: visible !important;
}

body.al_body_template_eight .blog-detail-content {
    background: #fff !important;
    padding: 0 0 32px !important;
    border-radius: 20px !important;
    border: 1px solid #e6ece9 !important;
    box-shadow:
        0 2px 4px rgba(37, 61, 78, 0.03),
        0 12px 32px rgba(37, 61, 78, 0.08) !important;
    overflow: visible !important;
}

body.al_body_template_eight .blog-detail-content .blog-detail_img {
    width: 100% !important;
    max-height: 460px !important;
    object-fit: cover !important;
    border-radius: 20px 20px 0 0 !important;
    margin: 0 0 0 !important;
    display: block !important;
    background: linear-gradient(180deg, #f4faf7 0%, #ffffff 100%) !important;
}

body.al_body_template_eight .blog-detail-content > h1,
body.al_body_template_eight .blog-detail-content > .blog-detail-meta,
body.al_body_template_eight .blog-detail-content > .blog-body,
body.al_body_template_eight .blog-detail-content > .blog-tags {
    padding-left: 32px !important;
    padding-right: 32px !important;
}

body.al_body_template_eight .blog-detail-content > h1 {
    font-size: 2rem !important;
    line-height: 1.3 !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
    color: #1f3344 !important;
    margin: 24px 0 16px !important;
}

body.al_body_template_eight .blog-detail-meta {
    margin-bottom: 22px !important;
    padding-bottom: 18px !important;
    border-bottom: 1px solid #eaf1ed !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
}

body.al_body_template_eight .blog-detail-meta span {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    background: #eef8f2 !important;
    border: 1px solid #d7efe2 !important;
    border-radius: 999px !important;
    padding: 6px 12px !important;
    color: #6f8f7f !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

body.al_body_template_eight .blog-detail-meta span i {
    color: var(--theme-deafult) !important;
}

body.al_body_template_eight .blog-body {
    color: #4a5560 !important;
}

body.al_body_template_eight .blog-body a,
body.al_body_template_eight .blog-body a:visited,
body.al_body_template_eight .blog-body a:hover,
body.al_body_template_eight .blog-body a:focus,
body.al_body_template_eight .blog-body a:active {
    color: var(--theme-deafult) !important;
    text-decoration: underline !important;
    font-weight: 600 !important;
}

body.al_body_template_eight .blog-body a:hover {
    text-decoration: none !important;
}

body.al_body_template_eight .blog-body p {
    margin-bottom: 18px !important;
    line-height: 1.8 !important;
    color: #5a6570 !important;
    font-size: 1.02rem !important;
}

body.al_body_template_eight .blog-body [style*="color:black"],
body.al_body_template_eight .blog-body [style*="color: black"],
body.al_body_template_eight .blog-body [style*="color:#000"],
body.al_body_template_eight .blog-body [style*="color: #000"],
body.al_body_template_eight .blog-body [style*="color:#000000"],
body.al_body_template_eight .blog-body [style*="color: #000000"],
body.al_body_template_eight .blog-body [style*="color:rgb(0,0,0)"],
body.al_body_template_eight .blog-body [style*="color:rgb(0, 0, 0)"],
body.al_body_template_eight .blog-body [style*="color: rgb(0, 0, 0)"] {
    color: #5a6570 !important;
}

body.al_body_template_eight .blog-body h2 {
    margin-top: 30px !important;
    margin-bottom: 14px !important;
    font-size: 1.55rem !important;
    font-weight: 800 !important;
    color: #1f3344 !important;
    letter-spacing: -0.01em !important;
}

body.al_body_template_eight .blog-body h3 {
    margin-top: 24px !important;
    margin-bottom: 12px !important;
    font-size: 1.28rem !important;
    font-weight: 800 !important;
    color: #253D4E !important;
}

body.al_body_template_eight .blog-body h4,
body.al_body_template_eight .blog-body h5 {
    color: #253D4E !important;
    font-weight: 700 !important;
}

body.al_body_template_eight .blog-body ul,
body.al_body_template_eight .blog-body ol {
    padding-left: 28px !important;
    margin-bottom: 18px !important;
}

body.al_body_template_eight .blog-body li {
    margin-bottom: 10px !important;
    color: #5a6570 !important;
    line-height: 1.7 !important;
}

body.al_body_template_eight .blog-body img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 14px !important;
    margin: 20px 0 !important;
    border: 1px solid #eaf1ed !important;
    box-shadow: 0 8px 22px rgba(37, 61, 78, 0.06) !important;
}

body.al_body_template_eight .blog-body blockquote {
    margin: 22px 0 !important;
    padding: 16px 20px !important;
    border-left: 4px solid var(--theme-deafult) !important;
    background: #eef8f2 !important;
    border-radius: 0 12px 12px 0 !important;
    color: #3d4f5c !important;
    font-style: italic !important;
}

body.al_body_template_eight .blog-body table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 20px 0 !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    border: 1px solid #eaf1ed !important;
}

body.al_body_template_eight .blog-body table th,
body.al_body_template_eight .blog-body table td {
    padding: 10px 12px !important;
    border: 1px solid #eaf1ed !important;
}

body.al_body_template_eight .blog-body table th {
    background: #eef8f2 !important;
    color: #1f3344 !important;
    font-weight: 700 !important;
}

body.al_body_template_eight .blog-tags {
    margin-top: 28px !important;
    padding-top: 22px !important;
    border-top: 1px solid #eaf1ed !important;
}

body.al_body_template_eight .blog-tags strong {
    display: inline-block !important;
    margin-bottom: 10px !important;
    color: #1f3344 !important;
    font-weight: 800 !important;
}

body.al_body_template_eight .blog-tag-badge {
    background: linear-gradient(180deg, #e8fbf1 0%, #def9ec 100%) !important;
    color: var(--theme-deafult) !important;
    padding: 7px 14px !important;
    border-radius: 999px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    display: inline-block !important;
    margin: 5px 8px 0 0 !important;
    border: 1px solid #bfe9d2 !important;
    box-shadow: 0 3px 8px rgba(59, 183, 126, 0.1) !important;
}

/* Related posts panel */
body.al_body_template_eight .related-blogs {
    margin-top: 0 !important;
    background: #fff !important;
    border: 1px solid #e6ece9 !important;
    border-radius: 20px !important;
    padding: 20px 18px 10px !important;
    box-shadow:
        0 2px 4px rgba(37, 61, 78, 0.03),
        0 12px 32px rgba(37, 61, 78, 0.08) !important;
    position: relative !important;
    top: auto !important;
    overflow: visible !important;
}

body.al_body_template_eight .related-blogs > h3 {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    color: #1f3344 !important;
    margin: 0 0 16px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid #eaf1ed !important;
    letter-spacing: -0.01em !important;
}

body.al_body_template_eight .related-blogs .related-blog-card {
    margin-bottom: 12px !important;
}

body.al_body_template_eight .related-blogs .related-blog-card:last-child {
    margin-bottom: 8px !important;
}

@media (max-width: 991px) {
    body.al_body_template_eight .blog-detail-content > h1,
    body.al_body_template_eight .blog-detail-content > .blog-detail-meta,
    body.al_body_template_eight .blog-detail-content > .blog-body,
    body.al_body_template_eight .blog-detail-content > .blog-tags {
        padding-left: 22px !important;
        padding-right: 22px !important;
    }

    body.al_body_template_eight .blog-detail-content > h1 {
        font-size: 1.7rem !important;
        margin-top: 20px !important;
    }

    body.al_body_template_eight .related-blogs {
        margin-top: 28px !important;
        position: relative !important;
        top: auto !important;
    }

    body.al_body_template_eight .section-b-space:has(.blog-detail-content) > .container > .row > .col-lg-4,
    body.al_body_template_eight .nest-blog-detail-page > .container > .row > .col-lg-4 {
        position: static !important;
        top: auto !important;
        align-self: auto !important;
        height: auto !important;
    }

    body.al_body_template_eight .blog-detail-content .blog-detail_img {
        max-height: 320px !important;
    }
}

@media (max-width: 575px) {
    body.al_body_template_eight .section-b-space:has(.blog-detail-content):not(.nest-blog-detail-page) {
        padding-top: 18px !important;
        padding-bottom: 36px !important;
    }

    body.al_body_template_eight .nest-blog-detail-page,
    body.al_body_template_eight .nest-blog-listing-page {
        padding-top: 0 !important;
        padding-bottom: 36px !important;
    }

    body.al_body_template_eight .blog-detail-content {
        border-radius: 16px !important;
        padding-bottom: 22px !important;
    }

    body.al_body_template_eight .blog-detail-content .blog-detail_img {
        border-radius: 16px 16px 0 0 !important;
        max-height: 240px !important;
    }

    body.al_body_template_eight .blog-detail-content > h1,
    body.al_body_template_eight .blog-detail-content > .blog-detail-meta,
    body.al_body_template_eight .blog-detail-content > .blog-body,
    body.al_body_template_eight .blog-detail-content > .blog-tags {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    body.al_body_template_eight .blog-detail-content > h1 {
        font-size: 1.45rem !important;
    }

    body.al_body_template_eight .blog-body p {
        font-size: 0.95rem !important;
    }

    body.al_body_template_eight .related-blogs {
        border-radius: 16px !important;
        padding: 16px 14px 8px !important;
    }
}

@media (max-width: 767px) {
    body.al_body_template_eight .blog-card .blog-img-container {
        height: 180px !important;
    }

    body.al_body_template_eight .blog-card .blog-title {
        font-size: 16px !important;
    }

    body.al_body_template_eight .main-blog-section .col-lg-4,
    body.al_body_template_eight .main-blog-section .col-md-6 {
        padding-bottom: 18px !important;
    }
}
