/* The Research Track (/learn/track, /learn/track/{step}).
 *
 * Loaded by those two pages only, via cm_head()'s `css`. Everything here is
 * prefixed `ct-`: site.css styles bare `nav`, `thead th` and several one-word
 * classes globally, so an unprefixed class in a page stylesheet is a change to
 * the whole site waiting to happen.
 *
 * Colours come from the house variables, never from literals, so dark mode and
 * any future brand change carry through without this file being touched. No
 * grading state is colour alone: a passed step carries a tick and the word
 * "Passed", and a wrong answer is labelled as well as tinted.
 */

/* ---- the progress bar on /learn/track ---------------------------------- */

.ct-bar{display:flex; align-items:center; gap:18px; flex-wrap:wrap;
  margin:26px 0 6px; padding:18px 20px;
  border:1px solid var(--hairline-2); border-radius:14px; background:var(--surface)}
.ct-bar.is-out{background:transparent}
.ct-bar-n{flex:1 1 220px; min-width:0}
.ct-bar-k{margin:0; font-size:13px; letter-spacing:.04em; text-transform:uppercase; color:var(--muted)}
.ct-bar-v{margin:2px 0 0; font-size:19px; font-weight:650; color:var(--ink)}
.ct-bar-done{margin:0; flex:1 1 100%; color:var(--ink-2)}

/* One piece per step, not a percentage bar: it says WHICH steps are done as
   well as how many, and it carries no inline width — bin/check-uniform.php
   counts inline styles in public templates and that number only goes down. */
.ct-meter{flex:1 1 180px; display:flex; gap:4px}
.ct-meter span{flex:1 1 0; height:8px; border-radius:99px; background:var(--hairline)}
.ct-meter span.is-on{background:var(--accent)}

/* ---- the step list ----------------------------------------------------- */

.ct-steps{list-style:none; margin:0; padding:0; display:grid; gap:10px}
.ct-step{margin:0}
.ct-step-in{display:flex; align-items:flex-start; gap:16px; padding:16px 18px;
  border:1px solid var(--hairline-2); border-radius:14px; background:var(--surface);
  text-decoration:none; color:inherit; transition:border-color .15s, transform .15s}
.ct-step-in:hover{border-color:var(--accent-text); transform:translateY(-1px)}

.ct-n{flex:0 0 34px; width:34px; height:34px; display:grid; place-items:center;
  border-radius:50%; border:1px solid var(--hairline-2);
  font-size:14px; font-weight:650; color:var(--ink-2)}
