/* 3. Header */

.faq-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.faq-container h2 {
    font-weight: 400;
    text-align: center;
    font-size: var(--font-size-3xl);
    padding-bottom: 32px;
}

/* 4. Accordion List */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* space-y-4 */
    max-width: 1116px;
}

/* 5. Individual FAQ Item */
.faq-item {
    background-color: var(--color-bg-stories);
    border-radius: var(--border-radius-md);
    /* rounded-xl */
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

/* 6. Question Button */
.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 16px;
    gap: 24px;
    cursor: pointer;
    border: none;
    background: transparent;
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: 500;
    color: var(--color-text-medium);
    outline: none;
}

/* Responsive adjustments for question padding */

/* 7. Icon Styles */
.faq-icon {
    width: 24px;
    /* w-6 */
    height: 24px;
    /* h-6 */
    color: var(--color-primary-blue);
    flex-shrink: 0;
    transition: transform 0.3s ease-in-out;
}

/* 8. Answer Container (The Transition Magic) */
.faq-answer-container {
    max-height: 0;
    overflow: hidden;
    /* Transition max-height AND padding for a smoother look */
    transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 0;
}

/* Active state: Show the answer */
.faq-item.active .faq-answer-container {
    max-height: 500px;
    /* Needs to be larger than content */
    padding-bottom: 24px;
    /* pb-6 */
}

/* 9. Answer Content */
.faq-answer-content {
    font-size: var(--font-size-base);
    font-weight: 300;
    color: var(--text-medium);
    line-height: 1.625;
    margin: 0;
}

/* Icon Rotation for Active State */
.faq-item.active .faq-icon {
    transform: rotate(45deg);
    /* Rotates the plus icon to look like an X/close icon */
}

@media (min-width: 768px) {
    .faq-header {
        margin-bottom: 64px;
    }

    .faq-question {
        padding: 24px;
        /* md:py-6 md:px-8 */
    }
}

@media (max-width: 500px) {
    .faq-container h2 {
        font-size: var(--font-size-2xl);
        max-width: 300px;
    }

    .faq-list {
        padding: 0 8px;
    }

    .faq-question {
        padding: 24px;
        /* md:py-6 md:px-8 */
    }

    .faq-icon {
        width: 24px;
        height: 24px;
    }
}