/* ============================================================
   Writing Effective Learning Objectives — styles.css

   Palette (light, clean):
     --bg:          #F5F3EF  warm off-white page
     --surface:     #FFFFFF  card / section surface
     --border:      #E4E0D8  subtle warm gray line
     --text:        #1C1C1C  near-black body text
     --text-muted:  #6B6560  secondary text
     --text-light:  #A39E98  placeholder / meta text
     --accent:      #1D3557  deep navy (single accent color)
     --accent-mid:  #2E4F7A  hover state
     --success:     #1E5C3A  forest green
     --success-bg:  #EEF6F1
     --success-bd:  #B8D9C6
     --error:       #8B1E1E  deep red
     --error-bg:    #FDF1F1
     --error-bd:    #F0C0C0

   Fonts: Inter only — clean, modern, no serifs
   Sidebar: 220px fixed left
============================================================ */

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #F5F3EF;
  --surface:      #FFFFFF;
  --border:       #E4E0D8;
  --border-mid:   #D0CAC0;
  --text:         #1C1C1C;
  --text-muted:   #6B6560;
  --text-light:   #A39E98;
  --accent:       #1D3557;
  --accent-mid:   #2E4F7A;
  --accent-bg:    #EBF0F7;
  --accent-bd:    #C3D1E3;
  --success:      #1E5C3A;
  --success-bg:   #EEF6F1;
  --success-bd:   #B8D9C6;
  --error:        #8B1E1E;
  --error-bg:     #FDF1F1;
  --error-bd:     #F0C0C0;
  --sidebar-w:    220px;
  --font:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius:       8px;
  --radius-sm:    5px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────── */

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.5rem 1.25rem 1.1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.35rem;
}

.sidebar-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

/* Nav */
.sidebar-nav {
  list-style: none;
  padding: 0.5rem 0;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background 120ms, border-color 120ms;
}

.nav-item:hover:not(.locked-nav) { background: var(--bg); }

.nav-item.active {
  border-left-color: var(--accent);
  background: var(--accent-bg);
}

.nav-item.locked-nav {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.nav-num {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-light);
  min-width: 14px;
  padding-top: 2px;
  flex-shrink: 0;
}

.nav-item.active .nav-num { color: var(--accent); }

.nav-text {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
  flex: 1;
}

.nav-item.active .nav-text { color: var(--accent); font-weight: 500; }
.nav-item.completed .nav-text { color: var(--text); }

.nav-check {
  display: none;
  font-size: 0.62rem;
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
  padding-top: 3px;
}

.nav-item.completed .nav-check { display: inline; }

/* Progress bar at bottom of sidebar */
.sidebar-progress {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.progress-bar-bg {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 300ms ease;
  width: 0%;
}

.progress-label {
  font-size: 0.7rem;
  color: var(--text-light);
}

/* ── Mobile Header ──────────────────────────────────────── */

.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 50px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  padding: 0 1rem;
  gap: 0.75rem;
  z-index: 300;
}

.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text);
  border-radius: 1px;
}

.mobile-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-counter {
  font-size: 0.7rem;
  color: var(--text-light);
  flex-shrink: 0;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 199;
}

.sidebar-overlay.visible { display: block; }

/* ── Main Content ───────────────────────────────────────── */

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
}

/* ── Sections ───────────────────────────────────────────── */

.content-section {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4.5rem 3rem 5rem;
  border-bottom: 1px solid var(--border);
}

.content-section.locked { display: none; }

.section-inner {
  width: 100%;
  max-width: 640px;
}

/* ── Typography ─────────────────────────────────────────── */

.eyebrow {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 1.1rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 0.9rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.7;
}

p:last-child { margin-bottom: 0; }

.lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

em { color: var(--accent); font-style: italic; }
strong { color: var(--text); font-weight: 600; }

