/*
 * Home v3 fold 7: FAQ "Answer Desk" (.fq-). Tokens only (base.css); mobile-first, min-width 640/1024.
 * Under 1024px: an exclusive accordion (native <details name>), then one Enquire now and the guides disclosure.
 * From 1024px: a one-screen fold (.v3-fold in base.css). Master-detail: the questions are a list on the left and the
 * open answer (.fq-body) is laid over the right-hand pane, so the section height never depends on which one is open.
 * Calm pass: the fold shows the title, the questions, one answer, one button. Nothing is squeezed on short screens:
 * rows keep their height and the fold grows instead.
 * Motion (transform, opacity and colour only): a marker slides to the open question (faq.js places it), the answer
 * fades up when the question changes, chevrons and arrows nudge. All of it is off under prefers-reduced-motion.
 */
.home-v3 .fq { scroll-margin-top: 72px; }
.home-v3 .fq [hidden] { display: none !important; }
.home-v3 .fq-head { margin: 0 0 28px; }
.home-v3 .fq-head .v3-h2 { margin-top: 0; }

.home-v3 .fq-md { display: grid; gap: 28px; }
.home-v3 .fq-list, .home-v3 .fq-pane { min-width: 0; }
.home-v3 .fq-list { display: grid; gap: 12px; }
.home-v3 .fq-empty, .home-v3 .fq-marker { display: none; }

/* ---------- Questions (accordion rows) ---------- */
.home-v3 .fq-q {
    position: relative; background: var(--white); border: 1px solid var(--l200); border-radius: var(--r-card);
    scroll-margin-top: 96px; transition: border-color var(--t-base) ease, box-shadow var(--t-base) ease;
}
.home-v3 .fq-q:hover { border-color: var(--l300); }
.home-v3 .fq-q[open] { border-color: var(--l300); box-shadow: var(--shadow-card); }

.home-v3 .fq-sum {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 18px 20px;
    border-radius: var(--r-card); list-style: none; cursor: pointer;
    font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--ink);
    transition: color var(--t-base) ease, background-color var(--t-base) ease;
}
.home-v3 .fq-sum::-webkit-details-marker { display: none; }
.home-v3 .fq-sum::marker { content: ''; }
.home-v3 .fq-sum-text { min-width: 0; text-wrap: pretty; }
.home-v3 .fq-q[open] .fq-sum { color: var(--brand-deep); }

/* Plus to minus: the vertical bar turns flat and fades. */
.home-v3 .fq-toggle {
    position: relative; flex: none; width: 32px; height: 32px; border-radius: 999px; background: var(--l100); color: var(--brand-deep);
    transition: background-color 240ms var(--ease), color 240ms var(--ease), transform 240ms var(--ease);
}
.home-v3 .fq-toggle::before, .home-v3 .fq-toggle::after {
    content: ''; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; margin: -1px 0 0 -6px;
    border-radius: 2px; background: currentColor; transition: transform 280ms var(--ease), opacity 200ms ease;
}
.home-v3 .fq-toggle::after { transform: rotate(90deg); }
.home-v3 .fq-q[open] .fq-toggle { background: var(--brand); color: var(--on-dark); }
.home-v3 .fq-q[open] .fq-toggle::after { transform: rotate(0deg); opacity: 0; }
@media (pointer: fine) { .home-v3 .fq-sum:hover .fq-toggle { background: var(--l200); } .home-v3 .fq-q[open] .fq-sum:hover .fq-toggle { background: var(--brand-deep); } }

/* ---------- Answers ---------- */
.home-v3 .fq-body { padding: 0 20px 22px; }
.home-v3 .fq-answer-text { color: var(--ink-2); }
.home-v3 .fq-answer-text p, .home-v3 .fq-answer-text li { max-width: 62ch; font-size: 16px; line-height: 1.65; }
.home-v3 .fq-answer-text p + p { margin-top: 12px; }

/* One quiet page link under the answer (outside the schema text) */
.home-v3 .fq-next { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 12px; }
.home-v3 .fq-link { font-size: 16px; }
.home-v3 .fq-next a:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.home-v3 .fq-arrow { transition: transform 200ms var(--ease); }
@media (pointer: fine) {
    .home-v3 .fq-link:hover .fq-arrow, .home-v3 .fq-row:hover .fq-arrow { transform: translateX(4px); }
}

/* ---------- The one action ---------- */
.home-v3 .fq-ask { display: flex; }
.home-v3 .fq-ask-btn { width: 100%; }

