/* ── FAQ page styles (extends ../style.css) ── */

.hero-compact {
    padding: 64px 24px 32px;
}

.hero-compact h1 {
    font-size: 2.4rem;
}

/* ── Wrap & Grid ── */
.faq-wrap {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 32px 100px;
    animation: fadeUp 0.5s var(--ease);
}

.faq-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 32px;
    align-items: start;
}

/* ── Sidebar ── */
.faq-side {
    position: sticky;
    top: 88px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-toc {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.faq-toc-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--fg-55);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 6px 10px 10px;
}

.faq-toc-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--fg-70);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.18s;
}

.faq-toc-link:hover {
    color: var(--fg);
    background: var(--surface-2);
}

.faq-toc-link.active {
    background: var(--fg);
    color: var(--bg);
}

.faq-toc-link.active svg {
    color: var(--bg);
}

/* re-icon sizing inside the TOC */
.faq-toc-link re-icon {
    font-size: 14px;
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    flex-shrink: 0;
    color: inherit;
}

.faq-toc-link re-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ── Help block ── */
.faq-help .panel-body {
    padding: 14px 18px 16px;
}

.faq-help-text {
    font-size: 0.84rem;
    color: var(--fg-70);
    line-height: 1.5;
    margin-bottom: 12px;
}

.faq-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--fg);
    color: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.faq-cta:hover {
    background: rgba(245, 245, 245, 0.9);
    transform: translateX(2px);
}

/* ── Sections ── */
.faq-main {
    display: flex;
    flex-direction: column;
    gap: 36px;
    min-width: 0;
}

.faq-section {
    scroll-margin-top: 96px;
}

.faq-section-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* ── Accordion item ── */
.faq-item {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.faq-item:hover {
    border-color: var(--border-hover);
}

.faq-item[open] {
    border-color: var(--border-hover);
    background: var(--surface-2);
}

.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    user-select: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-q {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--fg);
    line-height: 1.4;
    flex: 1;
}

.faq-toggle {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-55);
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: transparent;
    transition: all 0.25s var(--ease);
}

.faq-item[open] .faq-toggle {
    transform: rotate(180deg);
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}

.faq-a {
    padding: 0 22px 22px;
    color: var(--fg-70);
    font-size: 0.92rem;
    line-height: 1.7;
    animation: fadeIn 0.25s var(--ease);
}

.faq-a>p+p {
    margin-top: 10px;
}

.faq-a ul {
    margin: 8px 0 8px 18px;
    padding-left: 4px;
}

.faq-a li {
    margin-bottom: 4px;
}

.faq-a strong {
    color: var(--fg);
    font-weight: 600;
}

.faq-a a {
    color: var(--fg);
    text-decoration: underline;
    text-decoration-color: var(--fg-25);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s;
}

.faq-a a:hover {
    text-decoration-color: var(--fg);
}

.faq-a code {
    font-family: "SF Mono", "JetBrains Mono", "Fira Code", monospace;
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.84em;
    color: var(--fg);
    border: 1px solid var(--border);
}

.faq-a pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin: 10px 0;
    overflow-x: auto;
}

.faq-a pre code {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--fg-70);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Empty state ── */
.faq-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--fg-55);
    font-size: 0.92rem;
}

/* ── Search bar — Expand all button (matches primary action style) ── */
.search-bar #expand-all-btn {
    background: var(--fg);
    color: var(--bg);
    border: none;
}

.search-bar #expand-all-btn:hover {
    background: rgba(245, 245, 245, 0.9);
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .faq-grid {
        grid-template-columns: 1fr;
    }

    .faq-side {
        position: static;
    }

    .faq-toc {
        flex-direction: row;
        flex-wrap: wrap;
        overflow-x: auto;
    }

    .faq-toc-title {
        width: 100%;
        padding: 4px 6px 8px;
    }

    .faq-help {
        display: none;
    }
}

@media (max-width: 580px) {
    .faq-wrap {
        padding: 0 20px 60px;
    }

    .hero-compact h1 {
        font-size: 1.85rem;
    }

    .faq-section-title {
        font-size: 1.2rem;
    }

    .faq-q {
        font-size: 0.92rem;
    }

    .faq-item summary {
        padding: 16px 18px;
    }

    .faq-a {
        padding: 0 18px 18px;
    }
}