blockquote {
  border-left: 2px solid var(--accent);
  padding: 0.9rem 1.25rem;
  background: var(--accent-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ── Objectives list ────────────────────────────────────── */

.obj-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-top: 1.5rem;
  background: var(--surface);
}

.obj-list h3 { margin-bottom: 0.6rem; }

.obj-list ul { list-style: none; }

.obj-list li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0.4rem 0 0.4rem 1.25rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.obj-list li:last-child { border-bottom: none; }

.obj-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.82rem;
}

/* ── Three-card row ─────────────────────────────────────── */

.card-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
}

.card-icon { font-size: 1.3rem; margin-bottom: 0.5rem; }
.card p { font-size: 0.82rem; margin: 0; }

/* ── Formula box ────────────────────────────────────────── */

.formula-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-top: 1.5rem;
}

.formula-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  display: block;
  margin-bottom: 0.75rem;
}

.formula-tokens {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.token {
  padding: 0.25rem 0.7rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
}

.token.action {
  background: var(--accent-bg);
  border: 1px solid var(--accent-bd);
  color: var(--accent);
}

.token.content {
  background: var(--success-bg);
  border: 1px solid var(--success-bd);
  color: var(--success);
}

.token.context {
  background: var(--bg);
  border: 1px solid var(--border-mid);
  color: var(--text-muted);
}

.token-plus { color: var(--text-light); font-size: 0.85rem; }

.formula-example {
  font-size: 0.87rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

/* ── Bloom's table ──────────────────────────────────────── */

.blooms-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 1.25rem 0;
}

.bloom-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

/* Level colors — subtle tinted backgrounds, dark text */
.bloom-row.level-1 { background: #EEF2F7; border-color: #D4DCE9; }
.bloom-row.level-2 { background: #EAF3EE; border-color: #C8DECE; }
.bloom-row.level-3 { background: #F0F5E8; border-color: #D4E4BA; }
.bloom-row.level-4 { background: #FDF6E3; border-color: #EBDBA8; }
.bloom-row.level-5 { background: #FDF0E6; border-color: #EAC8A0; }
.bloom-row.level-6 { background: #FAEAEA; border-color: #E8BCBC; }

.bloom-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 100px;
}

.bloom-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.bloom-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.bloom-verbs {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.tip-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 1rem;
}

/* ── Compare grid ───────────────────────────────────────── */

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.compare-col {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.compare-header {
  padding: 0.6rem 0.9rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.weak-header {
  background: var(--error-bg);
  color: var(--error);
  border-bottom: 1px solid var(--error-bd);
}

.strong-header {
  background: var(--success-bg);
  color: var(--success);
  border-bottom: 1px solid var(--success-bd);
}

.compare-item {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.compare-item:last-child { border-bottom: none; }

.compare-item p {
  font-size: 0.83rem;
  color: var(--text);
  margin-bottom: 0.2rem;
  line-height: 1.5;
}

.compare-note {
  font-size: 0.7rem;
  color: var(--text-light);
}

/* ── Activity questions / choices ───────────────────────── */

.question-block { margin: 1.25rem 0; }

.question-prompt {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.9rem;
  line-height: 1.55;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.choice-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  padding: 0.8rem 1rem;
  font-size: 0.87rem;
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms, background 120ms, color 120ms;
  line-height: 1.5;
}

.choice-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--text);
}

.choice-btn:disabled { cursor: default; }

.choice-btn.correct {
  background: var(--success-bg);
  border-color: var(--success-bd);
  color: var(--success);
}

.choice-btn.incorrect {
  background: var(--error-bg);
  border-color: var(--error-bd);
  color: var(--error);
}

/* ── Feedback box ───────────────────────────────────────── */

.feedback-box {
  display: none;
  margin-top: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.6;
}

.feedback-box.show { display: block; }

.feedback-box.correct-fb {
  background: var(--success-bg);
  border: 1px solid var(--success-bd);
  color: var(--success);
}

.feedback-box.incorrect-fb {
  background: var(--error-bg);
  border: 1px solid var(--error-bd);
  color: var(--error);
}

.feedback-box.info-fb {
  background: var(--accent-bg);
  border: 1px solid var(--accent-bd);
  color: #1C3A5F;
}

/* ── Verb activity ──────────────────────────────────────── */

.verb-question {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 1.25rem 0;
}

.scenario-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.scenario-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.scenario-box p { font-size: 0.87rem; margin: 0; }

.verb-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.verb-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 0.6rem 0.85rem;
  font-size: 0.87rem;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 120ms, background 120ms, color 120ms;
  text-align: center;
}

.verb-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
}

.verb-btn.correct {
  background: var(--success-bg);
  border-color: var(--success-bd);
  color: var(--success);
}

.verb-btn.incorrect {
  background: var(--error-bg);
  border-color: var(--error-bd);
  color: var(--error);
}

.verb-btn:disabled { cursor: default; }

/* ── Tip cards (pre-rewrite) ────────────────────────────── */

.tip-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1.25rem 0;
}

.tip-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.tip-num {
  width: 24px;
  height: 24px;
  background: var(--accent-bg);
  border: 1px solid var(--accent-bd);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

/* ── Rewrite activity ───────────────────────────────────── */

.rewrite-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1.25rem 0;
}

.weak-display {
  background: var(--error-bg);
  border: 1px solid var(--error-bd);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
}

.weak-tag {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--error);
  margin-bottom: 0.3rem;
}

.weak-display p {
  font-size: 0.88rem;
  color: #5A1515;
  font-style: italic;
  margin: 0;
}

.rewrite-block label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.45rem;
}

.rewrite-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  line-height: 1.6;
  padding: 0.65rem 0.85rem;
  resize: vertical;
  transition: border-color 120ms, box-shadow 120ms;
  margin-bottom: 0.75rem;
}

.rewrite-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 53, 87, 0.07);
}

