/* ==========================================================================
   Accordion (FAQ page)
   ========================================================================== */

.accordion-item {
    border-top: 1px solid var(--color-border-light);
}

.accordion-item:first-child {
    border-top: none;
}

.accordion-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 20px 0;

    background: none;
    border: none;
    cursor: pointer;

    font: inherit;           /* the size and weight of the h2 that holds the button */
    color: inherit;
    text-align: left;
}

/* The h2 holds the button (a heading cannot go inside a button). */
.accordion-heading {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    color: var(--color-heading);
}

.accordion-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 20px;
    line-height: 1;
    color: var(--color-primary);

    transition: transform 0.25s ease;
}

.accordion-trigger[aria-expanded="true"] .accordion-icon {
    transform: rotate(45deg); /* turns the "+" into an "x" */
}

/* A closed answer is hidden for everyone: max-height animates the opening, and visibility takes it out of what screen
   readers read and of the Tab order (it switches after the closing animation, at once when opening). */
.accordion-panel {
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.3s ease, visibility 0s linear 0.3s;
}

.accordion-panel.open {
    max-height: 8000px; /* large enough for any answer */
    visibility: visible;
    transition: max-height 0.3s ease, visibility 0s linear 0s;
}

.accordion-panel-inner {
    padding-bottom: 28px;
}

/* Sub-sections inside a long answer ("How does this website work?"). */
.accordion-panel-inner h3 {
    margin: 22px 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: var(--color-heading);
}

.accordion-panel-inner p + p {
    margin-top: 8px;
}

/* Answer text */
.accordion-panel-inner p {
    color: var(--color-muted);
    font-size: 15px;
    line-height: 1.7;
}

/* Level guide inside the "A1 - A2, B1 - B2, C1+" answer */
.faq-levels {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
    list-style: none;
}

.faq-levels li {
    padding: 12px 16px;
    background: var(--color-primary-soft);
    border-radius: var(--radius-md);
    color: var(--color-muted);
    font-size: 15px;
    line-height: 1.6;
}

.faq-levels strong {
    margin-right: 6px;
    color: var(--color-heading);
}

/* FAQ, "The developer": the copyright line closes the section, quieter than the text above it */
.faq-copyright {
    margin-top: var(--space-sm);
    font-size: 13px;
    color: var(--color-label);
}
