/* Static learning pages for Mines Financial. Loaded only by index.html and
   new learning pages, so existing source-code pages keep their current layout. */

.learning-entry-grid,
.learning-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.learning-entry {
  display: block;
  min-height: 150px;
  padding: 16px 16px 18px;
  border: 3px solid var(--border);
  background: var(--hdr-bg);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.12s, box-shadow 0.12s;
}

.learning-entry:nth-child(4n+1) { border-left: 10px solid var(--coral); }
.learning-entry:nth-child(4n+2) { border-left: 10px solid var(--teal); }
.learning-entry:nth-child(4n+3) { border-left: 10px solid var(--lav); }
.learning-entry:nth-child(4n)   { border-left: 10px solid var(--yellow); }

.learning-entry:hover,
.learning-card:hover,
.node-pill:hover,
.trace-step:hover,
.tab-button:hover {
  transform: translate(-3px, -3px);
  box-shadow: 7px 7px 0 var(--border);
}

.entry-kicker,
.panel-kicker {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 8px;
  border: 2px solid #000;
  background: var(--yellow);
  color: #000;
  font-size: 10px;
  font-weight: 700;
}

.entry-title,
.learning-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.15;
  color: var(--yellow);
  margin-bottom: 8px;
}

html[data-theme="light"] .entry-title,
html[data-theme="light"] .learning-card-title {
  color: #000;
}

.entry-desc,
.learning-card-desc,
.learning-copy {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-muted);
}

.learning-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 34px 86px;
}

.learning-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 24px;
  padding: 20px 22px;
  border: 3px solid var(--border);
  background: var(--hdr-bg);
  box-shadow: var(--shadow);
}

.learning-hero h1 {
  font-family: var(--font-display);
  font-size: 2.1rem;
  line-height: 1.05;
  color: var(--coral);
  text-shadow: 4px 4px 0 var(--yellow);
  margin: 0 0 8px;
}

html[data-theme="light"] .learning-hero h1 {
  text-shadow: 4px 4px 0 #000;
}

.learning-hero p {
  max-width: 760px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.75;
}

.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 14px;
  border: 2.5px solid var(--border);
  background: var(--teal);
  color: #000;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.learning-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 18px;
}

.learning-panel,
.learning-card,
.node-picker,
.trace-list,
.debug-sidebar,
.static-note,
.filter-panel {
  border: 3px solid var(--border);
  background: var(--hdr-bg);
  box-shadow: var(--shadow);
}

.learning-panel,
.node-picker,
.trace-list,
.debug-sidebar,
.static-note,
.filter-panel {
  padding: 16px;
}

.learning-card {
  padding: 16px;
}

.node-group-title,
.panel-title,
.mini-title {
  font-family: var(--font-display);
  color: var(--yellow);
  font-size: 1rem;
  margin-bottom: 10px;
}

html[data-theme="light"] .node-group-title,
html[data-theme="light"] .panel-title,
html[data-theme="light"] .mini-title {
  color: #000;
}

.node-pill,
.trace-step,
.tab-button,
.filter-chip {
  width: 100%;
  display: block;
  margin: 8px 0;
  padding: 9px 10px;
  border: 2px solid var(--border);
  background: var(--flow-bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--border);
}

.node-pill.active,
.trace-step.active,
.tab-button.active,
.filter-chip.active {
  background: var(--yellow);
  color: #000;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.field-box {
  border: 2px solid var(--border);
  background: var(--flow-bg);
  padding: 12px;
}

.field-box ul {
  margin: 8px 0 0 18px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.7;
}

.source-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.source-link:hover { color: var(--yellow); }

.state-diff,
.sample-block {
  margin-top: 14px;
  padding: 14px;
  border: 3px solid var(--flow-bdr);
  background: var(--flow-bg);
  color: var(--flow-fg);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-x: auto;
}

.compare-grid,
.debug-grid,
.eval-grid,
.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.compare-card {
  border: 3px solid var(--border);
  background: var(--hdr-bg);
  box-shadow: var(--shadow);
  padding: 18px;
}

.compare-card ul,
.learning-card ul {
  margin: 12px 0 0 18px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.75;
}

.handoff-strip {
  margin: 18px 0;
  padding: 14px;
  border: 3px solid var(--border);
  background: var(--tag-bg);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  line-height: 1.7;
}

.debug-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
}

.hit-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.hit-card {
  border: 2px solid var(--border);
  background: var(--flow-bg);
  padding: 12px;
}

.hit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.mini-tag {
  display: inline-block;
  padding: 2px 7px;
  border: 2px solid #000;
  background: var(--teal);
  color: #000;
  font-size: 10px;
  font-weight: 700;
}

.search-input {
  width: 100%;
  padding: 10px 12px;
  border: 3px solid var(--border);
  background: var(--flow-bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
  box-shadow: var(--shadow-sm);
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.term-card {
  border: 3px solid var(--border);
  background: var(--hdr-bg);
  padding: 14px;
  box-shadow: var(--shadow);
}

.term-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--coral);
  margin-bottom: 8px;
}

.term-card p {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.7;
}

.term-card code {
  display: inline-block;
  margin-top: 8px;
  color: var(--teal);
  font-size: 11px;
}

details.learning-card summary {
  cursor: pointer;
  font-family: var(--font-display);
  color: var(--yellow);
}

html[data-theme="light"] details.learning-card summary {
  color: #000;
}

@media (max-width: 920px) {
  .learning-hero,
  .learning-shell,
  .debug-layout,
  .compare-grid,
  .debug-grid,
  .eval-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }

  .learning-page {
    padding: 24px 18px 74px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }
}
