/* ============================================================
   Knowledge Base — Help Section Widget  v1.1
   ============================================================ */

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

/* ── CSS Variables ──────────────────────────────────────────── */
.kb-help-section {
    --kb-purple:       #7C3AED;
    --kb-purple-dark:  #6D28D9;
    --kb-badge-bg:     #7C3AED;
    --kb-btn-bg:       #7C3AED;
    --kb-btn-color:    #FFFFFF;
    --kb-btn-hover-bg: #6D28D9;
    --kb-btn-hover-color: #FFFFFF;
    --kb-btn-radius:   4px;
    --kb-line-color:   #E5E7EB;
    --kb-transition:   .3s cubic-bezier(.4,0,.2,1);

    font-family: 'Inter', 'Segoe UI', sans-serif;
    padding: 60px 0 40px;
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
}

/* ══════════════════════════════════════════════════════════════
   SECTION HEADER
   ══════════════════════════════════════════════════════════════ */
.kb-section__header {
    text-align: center;
    margin-bottom: 64px;
}

.kb-section__subtitle {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #6B7280;
    margin-bottom: 16px;
}

.kb-section__title {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
    margin: 0 auto;
    max-width: 680px;
}

/* ══════════════════════════════════════════════════════════════
   ITEMS LIST — LISTING
   ══════════════════════════════════════════════════════════════ */
.kb-items {
    display: flex;
    flex-direction: column;
    gap: 70px;
    position: relative;
}

/* Vertical connector line */
.kb-has-connector .kb-items::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: var(--kb-line-color);
    z-index: 0;
    pointer-events: none;
}

/* ── Single Item Row ────────────────────────────────────────── */
.kb-item {
    display: flex;
    align-items: center;
    gap: 48px;
    position: relative;
    z-index: 1;
}

/* Default: content LEFT, image RIGHT */
.kb-item__content {
    flex: 1 1 0%;
    min-width: 0;
}

.kb-item__image {
    flex: 1 1 0%;
    min-width: 0;
}

/* Reversed: image LEFT, content RIGHT */
.kb-item--reverse {
    flex-direction: row-reverse;
}

/* ── Number Badge ───────────────────────────────────────────── */
.kb-item__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--kb-badge-bg);
    color: #fff;
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 18px;
    flex-shrink: 0;
    box-shadow: 0 3px 12px rgba(124, 58, 237, .25);
}

/* ── Item Title ─────────────────────────────────────────────── */
.kb-item__title {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    margin: 0 0 14px;
}

/* ── Item Description ───────────────────────────────────────── */
.kb-item__desc {
    font-size: 15px;
    line-height: 1.72;
    color: #4B5563;
    margin: 0 0 22px;
}

/* ── Item Image ─────────────────────────────────────────────── */
.kb-item__image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    transition: transform .45s cubic-bezier(.4,0,.2,1);
}

.kb-item:hover .kb-item__image img {
    transform: scale(1.02);
}

/* ── Item Button ────────────────────────────────────────────── */
.kb-item__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--kb-btn-bg);
    color: var(--kb-btn-color);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 11px 24px;
    border-radius: var(--kb-btn-radius);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition:
        background var(--kb-transition),
        color var(--kb-transition),
        transform var(--kb-transition),
        gap var(--kb-transition);
}

.kb-item__btn:hover {
    background: var(--kb-btn-hover-bg);
    color: var(--kb-btn-hover-color);
    transform: translateY(-1px);
    gap: 12px;
}

.kb-item__btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    flex-shrink: 0;
    transition: transform var(--kb-transition);
}

.kb-item__btn:hover svg {
    transform: translateX(3px);
}

/* ══════════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════════ */
.kb-no-items {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6B7280;
    gap: 14px;
    text-align: center;
}

.kb-no-items svg {
    width: 44px;
    height: 44px;
    stroke: #A78BFA;
}

