/* /css/XWingLesson.css
// ==========================================================
// Sudoku Paradise — X-Wing Interactive Lesson
// ========================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: #243b3e;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.lesson-page-header {
  display: flex;
  justify-content: center;
  padding: 1.1rem 5rem 0.4rem;
}

.lesson-brand {
  color: #0b6870;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.lesson-page-main {
  width: min(1040px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.7rem 0 2.5rem;
}

.lesson-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  max-width: 920px;
  margin: 0 auto 1rem;
  color: #547074;
  font-size: 0.84rem;
}

.lesson-breadcrumbs a,
.lesson-page-footer a { color: #0b6870; font-weight: 700; }

.lesson-hero {
  max-width: 920px;
  margin: 0 auto 1.4rem;
  text-align: center;
}

.lesson-eyebrow,
.section-kicker {
  margin: 0 0 0.4rem;
  color: #0b6870;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.lesson-hero h1 {
  margin: 0;
  color: #174f55;
  font-size: clamp(2rem, 6vw, 3.35rem);
  line-height: 1.08;
}

.lesson-lead {
  max-width: 820px;
  margin: 1rem auto 0;
  font-size: clamp(1.03rem, 2.4vw, 1.18rem);
  line-height: 1.68;
}

.natural-order,
.vocabulary-ladder,
.cross-proof,
.practice-workbench,
.real-example-section,
.classification-section,
.technical-bridge,
.family-preview,
.lesson-faq,
.lesson-cta {
  max-width: 920px;
  margin: 1.3rem auto;
  padding: clamp(1.15rem, 4vw, 1.8rem);
  border: 1px solid rgba(11, 104, 112, 0.25);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 8px 22px rgba(20, 55, 60, 0.1);
}

.natural-order h2,
.vocabulary-ladder h2,
.cross-proof h2,
.practice-workbench h2,
.real-example-section h2,
.classification-section h2,
.technical-bridge h2,
.family-preview h2,
.lesson-faq h2,
.lesson-cta h2 {
  margin: 0 0 0.85rem;
  color: #0b6870;
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  line-height: 1.25;
}

.natural-order p,
.vocabulary-ladder p,
.cross-proof p,
.real-example-section p,
.classification-section > p,
.technical-bridge p,
.family-preview p,
.lesson-faq p,
.lesson-cta p { line-height: 1.65; }

.search-progression,
.term-grid,
.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.search-progression article,
.term-grid article,
.preview-grid article {
  padding: 1rem;
  border: 1px solid rgba(11, 104, 112, 0.22);
  border-radius: 11px;
  background: rgba(239, 249, 248, 0.82);
}

.search-progression h3,
.term-grid h3,
.preview-grid h3 {
  margin: 0.55rem 0 0.35rem;
  color: #174f55;
  font-size: 1.05rem;
}

.search-progression p,
.term-grid p,
.preview-grid p { margin: 0; }

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #0b6870;
  color: #fff;
  font-weight: 850;
}

.memory-rule,
.truth-rule,
.preview-restraint {
  margin: 1rem 0 0;
  padding: 0.8rem 1rem;
  border-left: 4px solid #d39a1f;
  background: rgba(255, 246, 216, 0.75);
  color: #174f55;
}

.truth-rule {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.term-stage {
  color: #0b6870;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cross-proof { background: linear-gradient(145deg, rgba(242, 251, 250, 0.96), rgba(255,255,255,0.96)); }

.proof-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  align-items: center;
  gap: 1.4rem;
}

.mini-xwing {
  position: relative;
  width: min(100%, 260px);
  aspect-ratio: 1;
  margin: 0 auto;
  border: 1px solid rgba(11, 104, 112, 0.18);
  border-radius: 14px;
  background: rgba(255,255,255,0.9);
}

.wing-corner {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 50%;
  background: #0b6870;
  color: #fff;
  font-size: 1.3rem;
}

.top-left { top: 12%; left: 12%; }
.top-right { top: 12%; right: 12%; }
.bottom-left { bottom: 12%; left: 12%; }
.bottom-right { right: 12%; bottom: 12%; }

.wing-line { position: absolute; z-index: 1; background: #d39a1f; }
.top-line, .bottom-line { left: 20%; width: 60%; height: 4px; }
.top-line { top: calc(12% + 1.25rem); }
.bottom-line { bottom: calc(12% + 1.25rem); }
.left-line, .right-line { top: 20%; width: 4px; height: 60%; }
.left-line { left: calc(12% + 1.25rem); }
.right-line { right: calc(12% + 1.25rem); }

.workbench-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

#nextExerciseButton,
.practice-actions button,
.classification-choices button {
  appearance: none;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

#nextExerciseButton {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(11, 104, 112, 0.38);
  background: #fff;
  color: #0b6870;
}

.exercise-title { margin: 0.35rem 0; color: #174f55; font-size: 1.12rem; }
.exercise-prompt, .candidate-map-note { margin: 0.4rem 0; line-height: 1.55; }
.candidate-map-note { color: #547074; font-size: 0.88rem; }

.candidate-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  width: min(100%, 34rem);
  aspect-ratio: 1;
  margin: 1rem auto;
  border: 3px solid #34494c;
  background: #fff;
}

.candidate-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-right: 1px solid #aeb9ba;
  border-bottom: 1px solid #aeb9ba;
  border-radius: 0;
  background: rgba(255,255,255,0.97);
  color: #0b6870;
  font: inherit;
}

button.candidate-cell { cursor: pointer; }
.candidate-cell:nth-child(9n) { border-right: 0; }
.candidate-cell:nth-child(n + 73) { border-bottom: 0; }
.candidate-cell:nth-child(9n + 3), .candidate-cell:nth-child(9n + 6) { border-right: 2px solid #526467; }
.candidate-cell:nth-child(n + 19):nth-child(-n + 27),
.candidate-cell:nth-child(n + 46):nth-child(-n + 54) { border-bottom: 2px solid #526467; }
.candidate-digit { font-size: clamp(0.9rem, 3.8vw, 1.35rem); font-weight: 850; }
.candidate-cell.is-corner { background: #ccefea; color: #075a62; box-shadow: inset 0 0 0 3px #0b6870; cursor: default; }
button.candidate-cell:not(.is-corner):hover,
button.candidate-cell:not(.is-corner):focus-visible { z-index: 2; background: #edf9f7; outline: 3px solid #0b6870; outline-offset: -3px; }
.candidate-cell.is-selected { background: #dff4f1; box-shadow: inset 0 0 0 3px #0b6870; }
.candidate-cell.is-correct { background: #d9f2dd; color: #1f6d31; box-shadow: inset 0 0 0 3px #27813a; }
.candidate-cell.is-missed { background: #fff0bc; color: #8b5e00; box-shadow: inset 0 0 0 3px #c48a0b; }
.candidate-cell.is-wrong { background: #f8d9d9; color: #8f2828; box-shadow: inset 0 0 0 3px #a93434; }

.practice-progress {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  max-width: 34rem;
  margin: 0.75rem auto;
  color: #486467;
  font-size: 0.88rem;
}

.practice-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin-top: 1rem; }
.practice-actions button { min-height: 42px; padding: 0.6rem 0.85rem; border: 1px solid rgba(11,104,112,.38); background:#fff; color:#0b6870; }
.practice-actions .primary-action { border-color:#0b6870; background:#0b6870; color:#fff; }

.practice-result {
  max-width: 44rem;
  min-height: 3.2rem;
  margin: 1rem auto 0;
  padding: 0.8rem 1rem;
  border-left: 4px solid #0b6870;
  background: rgba(231,247,244,.82);
  line-height: 1.55;
}
.practice-result.is-success, .classification-result.is-success { border-color:#27813a; background:rgba(224,246,227,.86); }
.practice-result.is-error, .classification-result.is-error { border-color:#a93434; background:rgba(250,226,226,.86); }

.practice-legend { display:flex; flex-wrap:wrap; justify-content:center; gap:.6rem 1rem; margin-top:.85rem; color:#486467; font-size:.8rem; }
.practice-legend span { display:inline-flex; align-items:center; gap:.35rem; }
.legend-swatch { display:inline-block; width:.85rem; height:.85rem; border:1px solid rgba(20,55,60,.28); border-radius:3px; }
.legend-swatch.corner { background:#ccefea; }
.legend-swatch.selected { background:#dff4f1; }
.legend-swatch.correct { background:#d9f2dd; }
.legend-swatch.missed { background:#fff0bc; }
.legend-swatch.wrong { background:#f8d9d9; }

.real-example-section {
  display:block;
}

.dual-xwing-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:1rem;
  margin-top:1rem;
}

.xwing-figure {
  margin:0;
  padding:1rem;
  border:1px solid rgba(11,104,112,.22);
  border-radius:11px;
  background:rgba(239,249,248,.72);
  text-align:center;
}

.xwing-figure img {
  display:block;
  width:min(100%,330px);
  height:auto;
  margin:0 auto;
  border:2px solid #526467;
  border-radius:8px;
  background:#fff;
  box-shadow:0 6px 18px rgba(20,55,60,.14);
}

.xwing-figure figcaption {
  margin-top:.65rem;
  color:#486467;
  font-size:.86rem;
  line-height:1.5;
}

.shared-eliminations {
  margin-top:1rem;
  padding:1rem;
  border-left:5px solid #0b6870;
  border-radius:7px;
  background:rgba(232,247,245,.82);
}

.shared-eliminations h3 {
  margin:0 0 .5rem;
  color:#174f55;
  font-size:1.08rem;
}

.shared-eliminations p { margin:.45rem 0; }

.classification-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.9rem; margin-top:1rem; }
.classification-card { display:flex; flex-direction:column; padding:1rem; border:1px solid rgba(11,104,112,.2); border-radius:10px; background:rgba(246,251,250,.86); }
.classification-card h3 { margin:0; color:#174f55; font-size:1.05rem; }
.classification-card > p { line-height:1.55; }
.classification-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.45rem; margin-top:auto; }
.classification-choices button { min-height:39px; padding:.45rem; border:1px solid rgba(11,104,112,.32); background:#fff; color:#174f55; }
.classification-choices button.is-correct { border-color:#27813a; background:#d9f2dd; color:#1f6d31; }
.classification-choices button.is-wrong { border-color:#a93434; background:#f8d9d9; color:#8f2828; }
.classification-result { min-height:2.4rem; margin:.7rem 0 0!important; padding:.45rem .6rem; border-left:3px solid #0b6870; background:rgba(231,247,244,.7); font-size:.88rem; }
.classification-explanation { margin-bottom:0!important; color:#486467; font-size:.88rem; }

.technical-bridge { display:flex; align-items:flex-start; gap:1.15rem; border-color:rgba(103,69,154,.4); background:linear-gradient(145deg,rgba(245,240,252,.95),rgba(255,255,255,.96)); }
.technical-badge { display:flex; flex:0 0 3.5rem; align-items:center; justify-content:center; width:3.5rem; height:3.5rem; border-radius:50%; background:#67459a; color:#fff; font-size:1.5rem; font-weight:850; }
code { padding:.08rem .25rem; border-radius:4px; background:rgba(11,104,112,.09); color:#174f55; font-family:ui-monospace,SFMono-Regular,Consolas,monospace; font-size:.9em; }

.skyscraper-preview {
  display:grid;
  grid-template-columns:minmax(250px,328px) minmax(0,1fr);
  align-items:center;
  gap:1.2rem;
  margin-top:1.2rem;
  padding:1rem;
  border:1px solid rgba(103,69,154,.3);
  border-left:5px solid #67459a;
  border-radius:10px;
  background:rgba(245,240,252,.78);
}

.skyscraper-preview figure { margin:0; text-align:center; }
.skyscraper-preview img {
  display:block;
  width:min(100%,328px);
  height:auto;
  margin:0 auto;
  border:2px solid #675b75;
  border-radius:8px;
  background:#fff;
  box-shadow:0 6px 18px rgba(46,31,67,.15);
}
.skyscraper-preview figcaption { margin-top:.6rem; color:#5e5570; font-size:.82rem; line-height:1.45; }
.skyscraper-preview h3 { margin:0 0 .55rem; color:#54357f; font-size:1.18rem; }
.skyscraper-preview p { margin:.5rem 0; }

.lesson-faq details { padding:.8rem 0; border-top:1px solid rgba(11,104,112,.17); }
.lesson-faq details:last-child { border-bottom:1px solid rgba(11,104,112,.17); }
.lesson-faq summary { color:#174f55; cursor:pointer; font-weight:750; line-height:1.45; }
.lesson-faq details p { margin:.65rem 0 .1rem; }

.lesson-cta { text-align:center; }
.lesson-cta > p { max-width:720px; margin-right:auto; margin-left:auto; }
.cta-links { display:flex; flex-wrap:wrap; justify-content:center; gap:.65rem; margin-top:1.1rem; }
.cta-links a { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:.68rem .95rem; border:1px solid rgba(11,104,112,.42); border-radius:9px; background:#fff; color:#0b6870; font-weight:750; text-decoration:none; }
.cta-links .cta-primary { border-color:#0b6870; background:#0b6870; color:#fff; }
.lesson-page-footer { padding:1rem; color:#486467; font-size:.9rem; text-align:center; }

@media (max-width:780px) {
  .lesson-page-header { padding-top:3.6rem; }
  .search-progression, .term-grid, .preview-grid, .proof-layout, .dual-xwing-grid, .classification-list, .skyscraper-preview { grid-template-columns:1fr; }
}

@media (max-width:620px) {
  .lesson-page-main { width:min(100% - 1rem,1040px); }
  .workbench-heading, .technical-bridge { flex-direction:column; }
  .practice-actions button { flex:1 1 calc(50% - .6rem); }
}

@media print {
  .site-menu-button,.site-drawer,.site-drawer-backdrop,.lesson-page-header,.lesson-breadcrumbs,.practice-workbench,.classification-section,.lesson-cta,.lesson-page-footer { display:none!important; }
  body { background:#fff!important; color:#111; }
  .lesson-page-main { width:100%; padding:0; }
  .natural-order,.vocabulary-ladder,.cross-proof,.real-example-section,.technical-bridge,.family-preview,.lesson-faq { break-inside:avoid; border-color:#8a8a8a; box-shadow:none; }
}