.rewrite-input::placeholder { color: var(--text-light); }
.rewrite-actions { display: flex; justify-content: flex-end; }

/* ── Knowledge check ────────────────────────────────────── */

.kc-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 1.1rem 0;
}

.kc-block p.question-prompt { margin-bottom: 0.9rem; }

/* ── Completion section ─────────────────────────────────── */

.completion-section { text-align: center; }

.completion-mark {
  width: 52px;
  height: 52px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  margin: 0 auto 1.25rem;
}

.takeaway-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1.25rem 0;
  text-align: left;
}

.takeaway-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}

.takeaway-icon { font-size: 1rem; flex-shrink: 0; margin-top: 2px; }

.takeaway-item strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 0.15rem;
}

.takeaway-item p { font-size: 0.8rem; margin: 0; }

.score-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.1rem auto;
  max-width: 320px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.score-card strong {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.completion-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.25rem 0 1rem;
}

.attribution {
  font-size: 0.7rem;
  color: var(--text-light);
}

/* ── Buttons ────────────────────────────────────────────── */

.btn-primary {
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  cursor: pointer;
  transition: background 120ms;
}

.btn-primary:hover { background: var(--accent-mid); }
.btn-primary:disabled { opacity: 0.45; cursor: default; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.55rem 1.15rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: border-color 120ms, color 120ms;
}

.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* Continue row — bottom of each section */
.continue-row {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.back-btn {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.83rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 0;
  transition: color 120ms;
}

.back-btn:hover { color: var(--text-muted); }
.back-btn.hidden { visibility: hidden; pointer-events: none; }

.btn-continue {
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.65rem 1.6rem;
  cursor: pointer;
  transition: background 120ms;
  letter-spacing: 0.01em;
}

.btn-continue:hover { background: var(--accent-mid); }

/* ── Scrollbar ──────────────────────────────────────────── */

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 2px; }

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 780px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 220ms ease;
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { display: flex; }
  .main-content { margin-left: 0; padding-top: 50px; }
  .content-section { padding: 2.5rem 1.25rem 3rem; min-height: auto; }
  .card-row { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .verb-choices { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
