/*
 * FAQ page (Views/Faq/Index.cshtml). Brand colours come from css/brand.css,
 * so the page follows whichever palette is live. Everything is scoped to .wbf.
 */
.wbf {
    --wbf-ink: #1F2937;      /* headings, questions */
    --wbf-text: #4B5563;     /* body copy */
    --wbf-muted: #6B7280;
    --wbf-line: #E5E7EB;
    --wbf-surface: #FFFFFF;
    --wbf-chip: #F3F4F6;
    --wbf-top: 100px;        /* room for the fixed site header when jumping to an anchor */
    color: var(--wbf-text);
}

.dark-theme .wbf {
    --wbf-ink: #F3F4F6;
    --wbf-text: #D1D5DB;
    --wbf-muted: #9CA3AF;
    --wbf-line: #374151;
    --wbf-surface: #1F2937;
    --wbf-chip: #374151;
}

/* Public Sans has no Bengali letters; they fall back to Noto Sans Bengali (loaded on /Faq/bn). */
.wbf, .wbf * {
    font-family: "Public Sans", "Noto Sans Bengali", sans-serif;
}

.wbf [hidden] {
    display: none !important;
}

.wbf-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ── Hero ── */
.wbf-hero {
    background:
        radial-gradient(900px 360px at 88% -20%, rgb(var(--brand-rgb) / .12), transparent 65%),
        linear-gradient(180deg, var(--brand-softer) 0%, var(--wbf-surface) 100%);
    border-bottom: 1px solid var(--wbf-line);
    padding: 44px 0 40px;
}

.dark-theme .wbf-hero {
    background: radial-gradient(900px 360px at 88% -20%, rgb(var(--brand-rgb) / .22), transparent 65%), #111827;
}

.wbf-crumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0 0 22px;
    padding: 0;
    font-size: 14px;
    color: var(--wbf-muted);
}

    .wbf-crumbs li + li::before {
        content: "/";
        margin-right: 6px;
        color: var(--wbf-line);
    }

.wbf-crumbs a {
    color: var(--wbf-muted);
    text-decoration: none;
}

    .wbf-crumbs a:hover {
        color: var(--brand);
    }

.wbf-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--brand);
}

    .wbf-eyebrow::before {
        content: "";
        width: 24px;
        height: 2px;
        border-radius: 2px;
        background: var(--brand);
    }

.wbf-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(30px, 4.4vw, 46px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.02em;
    color: var(--wbf-ink);
}

.wbf-lead {
    max-width: 660px;
    margin: 0;
    font-size: 18px;
    line-height: 1.65;
    color: var(--wbf-text);
}

.wbf-search {
    position: relative;
    max-width: 580px;
    margin-top: 28px;
}

    .wbf-search svg {
        position: absolute;
        top: 50%;
        left: 18px;
        transform: translateY(-50%);
        color: var(--wbf-muted);
        pointer-events: none;
    }

    .wbf-search input {
        width: 100%;
        height: 56px;
        padding: 0 20px 0 50px;
        border: 1px solid var(--wbf-line);
        border-radius: 14px;
        background: var(--wbf-surface);
        box-shadow: 0 1px 2px rgb(16 24 40 / .05), 0 10px 28px rgb(16 24 40 / .07);
        font-size: 16px;
        color: var(--wbf-ink);
        -webkit-appearance: none;
        appearance: none;
    }

        .wbf-search input::placeholder {
            color: var(--wbf-muted);
        }

        .wbf-search input:focus {
            outline: none;
            border-color: var(--brand);
            box-shadow: 0 0 0 4px rgb(var(--brand-rgb) / .16);
        }

.wbf-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 16px 0 0;
    font-size: 14px;
    color: var(--wbf-muted);
}

/* ── Topics + questions ── */
.wbf-body {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
    padding-top: 44px;
    padding-bottom: 24px;
}

.wbf-topics {
    position: sticky;
    top: var(--wbf-top);
}

    .wbf-topics p {
        margin: 0 0 10px 14px;
        font-size: 12px;
        font-weight: 600;
        letter-spacing: .08em;
        text-transform: uppercase;
        color: var(--wbf-muted);
    }

    .wbf-topics ol {
        display: flex;
        flex-direction: column;
        gap: 2px;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .wbf-topics a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 9px 14px;
        border-radius: 10px;
        font-size: 15px;
        font-weight: 500;
        color: var(--wbf-text);
        text-decoration: none;
        transition: background .15s, color .15s;
    }

        .wbf-topics a:hover,
        .wbf-topics a[aria-current="true"] {
            background: var(--brand-soft);
            color: var(--brand);
        }

        .wbf-topics a:focus-visible {
            outline: 2px solid var(--brand);
            outline-offset: 2px;
        }

.wbf-count {
    min-width: 24px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--wbf-chip);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    color: var(--wbf-muted);
}

.wbf-topic {
    scroll-margin-top: var(--wbf-top);
}

    .wbf-topic + .wbf-topic {
        margin-top: 44px;
    }

    .wbf-topic h2 {
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 0 0 16px;
        font-size: 22px;
        font-weight: 700;
        line-height: 1.3;
        color: var(--wbf-ink);
    }

.wbf-icon {
    display: inline-flex;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--brand-soft);
    color: var(--brand);
}

.wbf-list {
    overflow: hidden;
    border: 1px solid var(--wbf-line);
    border-radius: 16px;
    background: var(--wbf-surface);
    box-shadow: 0 1px 2px rgb(16 24 40 / .04);
}

