/**
 * Pillar Scroll Menu Styles
 * BS. Tăng Đức Cương
 */

.pillar-scroll-menu-wrap {
    width: 100%;
}

/* Standalone container styles (nếu không nằm trong .toc-box của Flatsome) */
.pillar-scroll-menu-wrap.toc-box {
    background: var(--soft-bg, #F0F8FA);
    border-left: 4px solid var(--primary, #048996);
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 40px;
    box-sizing: border-box;
}

/* Nếu shortcode được đặt bên trong 1 row/div đã có class .toc-box thì bỏ bọc trùng */
.toc-box .pillar-scroll-menu-wrap.toc-box {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.pillar-scroll-menu-wrap .toc-title,
.toc-title {
    display: none !important;
}

.pillar-scroll-menu-wrap .toc-list {
    list-style: none;
    counter-reset: toc;
    margin: 0;
    padding: 0;
}

.pillar-scroll-menu-wrap .toc-list li.pillar-toc-item {
    counter-increment: toc;
    padding: 10px 0;
    font-size: 16px;
    color: var(--gray-text, #4A5C63);
    cursor: pointer;
    border-bottom: 1px dashed var(--border, #E1E8EB);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    user-select: none;
}

.pillar-scroll-menu-wrap .toc-list li.pillar-toc-item:last-child {
    border-bottom: none;
}

/* Numbered Circle */
.pillar-scroll-menu-wrap .toc-list li.pillar-toc-item::before {
    content: counter(toc);
    width: 28px;
    height: 28px;
    background: #fff;
    color: var(--primary, #048996);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    border: 1.5px solid var(--accent, #BFECF7);
    flex-shrink: 0;
    transition: all 0.25s ease;
}

/* Link */
.pillar-scroll-menu-wrap .toc-list li.pillar-toc-item a.pillar-toc-link {
    color: var(--gray-text, #4A5C63);
    text-decoration: none;
    flex: 1;
    display: block;
    line-height: 1.45;
    transition: color 0.2s ease, transform 0.2s ease;
}

/* Hover State */
.pillar-scroll-menu-wrap .toc-list li.pillar-toc-item:hover {
    color: var(--primary, #048996);
}

.pillar-scroll-menu-wrap .toc-list li.pillar-toc-item:hover a.pillar-toc-link {
    color: var(--primary, #048996);
    transform: translateX(4px);
}

.pillar-scroll-menu-wrap .toc-list li.pillar-toc-item:hover::before {
    background: var(--primary, #048996);
    color: #fff;
    border-color: var(--primary, #048996);
    transform: scale(1.08);
}

/* Active State (ScrollSpy) */
.pillar-scroll-menu-wrap .toc-list li.pillar-toc-item.is-active a.pillar-toc-link {
    color: var(--primary, #048996);
    font-weight: 700;
}

.pillar-scroll-menu-wrap .toc-list li.pillar-toc-item.is-active::before {
    background: var(--primary, #048996);
    color: #fff;
    border-color: var(--primary, #048996);
    box-shadow: 0 0 0 3px var(--accent-soft, #E8F8FA);
}

/* Scroll margin top cho mục tiêu cuộn không bị che bởi sticky header */
.pillar-section,
.pillar-section-title,
[id^="pillar-sec-"] {
    scroll-margin-top: 100px;
}

@media (max-width: 849px) {
    .pillar-scroll-menu-wrap.toc-box {
        padding: 20px 20px;
        margin-bottom: 28px;
    }
    .pillar-scroll-menu-wrap .toc-title {
        font-size: 16px;
    }
    .pillar-scroll-menu-wrap .toc-list li.pillar-toc-item {
        font-size: 15px;
        padding: 9px 0;
        gap: 10px;
    }
    .pillar-section,
    .pillar-section-title,
    [id^="pillar-sec-"] {
        scroll-margin-top: 80px;
    }
}

/* ============================================================
   XC IVF POST — Flatsome [blog_posts] Card Style (Pillar Knowledge)
   ============================================================ */
.row.xc-ivf-post {
    margin-left: -6px !important;
    margin-right: -6px !important;
    margin-bottom: 20px !important;
}
.row.xc-ivf-post > .col {
    padding-left: 6px !important;
    padding-right: 6px !important;
    padding-bottom: 12px !important;
}
.row.xc-ivf-post .box-image,
.row.xc-ivf-post .is-divider,
.row.xc-ivf-post .post-meta,
.row.xc-ivf-post .badge {
    display: none !important;
}
.row.xc-ivf-post .col-inner {
    height: 100% !important;
}
.row.xc-ivf-post .box-blog-post {
    background: var(--soft-bg, #F0F8FA) !important;
    border-radius: 10px !important;
    padding: 14px 18px !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
}
.row.xc-ivf-post .box-blog-post:hover {
    background: var(--primary-light, #E8F8FA) !important;
    border-color: rgba(4, 137, 150, 0.2) !important;
    transform: translateY(-1px) !important;
}
.row.xc-ivf-post .box-text {
    padding: 0 !important;
    text-align: left !important;
    width: 100% !important;
}
.row.xc-ivf-post .blog-post-inner {
    padding: 0 !important;
    margin: 0 !important;
}
.row.xc-ivf-post .post-title {
    margin: 0 !important;
    font-size: 15px !important;
    line-height: 1.45 !important;
    font-weight: 500 !important;
    font-family: 'Averta', sans-serif !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}
.row.xc-ivf-post .post-title a {
    color: var(--dark, #000F15) !important;
    text-decoration: none !important;
    display: block !important;
    transition: color 0.2s ease !important;
}
.row.xc-ivf-post .box-blog-post:hover .post-title a {
    color: var(--primary, #048996) !important;
}

@media (max-width: 549px) {
    .row.xc-ivf-post {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .row.xc-ivf-post > .col {
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 8px !important;
    }
    .row.xc-ivf-post .box-blog-post {
        padding: 12px 16px !important;
    }
    .row.xc-ivf-post .post-title {
        font-size: 14px !important;
    }
}
