/*
|--------------------------------------------------------------------------
| ToolVerse - FAQ
|--------------------------------------------------------------------------
| Scope:
| - ONLY .tv-faq
| - No CSS leakage
| - Accessible accordion styling
| - Responsive
|--------------------------------------------------------------------------
*/


/* ==========================================================================
   SECTION
   ========================================================================== */

.tv-faq {
    position: relative;

    width: 100%;

    padding:
        84px
        0
        90px;

    overflow: hidden;

    background:
        linear-gradient(
            180deg,
            #f8faff 0%,
            #ffffff 100%
        );
}


/* ==========================================================================
   LAYOUT
   ========================================================================== */

.tv-faq__layout {
    display: grid;

    grid-template-columns:
        minmax(0, 0.82fr)
        minmax(480px, 1.18fr);

    align-items: start;

    gap: 64px;
}


/* ==========================================================================
   INTRO
   ========================================================================== */

.tv-faq__intro {
    position: sticky;

    top:
        calc(
            var(--tv-header-height)
            + 26px
        );

    min-width: 0;
}


/* ==========================================================================
   EYEBROW
   ========================================================================== */

.tv-faq__eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 30px;

    padding:
        0
        11px;

    border:
        1px solid
        rgba(99, 91, 255, 0.13);

    border-radius: 999px;

    background:
        var(--tv-color-primary-soft);

    color:
        var(--tv-color-primary-dark);

    font-size: 10px;
    font-weight: 750;

    line-height: 1;

    letter-spacing: 0.2px;
}


/* ==========================================================================
   TITLE
   ========================================================================== */

.tv-faq__title {
    max-width: 520px;

    margin:
        14px
        0
        0;

    color:
        var(--tv-color-heading);

    font-size:
        clamp(
            30px,
            3.3vw,
            43px
        );

    font-weight: 820;

    line-height: 1.12;

    letter-spacing: -1.45px;
}


/* ==========================================================================
   DESCRIPTION
   ========================================================================== */

.tv-faq__description {
    max-width: 520px;

    margin:
        14px
        0
        0;

    color:
        var(--tv-color-muted);

    font-size: 14px;
    font-weight: 400;

    line-height: 1.75;
}


/* ==========================================================================
   HELP CARD
   ========================================================================== */

.tv-faq__help {
    display: flex;
    align-items: flex-start;

    gap: 13px;

    max-width: 520px;

    margin-top: 28px;

    padding:
        17px
        18px;

    border:
        1px solid
        rgba(99, 91, 255, 0.10);

    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            #f8f7ff,
            #ffffff
        );
}


/* ==========================================================================
   HELP ICON
   ========================================================================== */

.tv-faq__help-icon {
    display: grid;
    place-items: center;

    width: 40px;
    height: 40px;

    flex:
        0
        0
        40px;

    border-radius: 12px;

    background:
        #ffffff;

    color:
        var(--tv-color-primary);

    box-shadow:
        0 4px 12px
        rgba(16, 24, 40, 0.045);
}