.ct-step.is-done .ct-n{background:var(--btn); border-color:var(--btn); color:#fff}

.ct-body{flex:1 1 auto; min-width:0; display:block}
.ct-t{display:block; font-size:17px; font-weight:650; color:var(--ink)}
.ct-tag{margin-left:8px; padding:2px 7px; border-radius:99px;
  font-size:11px; font-weight:650; letter-spacing:.03em; text-transform:uppercase;
  background:var(--btn); color:#fff; vertical-align:2px}
.ct-aim{display:block; margin-top:3px; color:var(--ink-2); line-height:1.5}
.ct-meta{display:block; margin:6px 0 0; font-size:13px; color:var(--muted)}
.ct-go{flex:0 0 auto; color:var(--muted); font-size:18px; align-self:center}
.ct-step-in:hover .ct-go{color:var(--accent-text)}

/* ---- a step page ------------------------------------------------------- */

/* .docpage already sets the reading column (site.css), as on a guide page;
   this only adds the room under the last block. */
.ct-page{padding-bottom:40px}

/* The two not-found states, which have no hero to space them off the nav. */
.ct-gap{margin:80px 0}
.ct-passed{display:inline-block; margin:0 0 18px; padding:7px 13px; border-radius:99px;
  background:var(--surface); border:1px solid var(--hairline-2); font-size:14px; color:var(--ink-2)}
.ct-passed b{color:var(--accent-text)}

.ct-card{margin:0 0 18px; padding:22px; border:1px solid var(--hairline-2);
  border-radius:16px; background:var(--surface)}
.ct-card h2{margin:0 0 8px; font-size:21px; line-height:1.3}
.ct-card h2 a{color:inherit}
.ct-card p{margin:0 0 12px; color:var(--ink-2); line-height:1.6}
.ct-card .btn{margin-top:4px}
.ct-k{display:flex; align-items:center; gap:9px; margin:0 0 10px !important;
  font-size:12px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted)}
.ct-k span{display:grid; place-items:center; width:22px; height:22px; border-radius:50%;
  background:var(--hairline); color:var(--ink-2); font-size:12px; letter-spacing:0}

.ct-check{border-color:var(--accent)}
.ct-alt{display:inline-block; margin-left:14px}

/* ---- the questions ----------------------------------------------------- */

.ct-qs{list-style:none; margin:0 0 20px; padding:0; display:grid; gap:18px; counter-reset:ctq}
.ct-q{margin:0}
.ct-q fieldset{margin:0; padding:0; border:0}
.ct-q legend{display:block; width:100%; margin:0 0 10px; padding:0;
  font-size:16px; font-weight:600; color:var(--ink); line-height:1.45; counter-increment:ctq}
.ct-q legend::before{content:counter(ctq) ". "; color:var(--muted); font-weight:650}

.ct-opt{display:flex; align-items:flex-start; gap:11px; padding:11px 13px; margin:0 0 7px;
  border:1px solid var(--hairline-2); border-radius:11px; cursor:pointer;
  line-height:1.5; color:var(--ink-2); transition:border-color .12s, background .12s}
.ct-opt:hover{border-color:var(--accent-text)}
.ct-opt input{flex:0 0 auto; margin:4px 0 0; width:17px; height:17px; accent-color:var(--accent)}
.ct-opt:has(input:checked){border-color:var(--accent); background:var(--hairline)}
.ct-opt:focus-within{outline:2px solid var(--accent-text); outline-offset:2px}

/* ---- the marking ------------------------------------------------------- */

.ct-win{color:var(--good)}
.ct-lose{color:var(--ink)}

.ct-res{list-style:none; margin:4px 0 20px; padding:0; display:grid; gap:14px}
.ct-res li{margin:0; padding:15px 17px; border:1px solid var(--hairline-2);
  border-left-width:4px; border-radius:12px}
.ct-res li.is-right{border-left-color:var(--good)}
.ct-res li.is-wrong{border-left-color:var(--bad)}
.ct-res-q{margin:0 0 9px !important; font-weight:600; color:var(--ink) !important}
.ct-res-a,.ct-res-x,.ct-res-e{margin:0 0 7px !important; line-height:1.6}
.ct-res-e{color:var(--ink-2) !important}

.ct-after{display:flex; align-items:center; gap:14px; flex-wrap:wrap}
.ct-form-inline{display:inline; margin:0}
.ct-nav{display:flex; justify-content:space-between; gap:16px; flex-wrap:wrap;
  margin:26px 0 20px; padding-top:18px; border-top:1px solid var(--hairline)}
.ct-note b{display:block}

@media(max-width:560px){
  .ct-bar{gap:12px}
  .ct-card{padding:18px}
  .ct-step-in{padding:14px}
  .ct-after{gap:10px}
  .ct-after .btn,.ct-after form,.ct-after .btn+form .btn{width:100%}
}

/* .docpage underlines every link in the reading column (site.css), which is
   right for prose and wrong for a card heading, a button and the step nav.
   Prose links inside the marking (the library word under each answer) keep it. */
.ct-page .btn,
.ct-page .ct-card h2 a,
.ct-page .ct-nav a,
.ct-page .ct-opt{text-decoration:none}
.ct-page .ct-card h2 a:hover{text-decoration:underline}
