/* Reuses the sibling master-detail FAQ (question rows, gradient ring, marker, answer panel, entry motion), which
   itself imports the home FAQ fold (cards, counters, chevron, accordion, ask card, orbs, illustration motion).
   The page head loads only itil-4-or-5/*.css, so it is imported here. Must stay the first rule in this file. */
@import url("../course-itil4f/fold-faq.css");

/*
 * Companion page /itil-4-or-itil-5, S4: questions and close (#faq, paper + orb).
 * Spec: docs/ux-discovery/itil-5-foundation/direction.md ("COMPANION PAGE", S4) + fold-companion.json.
 * Loaded after itil-4-or-5/page.css. Every selector starts main.itil-v1 #faq. Nothing below 16px.
 * Only the ask button uses --act (the section's ONE pink button).
 *
 * From 1200px (one screen, 556px budget at 1366x768):
 *   head row 84px (34px eyebrow + 8px + one H2 line), 20px gap,
 *   master-detail 280px: left 5 rows x 52px + 4 x 5px; right the answer panel, the same 280px,
 *   24px gap, ask strip 96px (illustration, heading + phone link, the pink button).
 *   84 + 20 + 280 + 24 + 96 = 504px, about 142px free.
 * Below 1200px: the home accordion in one 760px column, then the ask card (heading, button, phone link).
 */

/* ---------- Section ---------- */
/* The orbs reach past the container; the fold clips them to its own rounded box. */
main.itil-v1 #faq.v1-q45-faq { overflow: clip; }
/* The H2 takes the page size (--fs-h2 in page.css), the same as #compare and #changes. */

/* ---------- Question list ---------- */
main.itil-v1 #faq .v1-q45-faq__mark { display: none; }

@media (min-width: 1200px) {
    /* 5 x 52 + 4 x 5 = 280px. The box keeps 280px with fewer questions, so the panel always holds an answer. */
    main.itil-v1 #faq .v1-q45-faq__md { --faq-row: 52px; --faq-gap: 5px; --strip: 0px; min-height: 280px; }
    main.itil-v1 #faq .v1-q45-faq__md .c4-faq__q { font-size: 17px; padding-left: 18px; }

    /* Answer panel: the full height of the list (the ask strip is a separate bar below). */
    main.itil-v1 #faq .v1-q45-faq__md .v1-faq__body.c4-faq__body { padding: 26px 28px 22px; }
    main.itil-v1 #faq .v1-q45-faq__md .c4-faq__hint { padding: 26px 28px; }
    main.itil-v1 #faq .v1-q45-faq__panel::after {
        content: ""; position: absolute; right: -60px; bottom: -80px; width: 280px; height: 220px; pointer-events: none;
        background: radial-gradient(closest-side, rgba(124, 92, 255, .14), rgba(240, 72, 155, .06) 60%, transparent);
    }
    main.itil-v1 #faq .v1-q45-faq__mark {
        display: block; position: absolute; right: 14px; bottom: 10px; width: 132px; height: 110px;
        opacity: .13; pointer-events: none;
    }

    /* Answer change: a plain cross-fade, opacity over 180ms (no slide). */
    html.v1-motion main.itil-v1 #faq .c4-faq__md.v1-q45-faq__md .v1-faq__list.is-anim .v1-faq__body {
        transition: opacity 180ms ease;
    }
    html.v1-motion main.itil-v1 #faq .c4-faq__md.v1-q45-faq__md .v1-faq__list.is-anim .v1-faq__item.is-collapsed > .v1-faq__body,
    html.v1-motion main.itil-v1 #faq .c4-faq__md.v1-q45-faq__md .v1-faq__list.is-anim .v1-faq__item.is-collapsed.is-closing > .v1-faq__body {
        transform: none; transition-duration: 180ms;
    }
}