.tv-faq__help-icon svg {
    width: 20px;
    height: 20px;

    fill: none;

    stroke: currentColor;
    stroke-width: 1.8;

    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ==========================================================================
   HELP CONTENT
   ========================================================================== */

.tv-faq__help > div {
    min-width: 0;
}

.tv-faq__help strong {
    display: block;

    color:
        var(--tv-color-heading);

    font-size: 11px;
    font-weight: 770;

    line-height: 1.4;
}

.tv-faq__help p {
    margin:
        4px
        0
        0;

    color:
        var(--tv-color-muted);

    font-size: 10px;
    font-weight: 400;

    line-height: 1.55;
}

.tv-faq__help a {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    margin-top: 9px;

    color:
        var(--tv-color-primary);

    font-size: 10px;
    font-weight: 750;

    line-height: 1;
}

.tv-faq__help a > span {
    font-size: 13px;

    transition:
        transform 160ms ease;
}

.tv-faq__help a:hover > span {
    transform:
        translateX(3px);
}


/* ==========================================================================
   FAQ ITEMS
   ========================================================================== */

.tv-faq__items {
    display: grid;

    gap: 10px;
}


/* ==========================================================================
   FAQ ITEM
   ========================================================================== */

.tv-faq__item {
    overflow: hidden;

    border:
        1px solid
        rgba(222, 227, 235, 0.96);

    border-radius: 17px;

    background:
        #ffffff;

    box-shadow:
        0 5px 16px
        rgba(16, 24, 40, 0.035);

    transition:
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.tv-faq__item:hover {
    border-color:
        rgba(99, 91, 255, 0.17);

    box-shadow:
        0 8px 20px
        rgba(16, 24, 40, 0.05);
}

.tv-faq__item.is-open {
    border-color:
        rgba(99, 91, 255, 0.18);

    box-shadow:
        0 9px 24px
        rgba(16, 24, 40, 0.055);
}


/* ==========================================================================
   QUESTION WRAPPER
   ========================================================================== */

.tv-faq__question {
    margin: 0;
}


/* ==========================================================================
   QUESTION BUTTON
   ========================================================================== */

.tv-faq__button {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    width: 100%;

    min-height: 74px;

    padding:
        18px
        19px;

    border: 0;

    background:
        transparent;

    color:
        var(--tv-color-heading);

    text-align: left;

    font-size: 13px;
    font-weight: 760;

    line-height: 1.45;

    transition:
        color 160ms ease,
        background-color 160ms ease;
}

.tv-faq__button:hover {
    background:
        #fbfcff;
}

.tv-faq__item.is-open
.tv-faq__button {
    color:
        var(--tv-color-primary-dark);
}


/* ==========================================================================
   TOGGLE ICON
   ========================================================================== */

.tv-faq__toggle {
    position: relative;

    width: 30px;
    height: 30px;

    flex:
        0
        0
        30px;

    border:
        1px solid
        var(--tv-color-border);

    border-radius: 10px;

    background:
        #fafbfc;

    transition:
        background-color 180ms ease,
        border-color 180ms ease;
}

.tv-faq__toggle::before,
.tv-faq__toggle::after {
    content: "";

    position: absolute;

    top: 50%;
    left: 50%;

    width: 12px;
    height: 2px;

    border-radius: 999px;

    background:
        #667085;

    transform:
        translate(
            -50%,
            -50%
        );

    transition:
        transform 180ms ease,
        background-color 180ms ease;
}

.tv-faq__toggle::after {
    transform:
        translate(
            -50%,
            -50%
        )
        rotate(90deg);
}

.tv-faq__item.is-open
.tv-faq__toggle {
    border-color:
        rgba(99, 91, 255, 0.17);

    background:
        var(--tv-color-primary-soft);
}

.tv-faq__item.is-open
.tv-faq__toggle::before,
.tv-faq__item.is-open
.tv-faq__toggle::after {
    background:
        var(--tv-color-primary);
}

.tv-faq__item.is-open
.tv-faq__toggle::after {
    transform:
        translate(
            -50%,
            -50%
        )
        rotate(0deg);
}


/* ==========================================================================
   ANSWER
   ========================================================================== */

.tv-faq__answer {
    overflow: hidden;
}

.tv-faq__answer[hidden] {
    display: none;
}

.tv-faq__answer-inner {
    padding:
        0
        19px
        19px;
}

.tv-faq__answer-inner p {
    max-width: 680px;

    margin: 0;

    padding-top: 2px;

    color:
        var(--tv-color-muted);

    font-size: 11px;
    font-weight: 400;

    line-height: 1.75;
}


/* ==========================================================================
   FOCUS
   ========================================================================== */

.tv-faq__button:focus-visible {
    position: relative;

    z-index: 2;

    outline:
        3px solid
        rgba(99, 91, 255, 0.20);

    outline-offset: -3px;
}


/* ==========================================================================
   TABLET
   ========================================================================== */

@media (max-width: 1024px) {

    .tv-faq {
        padding:
            70px
            0
            76px;
    }

    .tv-faq__layout {
        grid-template-columns: 1fr;

        gap: 38px;
    }

    .tv-faq__intro {
        position: static;

        max-width: 720px;
    }

    .tv-faq__title {
        max-width: 620px;
    }

    .tv-faq__description {
        max-width: 640px;
    }

    .tv-faq__help {
        max-width: 620px;
    }
}


/* ==========================================================================
   MOBILE
   ========================================================================== */

@media (max-width: 640px) {

    .tv-faq {
        padding:
            52px
            0
            58px;
    }

    .tv-faq__layout {
        gap: 28px;
    }

    .tv-faq__eyebrow {
        min-height: 28px;

        font-size: 9px;
    }

    .tv-faq__title {
        margin-top: 12px;

        font-size:
            clamp(
                25px,
                7.5vw,
                32px
            );

        letter-spacing: -1px;
    }

    .tv-faq__description {
        margin-top: 10px;

        font-size: 12px;

        line-height: 1.65;
    }

    .tv-faq__help {
        margin-top: 22px;

        padding:
            14px
            15px;

        border-radius: 14px;
    }

    .tv-faq__help-icon {
        width: 37px;
        height: 37px;

        flex-basis: 37px;
    }

    .tv-faq__items {
        gap: 9px;
    }

    .tv-faq__item {
        border-radius: 15px;
    }

    .tv-faq__button {
        min-height: 68px;

        gap: 15px;

        padding:
            16px
            15px;

        font-size: 12px;
    }

    .tv-faq__toggle {
        width: 28px;
        height: 28px;

        flex-basis: 28px;

        border-radius: 9px;
    }

    .tv-faq__answer-inner {
        padding:
            0
            15px
            16px;
    }

    .tv-faq__answer-inner p {
        font-size: 10px;

        line-height: 1.7;
    }
}


/* ==========================================================================
   SMALL MOBILE
   ========================================================================== */

@media (max-width: 400px) {

    .tv-faq {
        padding:
            46px
            0
            52px;
    }

    .tv-faq__title {
        font-size: 25px;
    }

    .tv-faq__button {
        padding:
            15px
            14px;
    }

    .tv-faq__answer-inner {
        padding:
            0
            14px
            15px;
    }
}


/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    .tv-faq__help a > span,
    .tv-faq__item,
    .tv-faq__button,
    .tv-faq__toggle,
    .tv-faq__toggle::before,
    .tv-faq__toggle::after {
        transition: none;
    }

    .tv-faq__help a:hover > span {
        transform: none;
    }
}