/* The /faq page: each question a <details>, its answer below it. */

@layer reset, tokens, base, layout, components, pages, utilities;

@layer pages {
    /* min-width: 0 lets the grid column be narrower than the table,
       which then scrolls inside .table-scroll instead of the page. */
    .faq {
        min-width: 0;
        padding-block: var(--space-5) var(--space-6);
    }

    .faq__title {
        margin-bottom: var(--space-5);
        color: var(--teal-700);
        font-size: var(--text-xl);
        font-weight: normal;
    }

    .faq__item {
        border: 1px solid var(--gray-3);
        border-radius: var(--radius-lg);
    }

    .faq__item + .faq__item {
        margin-top: var(--space-3);
    }

    /* The question: the accent's bold link text it was, with the browser's
       disclosure triangle. */
    .faq__question {
        padding: var(--space-3) var(--space-4);
        color: var(--color-accent);
        font-size: var(--text-md);
        font-weight: bold;
        cursor: pointer;
    }

    @media (hover: hover) {
        .faq__question:hover {
            text-decoration: underline;
        }
    }

    .faq__item[open] > .faq__question {
        border-bottom: 1px solid var(--gray-3);
    }

    .faq__answer {
        padding: var(--space-2) var(--space-4) var(--space-4);
    }

    /* The table is as wide as its content, and scrolls (.table-scroll)
       where the column is narrower. */
    .faq__answer .table {
        width: auto;
    }

    /* On a phone, narrower cells, so the four columns fit without
       scrolling where they can. */
    @media (width < 600px) {
        .faq__answer {
            padding-inline: var(--space-2);
        }

        .faq__answer .table th,
        .faq__answer .table td {
            padding-inline: var(--space-2);
        }
    }
}
