/**
 * Style Confidence Quiz — editorial, calm, brand-aligned.
 * Loads on body.page-template-page-style-quiz and on posts that embed
 * the [22hues_style_quiz] shortcode (scoped via .style-quiz-page wrapper).
 */

/* --------------------------------------------------------------------------
   1. Page-wide cream override + hide leaked global panels
   -------------------------------------------------------------------------- */

body.page-template-page-style-quiz {
  background: var(--cream, #F6F1EB);
  color: var(--charcoal, #191919);
}

body.page-template-page-style-quiz .site-main {
  background: var(--cream, #F6F1EB);
}

/* The header.php emits .search-overlay statically. There is no global
   default rule hiding it, so on get_header() pages the markup leaks
   inline as visible text ("Soft Autumn Soft Summer Book Session ..."). 
   Hide it here only on the quiz page; the JS-triggered ".active" state
   will still reveal it normally if the user opens search. */
body.page-template-page-style-quiz .search-overlay {
  position: fixed;
  inset: 0;
  background: var(--cream, #F6F1EB);
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

body.page-template-page-style-quiz .search-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Belt-and-braces: nothing breadcrumb-like or palette-nav-like should
   show through on the quiz template. */
body.page-template-page-style-quiz .palette-quick-nav,
body.page-template-page-style-quiz .breadcrumb,
body.page-template-page-style-quiz .woocommerce-breadcrumb {
  display: none !important;
}

/* --------------------------------------------------------------------------
   2. Quiz page shell
   -------------------------------------------------------------------------- */

.style-quiz-page.section {
  background: var(--cream, #F6F1EB);
  color: var(--charcoal, #191919);
  padding: 140px 24px 120px;
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.style-quiz-page .container {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
}

body.page-template-page-style-quiz.style-quiz-outcome-page .style-quiz-page .container {
  max-width: 860px;
}

.style-quiz-wrap {
  font-family: var(--font-body, 'Inter', -apple-system, sans-serif);
  color: var(--charcoal, #191919);
  animation: styleQuizFadeIn 600ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Sibling-of-panel back affordance (gate + outcome). Sits inside the
   already-padded .style-quiz-page wrapper, so no extra top padding here —
   just a little breathing room before the centred panel below. */
.style-quiz-back-link {
  display: inline-flex;
  margin: 0 0 24px;
  align-self: flex-start;
}

@keyframes styleQuizFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   3. Panels (intro / gate / question / outcome) — flat editorial blocks,
      not modal cards.
   -------------------------------------------------------------------------- */

.style-quiz-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  text-align: center;
}

.style-quiz-question,
.style-quiz-outcome {
  text-align: left;
}

/* --------------------------------------------------------------------------
   4. Typography
   -------------------------------------------------------------------------- */

.style-quiz-eyebrow,
.style-quiz-kicker,
.style-quiz-step-label,
.style-quiz-recs-label {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--warm-gray, #6B6B6B);
  margin: 0 0 20px;
  font-weight: 500;
}

.style-quiz-heading {
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.005em;
  color: var(--charcoal, #191919);
  margin: 0 0 24px;
}

.style-quiz-heading em,
.style-quiz-heading i {
  font-style: italic;
  font-weight: 400;
}

.style-quiz-lead {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 17px;
  line-height: 1.65;
  color: var(--warm-gray, #6B6B6B);
  max-width: 620px;
  margin: 0 auto 36px;
}

.style-quiz-question .style-quiz-lead,
.style-quiz-outcome .style-quiz-lead,
.style-quiz-outcome .style-quiz-summary {
  margin-left: 0;
  margin-right: 0;
}

.style-quiz-summary {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 17px;
  line-height: 1.7;
  color: var(--warm-gray, #6B6B6B);
  margin: 0 0 28px;
  max-width: 640px;
}

.style-quiz-disclaimer {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 13px;
  line-height: 1.6;
  color: var(--gray-medium, #9A9A9A);
  margin: 28px auto 0;
  max-width: 540px;
}

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */

.style-quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin: 8px 0 0;
}

.style-quiz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  min-width: 180px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid var(--charcoal, #191919);
  background: transparent;
  color: var(--charcoal, #191919);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.style-quiz-btn:hover,
.style-quiz-btn:focus-visible {
  background: var(--charcoal, #191919);
  color: var(--white, #FFFFFF);
  outline: none;
}

.style-quiz-btn--primary {
  background: var(--charcoal, #191919);
  color: var(--white, #FFFFFF);
}

.style-quiz-btn--primary:hover,
.style-quiz-btn--primary:focus-visible {
  background: var(--gold, #A37E2C);
  border-color: var(--gold, #A37E2C);
  color: var(--white, #FFFFFF);
}

.style-quiz-btn--ghost {
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--warm-gray, #6B6B6B);
}

.style-quiz-btn--ghost:hover {
  background: transparent;
  border-color: var(--charcoal, #191919);
  color: var(--charcoal, #191919);
}

/* --------------------------------------------------------------------------
   6. Question state
   -------------------------------------------------------------------------- */

.style-quiz-progress {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 32px;
}

.style-quiz-progress-track {
  position: relative;
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.12);
}

.style-quiz-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 1px;
  background: var(--charcoal, #191919);
  transition: width 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.style-quiz-progress-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--warm-gray, #6B6B6B);
  white-space: nowrap;
  font-weight: 500;
}

.style-quiz-qtext {
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 400;
  line-height: 1.25;
  color: var(--charcoal, #191919);
  margin: 0 0 36px;
  letter-spacing: -0.005em;
}

.style-quiz-form--stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 32px;
}

.style-quiz-answer {
  display: block;
  width: 100%;
  text-align: left;
  padding: 22px 26px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 16px;
  line-height: 1.5;
  color: var(--charcoal, #191919);
  background: var(--white, #FFFFFF);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.style-quiz-answer:hover,
.style-quiz-answer:focus-visible {
  border-color: var(--charcoal, #191919);
  transform: translateX(4px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  outline: none;
}

.style-quiz-form-inline {
  margin: 0;
}

.style-quiz-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--warm-gray, #6B6B6B);
  cursor: pointer;
  transition: color 0.2s ease;
}

.style-quiz-link-btn:hover {
  color: var(--charcoal, #191919);
}

/* --------------------------------------------------------------------------
   7. Outcome state
   -------------------------------------------------------------------------- */

.style-quiz-outcome .style-quiz-heading {
  font-style: italic;
  font-size: clamp(32px, 4.6vw, 48px);
  margin-bottom: 18px;
}

.style-quiz-recs {
  margin: 36px 0 32px;
  padding: 32px 0 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.style-quiz-recs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.style-quiz-recs-list li {
  margin: 0;
}

.style-quiz-recs-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: var(--white, #FFFFFF);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 15px;
  color: var(--charcoal, #191919);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.style-quiz-recs-list a::after {
  content: '\2192';
  margin-left: 16px;
  color: var(--gold, #A37E2C);
  transition: transform 0.2s ease;
}

.style-quiz-recs-list a:hover {
  border-color: var(--charcoal, #191919);
  transform: translateX(4px);
}

.style-quiz-recs-list a:hover::after {
  transform: translateX(4px);
}

.style-quiz-outcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  align-items: center;
}

.style-quiz-error {
  color: var(--error, #C0392B);
  font-family: var(--font-body, 'Inter', sans-serif);
}

/* --------------------------------------------------------------------------
   8. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  .style-quiz-page.section {
    padding: 96px 18px 72px;
    min-height: calc(100vh - 60px);
  }

  .style-quiz-lead {
    font-size: 16px;
  }

  .style-quiz-summary {
    font-size: 16px;
  }

  .style-quiz-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .style-quiz-btn {
    width: 100%;
    min-width: 0;
  }

  .style-quiz-answer {
    padding: 18px 20px;
    font-size: 15px;
  }

  .style-quiz-progress {
    gap: 12px;
    margin-bottom: 24px;
  }

  .style-quiz-outcome-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .style-quiz-outcome-actions .style-quiz-btn,
  .style-quiz-outcome-actions form {
    width: 100%;
  }

  .style-quiz-outcome-actions .style-quiz-btn,
  .style-quiz-outcome-actions form .style-quiz-btn {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   9. v2 — section openers, branching question meta, outcome blocks, axes
   -------------------------------------------------------------------------- */

/* Section list on the intro panel */
.style-quiz-section-list {
  list-style: none;
  margin: 4px 0 36px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.style-quiz-section-list li {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 14px 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 14px;
  color: var(--charcoal, #191919);
}

.style-quiz-section-list-num {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--warm-gray, #6B6B6B);
  font-variant-numeric: tabular-nums;
  min-width: 24px;
}

.style-quiz-section-list-title {
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-size: 18px;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.005em;
}

@media (max-width: 720px) {
  .style-quiz-section-list { grid-template-columns: 1fr; }
}

/* Section opener (in-quiz, not the intro list) */
.style-quiz-section-intro {
  text-align: left;
  animation: styleQuizFadeIn 480ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.style-quiz-section-intro .style-quiz-heading {
  font-style: italic;
  font-size: clamp(34px, 5vw, 50px);
  margin-bottom: 18px;
}

.style-quiz-section-intro .style-quiz-lead {
  margin-left: 0;
  margin-right: 0;
  max-width: 640px;
  font-size: 18px;
}

.style-quiz-section-intro .style-quiz-actions {
  justify-content: flex-start;
  margin-top: 28px;
}

/* Question meta (Section X of 8 — Title · Q n / m) */
.style-quiz-progress {
  flex-wrap: wrap;
  gap: 12px 18px;
}

.style-quiz-progress-label {
  flex-basis: 100%;
  white-space: normal;
  line-height: 1.4;
}

.style-quiz-progress-percent {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--warm-gray, #6B6B6B);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* Section opener mini-progress (shown above the heading) */
.style-quiz-progress-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 28px;
}

.style-quiz-progress-meta .style-quiz-progress-track {
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.12);
  position: relative;
}

.style-quiz-progress-meta .style-quiz-progress-bar {
  position: absolute;
  left: 0; top: 0;
  height: 1px;
  background: var(--charcoal, #191919);
  transition: width 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Question help text under the question heading */
.style-quiz-qhelp {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 14px;
  line-height: 1.55;
  color: var(--warm-gray, #6B6B6B);
  margin: -22px 0 30px;
  max-width: 640px;
}

/* "Previous answer" pill on revisited questions */
.style-quiz-answer.is-prev {
  border-color: var(--charcoal, #191919);
  background: rgba(25, 25, 25, 0.02);
}

.style-quiz-answer-prev-tag {
  display: inline-block;
  margin-left: 12px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--warm-gray, #6B6B6B);
  vertical-align: middle;
}

/* Per-step controls (back / save & exit / restart section / start over) */
.style-quiz-step-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 22px;
  align-items: center;
  margin: 28px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.style-quiz-step-controls .style-quiz-form-inline { margin: 0; }

.style-quiz-link-btn {
  font-weight: 500;
}

.style-quiz-link-btn--quiet {
  color: var(--gray-medium, #9A9A9A);
}

/* --------------------------------------------------------------------------
   10. Outcome page (rich, multi-section)
   -------------------------------------------------------------------------- */

.style-quiz-outcome {
  animation: styleQuizFadeIn 600ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.style-quiz-outcome .style-quiz-summary {
  font-size: 18px;
  line-height: 1.7;
  max-width: 720px;
}

.style-quiz-outcome-block {
  margin: 56px 0 0;
  padding: 36px 0 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.style-quiz-block-eyebrow {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--warm-gray, #6B6B6B);
  margin: 0 0 14px;
  font-weight: 500;
}

.style-quiz-block-note {
  font-size: 14px;
  line-height: 1.55;
  color: var(--warm-gray, #6B6B6B);
  margin: 0 0 18px;
  max-width: 600px;
}

.style-quiz-outcome-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.style-quiz-outcome-list li {
  padding: 12px 0;
  border-bottom: 1px dotted rgba(0, 0, 0, 0.12);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 16px;
  line-height: 1.6;
  color: var(--charcoal, #191919);
}

.style-quiz-outcome-list li:last-child { border-bottom: 0; }

/* Axis score bars */
.style-quiz-axis-bars {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
}

.style-quiz-axis-row {
  display: grid;
  grid-template-columns: 130px 1fr 36px;
  gap: 14px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dotted rgba(0, 0, 0, 0.1);
}

.style-quiz-axis-label {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--charcoal, #191919);
  font-weight: 500;
}

.style-quiz-axis-track {
  position: relative;
  height: 4px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.style-quiz-axis-bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--charcoal, #191919);
  border-radius: 999px;
  transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

.style-quiz-axis-score {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--warm-gray, #6B6B6B);
  text-align: right;
}

@media (max-width: 600px) {
  .style-quiz-axis-row {
    grid-template-columns: 100px 1fr 30px;
    gap: 10px;
  }
}

/* Do / Don't grid */
.style-quiz-do-donts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin: 8px 0 0;
}

.style-quiz-do-donts > div {
  background: var(--white, #FFFFFF);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 22px 24px;
  border-radius: 4px;
}

.style-quiz-do-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--charcoal, #191919);
  margin: 0 0 12px;
  font-weight: 500;
}

.style-quiz-do-donts ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.style-quiz-do-donts li {
  padding: 8px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 15px;
  line-height: 1.55;
}

.style-quiz-do-donts li:first-child { border-top: 0; }

@media (max-width: 700px) {
  .style-quiz-do-donts { grid-template-columns: 1fr; gap: 14px; }
}

/* Mantra */
.style-quiz-mantra-block { text-align: center; }

.style-quiz-mantra {
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-style: italic;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.35;
  color: var(--charcoal, #191919);
  margin: 4px 0 0;
}

/* Outcome footer */
.style-quiz-outcome-footer {
  margin: 64px 0 0;
  padding: 36px 0 0;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.style-quiz-outcome-footer .style-quiz-disclaimer {
  margin: 0 0 22px;
  text-align: left;
  max-width: 720px;
}

.style-quiz-outcome .style-quiz-outcome-actions {
  margin-top: 24px;
}

/* Section transition fade */
.style-quiz-question,
.style-quiz-section-intro,
.style-quiz-intro,
.style-quiz-outcome,
.style-quiz-gate {
  animation: styleQuizFadeIn 420ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@media (max-width: 768px) {
  .style-quiz-step-controls {
    gap: 14px 18px;
    padding-top: 18px;
  }
  .style-quiz-outcome-block {
    margin-top: 40px;
    padding-top: 28px;
  }
}