/* ---------- Guides: one quiet disclosure ---------- */
.home-v3 .fq-guides { margin-top: 28px; background: var(--l50); border: 1px solid var(--l200); border-radius: var(--r-card); }
.home-v3 .fq-guides-sum {
    display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 14px 20px; border-radius: var(--r-card);
    list-style: none; cursor: pointer; font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--ink);
    transition: color var(--t-base) ease, background-color var(--t-base) ease, border-color var(--t-base) ease;
}
.home-v3 .fq-guides-sum::-webkit-details-marker { display: none; }
.home-v3 .fq-guides-sum::marker { content: ''; }
.home-v3 .fq-guides-icon { display: inline-flex; flex: none; color: var(--brand-deep); }
.home-v3 .fq-guides-chev {
    flex: none; width: 9px; height: 9px; margin: -4px 4px 0 auto; border: solid var(--brand-deep); border-width: 0 2px 2px 0;
    transform: rotate(45deg); transition: transform 280ms var(--ease);
}
.home-v3 .fq-guides[open] .fq-guides-chev { transform: translateY(4px) rotate(225deg); }
.home-v3 .fq-guides-panel { padding: 0 20px 10px; }
.home-v3 .fq-rows li + li { border-top: 1px solid var(--l200); }
.home-v3 .fq-row {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 10px 0;
    color: var(--ink); text-decoration: none; border-radius: 10px; transition: color var(--t-base) ease, background-color var(--t-base) ease;
}
.home-v3 .fq-row-text { min-width: 0; font-size: 16px; font-weight: 500; line-height: 1.4; }
.home-v3 .fq-row .fq-arrow { flex: none; color: var(--brand-deep); }
.home-v3 .fq-row:hover { color: var(--brand-deep); }

/* ---------- 640+ ---------- */
@media (min-width: 640px) {
    .home-v3 .fq-head { margin-bottom: 36px; }
    .home-v3 .fq-sum { padding: 20px 24px; font-size: 17px; }
    .home-v3 .fq-body { padding: 0 24px 24px; }
    .home-v3 .fq-ask-btn { width: auto; }
    .home-v3 .fq-guides-sum { padding: 14px 24px; }
    .home-v3 .fq-guides-panel { padding: 0 24px 12px; }
}

