/* ── Static sudoku grid renderer, shared by every /learn page ─────────── */
.sgrid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  grid-template-rows: repeat(9, minmax(0, 1fr));
  width: min(100%, var(--size, 380px));
  aspect-ratio: 1;
  border: 2px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin: 0 auto;
  background: var(--secondary);
}
.scell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-right: 1px solid rgba(160, 160, 160, 0.15);
  border-bottom: 1px solid rgba(160, 160, 160, 0.15);
}
.scell[data-c="2"], .scell[data-c="5"] { border-right: 2px solid rgba(0, 255, 65, 0.6); }
.scell[data-r="2"], .scell[data-r="5"] { border-bottom: 2px solid rgba(0, 255, 65, 0.6); }
.c-unit { background: rgba(255, 255, 255, 0.06); }
.c-eliminate { background: rgba(255, 77, 77, 0.15); }
.c-pattern { box-shadow: inset 0 0 0 2px var(--accent); background: rgba(0, 255, 65, 0.13); }
.sdigit { color: #fff; font-weight: 700; font-size: calc(var(--size, 380px) * 0.06); }
.c-placed .sdigit { color: var(--accent); font-weight: 900; }
.smarks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); width: 100%; height: 100%; }
.smark, .smark-struck, .smark-empty { display: flex; align-items: center; justify-content: center; font-size: calc(var(--size, 380px) * 0.024); line-height: 1; }
.smark { color: var(--text-sec); }
.smark-struck { color: #ff4d4d; text-decoration: line-through; font-weight: 900; }
.sblock { color: rgba(160, 160, 160, 0.4); font-size: calc(var(--size, 380px) * 0.045); }

/* ── Article layout ───────────────────────────────────────────────────── */
.learn-article, .learn-hub {
  max-width: 760px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}
.back-link {
  display: inline-block;
  color: var(--text-sec);
  font-size: 14px;
  margin-bottom: 20px;
}
.back-link:hover { color: var(--accent); }
.diff-badge {
  display: inline-block;
  border: 1px solid;
  border-radius: 50px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}
.diff-badge.small { font-size: 10px; padding: 3px 10px; }
.learn-article h1, .learn-hub h1 {
  font-size: 34px;
  font-weight: 900;
  margin-bottom: 16px;
  line-height: 1.15;
}
.learn-article .intro, .learn-hub .intro {
  color: var(--text-sec);
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 8px;
}
.learn-article h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 40px 0 12px;
}
.learn-article p {
  color: var(--text-sec);
  font-size: 15px;
  line-height: 1.8;
}
.example-heading {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  margin: 28px 0 14px;
}
.step {
  display: flex;
  gap: 24px;
  align-items: center;
  margin: 28px 0;
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.step-grid { flex: 0 0 220px; max-width: 220px; }
.step-text { flex: 1; min-width: 220px; }
.step-num {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.step-text h4 { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.step-text p { font-size: 14px; line-height: 1.7; margin: 0; }
.tips {
  padding-left: 20px;
  color: var(--text-sec);
  font-size: 15px;
  line-height: 1.9;
}
.tips li { margin-bottom: 6px; }
.cta {
  margin-top: 44px;
  padding: 24px;
  text-align: center;
  background: rgba(0, 255, 65, 0.08);
  border: 1px solid rgba(0, 255, 65, 0.3);
  border-radius: var(--radius);
}
.cta p { color: var(--text); font-size: 15px; margin-bottom: 16px; }
.cta-btn,
.cta-btn:link,
.cta-btn:visited {
  display: inline-block;
  background: var(--accent);
  color: var(--primary);
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}
.cta-btn:hover { opacity: 0.9; text-decoration: none; color: var(--primary); }
.related { margin-top: 40px; }
.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.related-links a {
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 13px;
  color: var(--text-sec);
}
.related-links a:hover { color: var(--accent); border-color: var(--accent); }

/* ── Hub grid of technique cards ──────────────────────────────────────── */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-top: 32px;
}
.tech-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  display: block;
}
.tech-card:hover { border-color: var(--accent); }
.tech-card-grid { pointer-events: none; margin-bottom: 10px; }
.tech-card-body h3 { font-size: 15px; font-weight: 700; color: var(--text); margin-top: 6px; }

@media (max-width: 520px) {
  .step { flex-direction: column; }
  .step-grid { flex-basis: auto; max-width: 260px; width: 100%; }
}
