/*
 * HP-2 "The House" for the quiz: questions (A01/A02), result (A03/A04) and the Starting Point Report (A07).
 * 29 Nov 2026. Founder, 00:59 UTC: "the actual quiz design is flat and does not give custom feel".
 * Loaded after house-pages.css only while flags.HP2_quiz_house (with FD2 + HP1) is on. Presentation only:
 * no copy, question, scoring or route changes. Approved burgundy set only. One whole Soraia photo per page.
 */
body.is-hquiz { --hq-ease: cubic-bezier(.2, .7, .2, 1); }

/* ---------- Question pages ---------- */
body.is-hquiz .hp-body--bare { max-width: 76rem; margin: 0 auto; padding: 0 var(--hp-gut); }
body.is-hquiz .hq { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; min-height: calc(100vh - 9rem); }
body.is-hquiz .hq__side { padding: 1.25rem 0 0; }
body.is-hquiz .hq__side .ep-portrait { display: none; }
body.is-hquiz .hq__main .assess { max-width: 44rem !important; margin: 0; padding: clamp(1.25rem, 4vw, 3rem) 0 clamp(2.5rem, 6vw, 4.5rem); }

/* The progress rail: one hairline segment per question, filled in burgundy as she goes (the words stay in .progress). */
body.is-hquiz .hq-rail { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; }
body.is-hquiz .hq-rail li { height: 3px; background: var(--hp-rule); position: relative; overflow: hidden; }
body.is-hquiz .hq-rail li.is-done { background: var(--hp-burgundy); }
body.is-hquiz .hq-rail li.is-now { background: var(--hp-rule); }
body.is-hquiz .hq-rail li.is-now::after { content: ""; position: absolute; inset: 0; background: var(--hp-burgundy); transform-origin: left; animation: hq-fill 1.1s var(--hq-ease) .2s both; }
@keyframes hq-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

body.is-hquiz .assess .progress { font-family: var(--f-quote); font-style: italic; font-size: 1.15rem !important; letter-spacing: .01em; text-transform: none; color: var(--hp-gold); margin: 0 0 1.25rem; }
body.is-hquiz .assess .progress::before { display: none; }
body.is-hquiz .assess .context-line { font-family: var(--f-narrow); font-size: .72rem !important; letter-spacing: .18em; text-transform: uppercase; color: var(--hp-burgundy); }
body.is-hquiz .assess fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
body.is-hquiz .assess legend { padding: 0; margin: 0 0 clamp(1.5rem, 3.5vw, 2.5rem); }
body.is-hquiz .assess .q__h { font-family: var(--f-display); font-weight: 400; color: var(--hp-ink); font-size: clamp(2rem, 5.4vw, 3.9rem); line-height: 1.02; letter-spacing: -.022em;
  margin: 0; padding: 0; border: 0; text-wrap: balance; }

/* Answers: four engraved cards, lettered A to D, the chosen one framed in burgundy with a filled letter. */
body.is-hquiz .options { counter-reset: hq-opt; display: grid; gap: .8rem; }
body.is-hquiz .option { counter-increment: hq-opt; position: relative; display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) 1.5rem; align-items: center; gap: 1rem;
  min-height: 72px; padding: 1rem 1.25rem 1rem 1rem; margin: 0; background: var(--hp-paper); border: 1px solid var(--hp-rule); border-radius: 0; cursor: pointer;
  box-shadow: 0 1px 0 rgba(42, 30, 27, .03); transition: border-color .3s, box-shadow .4s var(--hq-ease), transform .4s var(--hq-ease), background .3s; }
body.is-hquiz .option::before { content: counter(hq-opt, upper-alpha); content: counter(hq-opt, upper-alpha) / ""; grid-column: 1; grid-row: 1;
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 1px solid var(--hp-gold-soft); font-family: var(--f-display); font-size: 1.25rem; color: var(--hp-burgundy);
  background: var(--hp-paper); transition: background .3s, color .3s, border-color .3s; }
body.is-hquiz .option__text { grid-column: 2; grid-row: 1; font-family: var(--f-body); font-size: clamp(1rem, 1.3vw, 1.1rem); line-height: 1.5; color: var(--hp-ink); }
/* The native radio mark becomes a small tick on the right. Selection is shown by frame, fill and tick, never colour alone. */
body.is-hquiz .option__mark { grid-column: 3; grid-row: 1; width: 1.5rem; height: 1.5rem; margin: 0; border: 0 !important; border-radius: 0; background: none !important; position: relative; }
body.is-hquiz .option__mark::after { content: ""; position: absolute; left: .3rem; top: .35rem; width: .85rem; height: .45rem; border: solid var(--hp-burgundy); border-width: 0 0 2px 2px;
  transform: rotate(-45deg) scale(.4); opacity: 0; transition: opacity .25s, transform .35s var(--hq-ease); }