.kb-no-items p {
    font-size: 15px;
    margin: 0;
    line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════
   SECTION FOOTER
   ══════════════════════════════════════════════════════════════ */
.kb-section__footer {
    text-align: center;
    margin-top: 64px;
    padding-top: 28px;
    border-top: 1px solid #E5E7EB;
}

.kb-section__footer span {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #9CA3AF;
}

/* ══════════════════════════════════════════════════════════════
   SCROLL REVEAL ANIMATION
   ══════════════════════════════════════════════════════════════ */
.kb-item {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity .6s cubic-bezier(.4,0,.2,1), transform .6s cubic-bezier(.4,0,.2,1);
}

.kb-item.kb-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Elementor editor — disable entrance animation */
.elementor-editor-active .kb-item {
    opacity: 1 !important;
    transform: none !important;
}

/* ══════════════════════════════════════════════════════════════
   DETAIL PAGE — single-help_section.php
   ══════════════════════════════════════════════════════════════ */
.kb-detail {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    padding: 40px 20px 80px;
}

.kb-detail__container {
    max-width: 860px;
    margin: 0 auto;
}

/* Back button */
.kb-detail__back-wrap {
    margin-bottom: 32px;
}

.kb-detail__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #6B7280;
    text-decoration: none;
    padding: 8px 16px 8px 10px;
    border-radius: 6px;
    transition: color .25s ease, background .25s ease;
}

.kb-detail__back:hover {
    color: #7C3AED;
    background: #F5F3FF;
}

.kb-detail__back svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    flex-shrink: 0;
}

/* Article */
.kb-detail__article {
    background: #FFFFFF;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #E5E7EB;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .04);
}

/* Featured image */
.kb-detail__image {
    width: 100%;
    overflow: hidden;
}

.kb-detail__image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: cover;
}

/* Body */
.kb-detail__body {
    padding: 40px 48px 48px;
}

.kb-detail__title {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: 30px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    margin: 0 0 28px;
}

/* Content — style the WordPress editor output */
.kb-detail__content {
    font-size: 16px;
    line-height: 1.75;
    color: #374151;
}

.kb-detail__content p {
    margin: 0 0 18px;
}

.kb-detail__content h2 {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin: 36px 0 14px;
}

.kb-detail__content h3 {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 28px 0 12px;
}

.kb-detail__content ul,
.kb-detail__content ol {
    margin: 0 0 18px;
    padding-left: 24px;
}

.kb-detail__content li {
    margin-bottom: 8px;
}

.kb-detail__content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 20px 0;
}

.kb-detail__content a {
    color: #7C3AED;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.kb-detail__content a:hover {
    color: #6D28D9;
}

.kb-detail__content blockquote {
    border-left: 3px solid #7C3AED;
    margin: 24px 0;
    padding: 14px 20px;
    background: #F9FAFB;
    border-radius: 0 6px 6px 0;
    color: #4B5563;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — LISTING
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .kb-help-section {
        padding: 40px 20px 30px;
    }

    .kb-section__title {
        font-size: 26px;
    }

    .kb-item {
        gap: 32px;
    }

    .kb-item__title {
        font-size: 20px;
    }

    .kb-item__desc {
        font-size: 14px;
    }
}

@media (max-width: 700px) {
    .kb-item,
    .kb-item--reverse {
        flex-direction: column;
        gap: 24px;
    }

    .kb-item__content,
    .kb-item__image {
        flex: unset;
        width: 100%;
    }

    .kb-section__header {
        margin-bottom: 40px;
    }

    .kb-section__title {
        font-size: 22px;
    }

    .kb-items {
        gap: 48px;
    }

    /* Hide the connector line on mobile */
    .kb-has-connector .kb-items::before {
        display: none;
    }

    .kb-section__footer {
        margin-top: 40px;
    }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — DETAIL PAGE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 700px) {
    .kb-detail {
        padding: 24px 16px 60px;
    }

    .kb-detail__body {
        padding: 28px 24px 32px;
    }

    .kb-detail__title {
        font-size: 24px;
    }

    .kb-detail__content {
        font-size: 15px;
    }
}
