/* ==========================================================================
   FAQ page (.page-faq)
   ========================================================================== */

.faq-page {
    display: flex;
    justify-content: center;
    padding: 56px 24px 96px;
}

.faq-shell {
    width: 100%;
    max-width: 760px;
}

/* ---- Hero ---- */

.faq-hero {
    text-align: center;
    margin-bottom: 40px;
}

.faq-hero .sui-lead {
    max-width: 520px;
    margin: 16px auto 0;
}

/* ---- Section nav ---- */

.faq-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 44px;
    padding-bottom: 4px;
}

.faq-nav__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--l-muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.faq-nav__link:hover {
    color: var(--l-text);
    background: var(--l-raise);
}

.faq-nav__link.is-active {
    color: var(--l-text);
    background: var(--l-card);
    border-color: var(--l-border-strong);
    font-weight: 600;
}

/* ---- Accordion list ---- */

.faq-list {
    border-top: 1px solid var(--l-border);
}

.faq-item {
    border-bottom: 1px solid var(--l-border);
}

.faq-item h2 {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
}

.faq-item__question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 23px 4px;
    border: 0;
    background: transparent;
    color: var(--l-text);
    font-family: inherit;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.45;
    text-align: left;
    cursor: pointer;
    transition: color 0.18s ease;
}

.faq-item__question:hover {
    color: var(--l-accent-hover);
}

html[data-theme="dark"] .faq-item__question:hover {
    color: #C4B5FD;
}

.faq-item__question i {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--l-dim);
    font-size: 11px;
    transition: transform 0.25s ease, color 0.18s ease, background-color 0.18s ease;
}

.faq-item__question:hover i {
    color: var(--l-accent-hover);
    background: var(--l-accent-soft);
}

html[data-theme="dark"] .faq-item__question:hover i {
    color: #C4B5FD;
}

.faq-item.is-open .faq-item__question i {
    transform: rotate(180deg);
    color: var(--l-accent-hover);
    background: var(--l-accent-soft);
}

html[data-theme="dark"] .faq-item.is-open .faq-item__question i {
    color: #C4B5FD;
}

.faq-item__answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.28s ease;
}

.faq-item.is-open .faq-item__answer {
    grid-template-rows: 1fr;
}

.faq-item__answer-inner {
    overflow: hidden;
}

.faq-item__answer-inner p {
    margin: 0;
    padding: 0 4px 24px;
    max-width: 640px;
    color: var(--l-muted);
    font-size: 15px;
    line-height: 1.7;
}

.faq-item__answer-inner .faq-inline-link,
.faq-item__answer-inner a.faq-inline-link {
    color: var(--l-accent);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 0.18s ease;
}

.faq-item__answer-inner .faq-inline-link:hover,
.faq-item__answer-inner a.faq-inline-link:hover {
    color: var(--l-accent-hover);
}

html[data-theme="dark"] .faq-item__answer-inner .faq-inline-link,
html[data-theme="dark"] .faq-item__answer-inner a.faq-inline-link {
    color: #A78BFA;
}

html[data-theme="dark"] .faq-item__answer-inner .faq-inline-link:hover,
html[data-theme="dark"] .faq-item__answer-inner a.faq-inline-link:hover {
    color: #C4B5FD;
}

.faq-empty {
    padding: 48px 8px;
    text-align: center;
}

.faq-empty p {
    margin: 0;
    color: var(--l-muted);
    font-size: 15px;
    line-height: 1.6;
}

/* ---- Reveal ---- */

@keyframes reveal-in {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.page-faq [data-reveal],
.page-faq [data-reveal-group] > * {
    opacity: 0;
}

.page-faq [data-reveal].is-visible {
    opacity: 1;
    animation: reveal-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.page-faq [data-reveal-group].is-visible > * {
    opacity: 1;
    animation: reveal-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.page-faq [data-reveal-group].is-visible > *:nth-child(1) { animation-delay: 0ms; }
.page-faq [data-reveal-group].is-visible > *:nth-child(2) { animation-delay: 60ms; }
.page-faq [data-reveal-group].is-visible > *:nth-child(3) { animation-delay: 120ms; }
.page-faq [data-reveal-group].is-visible > *:nth-child(4) { animation-delay: 180ms; }
.page-faq [data-reveal-group].is-visible > *:nth-child(5) { animation-delay: 240ms; }
.page-faq [data-reveal-group].is-visible > *:nth-child(6) { animation-delay: 300ms; }
.page-faq [data-reveal-group].is-visible > *:nth-child(n + 7) { animation-delay: 360ms; }

/* ---- Responsive ---- */

@media (max-width: 767px) {
    .faq-page {
        padding: 40px 16px 72px;
    }

    .faq-hero {
        margin-bottom: 28px;
    }

    .faq-nav {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        margin: 0 -16px 32px;
        padding: 0 16px 8px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .faq-nav::-webkit-scrollbar {
        display: none;
    }

    .faq-item__question {
        padding: 19px 0;
        font-size: 16px;
        gap: 16px;
    }

    .faq-item__answer-inner p {
        padding-bottom: 19px;
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-faq [data-reveal],
    .page-faq [data-reveal-group] > * {
        opacity: 1;
        animation: none;
    }

    .faq-item__answer,
    .faq-item__question i,
    .faq-item__question,
    .faq-nav__link {
        transition: none;
    }
}
