/* ==========================================================================
   Components section colour + blocks — 2026-09-28
   components.html takes the site's purple (the third colour of the home
   page hero), so the three Learn sections read apart at a glance:
   Strokes blue, Components purple, the rest of the site coral. As on
   strokes.html, only <main> is re-toned, by overriding the colour tokens
   skill-page-v2.css reads; the shared header and footer stay coral.
   Also holds the two blocks this page has and strokes.html does not:
   the module cards and the one-lesson walkthrough.
   Loaded last on components.html.
   ========================================================================== */

body.dna-page.site-ui.sp-components .sp-main {
  --hc-coral:#956AFA;      --hc-coral-rgb:149,106,250;
  --hc-coral-deep:#6B45D6; --hc-coral-deep-rgb:107,69,214;
  --hc-tint:#F3EEFF; --hc-tint-2:#E7DDFE; --hc-wash:#F8F5FF;
  --sp-line:#E6E0F2; --sp-line-soft:#EEE9F7; --sp-paper:#FDFCFF;
  --sp-lift:0 4px 0 #ECE6F7,0 22px 40px -28px rgba(107,69,214,.4);
}
/* the few corals written out in full in skill-page-v2.css */
body.dna-page.site-ui.sp-components .sp-main .sp-btn-light,
body.dna-page.site-ui.sp-components .sp-main .sp-ask .sp-btn { box-shadow:0 14px 26px -14px rgba(52,24,120,.55); }
body.dna-page.site-ui.sp-components .sp-main .sp-ask { background:linear-gradient(135deg,var(--hc-coral),#5B36C4); }
body.dna-page.site-ui.sp-components .sp-main .sp-checks li::before {
  background:var(--hc-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B45D6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/13px no-repeat;
}
@media (hover:hover) and (pointer:fine) {
  body.dna-page.site-ui.sp-components .sp-main .sp-tool:hover,
  body.dna-page.site-ui.sp-components .sp-main .cp-module:hover {
    box-shadow:0 4px 0 #ECE6F7,0 28px 46px -24px rgba(107,69,214,.45);
  }
}

/* ── Module cards: number, sample, name, one line ───────────────────────── */
body.dna-page.site-ui .sp-main .cp-modules {
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; margin-top:44px; padding:0; list-style:none;
}
body.dna-page.site-ui .sp-main .cp-module {
  position:relative; display:flex; flex-direction:column; padding:26px 26px 24px;
  border:1px solid var(--sp-line); border-radius:22px; background:var(--sp-paper); box-shadow:var(--sp-lift);
  transition:transform .18s ease,box-shadow .18s ease;
}
body.dna-page.site-ui .sp-main .cp-module-top { display:flex; align-items:center; justify-content:space-between; gap:12px; }
body.dna-page.site-ui .sp-main .cp-module-n { font:600 13px/1 var(--hz-ui); letter-spacing:.16em; color:var(--hc-coral-deep); }
body.dna-page.site-ui .sp-main .cp-sample {
  display:inline-flex; align-items:center; gap:8px; padding:6px 12px; border-radius:12px;
  background:var(--hc-tint); font:400 24px/1 var(--hz-hanzi); color:var(--hc-ink);
}
body.dna-page.site-ui .sp-main .cp-sample i { font:500 14px/1 var(--hz-ui); font-style:normal; color:var(--hc-coral-deep); }
body.dna-page.site-ui .sp-main .cp-module h3 { margin-top:22px; font:700 22px/1.25 var(--hz-display); letter-spacing:-.01em; color:var(--hc-ink); }
body.dna-page.site-ui .sp-main .cp-module p { margin-top:8px; font:400 15.5px/1.6 var(--hz-ui); color:var(--hc-body); }
body.dna-page.site-ui .sp-main .cp-module.is-test {
  border-color:transparent; background:linear-gradient(150deg,var(--hc-coral),#5B36C4);
  box-shadow:0 4px 0 #E3DAF6,0 24px 40px -24px rgba(107,69,214,.6);
}
body.dna-page.site-ui .sp-main .cp-module.is-test :is(h3,p,.cp-module-n) { color:#fff; }
body.dna-page.site-ui .sp-main .cp-module.is-test p { color:rgba(255,255,255,.9); }
body.dna-page.site-ui .sp-main .cp-module.is-test .cp-sample { background:rgba(255,255,255,.18); color:#fff; font:600 14px/1 var(--hz-ui); padding:9px 12px; }

/* the four steps every component goes through */
body.dna-page.site-ui .sp-main .cp-path {
  display:flex; flex-wrap:wrap; align-items:center; gap:10px 12px; margin-top:32px; padding:0; list-style:none;
}
body.dna-page.site-ui .sp-main .cp-path li {
  padding:10px 16px; border:1px solid var(--sp-line); border-radius:999px; background:#fff;
  font:500 15px/1.3 var(--hz-ui); color:var(--hc-ink);
}
body.dna-page.site-ui .sp-main .cp-path li b { margin-right:8px; font-weight:600; color:var(--hc-coral-deep); }
body.dna-page.site-ui .sp-main .cp-path .cp-arrow { padding:0; border:0; background:none; color:var(--hc-coral); font-weight:600; }

/* ── One lesson: the component on the left, the ten steps on the right ─── */
body.dna-page.site-ui .sp-main .cp-lesson {
  display:grid; grid-template-columns:300px minmax(0,1fr); gap:48px; align-items:start; margin-top:44px;
}
body.dna-page.site-ui .sp-main .cp-subject {
  position:sticky; top:calc(var(--mw-header-h,80px) + 24px);
  display:flex; flex-direction:column; align-items:center; gap:18px; padding:32px 24px 28px;
  border:1px solid var(--sp-line); border-radius:24px; background:var(--sp-paper); box-shadow:var(--sp-lift); text-align:center;
}
body.dna-page.site-ui .sp-main .cp-glyph {
  position:relative; display:grid; place-items:center; width:180px; height:180px;
  border:1px solid #E3D8F8; border-radius:8px; background:#fff;
  font:400 128px/1 var(--hz-hanzi); color:var(--hc-coral-deep);
}
body.dna-page.site-ui .sp-main .cp-glyph::before,
body.dna-page.site-ui .sp-main .cp-glyph::after { content:""; position:absolute; pointer-events:none; }
body.dna-page.site-ui .sp-main .cp-glyph::before { inset:0 50% 0 auto; border-left:1px dashed #E7DDFE; }
body.dna-page.site-ui .sp-main .cp-glyph::after  { inset:50% 0 auto; border-top:1px dashed #E7DDFE; }
body.dna-page.site-ui .sp-main .cp-subject b { font:600 18px/1.3 var(--hz-ui); color:var(--hc-ink); }
body.dna-page.site-ui .sp-main .cp-subject small { font:400 15px/1.4 var(--hz-ui); color:var(--hc-muted); }
body.dna-page.site-ui .sp-main .cp-steps { display:grid; gap:10px; padding:0; list-style:none; counter-reset:cp; }
body.dna-page.site-ui .sp-main .cp-steps li {
  counter-increment:cp; display:grid; grid-template-columns:36px minmax(0,1fr); column-gap:16px; align-items:start;
  padding:16px 20px; border:1px solid var(--sp-line-soft); border-radius:16px; background:#fff;
}
body.dna-page.site-ui .sp-main .cp-steps li::before {
  content:counter(cp); grid-row:1 / span 2; display:grid; place-items:center; width:36px; height:36px; border-radius:50%;
  background:var(--hc-tint); font:600 15px/1 var(--hz-ui); color:var(--hc-coral-deep);
}
body.dna-page.site-ui .sp-main .cp-steps b { font:600 16.5px/1.4 var(--hz-ui); color:var(--hc-ink); }
body.dna-page.site-ui .sp-main .cp-steps small { margin-top:2px; font:400 15px/1.55 var(--hz-ui); color:var(--hc-body); }
body.dna-page.site-ui .sp-main .cp-steps [lang="zh"] { font-family:var(--hz-hanzi); font-size:1.12em; color:var(--hc-ink); }

@media (hover:hover) and (pointer:fine) {
  body.dna-page.site-ui .sp-main .cp-module:hover { transform:translateY(-3px); }
}
@media (max-width:1023px) {
  body.dna-page.site-ui .sp-main .cp-modules { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body.dna-page.site-ui .sp-main .cp-lesson { grid-template-columns:minmax(0,1fr); gap:28px; }
  body.dna-page.site-ui .sp-main .cp-subject { position:static; flex-direction:row; text-align:left; padding:20px; }
  body.dna-page.site-ui .sp-main .cp-glyph { width:112px; height:112px; font-size:80px; flex:none; }
  body.dna-page.site-ui .sp-main .cp-subject > span { display:flex; flex-direction:column; gap:4px; }
}
@media (max-width:639px) {
  body.dna-page.site-ui .sp-main .cp-modules { grid-template-columns:minmax(0,1fr); margin-top:32px; gap:16px; }
  body.dna-page.site-ui .sp-main .cp-steps li { padding:14px 16px; column-gap:12px; grid-template-columns:30px minmax(0,1fr); }
  body.dna-page.site-ui .sp-main .cp-steps li::before { width:30px; height:30px; font-size:14px; }
}
@media (prefers-reduced-motion:reduce) {
  body.dna-page.site-ui .sp-main .cp-module { transition:none; }
  body.dna-page.site-ui .sp-main .cp-module:hover { transform:none; }
}
body.dna-page.site-ui .sp-main .cp-subject > span { display:flex; flex-direction:column; gap:6px; }
/* the final test closes the grid as one full-width card */
body.dna-page.site-ui .sp-main .cp-module.is-test {
  grid-column:1 / -1; display:grid; grid-template-columns:auto minmax(0,1fr); column-gap:32px; align-items:center;
}
body.dna-page.site-ui .sp-main .cp-module.is-test .cp-module-top { grid-row:1 / span 2; flex-direction:column; align-items:flex-start; gap:14px; }
body.dna-page.site-ui .sp-main .cp-module.is-test h3 { margin-top:0; }
@media (max-width:639px) {
  body.dna-page.site-ui .sp-main .cp-module.is-test { display:flex; }
  body.dna-page.site-ui .sp-main .cp-module.is-test .cp-module-top { flex-direction:row; align-items:center; }
  body.dna-page.site-ui .sp-main .cp-module.is-test h3 { margin-top:22px; }
}
/* component-test option tiles */
body.dna-page.site-ui .st-main .ct-opts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; width:100%; }
body.dna-page.site-ui .st-main .ct-opt { justify-content:center; align-items:center; min-height:96px; }
/* A component glyph is the whole answer, so it is the biggest thing on the tile —
   and the focus-mode rule for ordinary <b> answers (stroke-test.css) must not shrink it. */
body.dna-page.site-ui .st-main .st-opt.ct-opt b.ct-big,
body.dna-page.site-ui.st-focus .st-main .st-opt.ct-opt b.ct-big { font:400 clamp(48px,5vw,64px)/1.1 var(--hz-hanzi); color:var(--hc-ink); }
/* the st-* styles read --sd-* tokens that stroke-page.css defines on .sd-page;
   this page is purple, not blue, so define them here */
body.dna-page.site-ui.sp-components { --sd-blue:#6B45D6; --sd-blue-rgb:107,69,214; --sd-ink:#2F2727; --sd-green:#2E8B57; --sd-top:calc(var(--mw-header-h,80px) + 16px); }
