/*
 * Course v2 fold 6: questions and answers (.fq-). Overrides only, on top of home-v3/faq.css (reused unchanged).
 * home-v3/faq.css is pushed from the partial, so it loads AFTER this file: every rule here is scoped .home-v3.course-v2 to win
 * on specificity, not on order. Tokens only (base.css). Text is 16px or larger everywhere.
 * Phones (<1024px): accordion cards, a rotating chevron instead of plus/minus, a height transition where supported, then the line
 * and a full-width amber button. Desktop: the H2 alone, then the Answer Desk: 7 rows of 52px max and a 364px --l50 pane whose
 * footer holds the line and the one amber button.
 * Motion (transform and opacity only; colour and block-size on phones): rows rise 12px in a 40ms stagger when the fold arrives,
 * the answer fades up (home fqAnswerIn), the marker slides (home), chevrons turn. All of it is off under prefers-reduced-motion.
 */
.home-v3.course-v2 .fq-head { margin: 0 0 28px; padding-right: 0; }

/* ---------- Meta row: source note · one quiet in-page link (outside the schema text) ---------- */
.home-v3.course-v2 .fq-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; margin: 6px 0 0;
    font-size: 16px; line-height: 1.5; color: var(--mute);
}
.home-v3.course-v2 .fq-src { padding: 6px 0; }
.home-v3.course-v2 .fq-dot { color: var(--l300); }
.home-v3.course-v2 .fq-meta .fq-link {
    display: inline-flex; align-items: center; gap: 6px; min-height: 48px; font-size: 16px; color: var(--brand-deep);
}
.home-v3.course-v2 .fq-meta .fq-link:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 6px; }

/* ---------- The one action ---------- */
.home-v3.course-v2 .fq-ask { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.home-v3.course-v2 .fq-ask-line { margin: 0; font-size: 16px; line-height: 1.5; color: var(--mute); }
.home-v3.course-v2 .fq-ask-btn { width: 100%; min-height: 52px; }
.home-v3.course-v2 .fq-ask-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.home-v3.course-v2 .fq-ask-btn .v3-i { transition: transform 200ms var(--ease); }
@media (pointer: fine) { .home-v3.course-v2 .fq-ask-btn:hover .v3-i { transform: translateX(4px); } }

/* ---------- Phones and tablets: accordion ---------- */
@media (max-width: 1023px) {
    .home-v3.course-v2 .fq-md { gap: 28px; }
    .home-v3.course-v2 .fq-sum:focus-visible { outline: 3px solid var(--brand-deep); outline-offset: 2px; }
    /* Plus/minus becomes a chevron that turns 180deg on open */
    .home-v3.course-v2 .fq-toggle::after { display: none; }
    .home-v3.course-v2 .fq-toggle::before {
        width: 8px; height: 8px; margin: -6px 0 0 -4px; border: solid currentColor; border-width: 0 2px 2px 0;
        border-radius: 0; background: none; transform: rotate(45deg); transition: transform 280ms var(--ease);
    }
    .home-v3.course-v2 .fq-q[open] .fq-toggle::before { transform: translateY(3px) rotate(225deg); }
    .home-v3.course-v2 .fq-body { padding-bottom: 14px; }
}
@media (min-width: 640px) and (max-width: 1023px) {
    .home-v3.course-v2 .fq-ask { flex-direction: row; align-items: center; justify-content: space-between; }
    .home-v3.course-v2 .fq-ask-btn { width: auto; }
}

/* ---------- Desktop: master-detail on one screen ---------- */
@media (min-width: 1024px) {
    .home-v3.course-v2 .fq-head { min-height: 46px; margin: 0 0 var(--fq-gap); padding-right: 0; }
    /* The list stacks above the pane, so the answer laid over the pane is never covered while a reveal transform is live. */
    .home-v3.course-v2 .fq-list { z-index: 1; }
    .home-v3.course-v2 .fq-pane { min-height: max(360px, calc(var(--fq-row) * min(var(--fq-count, 7), 7))); }
    .home-v3.course-v2 .fq-sum:focus-visible { outline: 3px solid var(--brand-deep); outline-offset: -3px; }
    .home-v3.course-v2 .fq-body { padding-bottom: 4px; }
    .home-v3.course-v2 .fq-meta { margin-top: 8px; }
    .home-v3.course-v2 .fq-meta .fq-link { min-height: 40px; }
    .home-v3.course-v2 .fq-ask {
        flex-direction: row; align-items: center; justify-content: space-between; gap: 20px;
        padding: 14px var(--fq-padx) var(--fq-pad);
    }
    .home-v3.course-v2 .fq-ask-btn { width: auto; flex: none; }
}

/* ---------- Motion ---------- */
/* The answer open in the HTML never animates: it is visible at once, even where animations are paused or throttled.
   course-v2/faq.js adds .fq-live on the first visitor action, from then on answers fade up (home fqAnswerIn). */
.home-v3.course-v2 .fq:not(.fq-live) .fq-q[open] > .fq-body { animation: none; }
@media (prefers-reduced-motion: no-preference) {
    /* Rows rise 12px and fade in, 40ms apart, once the fold arrives (start state only under html.hv-motion + .cv2-armed). */
    html.hv-motion .home-v3.course-v2 .fq.cv2-armed:not(.cv2-in) .fq-sum { opacity: 0; transform: translate3d(0, 12px, 0); }
    html.hv-motion .home-v3.course-v2 .fq.cv2-armed:not(.cv2-done) .fq-sum {
        transition: opacity 400ms var(--ease), transform 400ms var(--ease), color var(--t-base) ease, background-color var(--t-base) ease;
        transition-delay: calc(var(--fq-i, 0) * 40ms);
    }
    /* Phones: the accordion height follows the content where ::details-content is supported (instant elsewhere). */
    @media (max-width: 1023px) {
        .home-v3.course-v2 { interpolate-size: allow-keywords; }
        .home-v3.course-v2 .fq-q::details-content {
            block-size: 0; overflow: clip;
            transition: block-size 320ms var(--ease), content-visibility 320ms allow-discrete;
        }
        .home-v3.course-v2 .fq-q[open]::details-content { block-size: auto; }
    }
}
@media (prefers-reduced-motion: reduce) {
    .home-v3.course-v2 .fq-sum, .home-v3.course-v2 .fq-toggle::before, .home-v3.course-v2 .fq-ask-btn .v3-i { transition: none; }
    .home-v3.course-v2 .fq-q[open] > .fq-body { animation: none; }
}

@media (forced-colors: active) {
    .home-v3.course-v2 .fq-toggle::before { background: none; border-color: CanvasText; }
}

/* ---------- Desktop question list: full-strength type so it does not look weak beside the answer pane ---------- */
@media (min-width: 1024px) {
    .home-v3.course-v2 .fq-sum { font-size: 17px; font-weight: 600; line-height: 1.35; color: var(--ink); }
    .home-v3.course-v2 .fq-q[open] .fq-sum { color: var(--brand-deep); }
    .home-v3.course-v2 .fq-toggle { color: var(--brand-deep); }
    /* The pane fits the questions it answers: no tall empty box under a short answer */
    .home-v3.course-v2 .fq-pane { min-height: max(280px, calc(var(--fq-row) * min(var(--fq-count, 7), 7))); }
    .home-v3.course-v2 .fq-answer-text p { font-size: 17px; }
}
