/*
 * The frequently asked questions page (protected/views/site/_faqPage.php, every source; the script is
 * jscripts/faq.js). Loaded through $this->headers after the layout's own stylesheets, then, where the
 * theme has one, css/custom/<theme>/faq.css on top of it. The page renders inside the legacy stack on
 * most themes (css/bootstrap-legacy.css, 10px root), so every size here is px on purpose.
 *
 * The page head (the theme's own h1), then one white card per topic on a cream panel, the same family
 * as the credit details page (css/credit-details.css). Each question is a <details> row: a leading
 * chevron that turns down when it opens, the answer set in under the question's text. The chevron
 * takes the question's colour: a helper, not an accent.
 *
 * Section 0 declares the --faq-* tokens on .faq-page and every rule reads only those. The look is
 * neutral on purpose (the NetStudy source has no brand colour, and Bootstrap's link blue is not one):
 * a question underlines on hover. A theme with its own look (InsuranceStudy) remaps the tokens in
 * its override file.
 */

/* 0. Tokens ------------------------------------------------------------------------------- */
.faq-page {
    --faq-ink: #1F2428;             /* topic titles, questions, status labels */
    --faq-text: #2B2F33;            /* answers */
    --faq-line: #E2E6E9;            /* card borders, hairlines */
    --faq-surface: #fff;            /* the cards */
    --faq-well: #F7F4EF;            /* the panel behind the cards: the course page's cream */
    --faq-well-pad: 20px;
    --faq-radius: 8px;
    --faq-shadow: 0 1px 2px rgba(31, 36, 40, .05), 0 1px 3px rgba(31, 36, 40, .06);
    --faq-font-display: var(--theme-font-display, var(--font-display, inherit));
    --faq-q-hover: var(--faq-ink);
    --faq-q-hover-line: underline;  /* the neutral hover; a theme with a brand colour recolours instead */
    --faq-q-active: var(--faq-text);
    --faq-focus: currentColor;
    --faq-ease: cubic-bezier(.2, 0, .2, 1);
    --faq-header-offset: var(--theme-header-offset, 0px);  /* a sticky header, for in-page links */
    padding-bottom: 48px;
    color: var(--faq-text);
}

/* 1. Page head ---------------------------------------------------------------------------- */
/* clear of the theme's header (several column layouts start their content right under it) */
.faq-page .faq-head {
    padding-top: 20px;
}
/* the h1 is the theme's own (size, face and colour) */
.faq-page .faq-head h1 {
    margin: 0;
}

/* 2. Topic cards -------------------------------------------------------------------------- */
.faq-page .faq-well {
    max-width: 900px;
    margin: 24px 0 0;
    padding: var(--faq-well-pad);
    background: var(--faq-well);
    border-radius: var(--faq-radius);
}
.faq-page .faq-topics {
    display: grid;
    gap: 20px;
    max-width: 860px;
}
.faq-page .faq-card {
    padding: 24px 24px 8px;
    background: var(--faq-surface);
    border: 1px solid var(--faq-line);
    border-radius: var(--faq-radius);
    box-shadow: var(--faq-shadow);
    scroll-margin-top: calc(var(--faq-header-offset) + 16px);
}
.faq-page .faq-card-title {
    margin: 0 0 8px;
    font-family: var(--faq-font-display);
    font-weight: 700;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: -.01em;
    color: var(--faq-ink);
    text-transform: none;
}

/* 3. Questions ---------------------------------------------------------------------------- */
/* margin, padding, background and radius reset: the nabip and bbrown stylesheets give their own
   .faq-item (staff-written page content) a grey box */
.faq-page .faq-item {
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    border-top: 1px solid var(--faq-line);
    border-radius: 0;
    scroll-margin-top: calc(var(--faq-header-offset) + 16px);
}
.faq-page .faq-q {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 16px 0;
    list-style: none;
    cursor: pointer;
    font-family: var(--faq-font-display);
    font-weight: 600;
    font-size: 17px;
    line-height: 1.4;
    color: var(--faq-ink);
}
.faq-page .faq-q::-webkit-details-marker {
    display: none;
}
.faq-page .faq-q::marker {
    content: "";
}
.faq-page .faq-q i {
    flex: 0 0 14px;
    font-size: 12px;
    transition: transform 180ms var(--faq-ease);
}
.faq-page .faq-item[open] > .faq-q i {
    transform: rotate(90deg);
}
.faq-page .faq-q:hover {
    color: var(--faq-q-hover);
}
.faq-page .faq-q:hover span {
    text-decoration: var(--faq-q-hover-line);
    text-underline-offset: 3px;
}
.faq-page .faq-q:active {
    color: var(--faq-q-active);
}
.faq-page .faq-q:focus-visible {
    outline: 2px solid var(--faq-focus);
    outline-offset: 2px;
    border-radius: 2px;
}
@media (prefers-reduced-motion: reduce) {
    .faq-page .faq-q i {
        transition: none;
    }
}

/* 4. Answers ------------------------------------------------------------------------------ */
/* set in by the chevron and its gap, so the answer starts under the question's first word */
.faq-page .faq-a {
    max-width: calc(72ch + 26px);
    padding: 0 0 20px 26px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--faq-text);
}
.faq-page .faq-a p {
    margin: 0 0 12px;
    font-size: inherit;
    line-height: inherit;
}
.faq-page .faq-a > :last-child,
.faq-page .faq-a dd:last-child {
    margin-bottom: 0;
}
/* the transcript answer's statuses: each status a label over its advice. The legacy layer sets dt /
   dd line-height: reset here. */
.faq-page .faq-statuses {
    margin: 0;
}
.faq-page .faq-statuses dt {
    margin: 16px 0 2px;
    font-weight: 700;
    line-height: inherit;
    color: var(--faq-ink);
}
.faq-page .faq-statuses dd {
    margin: 0;
    line-height: inherit;
}

@media (max-width: 575.98px) {
    /* no negative side margins: some column layouts (cltc-advisor's column2) leave no gutter for them */
    .faq-page .faq-well {
        padding: 12px 8px;
    }
    .faq-page .faq-topics {
        gap: 16px;
    }
    .faq-page .faq-card {
        padding: 20px 18px 6px;
    }
    .faq-page .faq-card-title {
        font-size: 20px;
    }
    .faq-page .faq-q {
        font-size: 16px;
        padding: 14px 0;
    }
    .faq-page .faq-a {
        padding-left: 0;
    }
}
