/* ReadOnce FAQ page. Builds on style.css tokens (--bg, --bg-card, --primary...). */

.faq-main {
    position: relative;
    z-index: 1;
    flex: 1 0 auto;
    width: min(880px, 100%);
    margin: 0 auto;
    padding: 1.5rem 2rem 3rem;
}

.faq-main [hidden] { display: none !important; }

.faq-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---- Hero ---- */
.faq-hero {
    text-align: center;
    padding: 1.5rem 0 1.75rem;
}

.faq-eyebrow {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-hover);
    background: var(--info-bg);
    border: 1px solid var(--info-border);
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
    margin-bottom: 1.1rem;
}

.faq-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.1;
    margin-bottom: 0.9rem;
    background: linear-gradient(180deg, #fff 30%, #a5a7f5 130%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.faq-lead {
    max-width: 560px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
}

/* ---- Search ---- */
.faq-search {
    position: relative;
    max-width: 520px;
    margin: 1.75rem auto 0;
}

.faq-search input {
    width: 100%;
    font: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.85rem 6.5rem 0.85rem 2.9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.faq-search input::placeholder { color: var(--text-dim); }

.faq-search input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.faq-search input::-webkit-search-cancel-button { display: none; }

.faq-search-icon {
    position: absolute;
    left: 1.05rem;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--text-dim);
    pointer-events: none;
}

.faq-search-count {
    position: absolute;
    right: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    pointer-events: none;
}

/* ---- Section index (chips) ---- */
.faq-index {
    position: sticky;
    top: 0;
    z-index: 5;
    /* full-bleed bar so the blurred band spans the viewport, not the column */
    margin: 0 calc(50% - 50vw) 1.5rem;
    padding: 0.75rem calc(50vw - 50%);
    background: rgba(10, 10, 15, 0.8);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(30, 30, 46, 0.7);
}

.faq-index-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
}

.faq-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex: 0 0 auto;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 500;
    padding: 0.42rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.faq-chip span {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-dim);
}

.faq-chip:hover {
    color: var(--text);
    border-color: var(--info-border);
    background: var(--bg-card-hover);
}

.faq-chip:focus-visible,
.faq-item summary:focus-visible,
.faq-a a:focus-visible,
.faq-cta .btn:focus-visible {
    outline: 2px solid var(--primary-hover);
    outline-offset: 2px;
}

/* ---- Sections ---- */
.faq-section {
    scroll-margin-top: 4.5rem;
    margin-bottom: 2.25rem;
}

.faq-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary-hover);
    margin: 0 0 0.85rem 0.25rem;
}

.faq-section h2::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
}

.faq-list {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* ---- Accordion ---- */
.faq-item {
    scroll-margin-top: 4.5rem;
    border-top: 1px solid var(--border);
    transition: background var(--transition);
}

.faq-item:first-child { border-top: 0; }

.faq-item[open] { background: rgba(99, 102, 241, 0.035); }

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.4rem;
    cursor: pointer;
    list-style: none;
    font-weight: 500;
    font-size: 0.98rem;
    line-height: 1.45;
    color: var(--text);
    transition: color var(--transition);
}

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

.faq-item summary:hover { color: #fff; }
.faq-item summary:focus-visible { outline-offset: -2px; border-radius: var(--radius-sm); }

.faq-q { min-width: 0; }

.faq-chev {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    padding: 5px;
    border-radius: 999px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    transition: transform var(--transition), color var(--transition), background var(--transition);
}

.faq-item summary:hover .faq-chev { color: var(--text); }

.faq-item[open] .faq-chev {
    transform: rotate(180deg);
    color: var(--primary-hover);
    background: var(--primary-glow);
}

.faq-item:target summary { color: var(--primary-hover); }

.faq-a {
    padding: 0 1.4rem 1.25rem;
    color: #a1a1aa;
    font-size: 0.92rem;
    line-height: 1.75;
    max-width: 68ch;
}

.faq-item[open] .faq-a { animation: faqIn 0.22s ease-out; }

@keyframes faqIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

.faq-a p + p,
.faq-a ul + p,
.faq-a p + ul { margin-top: 0.6rem; }

.faq-a ul {
    list-style: none;
    display: grid;
    gap: 0.4rem;
}

.faq-a li {
    position: relative;
    padding-left: 1.1rem;
}

.faq-a li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
}

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

.faq-a a {
    color: var(--primary-hover);
    text-decoration: underline;
    text-decoration-color: rgba(129, 140, 248, 0.35);
    text-underline-offset: 3px;
    transition: text-decoration-color var(--transition);
}

.faq-a a:hover { text-decoration-color: currentColor; }

.faq-a code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    padding: 0.05em 0.35em;
}

.faq-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 1rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}

.faq-empty a { color: var(--primary-hover); }

/* ---- Closing CTA ---- */
.faq-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 1rem;
    padding: 1.6rem 1.75rem;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(99, 102, 241, 0.16), transparent 60%),
        var(--bg-card);
    box-shadow: 0 0 0 1px var(--info-border), 0 8px 40px rgba(0, 0, 0, 0.45);
}

.faq-cta h2 {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 0.3rem;
}

.faq-cta p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.faq-cta-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    flex: 0 0 auto;
}

.faq-cta-actions .btn {
    width: auto;
    min-height: 46px;
    padding: 0.7rem 1.25rem;
    font-size: 0.92rem;
    margin: 0;
    white-space: nowrap;
}

.faq-cta-actions .btn-secondary { color: var(--text); }

/* ---- Small screens ---- */
@media (max-width: 760px) {
    .faq-cta {
        flex-direction: column;
        align-items: stretch;
    }
    .faq-cta-actions { flex-direction: column; align-items: stretch; }
    .faq-cta-actions .btn { width: 100%; }
}

@media (max-width: 640px) {
    .faq-main { padding: 0.5rem 1rem 2.5rem; }
    .faq-hero { padding: 1rem 0 1.25rem; }
    .faq-lead { font-size: 0.94rem; }

    /* One scrollable row instead of a wrapping, sticky block */
    .faq-index {
        position: static;
        margin: 0 -1rem 1.25rem;
        padding: 0.25rem 0;
        background: none;
        border-bottom: 0;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
    .faq-index-row {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0.25rem 1rem;
        scroll-padding-inline: 1rem;
        scrollbar-width: none;
        -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
        mask-image: linear-gradient(90deg, #000 85%, transparent);
    }
    .faq-index-row::-webkit-scrollbar { display: none; }

    .faq-section, .faq-item { scroll-margin-top: 1rem; }
    .faq-item summary { padding: 1rem 1.1rem; font-size: 0.95rem; }
    .faq-a { padding: 0 1.1rem 1.1rem; font-size: 0.9rem; }
    .faq-cta { padding: 1.35rem 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
    .faq-item[open] .faq-a { animation: none; }
    .faq-chev, .faq-chip, .faq-item, .faq-search input { transition: none; }
    html { scroll-behavior: auto; }
}

@media (prefers-reduced-motion: no-preference) {
    html:has(.faq-main) { scroll-behavior: smooth; }
}
