/* ============================================================
   /tools/b2b-saas-marketing-channels/ — the quiz + live-rank UI.
   Loaded only on this tool page via its registry `extra_css` entry
   (see tools/_tool-page.php), on top of the sitewide css/tools.css.

   Same rule as tools.css: no new colors, everything below is an
   existing london.css token (--hairline/--tint/--canvas/--brand/--ink/
   --ink-soft/var(--radius)). The 999px pill shape tools.css already
   reserved for "a future progress bar and effort chips" is used here
   for exactly that — the question progress pill and the Q5 multi-select
   chips (styled after the existing .chip component).
   ============================================================ */

/* Answering a question (or tapping Next) snaps this section to the top
   of the viewport via JS scrollIntoView — this offset keeps it clear of
   the fixed nav instead of tucking under it. */
.quiz { scroll-margin-top: 72px; }

.quiz__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
@media (max-width: 860px) {
  .quiz__grid { grid-template-columns: 1fr; }
}

/* ---------- question panel ---------- */
.quiz-progress { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.4rem; }
.quiz-progress__pill {
  font-family: var(--font-display);
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-soft);
  border: 1.5px solid var(--hairline);
  border-radius: 999px;
  padding: .35em 1em;
  white-space: nowrap;
}
.quiz-progress__track {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--hairline);
  overflow: hidden;
}
.quiz-progress__fill {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width .35s var(--ease, ease);
}

.quiz-question__prompt {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.4rem, 2.6vw, 1.8rem);
  line-height: 1.25;
  margin: 0 0 .4rem;
}
.quiz-question__subtitle {
  color: var(--ink-soft);
  font-size: .95rem;
  margin: 0 0 1.4rem;
}

.quiz-options { display: flex; flex-direction: column; gap: .7rem; margin-bottom: 1.6rem; }
.quiz-options--multi { flex-direction: row; flex-wrap: wrap; gap: .6rem; }

.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: .98rem;
  color: var(--ink);
  background: var(--canvas);
  border: 0.5px solid var(--hairline);
  border-radius: var(--radius);
  padding: .9em 1.1em;
  cursor: pointer;
  transition: border-color .2s var(--ease, ease), background .2s var(--ease, ease);
}
.quiz-option:hover { border-color: var(--brand); }
.quiz-option--selected {
  border-color: var(--brand);
  background: var(--tint);
  font-weight: 600;
}