.wbf-item {
    border-top: 1px solid var(--wbf-line);
    scroll-margin-top: var(--wbf-top);
}

    .wbf-item:first-child {
        border-top: 0;
    }

    .wbf-item > summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 19px 22px;
        list-style: none;
        cursor: pointer;
    }

        .wbf-item > summary::-webkit-details-marker {
            display: none;
        }

        .wbf-item > summary:focus-visible {
            outline: 2px solid var(--brand);
            outline-offset: -2px;
            border-radius: 14px;
        }

.wbf-q {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--wbf-ink);
    transition: color .15s;
}

.wbf-item > summary:hover .wbf-q,
.wbf-item[open] .wbf-q {
    color: var(--brand);
}

.wbf-chevron {
    display: inline-flex;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--wbf-chip);
    color: var(--wbf-muted);
    transition: transform .25s ease, background .2s, color .2s;
}

.wbf-item[open] .wbf-chevron {
    transform: rotate(180deg);
    background: var(--brand);
    color: #fff;
}

.wbf-a {
    max-width: 76ch;
    padding: 0 22px 22px;
    font-size: 16px;
    line-height: 1.75;
    color: var(--wbf-text);
}

    .wbf-a p,
    .wbf-a ul,
    .wbf-a ol {
        margin: 0 0 12px;
    }

    .wbf-a ul,
    .wbf-a ol {
        padding-left: 22px;
    }

    .wbf-a li {
        margin: 4px 0;
    }

    .wbf-a strong {
        font-weight: 600;
        color: var(--wbf-ink);
    }

    .wbf-a a {
        color: var(--brand);
        text-decoration: underline;
        text-decoration-thickness: 1px;
        text-underline-offset: 3px;
    }

        .wbf-a a:hover {
            color: var(--brand-hover);
        }

.wbf-permalink {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: 13px;
    color: var(--wbf-muted) !important;
    text-decoration: none !important;
}

    .wbf-permalink:hover {
        color: var(--brand) !important;
    }

/* Smooth open/close where the browser can animate to height:auto; elsewhere it just opens. */
@supports (interpolate-size: allow-keywords) {
    .wbf {
        interpolate-size: allow-keywords;
    }

    .wbf-item::details-content {
        block-size: 0;
        overflow: hidden;
        transition: block-size .28s ease, content-visibility .28s allow-discrete;
    }

    .wbf-item[open]::details-content {
        block-size: auto;
    }
}

.wbf-empty {
    padding: 36px 24px;
    border: 1px dashed var(--wbf-line);
    border-radius: 16px;
    text-align: center;
    color: var(--wbf-muted);
}

    .wbf-empty strong {
        display: block;
        margin-bottom: 6px;
        font-size: 17px;
        color: var(--wbf-ink);
    }

/* ── Still have a question ── */
.wbf-help {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    margin: 32px 0 72px;
    padding: 32px;
    border: 1px solid rgb(var(--brand-rgb) / .22);
    border-radius: 20px;
    background: linear-gradient(135deg, var(--brand-softer), var(--brand-soft));
}

.dark-theme .wbf-help {
    background: rgb(var(--brand-rgb) / .14);
}

.wbf-help h2 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    color: var(--wbf-ink);
}

.wbf-help p {
    margin: 0;
    font-size: 16px;
    line-height: 1.65;
}

.wbf-help a:not(.wbf-btn) {
    color: var(--brand);
    font-weight: 600;
}

.wbf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.wbf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 22px;
    border: 1.5px solid var(--brand);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background .15s, color .15s, transform .15s;
}

    .wbf-btn:hover {
        transform: translateY(-1px);
    }

    .wbf-btn:focus-visible {
        outline: 2px solid var(--brand);
        outline-offset: 3px;
    }

.wbf-btn-primary {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
    color: #fff !important;
}

    .wbf-btn-primary:hover {
        background: var(--brand);
    }

.wbf-btn-ghost {
    background: var(--wbf-surface);
    color: var(--brand) !important;
}

    .wbf-btn-ghost:hover {
        background: var(--brand-softer);
    }

/* ── Small screens: topics become a scrolling chip row ── */
@media (max-width: 991px) {
    .wbf-body {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
        padding-top: 28px;
    }

    .wbf-topics {
        position: static;
    }

        .wbf-topics p {
            display: none;
        }

        .wbf-topics ol {
            flex-direction: row;
            gap: 8px;
            overflow-x: auto;
            margin: 0 -15px;
            padding: 2px 15px 6px;
            scrollbar-width: none;
        }

            .wbf-topics ol::-webkit-scrollbar {
                display: none;
            }

        .wbf-topics a {
            padding: 8px 14px;
            border: 1px solid var(--wbf-line);
            border-radius: 999px;
            background: var(--wbf-surface);
            white-space: nowrap;
        }

    .wbf-help {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 575px) {
    .wbf-hero {
        padding: 28px 0 30px;
    }

    .wbf-lead {
        font-size: 16px;
    }

    .wbf-item > summary {
        padding: 16px 16px;
    }

    .wbf-q {
        font-size: 16px;
    }

    .wbf-a {
        padding: 0 16px 18px;
        font-size: 15px;
    }

    .wbf-help {
        padding: 24px;
    }

    .wbf-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wbf *,
    .wbf-item::details-content {
        transition: none !important;
    }
}