body.is-hquiz .option:hover { border-color: var(--hp-gold); box-shadow: 0 24px 40px -32px rgba(92, 17, 39, .55); transform: translateY(-1px); }
body.is-hquiz .option:has(input:checked) { border: 1px solid var(--hp-burgundy); background: #fffdf9; box-shadow: 0 0 0 1px var(--hp-burgundy), 0 26px 44px -32px rgba(92, 17, 39, .7); }
body.is-hquiz .option:has(input:checked)::before { background: var(--hp-burgundy); color: var(--hp-paper); border-color: var(--hp-burgundy); }
body.is-hquiz .option input:checked ~ .option__mark::after { opacity: 1; transform: rotate(-45deg) scale(1); }
body.is-hquiz .option:has(input:focus-visible) { outline: 2px solid var(--hp-burgundy); outline-offset: 3px; }
body.is-hquiz .option input:focus-visible ~ .option__mark { outline: 0; }

body.is-hquiz .qform__actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: clamp(1.75rem, 3.5vw, 2.5rem); padding-top: 1.25rem; border-top: 1px solid var(--hp-rule); }
body.is-hquiz .qform__actions .btn--primary { margin-left: auto; min-width: 12rem; }
body.is-hquiz .qform__actions .btn--ghost { border: 0; background: none; box-shadow: none; min-height: 44px; padding: 0; color: var(--hp-muted); }
body.is-hquiz .qform__actions .btn--ghost::after { display: none; }
body.is-hquiz .qform__actions .btn--ghost::before { content: ""; width: 22px; height: 9px; margin-right: .75rem; background: currentColor; transform: scaleX(-1);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 9'%3E%3Cpath d='M0 4.5h20M16.5 1l4 3.5-4 3.5' fill='none' stroke='%23000' stroke-width='1.2'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 9'%3E%3Cpath d='M0 4.5h20M16.5 1l4 3.5-4 3.5' fill='none' stroke='%23000' stroke-width='1.2'/%3E%3C/svg%3E") center / contain no-repeat; }
body.is-hquiz .qform__actions .btn--ghost:hover { color: var(--hp-burgundy); }

/* Desktop: a two-column spread. Left, the rail and Soraia on her mat; right, the question. */
@media (min-width: 64em) {
  body.is-hquiz .hq { grid-template-columns: 21rem minmax(0, 1fr); column-gap: clamp(3rem, 7vw, 6.5rem); align-items: start; }
  body.is-hquiz .hq__side { position: sticky; top: 0; padding: clamp(2.5rem, 5vw, 3.75rem) 0 2rem; }
  body.is-hquiz .hq__side .ep-portrait { display: block; margin-top: 2rem; }
  body.is-hquiz .hq__side .ep-portrait__fig { position: relative; max-width: none; }
  body.is-hquiz .hq__side .ep-portrait__frame { background: var(--hp-paper); padding: .6rem; border: 1px solid var(--hp-rule); position: relative; z-index: 1; box-shadow: 0 40px 70px -45px rgba(92, 17, 39, .55); }
  body.is-hquiz .hq__side .ep-portrait__frame::after { inset: .6rem; }
  body.is-hquiz .hq__side .ep-portrait__fig::before { content: ""; position: absolute; z-index: 0; top: 1rem; left: 1rem; right: -1rem; bottom: 1.3rem; border: 1px solid var(--hp-burgundy); }
  body.is-hquiz .hq__side .ep-portrait figcaption { text-align: left; position: relative; z-index: 1; }
  body.is-hquiz .hq__main .assess { padding-top: clamp(3rem, 6vw, 4.5rem); }
}

/* ---------- Result and report: the ladder and steps as a printed publication ---------- */
body.is-hquiz .result .eyebrow, body.is-hquiz .report .eyebrow { font-family: var(--f-narrow); font-weight: 500; font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--hp-burgundy);
  display: flex; align-items: center; gap: .9rem; margin: 0 0 1.25rem; }
body.is-hquiz .result .eyebrow::before, body.is-hquiz .report .eyebrow::before { content: ""; width: 2.5rem; height: 1px; background: var(--hp-burgundy); margin: 0; }
body.is-hquiz .result .lede { max-width: 44rem; }
body.is-hquiz .result > section, body.is-hquiz .report > section { margin: clamp(2.5rem, 5vw, 3.75rem) 0; }
body.is-hquiz .report > section:not(.card):not(.paid) { padding-top: clamp(1.75rem, 3.5vw, 2.5rem); border-top: 1px solid var(--hp-rule); }
body.is-hquiz .report h3 { font-family: var(--f-quote) !important; font-style: italic; text-transform: none !important; letter-spacing: 0 !important; font-weight: 500 !important; font-size: 1.35rem !important; color: var(--hp-burgundy) !important; }

