/* ============================================================
   The front door: one question, the contents, and behind the question
   the Guided Path. Layout, type and colour follow the design handoff's
   final design, 2a on a phone and 2b on a desktop, and the earlier
   1c/2c for the stepped flow. Every colour is a token from styles.css.
   `_guided.py` is the markup, `guided.js` the behaviour.
   ============================================================ */

.guided { margin: 0 0 var(--s5); }

/* One DOM order, two arrangements. A phone runs it down: the question and
   its chips, then the contents, then why the site exists. A desktop stands
   the contents beside the question as a 280px column and the reason sits
   under the question. */
.guided__grid { display: grid; gap: var(--s4); }
.guided__main { min-width: 0; }
.guided__side { min-width: 0; }

@media (min-width: 900px) {
  .guided { margin: 0 -24px var(--s5); }
  .guided__grid {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 0;
    min-height: 560px;
  }
  .guided__side {
    grid-column: 1; grid-row: 1 / span 2;
    padding: 28px 24px;
    border-right: 1px solid var(--rule);
    background: var(--paper-2);
    display: flex; flex-direction: column;
  }
  .guided__grid { grid-template-rows: auto 1fr; }
  .guided__main { grid-column: 2; grid-row: 1; padding: 40px 44px 0; }
  .guided .guided__why { grid-column: 2; grid-row: 2; align-self: start;
                         margin: 32px 44px 40px; max-width: 640px; }
  .guided__note { margin-top: auto; }
}

/* ---------- the question ---------- */

.guided__eyebrow {
  margin: 0;
  font-family: var(--font-hand); font-weight: 500; font-size: 10.5px; line-height: 1;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint);
}
.guided__ask {
  margin: 12px 0 0; max-width: 560px;
  font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1.05;
  letter-spacing: -0.025em; color: var(--ink); text-wrap: pretty;
}
.guided__chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; max-width: 640px; }
.guided__chip {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 12px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--rule-strong); background: var(--paper-card);
  font-family: var(--font-ui); font-weight: 600; font-size: 14px; line-height: 1;
  color: var(--ink);
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.guided__chip:hover { border-color: var(--deep); background: var(--hover-cream); }
.guided__chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.guided__chip[aria-pressed="true"],
.guided:not([data-guided-role]) .guided__chip:first-child {
  background: var(--deep); border-color: var(--deep); color: var(--cream-on-deep);
}
.guided__lede {
  margin: 14px 0 0; max-width: var(--measure);
  font-family: var(--font-body); font-weight: 300; font-size: 15px; line-height: 1.5;
  color: var(--ink-soft);
}

/* ---------- why the site exists, and every green quote card ---------- */

.why, blockquote.pull {
  margin: 0; padding: 22px 26px; border-radius: 8px;
  background: var(--deep); color: var(--cream-on-deep);
  border: 0; font-style: normal;
}
.why__e {
  display: block; margin-bottom: 10px;
  font-family: var(--font-hand); font-weight: 500; font-size: 10.5px; line-height: 1;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold);
}
.why__q, blockquote.pull {
  font-family: var(--font-body); font-weight: 400; font-size: 19px; line-height: 1.4;
  text-wrap: pretty;
}
.why__q { margin: 0; max-width: none; }
.why__who, blockquote.pull cite {
  display: block; margin-top: 12px;
  font-family: var(--font-ui); font-weight: 700; font-size: 10.5px; line-height: 1;
  letter-spacing: 0.1em; text-transform: uppercase; font-style: normal;
  color: var(--cream-on-deep); opacity: 0.65;
}
.why__who a { color: inherit; text-decoration: none; display: inline-flex; align-items: center;
              min-height: 44px; margin: -16px 0 -14px; }
.why__who a:hover { text-decoration: underline; }
blockquote.pull { margin: var(--s4) 0; max-width: var(--measure); color: var(--cream-on-deep); }

/* ---------- the contents ---------- */

.guided__eyebrow--side { padding-bottom: 10px; border-bottom: 1px solid var(--rule); max-width: none; }
/* On a desktop the chips stay while a path is open, so a reader can change
   their mind without going back to the start. A phone folds them away and
   the arrow in the progress row goes home. */