/* ---------- Ask strip (base = tablet and phone card: illustration + heading, button, phone link) ---------- */
main.itil-v1 #faq .v1-q45-faq__ask-wrap { margin-top: var(--s-2, 8px); }
main.itil-v1 #faq .v1-q45-faq__ask {
    display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
    padding: 24px;
}
main.itil-v1 #faq .v1-q45-faq__art { position: static; flex: none; width: 72px; height: 60px; }
main.itil-v1 #faq .v1-q45-faq__ask-h {
    flex: 1 1 calc(100% - 100px); min-width: 0;   /* the illustration and the heading always fill the first row */
    font-size: 19px; font-weight: 700; line-height: 1.3; text-wrap: balance; --v1-mb: 0; margin: 0;
}
main.itil-v1 #faq .v1-q45-faq__btn { flex: 1 1 100%; gap: 10px; }
main.itil-v1 #faq .v1-q45-faq__btn .v1-i { width: 20px; height: 20px; flex: none; transition: transform 320ms var(--ease-out); }
main.itil-v1 #faq .v1-q45-faq__btn:hover .v1-i { transform: translateX(4px); }
main.itil-v1 #faq .v1-q45-faq__phone {
    flex: 1 1 100%; justify-content: center;
    min-height: 48px; font-size: 17px; white-space: normal;
}
main.itil-v1 #faq .v1-q45-faq__phone .v1-i { width: 18px; height: 18px; }

/* From 600px the button and the phone link share one row. */
@media (min-width: 600px) and (max-width: 1199.98px) {
    main.itil-v1 #faq .v1-q45-faq__btn { flex: 0 0 auto; }
    main.itil-v1 #faq .v1-q45-faq__phone { flex: 0 1 auto; justify-content: flex-start; }
}
@media (max-width: 599.98px) {
    main.itil-v1 #faq .v1-q45-faq__ask { padding: 22px 20px; gap: 14px; row-gap: 12px; }
    main.itil-v1 #faq .v1-q45-faq__art { width: 60px; height: 50px; }
    main.itil-v1 #faq .v1-q45-faq__phone { margin-top: -4px; }
}

/* Desktop: one 96px bar. Illustration | heading over phone link | button. */
@media (min-width: 1200px) {
    /* .v1-fold__inner has a 20px gap here (sibling rule); the strip sits 24px under the list. */
    main.itil-v1 #faq .v1-q45-faq__ask-wrap { margin-top: 4px; }
    main.itil-v1 #faq .v1-q45-faq__ask {
        display: grid; height: 96px;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas: "art h btn" "art ph btn";
        align-content: center; align-items: center; column-gap: 20px; row-gap: 0;
        padding: 3px 28px 0;
    }
    main.itil-v1 #faq .v1-q45-faq__art { grid-area: art; width: 72px; height: 60px; }
    main.itil-v1 #faq .v1-q45-faq__ask-h { grid-area: h; align-self: end; }
    main.itil-v1 #faq .v1-q45-faq__phone { grid-area: ph; align-self: start; justify-self: start; justify-content: flex-start; min-height: 32px; white-space: nowrap; }
    main.itil-v1 #faq .v1-q45-faq__btn { grid-area: btn; min-height: 52px; padding-inline: 26px; }
    main.itil-v1 #faq .v1-q45-faq__ask-wrap .v1-faq__orb { left: -90px; bottom: -84px; width: 240px; opacity: .55; }
    main.itil-v1 #faq .v1-q45-faq__ask-wrap .v1-faq__orb2 { right: -40px; top: -44px; }
}

/* Hover: the bar lifts 2px with a deeper glow (colour only under reduced motion). */
main.itil-v1 #faq .v1-q45-faq__ask { transition: transform var(--t-fast) var(--ease-out), box-shadow 320ms ease; }
@media (hover: hover) {
    main.itil-v1 #faq .v1-q45-faq__ask:hover {
        transform: translateY(-2px);
        box-shadow: 0 1px 2px rgba(14, 13, 51, .06), 0 34px 60px -30px rgba(74, 53, 232, .65), 0 12px 26px -20px rgba(240, 72, 155, .4), inset 0 1px 0 #fff;
    }
}
main.itil-v1 #faq .v1-q45-faq__phone:focus-visible,
main.itil-v1 #faq .v1-q45-faq__btn:focus-visible { outline: var(--focus); outline-offset: var(--focus-offset, 2px); }

@media (prefers-reduced-motion: reduce) {
    main.itil-v1 #faq .v1-q45-faq__ask, main.itil-v1 #faq .v1-q45-faq__btn .v1-i { transition: none !important; }
    main.itil-v1 #faq .v1-q45-faq__ask:hover, main.itil-v1 #faq .v1-q45-faq__btn:hover .v1-i { transform: none; }
}
@media print {
    main.itil-v1 #faq .v1-q45-faq__ask-orb, main.itil-v1 #faq .v1-q45-faq__mark, main.itil-v1 #faq .v1-q45-faq__art { display: none; }
}