/* The ladder: six rungs on paper, her rung framed in burgundy with a marker on the rail, not a black slab. */
body.is-hquiz .ladder { display: grid; gap: 0; margin: 1.25rem 0 .75rem; border-top: 1px solid var(--hp-ink); counter-reset: none; }
body.is-hquiz .ladder__step { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 1rem; align-items: baseline; padding: 1rem .25rem; margin: 0;
  background: transparent !important; border: 0 !important; border-bottom: 1px solid var(--hp-rule) !important; border-radius: 0; color: var(--hp-body) !important; position: relative; }
body.is-hquiz .ladder__num { width: auto; height: auto; flex: none; border: 0 !important; border-radius: 0; background: none !important; display: block;
  font-family: var(--f-display); font-weight: 400; font-size: 2.1rem; line-height: 1; color: var(--hp-gold-soft) !important; }
body.is-hquiz .ladder__name { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.15rem, 1.8vw, 1.35rem); color: var(--hp-ink) !important; }
body.is-hquiz .ladder__ex { font-family: var(--f-quote); font-style: italic; font-size: 1.05rem; color: var(--hp-muted) !important; }
body.is-hquiz .ladder__step.is-here { background: #fffdf9 !important; box-shadow: inset 3px 0 0 var(--hp-burgundy), 0 0 0 1px var(--hp-burgundy); padding-left: 1rem; z-index: 1; }
body.is-hquiz .ladder__step.is-here .ladder__num { color: var(--hp-burgundy) !important; }
body.is-hquiz .ladder__step.is-here .ladder__name { color: var(--hp-burgundy) !important; }
body.is-hquiz .ladder__here { display: inline-flex; align-items: center; gap: .5rem; margin-top: .6rem; font-family: var(--f-narrow); font-weight: 500; font-size: .68rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--hp-paper) !important; background: var(--hp-burgundy); padding: .35rem .7rem; align-self: start; width: max-content; }
body.is-hquiz .ladder__here > span[aria-hidden] { color: var(--hp-gold-soft); }
body.is-hquiz .ladder + .caption, body.is-hquiz .caption { font-size: .85rem; color: var(--hp-muted); }
body.is-hquiz .result .card:has(.ladder), body.is-hquiz .report .card:has(.ladder) { padding-bottom: clamp(1.25rem, 3vw, 2rem); }

/* Next steps: big numerals, hairline rows. */
body.is-hquiz .steps--free { counter-reset: hq-step; list-style: none; padding: 0; margin: 1rem 0 0; border-top: 1px solid var(--hp-ink); }
body.is-hquiz .steps--free li { counter-increment: hq-step; display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); align-items: baseline; gap: 1rem; padding: 1rem .25rem; margin: 0; border-bottom: 1px solid var(--hp-rule); }
body.is-hquiz .steps--free li::before { content: counter(hq-step, decimal-leading-zero); content: counter(hq-step, decimal-leading-zero) / ""; font-family: var(--f-display); font-size: 1.9rem; line-height: 1; color: var(--hp-burgundy); }
body.is-hquiz .steps--free li::marker { content: none; }
body.is-hquiz .note { background: var(--hp-linen); border: 0; border-left: 2px solid var(--hp-burgundy); padding: 1rem 1.25rem; font-family: var(--f-quote); font-style: italic; font-size: 1.15rem !important; color: var(--hp-ink); }
body.is-hquiz .disclose { font-size: .88rem !important; color: var(--hp-muted); border: 0; padding: 0; }
body.is-hquiz .capture h2, body.is-hquiz .report .card h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
body.is-hquiz .paid { margin-top: clamp(2.5rem, 5vw, 3.75rem); padding: clamp(1.75rem, 4vw, 2.75rem); background: var(--hp-linen); text-align: left; position: relative; }
body.is-hquiz .paid::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(122, 22, 49, .25); pointer-events: none; }
body.is-hquiz .paid .btn { margin-top: .75rem; }

/* HP-3 (29 Nov 2026): the three quiz photos are 2:3, so their frame is 2:3 too (never cropped). */
body.is-hquiz .ep-portrait--23 .ep-portrait__frame img { aspect-ratio: 1024 / 1536; object-fit: contain; }

@media (prefers-reduced-motion: reduce) {
  body.is-hquiz .hq-rail li.is-now::after { animation: none; }
  body.is-hquiz .option, body.is-hquiz .option::before, body.is-hquiz .option__mark::after { transition: none !important; }
}
@media print { body.is-hquiz .hq__side { display: none; } }