.guided[data-guided-role] .guided__home > :not(.guided__chips) { display: none; }
.guided[data-guided-role] .guided__chips { margin: 0 0 22px; }
@media (max-width: 640px) {
  .guided[data-guided-role] .guided__home { display: none; }
}
.guided__side-short { display: none; }
.contents { display: flex; flex-direction: column; }
.contents__row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 44px; padding: 13px 2px; box-sizing: border-box;
  border-bottom: 1px solid var(--rule);
  color: var(--ink); text-decoration: none;
}
.contents__row:hover .contents__name { text-decoration: underline; }
.contents__row:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.contents__rung {
  flex: 0 0 4px; width: 4px; height: 24px; border-radius: 2px;
  background: var(--accent, var(--ink)); margin-right: 8px;
}
.contents__name {
  flex: 1 1 auto;
  font-family: var(--font-ui); font-weight: 700; font-size: 15px; line-height: 1.2;
  letter-spacing: -0.02em;
}
.contents__n {
  flex: 0 0 auto; text-align: right;
  font-family: var(--font-ui); font-weight: 600; font-size: 11px; line-height: 1.3;
  color: var(--ink-faint);
}
.contents__n-short { display: none; }
@media (max-width: 640px) {
  .contents__n-full { display: none; }
  .contents__n-short { display: inline; }
}
.guided__note {
  margin: 18px 0 0; padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-body); font-weight: 300; font-size: 13px; line-height: 1.5;
  color: var(--ink-soft); max-width: none; text-wrap: pretty;
}

/* ---------- the path, once a chip is pressed ---------- */

.guided__progress { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.guided__step {
  flex: 0 0 auto; padding: 5px 11px; border-radius: 999px;
  background: var(--deep); color: #FFFFFF;
  font-family: var(--font-ui); font-weight: 600; font-size: 11px; line-height: 1;
}
.guided__track {
  flex: 1 1 auto; height: 3px; border-radius: 99px; overflow: hidden;
  background: var(--rule);
}
.guided__track i {
  display: block; height: 100%; width: 0; background: var(--deep);
  transition: width .3s ease;
}
.guided__left {
  flex: 0 0 auto;
  font-family: var(--font-ui); font-weight: 500; font-size: 11.5px; line-height: 1;
  color: var(--ink-faint);
}
.guided__mback, .guided__mskip { display: none; }

.guided__q { margin-bottom: 24px; }
.guided__stage {
  display: block; margin-bottom: 10px;
  font-family: var(--font-hand); font-weight: 500; font-size: 10.5px; line-height: 1;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint);
}
.guided__stage:empty { display: none; }
.guided__h {
  margin: 0 0 8px;
  font-family: var(--font-display); font-weight: 800; font-size: 32px; line-height: 1.03;
  letter-spacing: -0.015em; color: var(--ink); text-wrap: balance;
}
.guided__sub {
  margin: 0; max-width: 520px;
  font-family: var(--font-body); font-weight: 300; font-size: 15px; line-height: 1.5;
  color: var(--ink-soft); text-wrap: pretty;
}
/* A card printed in place is the reading, not a sub-line, so it takes the
   body size and the body weight. */
.guided__sub--card { font-weight: 400; font-size: 17px; line-height: 1.55; color: var(--ink); }

.guided__answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 600px; }
.guided__answer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 44px; padding: 16px 18px; border-radius: 6px;
  border: 1px solid var(--rule-strong); background: var(--paper-card);
  font-family: var(--font-body); font-weight: 400; font-size: 15px; line-height: 1.3;
  color: var(--ink); text-align: left; text-decoration: none; cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.guided__answer:hover { border-color: var(--deep); background: var(--hover-cream); }
.guided__answer:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.guided__go {
  flex: 0 0 auto;
  font-family: var(--font-ui); font-weight: 600; font-size: 12px; color: var(--ink-faint);
}

