/* Protocol One - GLP-1 quiz module
 * Extends style.css. Editorial, NYT-style "Should I X?" quiz.
 * Lives only on /should-i-get-on-glp-1.
 */

/* === QUIZ SHELL === */
.quiz {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: var(--gap-l) var(--pad-x);
}

.quiz__progress {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: var(--gap-s);
  border-top: 2px solid var(--coral);
  border-bottom: 1px solid var(--black);
  padding: var(--gap-s) 0;
  margin: 0 0 var(--gap-m);
}
.quiz__progress-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--coral);
  margin: 0;
}
.quiz__progress-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--t-meta);
  letter-spacing: 0.08em;
  color: var(--ink-50);
}
.quiz__progress-bar {
  grid-column: 1 / -1;
  height: 6px;
  background: var(--rule);
  position: relative;
  overflow: hidden;
  border-radius: 0;
}
.quiz__progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--coral);
  width: 0%;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === SKIP-LINK (accessibility) === */
.quiz__skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--t-meta);
  color: var(--coral-deep);
}
.quiz__skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.4rem 0.75rem;
  display: inline-block;
  background: var(--coral);
  color: var(--cream);
  border: 2px solid var(--coral-deep);
  margin: 0 0 var(--gap-s);
  outline: 3px solid var(--coral);
  outline-offset: 4px;
}

/* === STEP === */
.quiz__step {
  display: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  will-change: opacity, transform;
}
.quiz__step--active {
  display: block;
}
.quiz__step--leaving {
  pointer-events: none;
}

/* Honor prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .quiz__step,
  .quiz__progress-fill,
  .quiz__option,
  .quiz__btn,
  .quiz__result-card {
    transition: none !important;
    animation: none !important;
  }
}

/* Visible coral focus ring across all interactive elements */
.quiz__option:focus-visible,
.quiz__btn:focus-visible,
.quiz__field input:focus-visible,
.quiz__restart:focus-visible,
.quiz__result-card:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 4px;
}
.quiz__question {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 1;
  font-weight: 500;
  font-size: var(--t-h2);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--black);
  margin: 0 0 var(--gap-s);
  max-width: 22ch;
}
.quiz__question em {
  font-style: italic;
  color: var(--coral);
  font-variation-settings: "opsz" 144, "SOFT" 80, "WONK" 1;
}
.quiz__sub {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 24, "SOFT" 0, "WONK" 0;
  font-weight: 350;
  font-size: var(--t-lede);
  line-height: 1.4;
  color: var(--black-soft);
  max-width: 50ch;
  margin: 0 0 var(--gap-m);
}

/* === OPTIONS === */
.quiz__options {
  display: grid;
  gap: 0.5rem;
  margin: 0 0 var(--gap-m);
}
.quiz__option {
  display: block;
  padding: 1rem 1.1rem;
  border: 1.5px solid var(--rule);
  background: var(--cream);
  color: var(--black);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: var(--t-body);
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  width: 100%;
  position: relative;
  min-height: 44px;
  line-height: 1.4;
}
.quiz__option:hover {
  border-color: var(--black);
  background: var(--warm-cream);
}
.quiz__option--active,
.quiz__option[aria-pressed="true"] {
  border-color: var(--coral);
  background: var(--coral);
  color: var(--cream);
}
.quiz__option--active:hover,
.quiz__option[aria-pressed="true"]:hover {
  background: var(--coral-deep);
  border-color: var(--coral-deep);
}
.quiz__option-key {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--coral);
  margin-right: 0.85rem;
  display: inline-block;
  min-width: 1.2em;
}
.quiz__option--active .quiz__option-key,
.quiz__option[aria-pressed="true"] .quiz__option-key {
  color: var(--cream);
  opacity: 0.85;
}
.quiz__option-note {
  display: block;
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 14, "SOFT" 0, "WONK" 0;
  font-weight: 350;
  font-size: var(--t-meta);
  line-height: 1.4;
  color: var(--ink-50);
  margin: 0.3rem 0 0 calc(1.2em + 0.85rem);
}
.quiz__option--active .quiz__option-note,
.quiz__option[aria-pressed="true"] .quiz__option-note {
  color: var(--cream);
  opacity: 0.85;
}

/* === INPUTS === */
.quiz__inputs {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 var(--gap-m);
}
@media (max-width: 480px) {
  .quiz__inputs { grid-template-columns: 1fr; }
}
.quiz__field label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--coral);
  margin: 0 0 0.4rem;
}
.quiz__field input {
  width: 100%;
  border: 1.5px solid var(--black);
  background: var(--cream);
  padding: 0.85rem 1rem;
  font: inherit;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: var(--t-body);
  color: var(--black);
  min-height: 44px;
}
.quiz__field input:focus {
  outline: 2px solid var(--coral);
  outline-offset: 0;
}
.quiz__field-note {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--t-meta);
  letter-spacing: 0.04em;
  color: var(--ink-50);
  margin: 0.4rem 0 0;
}
.quiz__field-error {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--t-meta);
  letter-spacing: 0.04em;
  color: #c0392b;
  margin: 0.4rem 0 0;
  min-height: 1.2em;
}

