/* =========================================================
   LEARNING REWIRED LAB — LEARNING SYSTEMS MAP
   Design Lab detail page
   URL: /resource-lab/learning-systems-map/
   ========================================================= */

.learning-systems-map-page {
  --lsm-ink: #f8fbff;
  --lsm-muted: rgba(226, 232, 240, 0.78);
  --lsm-muted-strong: rgba(226, 232, 240, 0.92);
  --lsm-line: rgba(148, 163, 184, 0.22);
  --lsm-panel: rgba(10, 24, 42, 0.78);
  --lsm-panel-soft: rgba(255, 255, 255, 0.06);
  --lsm-panel-strong: rgba(12, 28, 50, 0.94);
  --lsm-cyan: #66e3ff;
  --lsm-lime: #b9ff7a;
  --lsm-shadow: 0 22px 62px rgba(0, 0, 0, 0.24);
  --lsm-shadow-soft: 0 16px 44px rgba(0, 0, 0, 0.18);

  position: relative;
  width: 100%;
  overflow: hidden;
  color: var(--lsm-ink);
}

.learning-systems-map-page *,
.learning-systems-map-page *::before,
.learning-systems-map-page *::after {
  box-sizing: border-box;
}

.learning-systems-map-page button {
  font: inherit;
}

.learning-systems-map-page .resource-detail-inner,
.learning-systems-map-page .dld-shell {
  width: min(1120px, calc(100% - 40px));
  max-width: 1120px;
  margin-inline: auto;
}

.learning-systems-map-page .resource-detail-hero {
  max-width: 1120px;
  margin: 0 auto clamp(42px, 6vw, 72px);
}

.learning-systems-map-page .resource-detail-hero h1 span {
  color: var(--lsm-cyan);
}

.lsm-article {
  display: grid;
  gap: clamp(40px, 5vw, 64px);
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.lsm-section {
  width: 100%;
  margin: 0 auto;
}

.lsm-reading-section {
  max-width: 760px;
}

.lsm-panel-section,
.lsm-preview-section,
.lsm-code-section,
.lsm-closing {
  max-width: 980px;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--lsm-line);
  border-radius: 34px;
  background:
    radial-gradient(circle at 10% 0%, rgba(102, 227, 255, 0.12), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(185, 255, 122, 0.08), transparent 32%),
    rgba(255, 255, 255, 0.045);
  box-shadow: var(--lsm-shadow-soft);
}

.lsm-preview-section {
  max-width: 1120px;
}

.lsm-reading-section h2,
.lsm-section-header h2,
.lsm-closing h2 {
  max-width: 780px;
  margin: 0 0 18px;
  color: var(--lsm-ink);
  font-size: clamp(2.15rem, 4vw, 3.15rem);
  font-weight: 820;
  line-height: 1;
  letter-spacing: -0.058em;
  text-wrap: balance;
}

.lsm-reading-section p,
.lsm-section-header p,
.lsm-closing p {
  max-width: 720px;
  margin: 0 0 18px;
  color: var(--lsm-muted);
  font-size: clamp(1rem, 1.35vw, 1.08rem);
  line-height: 1.72;
}

.lsm-reading-section p:last-child,
.lsm-section-header p:last-child,
.lsm-closing p:last-child {
  margin-bottom: 0;
}

.lsm-section-header {
  max-width: 780px;
  margin: 0 0 28px;
}

.lsm-small-label,
.lsm-map-label {
  display: inline-flex;
  width: fit-content;
  max-width: fit-content;
  margin: 0 0 16px;
  padding: 8px 11px;
  border: 1px solid rgba(102, 227, 255, 0.2);
  border-radius: 999px;
  background: rgba(102, 227, 255, 0.1);
  color: var(--lsm-cyan);
  font-size: 0.7rem;
  font-weight: 920;
  letter-spacing: 0.11em;
  line-height: 1;
  text-transform: uppercase;
}

/* =========================================================
   Opening overview section
   ========================================================= */

.lsm-opening-section {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 32px;
  background:
    radial-gradient(circle at 8% 0%, rgba(102, 227, 255, 0.11), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(185, 255, 122, 0.07), transparent 32%),
    rgba(255, 255, 255, 0.045);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.18);
}

.lsm-opening-section h2 {
  max-width: 720px;
  margin: 0 0 18px;
  color: var(--lsm-ink);
  font-size: clamp(2.35rem, 4.4vw, 3.6rem);
  font-weight: 820;
  line-height: 0.98;
  letter-spacing: -0.06em;
  text-wrap: balance;
}

.lsm-opening-section p {
  max-width: 720px;
  margin: 0 0 18px;
  color: var(--lsm-muted);
  font-size: clamp(1rem, 1.35vw, 1.08rem);
  line-height: 1.72;
}