.guided__foot {
  display: flex; align-items: center; flex-wrap: wrap; gap: 18px;
  margin-top: 26px; padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.guided__link {
  padding: 0; border: 0; background: none; cursor: pointer;
  min-height: 24px;
  font-family: var(--font-ui); font-weight: 500; font-size: 12.5px; line-height: 1;
  color: var(--forest); text-decoration: none;
}
.guided__link--back { color: var(--ink-faint); }
.guided__link:hover { text-decoration: underline; }

.guided__payoff {
  margin-top: 28px; padding: 20px 22px; border-radius: 8px;
  background: var(--deep); color: var(--cream-on-deep);
}
.guided__payoff-e {
  display: block; margin-bottom: 8px;
  font-family: var(--font-hand); font-weight: 500; font-size: 10.5px; line-height: 1;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold);
}
.guided__payoff-t {
  margin: 0; max-width: none;
  font-family: var(--font-body); font-weight: 400; font-size: 19px; line-height: 1.3;
  color: inherit;
}

.guided__flow.is-in { animation: guided-in .18s ease-out; }
@keyframes guided-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .guided__flow.is-in { animation: none; }
  .guided__track i { transition: none; }
}

/* ---------- the diagnosis inside the path ----------

   The same walker the homepage always had. The shell is the frame now, so
   the green slab it used to sit in comes off and its own heading goes: the
   question the walker prints is the heading. Its trail is the bar's crumbs
   and the back link, so it goes too. */
.guided .finder--solo { background: none; border-radius: 0; padding: 0; margin: 0; }
.guided .finder--solo .finder__head { display: none; }
.guided .finder--solo .finder__dq { background: none; border: 0; border-radius: 0; padding: 0; }
.guided .finder__dq-trail { display: none; }
.guided .finder__dq-qhead { margin-bottom: 18px; }
.guided .finder__dq-step {
  font-family: var(--font-hand); font-weight: 500; font-size: 10.5px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint);
}
.guided .finder__dq-q {
  font-family: var(--font-display); font-weight: 800; font-size: 32px; line-height: 1.03;
  letter-spacing: -0.015em; color: var(--ink);
}

/* ---------- a phone: one column, 44px targets ---------- */

@media (max-width: 899px) {
  .guided { margin-top: var(--s4); }
  .guided__side-full { display: none; }
  .guided__side-short { display: inline; }
  .guided__why { max-width: none; }
}

@media (max-width: 640px) {
  .guided { margin-top: var(--s3); }
  .guided__grid { gap: var(--s4); }
  .guided__ask { font-size: 24px; line-height: 1.1; letter-spacing: -0.02em; margin-top: 8px; }
  .guided__chips { gap: 6px; margin-top: 12px; }
  .guided__chip { font-size: 12.5px; padding: 12px 13px; }
  .guided__lede { font-size: 14px; margin-top: 12px; }
  .guided__grid { gap: var(--s3); }
  .contents__row { padding: 12px 2px; }
  .contents__rung { height: 22px; margin-right: 8px; }
  .contents__name { font-size: 15px; }
  .contents__n { font-size: 11.5px; }
  .why, blockquote.pull { padding: 18px 20px; }
  .why__q, blockquote.pull { font-size: 15.5px; line-height: 1.42; }

  .guided__progress { gap: 12px; margin-bottom: 20px; }
  .guided__mback {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 999px; border: 0; cursor: pointer;
    background: var(--rule-soft); color: var(--ink);
    font-family: var(--font-ui); font-weight: 600; font-size: 15px; line-height: 1;
  }
  .guided__mskip {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px;
    font-family: var(--font-ui); font-weight: 500; font-size: 12px; line-height: 1;
    color: var(--forest); text-decoration: none;
  }
  .guided__link--back { display: none; }

  .guided__h, .guided .finder__dq-q { font-size: 28px; }
  .guided__sub { font-size: 14.5px; }
  .guided__answers { grid-template-columns: minmax(0, 1fr); gap: 8px; max-width: none; }
  .guided__answer { min-height: 56px; padding: 14px 18px; border-radius: 8px; font-size: 16px; }
  .guided__go { font-size: 13px; }

  .guided__foot { gap: 8px; margin-top: 16px; padding-top: 16px; }
  .guided__foot .guided__link {
    flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center;
    height: 44px; border-radius: 999px; background: var(--rule-soft); color: var(--ink);
    font-size: 13px;
  }
  .guided__payoff { margin-top: 16px; padding: 16px 18px; }
  .guided__payoff-e { font-size: 10px; margin-bottom: 6px; }
  .guided__payoff-t { font-size: 16.5px; line-height: 1.35; }
}