/* ---------- Desktop: master-detail on one screen ---------- */
@media (min-width: 1024px) {
    .home-v3 .fq {
        --fq-row: clamp(52px, 6.6vh, 60px);        /* height of one question row */
        --fq-gap: clamp(28px, 4.6vh, 44px);        /* title to desk */
        --fq-cg: clamp(28px, 3.4vw, 52px);         /* list to answer pane */
        --fq-pad: clamp(30px, 4.8vh, 46px);        /* answer pane padding, top and bottom */
        --fq-padx: clamp(30px, 3.4vw, 52px);
        --fq-foot: calc(52px + var(--fq-pad) + 12px); /* height of the action row; faq.js writes the real one */
        --fq-l: 40; --fq-r: 60;                    /* column shares: the answer is placed from the list's own box */
    }
    .home-v3 .fq > .v3-wrap { position: relative; }

    /* Title row: the guides menu sits at its right-hand end */
    .home-v3 .fq-head { display: flex; align-items: center; min-height: 46px; margin: 0 0 var(--fq-gap); padding-right: 280px; }

    .home-v3 .fq-md { grid-template-columns: minmax(0, 40fr) minmax(0, 60fr); gap: 0 var(--fq-cg); align-items: stretch; }

    /* Questions: plain rows, no boxes; the marker shows which one is open */
    .home-v3 .fq-list { position: relative; gap: 0; grid-auto-rows: minmax(var(--fq-row), auto); align-content: start; }
    /* static: the open answer is positioned against .fq-list, not against its own row */
    .home-v3 .fq-q, .home-v3 .fq-q:hover, .home-v3 .fq-q[open] { position: static; background: none; border: 0; border-radius: 0; box-shadow: none; scroll-margin-top: 0; }
    .home-v3 .fq-sum {
        position: relative; z-index: 1; min-height: var(--fq-row); padding: 8px 16px 8px 24px; gap: 16px; border-radius: 14px;
        font-size: 16px; font-weight: 500; line-height: 1.35; color: var(--ink-2);
    }
    .home-v3 .fq-sum:hover { color: var(--ink); background: var(--l50); }
    .home-v3 .fq-q[open] .fq-sum { color: var(--brand-deep); background: var(--l100); cursor: default; }
    .home-v3 .fq-sum:focus-visible { outline-offset: -3px; }

    /* With faq.js the highlight is one marker that slides between rows */
    .home-v3 .fq-has-marker .fq-marker {
        display: block; position: absolute; z-index: 0; left: 0; right: 0; top: 0; border-radius: 14px; background: var(--l100);
        pointer-events: none;
    }
    .home-v3 .fq-has-marker .fq-marker::before { content: ''; position: absolute; left: 8px; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--brand); }
    .home-v3 .fq-has-marker .fq-q[open] .fq-sum, .home-v3 .fq-has-marker .fq-q[open] .fq-sum:hover { background: none; }

    /* Toggle becomes a "go to answer" chevron */
    .home-v3 .fq-toggle { width: 24px; height: 24px; background: none; color: var(--l300); }
    .home-v3 .fq-toggle::after { display: none; }
    .home-v3 .fq-toggle::before {
        width: 8px; height: 8px; margin: -5px 0 0 -7px; border: solid currentColor; border-width: 2px 2px 0 0;
        border-radius: 0; background: none; transform: rotate(45deg);
    }
    .home-v3 .fq-sum:hover .fq-toggle, .home-v3 .fq-q[open] .fq-sum:hover .fq-toggle { background: none; }
    .home-v3 .fq-sum:hover .fq-toggle { color: var(--brand); transform: translateX(2px); }
    .home-v3 .fq-q[open] .fq-toggle { background: none; color: var(--brand); transform: translateX(4px); }

    /* Answer pane: a quiet card. The open answer sits over its top, the action holds its bottom. */
    .home-v3 .fq-pane {
        position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 360px;
        background: var(--l50); border: 1px solid var(--l200); border-radius: var(--r-panel);
    }
    .home-v3 .fq-md:not(:has(details[open])) .fq-empty { display: block; margin: auto; padding: var(--fq-pad) var(--fq-padx); font-size: 17px; color: var(--mute); text-align: center; }

    .home-v3 .fq-body {
        position: absolute; z-index: 1; top: 1px; left: calc(100% + var(--fq-cg) + 1px);
        /* list width x (answer share / list share) = pane width */
        width: calc(100% * var(--fq-r) / var(--fq-l) - 2px);
        /* never taller than the space above the action: a longer answer scrolls inside itself, it is never cut off */
        max-height: calc(100% - var(--fq-foot) - 2px); overflow-y: auto; overscroll-behavior: contain;
        scrollbar-width: thin; scrollbar-color: var(--l300) transparent;
        padding: var(--fq-pad) var(--fq-padx) 8px;
    }
    .home-v3 .fq-body:focus-visible { outline: var(--focus-light); outline-offset: -3px; border-radius: var(--r-panel) var(--r-panel) 0 0; }
    .home-v3 .fq-answer-text p, .home-v3 .fq-answer-text li { max-width: 56ch; font-size: clamp(18px, 2.5vh, 21px); line-height: 1.65; color: var(--ink-2); }
    .home-v3 .fq-answer-text p + p { margin-top: 14px; }
    .home-v3 .fq-next { margin-top: 14px; }

    .home-v3 .fq-ask { min-height: var(--fq-foot); align-items: flex-end; padding: 12px var(--fq-padx) var(--fq-pad); }

    /* Guides: a small menu at the right of the title row; it opens over the page, so the fold never changes height */
    .home-v3 .fq-guides { position: absolute; z-index: 5; top: 0; right: 0; margin: 0; background: none; border: 0; border-radius: 0; }
    .home-v3 .fq-guides-sum {
        display: inline-flex; gap: 10px; min-height: 46px; padding: 0 20px 0 18px; background: var(--white); border: 1px solid var(--l200); border-radius: 999px;
        font-size: 15px; color: var(--brand-deep);
    }
    .home-v3 .fq-guides-sum:hover, .home-v3 .fq-guides[open] .fq-guides-sum { background: var(--l50); border-color: var(--l300); }
    .home-v3 .fq-guides-chev { width: 8px; height: 8px; margin: -4px 0 0 6px; }
    .home-v3 .fq-guides-panel {
        position: absolute; top: calc(100% + 10px); right: 0; width: min(400px, 80vw); padding: 12px;
        background: var(--white); border: 1px solid var(--l200); border-radius: var(--r-card); box-shadow: var(--shadow-panel);
    }
    .home-v3 .fq-rows li + li { border-top: 0; }
    .home-v3 .fq-row { min-height: 50px; padding: 8px 14px; }
    .home-v3 .fq-row:hover { background: var(--l50); }
}
@media (min-width: 1200px) {
    .home-v3 .fq { --fq-l: 38; --fq-r: 62; }
    .home-v3 .fq-md { grid-template-columns: minmax(0, 38fr) minmax(0, 62fr); }
}

/* ---------- Motion ---------- */
@keyframes fqAnswerIn { from { opacity: 0; transform: translate3d(0, 12px, 0); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
    .home-v3 .fq-q[open] > .fq-body { animation: fqAnswerIn 380ms var(--ease) both; }
    .home-v3 .fq-guides[open] > .fq-guides-panel { animation: fqAnswerIn 260ms var(--ease) both; }
    .home-v3 .fq-marker.is-live { transition: transform 380ms var(--ease); }
}
@media (prefers-reduced-motion: reduce) {
    .home-v3 .fq-toggle, .home-v3 .fq-toggle::before, .home-v3 .fq-toggle::after, .home-v3 .fq-guides-chev, .home-v3 .fq-arrow { transition: none; }
}

@media (forced-colors: active) {
    .home-v3 .fq-toggle::before, .home-v3 .fq-toggle::after { background: CanvasText; }
    .home-v3 .fq-q[open] { outline: 2px solid Highlight; }
}
@media (forced-colors: active) and (min-width: 1024px) {
    .home-v3 .fq-toggle::before { background: none; border-color: CanvasText; }
    .home-v3 .fq-q[open] { outline: 0; }
    .home-v3 .fq-q[open] .fq-sum { outline: 2px solid Highlight; outline-offset: -2px; }
}
