/*<--------------------------------------------------->
<!-- FAQ (section component)                        -->
<!----------------------------------------------------->
* Description:
    Frequently-asked-questions section for #faq.
    Grouped by category with a borderless accordion
    using native <details>/<summary>. Smooth bidirectional
    animation via CSS grid-template-rows trick +
    @starting-style for entry. JS handles closing so the
    transition completes before [open] is removed.
* Dependencies:
    - style.css (custom properties, sectionHeader, .content)
    - faq.js (smooth closing animation)
--------------------------------------------------->*/

/*###################################################*/
/*...................................................*/
/* faq shell                                         */
/*...................................................*/
/*###################################################*/

.faq {
    display: flex;
    align-items: center;
    justify-content: center;
}

.faq > .content {
    display: flex;
    flex-direction: column;
}

.faq .sectionHeader {
    width: 100%;
    max-width: 52rem;

    @media (min-width: 991px) {
        max-width: none;
    }
}

/*###################################################*/
/*...................................................*/
/* end faq shell                                     */
/*...................................................*/
/*###################################################*/


/*###################################################*/
/*...................................................*/
/* faq body                                          */
/*...................................................*/
/*###################################################*/

.faqBody {
    width: 100%;
    max-width: 52rem;
    margin-right: auto;
    margin-left: auto;
    padding: 2rem 0.5rem 5rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;

    @media (min-width: 768px) {
        padding: 3rem 2rem 8rem;
        gap: 4rem;
    }
}

/*###################################################*/
/*...................................................*/
/* end faq body                                      */
/*...................................................*/
/*###################################################*/


/*###################################################*/
/*...................................................*/
/* faq group                                         */
/*...................................................*/
/*###################################################*/

.faqGroup {
    display: flex;
    flex-direction: column;
}

.faqGroupLabel {
    margin: 0 0 1.5rem;
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.faqList {
    display: flex;
    flex-direction: column;
}

/*###################################################*/
/*...................................................*/
/* end faq group                                     */
/*...................................................*/
/*###################################################*/


/*###################################################*/
/*...................................................*/
/* faq item — <details> / <summary>                  */
/*...................................................*/
/*###################################################*/

.faqItem {
    border-top: 1px solid rgba(255, 255, 255, 0.07);

    &:last-child {
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    }
}

/* Remove browser default triangle marker */
.faqItem > summary {
    list-style: none;
}
.faqItem > summary::-webkit-details-marker {
    display: none;
}

/*###################################################*/
/*...................................................*/
/* end faq item                                      */
/*...................................................*/
/*###################################################*/


/*###################################################*/
/*...................................................*/
/* faq question — summary row                        */
/*...................................................*/
/*###################################################*/

.faqQuestion {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 0.75rem;
    margin: 0 -0.75rem;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    border-radius: 6px;
    transition: background-color 0.18s ease;

    &:hover {
        background-color: rgba(255, 255, 255, 0.04);
    }

    &:focus-visible {
        outline: 2px solid var(--primary);
        outline-offset: 2px;
    }

    &:hover .faqQuestionText {
        color: rgba(255, 255, 255, 0.92);
    }
}

.faqQuestionText {
    font-family: var(--font-body);
    font-size: clamp(0.8rem, 1vw, 0.95rem);
    font-weight: 500;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.65);
    transition: color 0.2s ease;

    @media (min-width: 768px) {
        font-size: clamp(0.9rem, 1.05vw, 1.05rem);
    }
}

.faqItem[open] .faqQuestionText {
    color: rgba(255, 255, 255, 1);
}

/*###################################################*/
/*...................................................*/
/* end faq question                                  */
/*...................................................*/
/*###################################################*/


/*###################################################*/
/*...................................................*/
/* chevron icon                                      */
/*...................................................*/
/*###################################################*/

.faqChevron {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    transition: transform 0.35s ease, color 0.2s ease;
    margin-top: 0.2rem;
}

.faqItem[open] .faqChevron,
.faqItem.isClosing .faqChevron {
    color: var(--primary);
}

.faqItem[open] .faqChevron {
    transform: rotate(180deg);
}

/*###################################################*/
/*...................................................*/
/* end chevron icon                                  */
/*...................................................*/
/*###################################################*/


/*###################################################*/
/*...................................................*/
/* faq answer — animated panel                       */
/*...................................................*/
/*###################################################*/

/* Grid trick: animates height without knowing fixed px value */
.faqAnswerOuter {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
}

.faqItem[open] .faqAnswerOuter {
    grid-template-rows: 1fr;

    /* @starting-style fires when element first becomes visible, enabling entry animation */
    @starting-style {
        grid-template-rows: 0fr;
    }
}

/* isClosing class: keeps [open] alive during exit transition */
.faqItem.isClosing .faqAnswerOuter {
    grid-template-rows: 0fr;
}

/* min-height: 0 is required for the 0fr trick to collapse fully */
.faqAnswerInner {
    overflow: hidden;
    min-height: 0;
    padding-top: 1rem;
}

.faqAnswerInner p {
    margin: 0 0 0.8rem;
    font-family: var(--font-body);
    font-size: clamp(0.75rem, 0.9vw, 0.9rem);
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.45);

    &:first-child {
        margin-top: 0.1rem;
    }

    &:last-child {
        margin-bottom: 1.5rem;
    }

    @media (min-width: 768px) {
        font-size: clamp(0.85rem, 0.95vw, 0.95rem);
    }
}

/*###################################################*/
/*...................................................*/
/* end faq answer                                    */
/*...................................................*/
/*###################################################*/
