/* site/css/wizard.css */

/* ─── Scroll layout: no wizard chrome ─── */
html:not(.layout-wizard) .wizard-progress { display: none !important; }
html:not(.layout-wizard) .wizard-step     { display: block; }
html:not(.layout-wizard) .wizard-testimonials { display: none !important; }

/* ════════════════════════════════════════════════════════
   WIZARD MODE — Split-screen ritual

   Desktop ≥ 768px:
     ┌──────────────────────────────────────────────────┐
     │  header bar: brand · progress dots · step label  │
     ├────────────────────────┬─────────────────────────┤
     │  LEFT PANEL            │  RIGHT PANEL            │
     │  (hero + testimonials) │  (active wizard step)   │
     │  fixed 360px           │  flex: 1, scrollable    │
     └────────────────────────┴─────────────────────────┘

   Mobile < 768px:
     Header bar → step content only (hero hidden)
   ════════════════════════════════════════════════════════ */

html.layout-wizard,
html.layout-wizard body {
  height: 100dvh;
  overflow: hidden;
}

/* ─── Hide non-wizard clutter ─── */
html.layout-wizard .section-how,
html.layout-wizard .section-testimonials,
html.layout-wizard .section-pullquote,
html.layout-wizard .site-footer,
html.layout-wizard .sticky-cta {
  display: none !important;
}

/* ─── Wizard header bar ─── */
.wizard-progress {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 56px;
  padding: 0 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 20;
  flex-shrink: 0;
}

.wizard-brand {
  font-size: 0.48rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.wizard-brand-mirror {
  visibility: hidden;
  font-size: 0.48rem;
  letter-spacing: 0.22em;
  white-space: nowrap;
}

.wizard-steps-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
}

.wizard-step-dot {
  font-size: 0.85rem;
  color: var(--muted-2, rgba(255,255,255,0.12));
  transition: color 0.35s ease, transform 0.35s ease;
  padding: 0 7px;
  cursor: default;
  position: relative;
}

.wizard-step-dot:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 1px;
  background: var(--border);
  transition: background 0.35s;
}

.wizard-step-dot.completed      { color: var(--muted); }
.wizard-step-dot.completed::after { background: var(--muted); }
.wizard-step-dot.active         { color: var(--accent); transform: scale(1.25); }

.wizard-step-label {
  font-size: 0.46rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* ══════════════════════════════════════
   DESKTOP — 2-panel grid
   ══════════════════════════════════════ */
@media (min-width: 768px) {
  html.layout-wizard body {
    display: grid;
    grid-template-columns: 360px 1fr;
    grid-template-rows: 56px 1fr;
  }

  /* Header spans both columns */
  .wizard-progress {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  /* Left panel: hero */
  html.layout-wizard #hero {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    grid-column: 1;
    grid-row: 2;
    overflow-y: auto;
    border-right: 1px solid var(--border);
  }

  /* Condense hero for sidebar */
  html.layout-wizard .hero-inner {
    padding: 36px 32px !important;
    text-align: left;
    max-width: none !important;
  }

  html.layout-wizard .hero-title {
    font-size: clamp(1.5rem, 3vw, 2.6rem) !important;
    line-height: 1.05 !important;
  }

  html.layout-wizard .hero-sub,
  html.layout-wizard .hero-body {
    text-align: left;
    max-width: none !important;
  }

  html.layout-wizard .hero-cta-wrap,
  html.layout-wizard .hero-scroll,
  html.layout-wizard #hero-counter {
    display: none !important;
  }

  /* All wizard steps share the right panel */
  html.layout-wizard .wizard-step {
    grid-column: 2;
    grid-row: 2;
    display: none;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  html.layout-wizard .wizard-step.active {
    display: flex;
    flex-direction: column;
  }

  /* Step inner: comfortable centering */
  html.layout-wizard .wizard-step .section-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 28px 40px !important;
    max-width: 540px;
    margin: 0 auto;
    width: 100%;
  }

  /* 2-col curse grid on desktop right panel */
  html.layout-wizard .curse-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 14px 0 12px;
  }

  html.layout-wizard .curse-card {
    padding: 16px 12px 14px;
    min-height: 96px;
    text-align: left;
  }

  html.layout-wizard .curse-emoji { font-size: 1.5rem; display: block; margin-bottom: 6px; }
  html.layout-wizard .curse-name  { font-size: 0.7rem; display: block; }
  html.layout-wizard .curse-desc  { font-size: 0.55rem; line-height: 1.35; margin-top: 4px; opacity: 0.7; }
}

/* ══════════════════════════════════════
   MOBILE — Single column
   ══════════════════════════════════════ */
@media (max-width: 767px) {
  html.layout-wizard body {
    display: flex;
    flex-direction: column;
  }

  .wizard-progress {
    order: -1;
    flex-shrink: 0;
  }

  /* Hero hidden on mobile (brand is in header) */
  html.layout-wizard #hero {
    display: none !important;
  }

  html.layout-wizard .wizard-step {
    display: none;
    flex: 1;
    overflow-y: auto;
  }

  html.layout-wizard .wizard-step.active {
    display: flex;
    flex-direction: column;
  }

  html.layout-wizard .wizard-step .section-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 18px !important;
    width: 100%;
  }

  /* 2-col on mobile too */
  html.layout-wizard .curse-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 12px 0 10px;
  }

  html.layout-wizard .curse-card    { padding: 14px 10px 12px; min-height: 80px; }
  html.layout-wizard .curse-emoji   { font-size: 1.4rem; }
  html.layout-wizard .curse-name    { font-size: 0.65rem; }
  html.layout-wizard .curse-desc    { display: none; }

  .wizard-step-label { display: none; }
}

/* ─── Step transition animations ─── */
html.layout-wizard .wizard-step.active {
  animation: stepIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
html.layout-wizard .wizard-step.active.going-back {
  animation: stepInBack 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes stepIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes stepInBack {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Description field ─── */
html.layout-wizard .description-field { margin-top: 14px; }
html.layout-wizard #curse-description {
  min-height: 60px;
  font-size: 0.75rem;
}

/* ─── Nav buttons ─── */
.wizard-nav {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.wizard-nav .btn-back { flex: 0 0 auto; opacity: 0.6; }
.wizard-nav .btn-next { flex: 1; }

/* ─── Injected testimonials in left panel ─── */
.wizard-testimonials {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.wizard-quote {
  margin: 0;
  padding: 0;
}

.wizard-quote p {
  font-size: 0.68rem;
  font-style: italic;
  line-height: 1.55;
  margin: 0 0 5px;
  opacity: 0.75;
}

.wizard-quote cite {
  font-size: 0.48rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-style: normal;
}