.quiz-chip {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: .92rem;
  color: var(--ink);
  background: var(--canvas);
  border: 1.5px solid var(--hairline);
  border-radius: 999px;
  padding: .6em 1.15em;
  cursor: pointer;
  transition: border-color .2s var(--ease, ease), background .2s var(--ease, ease), color .2s var(--ease, ease);
}
.quiz-chip:hover { border-color: var(--brand); }
.quiz-chip--selected { border-color: var(--brand); background: var(--brand); color: #fff; }

.quiz-nav { display: flex; justify-content: space-between; gap: 1rem; }
/* Looks disabled but stays clickable — see the JS comment in
   renderQuestion() for why: a tap with no answer yet needs to produce
   .quiz-nav__status feedback, which a real `disabled` button can't do. */
.quiz-nav__next--muted { opacity: .45; }
.quiz-nav__status {
  color: var(--write);
  font-size: .85rem;
  font-weight: 600;
  margin: .7rem 0 0;
  min-height: 1.2em;
}

/* mobile-only <select> swap for single-select questions — see the JS
   comment in renderQuestion() for why. Hidden on desktop regardless of
   the `hidden` attribute; on mobile it replaces the button stack only
   when JS hasn't set `hidden` on it (i.e. only for single-select). */
.quiz-select { display: none; }
@media (max-width: 640px) {
  .quiz-options--single { display: none; }
  .quiz-select:not([hidden]) {
    display: block;
    width: 100%;
    font-family: var(--font-body);
    font-size: .98rem;
    color: var(--ink);
    background: var(--canvas);
    border: 0.5px solid var(--hairline);
    border-radius: var(--radius);
    padding: .9em 1.1em;
    margin-bottom: 1.6rem;
  }
}

/* ---------- live rank panel ---------- */
.quiz-rank-panel {
  border: 0.5px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--tint);
  padding: clamp(1.2rem, 2.5vw, 1.6rem);
}
.quiz-rank__heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  margin: 0 0 1rem;
  color: var(--ink-soft);
}
.quiz-rank-empty { color: var(--ink-soft); font-size: .92rem; line-height: 1.5; margin: 0; }
.quiz-rank-list { list-style: none; margin: 0; padding: 0; }
.quiz-rank-row {
  display: grid;
  grid-template-columns: 2em 1fr 4.5em;
  align-items: center;
  gap: .6rem;
  padding: .5em 0;
  font-size: .88rem;
}
.quiz-rank-row__pos { color: var(--ink-soft); font-weight: 600; text-align: right; }
.quiz-rank-row__name { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quiz-rank-row__name--blurred { filter: blur(4px); user-select: none; }
.quiz-rank-row__bar {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: var(--hairline);
  overflow: hidden;
}
.quiz-rank-row__bar-fill { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

/* ---------- post-quiz reveal ---------- */
/* Top 3 results, stacked full-width Design Scheme cards (.gbox.swatch —
   rank 1 is swatch--duotone-indigo-azure, ranks 2-3 are swatch--grey; see
   renderReveal() in channel-quiz.js) with the metro-line corner deco
   (added per-card via window.FirstOrg.decorateBox, since these render
   after assets/app.js's own DOMContentLoaded sweep already ran). A
   2-line intro shows by default; volumes/scaling/difficulty sit behind
   the "More" toggle so all 3 rows read at a glance before expanding.

   .gbox__title/.gbox__body (on the name + intro) already get correct
   white-on-colour vs. dark-on-grey text from london.css's .swatch /
   .swatch--grey rules — only the custom bits below (rank badge, "More"
   toggle, detail list) need their own light/dark pair, mirroring that
   same .swatch / .swatch--grey override pattern. */
.quiz-reveal-rows { list-style: none; margin: 0 0 1.6rem; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.quiz-reveal-row__head { display: flex; align-items: baseline; gap: .8rem; margin-bottom: .6rem; }
.quiz-reveal-row__head .gbox__title { margin: 0; }
.quiz-reveal-row__intro {
  margin: 0 0 .6rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.quiz-reveal-row__rank {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .82rem;
  border-radius: 999px;
  padding: .2em .8em;
  flex-shrink: 0;
  color: var(--brand);
  border: 1.5px solid var(--brand);
}
.quiz-reveal-row__more {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .85rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  color: var(--brand);
}
.quiz-reveal-row__detail { margin: 1rem 0 0; max-width: 75%; }
.quiz-reveal-row__detail dt {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .85rem;
  margin-top: .7rem;
  color: var(--ink);
}
.quiz-reveal-row__detail dd {
  margin: .2rem 0 0;
  font-size: .9rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.swatch:not(.swatch--grey) .quiz-reveal-row__rank { color: #fff; border-color: rgb(255 255 255 / .7); }
.swatch:not(.swatch--grey) .quiz-reveal-row__more { color: #fff; }
.swatch:not(.swatch--grey) .quiz-reveal-row__detail dt { color: #fff; text-shadow: 0 1px 6px rgb(0 0 0 / .2); }
.swatch:not(.swatch--grey) .quiz-reveal-row__detail dd { color: rgb(255 255 255 / .85); text-shadow: 0 1px 6px rgb(0 0 0 / .2); }

/* Per-channel "Read the full guide" link — same underlined-label treatment
   as .quiz-reveal-row__more, on its own line since it can follow either
   the 2-line intro or the expanded detail list. */
.quiz-reveal-row__guide {
  display: inline-block;
  margin-top: .8rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .85rem;
  text-decoration: underline;
  color: var(--brand);
}
.swatch:not(.swatch--grey) .quiz-reveal-row__guide { color: #fff; }

/* "14 more channels..." heading + the unlock CTA share a line — wraps to
   two lines only if space genuinely runs out. */
.quiz-unlock-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .4rem 1.2rem;
  margin: 0 0 1.2rem;
}
.quiz-unlock-row .quiz-rank__heading { margin: 0; }
.quiz-unlock-link {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--brand);
  white-space: nowrap;
}

/* 14 remaining channels — 2 columns so the list reads as one compact
   block instead of a single long scroll. */
.quiz-blur-list {
  list-style: none;
  margin: 0 0 1.6rem;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 2rem;
}
@media (max-width: 640px) {
  .quiz-blur-list { grid-template-columns: 1fr; }
}
.quiz-blur-row {
  display: grid;
  grid-template-columns: 2.2em 1fr;
  gap: .8rem;
  align-items: center;
  padding: .6em 0;
  border-bottom: 0.5px solid var(--hairline);
}
.quiz-blur-row__pos { color: var(--ink-soft); font-weight: 600; }
.quiz-blur-row__name {
  color: var(--ink);
  filter: blur(5px);
  user-select: none;
}

/* Email capture — the gate itself is now a Design Scheme colour-treatment
   card (.gbox.swatch.swatch--duotone-indigo-red, metro deco, set in
   _mechanism.php) rather than a plain bordered box, and full width
   rather than tools.css's default 420px cap. Its .gbox__title/.gbox__body
   already come out white via london.css's .swatch rules for free. */
.tools-gate { scroll-margin-top: calc(72px + 1.5rem); }
/* The card chrome now lives on .tools-gate itself (.gbox styles it) — the
   inner .tools-gate__form no longer needs the second layer of border/
   background/padding tools.css gives it by default for tools that don't
   wrap it in a swatch card. */
.tools-gate.gbox .tools-gate__form {
  max-width: none;
  padding: 0;
  border: none;
  background: none;
  margin-top: 1.2rem;
}
/* Input + submit button: inline on desktop, full-width stacked on
   mobile. No visible <label> on the email field (removed per design) —
   its accessible name comes from aria-label instead. */
.tools-gate__row { display: flex; gap: .75rem; align-items: stretch; }
.tools-gate__row .form-field__input { flex: 1; }
.tools-gate__row .btn { flex: none; white-space: nowrap; }
@media (max-width: 640px) {
  .tools-gate__row { flex-direction: column; }
  .tools-gate__row .btn { width: 100%; }
}

/* ---------- long-form reference article (docs/tools-gtm-plan-for-company.md
   companion copy, tools/b2b-saas-marketing-channels/_seo-copy.php) ---------- */
/* Same type scale as .guide-article (resources/guides/, reviews/) for
   visual consistency, without adopting that system's sidebar/TOC shell —
   per feedback_article_layout_pattern, tool pages aren't guide pages. */
.tool-article { max-width: 720px; }
.tool-article h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.02em;
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  color: var(--ink);
  margin: clamp(2.8rem, 6vw, 3.8rem) 0 1.1rem;
}
.tool-article h2:first-child { margin-top: 0; }
.tool-article h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  color: var(--ink);
  margin: 1.9rem 0 .7rem;
}
.tool-article p {
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.7;
  margin: 0 0 1.25rem;
}
.tool-article p:last-child { margin-bottom: 0; }
.tool-article strong { color: var(--ink); font-weight: 600; }
.tool-article a { color: var(--brand); text-decoration: underline; text-underline-offset: .15em; }
.tool-article a:hover { text-decoration-thickness: 2px; }