.lsm-opening-section p:last-child {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .lsm-opening-section {
    padding: 20px;
    border-radius: 26px;
  }

  .lsm-opening-section h2 {
    font-size: clamp(2.1rem, 10vw, 3.1rem);
  }
}

.lsm-card-grid,
.lsm-use-grid,
.lsm-note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.lsm-info-card,
.lsm-use-card,
.lsm-note-card,
.lsm-code-note {
  padding: clamp(18px, 2.5vw, 24px);
  border: 1px solid var(--lsm-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 92% 12%, rgba(102, 227, 255, 0.08), transparent 38%),
    rgba(255, 255, 255, 0.055);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
}

.lsm-info-card span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--lsm-cyan), var(--lsm-lime));
  color: #071321;
  font-size: 0.72rem;
  font-weight: 950;
}

.lsm-note-card span {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 14px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(102, 227, 255, 0.1);
  color: var(--lsm-cyan);
  font-size: 0.68rem;
  font-weight: 920;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.lsm-info-card h3,
.lsm-use-card h3,
.lsm-note-card h3,
.lsm-code-note h3,
.lsm-step h3 {
  margin: 0 0 9px;
  color: var(--lsm-ink);
  font-size: clamp(1.08rem, 2vw, 1.34rem);
  font-weight: 820;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.lsm-info-card p,
.lsm-use-card p,
.lsm-note-card p,
.lsm-code-note p,
.lsm-step p {
  margin: 0;
  color: var(--lsm-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.lsm-map-shell {
  width: 100%;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid var(--lsm-line);
  border-radius: 30px;
  background:
    radial-gradient(circle at 8% 0%, rgba(102, 227, 255, 0.13), transparent 28%),
    radial-gradient(circle at 92% 10%, rgba(185, 255, 122, 0.08), transparent 30%),
    rgba(255, 255, 255, 0.045);
  box-shadow: var(--lsm-shadow);
}

.lsm-map-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

.lsm-map-intro h3 {
  max-width: 680px;
  margin: 0 0 11px;
  color: var(--lsm-ink);
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 820;
  line-height: 1;
  letter-spacing: -0.06em;
}

.lsm-map-intro p {
  max-width: 700px;
  margin: 0;
  color: var(--lsm-muted);
  font-size: clamp(0.96rem, 1.3vw, 1.05rem);
  line-height: 1.65;
}

.lsm-reset {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--lsm-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  color: var(--lsm-ink);
  font-size: 0.86rem;
  font-weight: 850;
  cursor: pointer;
}

.lsm-map-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.72fr);
  gap: 16px;
  align-items: stretch;
}

.lsm-orbit {
  position: relative;
  min-height: 500px;
  border: 1px solid var(--lsm-line);
  border-radius: 26px;
  background:
    radial-gradient(circle at center, rgba(102, 227, 255, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.lsm-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.lsm-ring.ring-one {
  width: 330px;
  height: 330px;
  border: 1px dashed rgba(102, 227, 255, 0.24);
}

.lsm-ring.ring-two {
  width: 250px;
  height: 250px;
  border: 1px solid rgba(114, 167, 255, 0.2);
}

.lsm-ring.ring-three {
  width: 172px;
  height: 172px;
  border: 1px solid rgba(185, 255, 122, 0.18);
}

.lsm-core,
.lsm-node {
  appearance: none;
  border: 0;
  cursor: pointer;
}

.lsm-core {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 124px;
  height: 124px;
  padding: 16px;
  transform: translate(-50%, -50%);
  border: 2px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(var(--lsm-panel-strong), var(--lsm-panel-strong)) padding-box,
    linear-gradient(135deg, var(--lsm-cyan), var(--lsm-lime)) border-box;
  color: var(--lsm-ink);
  box-shadow: 0 20px 54px rgba(102, 227, 255, 0.16);
}

.lsm-core span {
  display: block;
  margin-bottom: 4px;
  color: var(--lsm-cyan);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lsm-core strong {
  color: var(--lsm-ink);
  font-size: 1.42rem;
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.lsm-node {
  position: absolute;
  z-index: 4;
  display: grid;
  gap: 7px;
  place-items: center;
  width: 110px;
  min-height: 88px;
  padding: 12px;
  border: 1px solid var(--lsm-line);
  border-radius: 21px;
  background: rgba(255, 255, 255, 0.075);
  color: var(--lsm-ink);
  text-align: center;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}

.lsm-node.active {
  border-color: rgba(102, 227, 255, 0.42);
  background:
    radial-gradient(circle at top right, rgba(102, 227, 255, 0.12), transparent 42%),
    rgba(255, 255, 255, 0.1);
}

.lsm-node span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(102, 227, 255, 0.12);
  color: var(--lsm-cyan);
  font-size: 0.72rem;
  font-weight: 950;
}

.lsm-node.active span {
  background: linear-gradient(135deg, var(--lsm-cyan), var(--lsm-lime));
  color: #071321;
}

.lsm-node strong {
  color: var(--lsm-ink);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.16;
}

.lsm-node.node-one {
  left: 50%;
  top: 26px;
  transform: translateX(-50%);
}

.lsm-node.node-two {
  right: 32px;
  top: 72px;
}

.lsm-node.node-three {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lsm-node.node-four {
  right: 32px;
  bottom: 72px;
}

.lsm-node.node-five {
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
}

.lsm-node.node-six {
  left: 32px;
  bottom: 72px;
}

.lsm-node.node-seven {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lsm-node.node-eight {
  left: 32px;
  top: 72px;
}

.lsm-panel {
  display: flex;
  flex-direction: column;
  min-height: 500px;
  padding: clamp(18px, 2.5vw, 25px);
  border: 1px solid var(--lsm-line);
  border-radius: 26px;
  background:
    radial-gradient(circle at 100% 0%, rgba(102, 227, 255, 0.09), transparent 38%),
    rgba(255, 255, 255, 0.07);
}

.lsm-panel-kicker {
  margin: 0 0 13px;
  color: var(--lsm-cyan);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lsm-panel h3 {
  margin: 0 0 14px;
  color: var(--lsm-ink);
  font-size: clamp(1.55rem, 2.8vw, 2.1rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.lsm-panel > p {
  margin: 0 0 18px;
  color: var(--lsm-muted);
  font-size: 0.95rem;
  line-height: 1.62;
}

.lsm-panel-grid {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.lsm-panel-card,
.lsm-design-move {
  padding: 16px;
  border: 1px solid var(--lsm-line);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(102, 227, 255, 0.06), rgba(185, 255, 122, 0.035)),
    rgba(255, 255, 255, 0.04);
}

.lsm-panel-card span,
.lsm-design-move span {
  display: block;
  margin-bottom: 7px;
  color: var(--lsm-cyan);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lsm-panel-card p,
.lsm-design-move p {
  margin: 0;
  color: var(--lsm-muted-strong);
  font-size: 0.92rem;
  font-weight: 720;
  line-height: 1.46;
}

.lsm-design-move {
  margin-top: 12px;
}

.lsm-code-box {
  overflow: hidden;
  border: 1px solid var(--lsm-line);
  border-radius: 24px;
  background: rgba(3, 8, 18, 0.92);
  box-shadow: var(--lsm-shadow);
}

.lsm-code-box pre {
  margin: 0;
  max-height: 560px;
  overflow: auto;
  padding: clamp(18px, 3vw, 26px);
}

.lsm-code-box code {
  color: rgba(226, 232, 240, 0.92);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.84rem;
  line-height: 1.65;
  white-space: pre;
}

.lsm-code-note {
  margin-top: 18px;
}

.lsm-step-list {
  display: grid;
  gap: 14px;
}

.lsm-step {
  display: flex;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--lsm-line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 92% 12%, rgba(102, 227, 255, 0.08), transparent 38%),
    rgba(255, 255, 255, 0.055);
}

.lsm-step > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--lsm-cyan), var(--lsm-lime));
  color: #071321;
  font-size: 0.72rem;
  font-weight: 950;
}

.lsm-closing {
  text-align: left;
}

.lsm-closing .resource-detail-actions {
  justify-content: flex-start;
  margin-top: 26px;
}

.learning-systems-map-page .resource-detail-btn.secondary {
  border-color: var(--lsm-line);
  background: rgba(255, 255, 255, 0.075);
  color: var(--lsm-ink) !important;
  box-shadow: none;
}

@media (max-width: 1080px) {
  .lsm-map-workspace {
    grid-template-columns: 1fr;
  }

  .lsm-orbit {
    min-height: 520px;
  }

  .lsm-panel {
    min-height: auto;
  }
}

@media (max-width: 900px) {
  .lsm-card-grid,
  .lsm-use-grid,
  .lsm-note-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .learning-systems-map-page .resource-detail-inner,
  .learning-systems-map-page .dld-shell {
    width: min(100% - 32px, 1120px);
  }

  .lsm-article {
    gap: 42px;
  }

  .lsm-panel-section,
  .lsm-preview-section,
  .lsm-code-section,
  .lsm-closing {
    padding: 20px;
    border-radius: 26px;
  }

  .lsm-map-intro {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .lsm-orbit {
    display: grid;
    gap: 12px;
    min-height: auto;
    padding: 16px;
    overflow: visible;
  }

  .lsm-ring {
    display: none;
  }

  .lsm-core,
  .lsm-node {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: auto;
    transform: none !important;
  }

  .lsm-core {
    height: auto;
    min-height: 108px;
    border-radius: 24px;
  }

  .lsm-node {
    grid-template-columns: 38px 1fr;
    justify-items: start;
    text-align: left;
    border-radius: 20px;
  }

  .lsm-node strong {
    font-size: 0.95rem;
  }

  .lsm-closing .resource-detail-actions,
  .lsm-closing .resource-detail-btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .learning-systems-map-page .resource-detail-inner,
  .learning-systems-map-page .dld-shell {
    width: min(100% - 28px, 1120px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .learning-systems-map-page *,
  .learning-systems-map-page *::before,
  .learning-systems-map-page *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
/* =========================================================
   Learning Systems Map — Center node cleanup
   Fixes cramped/cut label inside the central Performance node
   ========================================================= */

.lsm-core {
  width: 138px;
  height: 138px;
  padding: 18px;
}

.lsm-core span {
  max-width: 100%;
  margin-bottom: 8px;
  color: var(--lsm-cyan);
  font-size: 0.56rem;
  font-weight: 950;
  letter-spacing: 0.16em;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.lsm-core strong {
  max-width: 100%;
  color: var(--lsm-ink);
  font-size: 1.36rem;
  line-height: 0.96;
  letter-spacing: -0.055em;
  text-align: center;
}

@media (max-width: 760px) {
  .lsm-core {
    width: 100%;
    height: auto;
    min-height: 108px;
    padding: 18px;
  }

  .lsm-core span {
    font-size: 0.62rem;
  }
}

/* =========================================================
   v2 LIGHT EDITORIAL MIGRATION
   ---------------------------------------------------------
   The shared lab-detail.css is now light (white page, navy
   ink, violet accent). Everything above this line was authored
   for a DARK page, so its near-white text went invisible on
   the new white background. The rules below repoint the page
   FRAMING to the light system, and keep ONLY the interactive
   map as a dark "stage" (as the lab-detail system intends).
   ========================================================= */

/* --- framing tokens → light editorial --------------------- */
.learning-systems-map-page {
  --lsm-ink: #0f172a;
  --lsm-muted: #475569;
  --lsm-muted-strong: #334155;
  --lsm-line: #e7ecf2;
  --lsm-surface: #f8fafc;
  --lsm-card: #ffffff;
  --lsm-accent: #6d4aff;
  --lsm-cyan: #6d4aff;   /* gradient/number-chip pair → violet */
  --lsm-lime: #5b34c9;
}

/* --- section surfaces → light ----------------------------- */
.learning-systems-map-page .lsm-opening-section,
.learning-systems-map-page .lsm-panel-section,
.learning-systems-map-page .lsm-preview-section,
.learning-systems-map-page .lsm-code-section,
.learning-systems-map-page .lsm-closing {
  background:
    radial-gradient(circle at 10% 0%, rgba(109, 74, 255, 0.05), transparent 36%),
    var(--lsm-surface);
  border-color: var(--lsm-line);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.06);
}

/* --- inner cards → white on light ------------------------- */
.learning-systems-map-page .lsm-info-card,
.learning-systems-map-page .lsm-use-card,
.learning-systems-map-page .lsm-note-card,
.learning-systems-map-page .lsm-code-note,
.learning-systems-map-page .lsm-step {
  background: var(--lsm-card);
  border-color: var(--lsm-line);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

/* --- accent pills → violet -------------------------------- */
.learning-systems-map-page .lsm-small-label,
.learning-systems-map-page .lsm-map-label,
.learning-systems-map-page .lsm-note-card span {
  border-color: rgba(109, 74, 255, 0.22);
  background: rgba(109, 74, 255, 0.10);
  color: var(--lsm-accent);
}

/* --- number chips → readable white on violet -------------- */
.learning-systems-map-page .lsm-info-card span,
.learning-systems-map-page .lsm-step > span {
  background: linear-gradient(135deg, #6d4aff, #5b34c9);
  color: #ffffff;
}

/* --- secondary button on light ---------------------------- */
.learning-systems-map-page .lsm-closing .resource-detail-btn.secondary {
  background: #ffffff;
}

/* --- interactive map STAYS a dark stage ------------------- */
/* re-scoping the tokens here flips the whole map subtree back
   to the original dark palette without touching its layout. */
.learning-systems-map-page .lsm-map-shell {
  --lsm-ink: #f8fbff;
  --lsm-muted: rgba(226, 232, 240, 0.78);
  --lsm-muted-strong: rgba(226, 232, 240, 0.92);
  --lsm-line: rgba(148, 163, 184, 0.22);
  --lsm-cyan: #66e3ff;
  --lsm-lime: #b9ff7a;
  background:
    radial-gradient(circle at 8% 0%, rgba(102, 227, 255, 0.16), transparent 30%),
    radial-gradient(circle at 92% 10%, rgba(185, 255, 122, 0.10), transparent 32%),
    #0b1224;
  border-color: rgba(148, 163, 184, 0.16);
}