/* === NAV === */
.quiz__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--gap-s);
  border-top: 1px solid var(--rule);
  padding-top: var(--gap-s);
  margin-top: var(--gap-s);
  flex-wrap: wrap;
}
.quiz__btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--t-meta);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.85rem 1.4rem;
  background: var(--black);
  color: var(--cream);
  border: 1.5px solid var(--black);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  min-height: 44px;
}
.quiz__btn:hover {
  background: var(--coral);
  border-color: var(--coral);
}
.quiz__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--ink-50);
  border-color: var(--ink-50);
}
.quiz__btn--ghost {
  background: transparent;
  color: var(--black);
  border-color: var(--rule);
}
.quiz__btn--ghost:hover {
  background: var(--cream-deep);
  color: var(--black);
  border-color: var(--black);
}
.quiz__btn--ghost:disabled {
  background: transparent;
  color: var(--rule);
}
/* Only one Next button visible at a time, controlled by JS */
.quiz__btn--next { display: none; }
.quiz__btn--next.quiz__btn--visible { display: inline-block; }

/* === RESULT === */
.quiz__result {
  display: none;
}
.quiz__result--active {
  display: block;
}
.quiz__result-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--coral);
  margin: 0 0 var(--gap-s);
}
.quiz__result-title {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 1;
  font-weight: 500;
  font-size: var(--t-h1);
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--black);
  margin: 0 0 var(--gap-m);
  max-width: 18ch;
}
.quiz__result-title em {
  font-style: italic;
  color: var(--coral);
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
}
.quiz__result-body p {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 16, "SOFT" 0, "WONK" 0;
  font-weight: 350;
  font-size: var(--t-lede);
  line-height: 1.55;
  color: var(--black);
  margin: 0 0 var(--gap-s);
}
.quiz__result-body p strong {
  font-variation-settings: "opsz" 16, "SOFT" 50, "WONK" 0;
  font-weight: 600;
}

.quiz__result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 var(--gap-m);
}
.quiz__result-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--t-meta);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--black);
  background: var(--warm-cream);
  color: var(--black);
}
.quiz__result-pill--prime {
  background: var(--coral);
  color: var(--cream);
  border-color: var(--coral);
}

.quiz__result-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  border-top: 1px solid var(--black);
  border-left: 1px solid var(--black);
  margin: var(--gap-m) 0;
}
.quiz__result-card {
  display: block;
  padding: var(--gap-s);
  border-right: 1px solid var(--black);
  border-bottom: 1px solid var(--black);
  background: var(--cream);
  color: var(--black);
  text-decoration: none;
  border-bottom-color: var(--black) !important;
  transition: background 0.18s ease, color 0.18s ease;
}
.quiz__result-card:hover {
  background: var(--coral);
  color: var(--cream);
  border-bottom-color: var(--coral) !important;
}
.quiz__result-card-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--coral);
  margin: 0 0 0.4rem;
}
.quiz__result-card:hover .quiz__result-card-label {
  color: var(--cream);
  opacity: 0.85;
}
.quiz__result-card-name {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 1;
  font-weight: 600;
  font-size: var(--t-h3);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem;
  color: inherit;
}
.quiz__result-card-why {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 14, "SOFT" 30, "WONK" 0;
  font-weight: 350;
  font-size: var(--t-meta);
  line-height: 1.4;
  color: var(--ink-50);
  margin: 0;
}
.quiz__result-card:hover .quiz__result-card-why {
  color: var(--cream);
  opacity: 0.9;
}

.quiz__affiliate {
  border-top: 2px solid var(--coral);
  border-bottom: 1px solid var(--black);
  padding: var(--gap-s) 0;
  margin: var(--gap-m) 0;
}
.quiz__affiliate-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--coral);
  margin: 0 0 var(--gap-s);
}
.quiz__affiliate-stub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--t-meta);
  letter-spacing: 0.04em;
  color: var(--ink-50);
  margin: 0;
}

.quiz__restart {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--t-meta);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--coral-deep);
  border-bottom: 1.5px solid var(--coral);
  padding-bottom: 2px;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
  margin: var(--gap-m) 0 0;
}
.quiz__restart:hover {
  color: var(--black);
  border-bottom-color: var(--black);
}

/* === MASTER QUIZ EXTENSIONS === */
.quiz__cross-link {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--t-meta);
  letter-spacing: 0.04em;
  color: var(--ink-50);
  margin: var(--gap-s) 0 0;
  padding: 0.65rem 0.85rem;
  border-left: 2px solid var(--coral);
  background: var(--warm-cream);
}
.quiz__cross-link a {
  color: var(--coral-deep);
  font-weight: 600;
  border-bottom: 1px solid var(--coral);
}
.quiz__cross-link a:hover {
  color: var(--black);
  border-bottom-color: var(--black);
}

.quiz__editor-note {
  border: 1.5px solid var(--coral);
  background: var(--warm-cream);
  padding: var(--gap-s);
  margin: 0 0 var(--gap-m);
}
.quiz__editor-note-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--coral-deep);
  margin: 0 0 0.4rem;
}
.quiz__editor-note-body {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 16, "SOFT" 0, "WONK" 0;
  font-weight: 350;
  font-size: var(--t-body);
  line-height: 1.5;
  color: var(--black);
  margin: 0;
  font-style: italic;
}

.quiz__result-secondary {
  border-top: 2px solid var(--coral);
  padding-top: var(--gap-s);
  margin: var(--gap-m) 0;
}
.quiz__result-secondary-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--coral);
  margin: 0 0 var(--gap-s);
}
.quiz__result-secondary-title {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 1;
  font-weight: 500;
  font-size: var(--t-h2);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--black);
  margin: 0 0 var(--gap-s);
}
.quiz__result-secondary-body p {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 16, "SOFT" 0, "WONK" 0;
  font-weight: 350;
  font-size: var(--t-body);
  line-height: 1.5;
  color: var(--black);
  margin: 0 0 var(--gap-s);
}

/* === MOBILE === */
@media (max-width: 480px) {
  .quiz__question { font-size: clamp(1.7rem, 1.4rem + 2vw, 2.2rem); }
  .quiz__option { font-size: 0.98rem; padding: 0.9rem 1rem; }
  .quiz__option-note { margin-left: 0; }
  .quiz__nav { flex-direction: row; }
  .quiz__btn { flex: 1; padding: 0.85rem 1rem; font-size: 0.78rem; }
  .quiz__editor-note-body { font-size: 0.95rem; }
}

/* === FULL-BLEED QUIZ CANVAS ===
 * Triggered by body.quiz-active. Hides marketing chrome while the user is
 * mid-quiz so the only thing on screen is the question, the answers, and
 * a sticky bottom progress bar. Restored when the result renders.
 */
body.quiz-active .masthead,
body.quiz-active .article__hero .dosing-banner,
body.quiz-active .article__hero .article__index,
body.quiz-active .article__hero .article__name,
body.quiz-active .article__hero .article__deck,
body.quiz-active .article__hero .quiz__cross-link,
body.quiz-active .article__section,
body.quiz-active .article__footnote,
body.quiz-active .colophon {
  display: none !important;
}
body.quiz-active .article {
  padding-top: 0;
}
body.quiz-active .article__body {
  padding: 0;
}
body.quiz-active .article__hero {
  padding: 0;
  margin: 0;
  border: 0;
}
body.quiz-active .quiz {
  max-width: var(--container-narrow);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--gap-l) var(--pad-x) calc(var(--gap-l) + 80px);
  position: relative;
}
/* Minimal brand wordmark, top-left while quiz active */
body.quiz-active .quiz::before {
  content: 'Protocol·One';
  position: fixed;
  top: 1rem;
  left: 1.25rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--t-meta);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-50);
  pointer-events: none;
  z-index: 10;
}
/* Pin progress bar to viewport bottom while quiz active */
body.quiz-active .quiz__progress {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0.65rem var(--pad-x);
  background: var(--cream);
  border-top: 1px solid var(--rule);
  border-bottom: none;
  z-index: 9;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  max-width: none;
}
body.quiz-active .quiz__progress-label {
  display: none;
}
body.quiz-active .quiz__progress-count {
  font-size: var(--t-eyebrow);
  color: var(--ink-50);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
body.quiz-active .quiz__progress-bar {
  grid-column: auto;
  height: 4px;
  background: var(--rule);
}
@media (max-width: 480px) {
  body.quiz-active .quiz {
    padding: var(--gap-m) var(--pad-x) calc(var(--gap-m) + 70px);
    min-height: 100vh;
    min-height: 100dvh;
    justify-content: flex-start;
    padding-top: 4rem;
  }
  body.quiz-active .quiz::before {
    top: 0.65rem;
    left: 0.85rem;
  }
  body.quiz-active .quiz__progress {
    grid-template-columns: 1fr auto;
    padding: 0.55rem 0.85rem;
  }
  body.quiz-active .quiz__progress-bar {
    grid-column: 1 / -1;
  }
}

/* === SHARE ROW === */
.quiz__share {
  margin: var(--gap-m) 0 0;
}
.quiz__share:empty {
  display: none;
}
.quiz__share-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--coral);
  margin: 0 0 var(--gap-s);
}
.quiz__share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.quiz__share-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--t-meta);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.75rem 1.1rem;
  background: var(--cream);
  color: var(--black);
  border: 1.5px solid var(--black);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.quiz__share-btn:hover,
.quiz__share-btn:focus-visible {
  background: var(--coral);
  color: var(--cream);
  border-color: var(--coral);
}
.quiz__share-btn:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 4px;
}
@media (max-width: 480px) {
  .quiz__share-row { flex-direction: column; align-items: stretch; }
  .quiz__share-btn { justify-content: center; padding: 0.85rem 1rem; }
}
