/* ============================================================================
   The home page (the next thing to do, the topics, starting over) and a
   topic's own page (its next thing to do, its ladder, its mixes).
   common.css has the tokens and says what each color is allowed to mean.
   ========================================================================= */

.lede { margin: 0; max-width: 62ch; }

/* ------------------------------------------------------------------ next up */

/* The next thing to do. Amber is what you are acting on. */
.next-panel {
  background: var(--panel);
  border: 2px solid var(--amber);
  border-left-width: 8px;
  padding: 16px 20px 20px;
}

.next-panel .label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--dim);
  margin-bottom: 8px;
}

.btn.big {
  font-size: clamp(1.1rem, 4.2vw, 1.4rem);
  padding: 14px 26px;
}

/* With more than one topic the button says which, on a line of its own. */
.btn.big.two-line { display: inline-grid; gap: 2px; text-align: left; line-height: 1.25; }
.btn.big .next-topic { font-size: 0.72em; font-weight: 500; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.next-panel p { margin: 0; }
.next-panel .all-done { font-size: 1.2rem; }
.pile-line { color: var(--dim); font-size: 0.95rem; }
.next-panel .pile-line { margin-top: 14px; }

/* --------------------------------------------------------------- the topics */

/* The home page: one card per topic, and the whole card is the link. */
.topics-list { display: grid; gap: 10px; }
.topics-list h2, .more-head, .how h2 { font-size: 1.15rem; margin: 0; }
.more-head { margin-top: 10px; padding-top: 16px; border-top: 2px solid var(--rule); }

.topic-cards { display: grid; gap: 10px; list-style: none; margin: 4px 0 0; padding: 0; }

.topic-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px 20px;
  background: var(--panel);
  border: 2px solid var(--rule-hot);
  box-shadow: 0 3px 0 0 var(--rule);
  padding: 14px 18px 16px;
  color: var(--ink);
  text-decoration: none;
}
.topic-card:hover { background: var(--panel-lo); }
.topic-card > * { grid-column: 1; }

/* The topic the big button leads to, marked the same way and with a tag. */
.topic-card.next { border-color: var(--amber); box-shadow: inset 6px 0 0 var(--amber), 0 3px 0 0 var(--rule); }

.topic-card .topic-name { font-size: 1.3rem; font-weight: 700; line-height: 1.25; }
.topic-about { color: var(--dim); font-size: 1rem; line-height: 1.35; }
.topic-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 4px; font-size: 0.95rem; }
.topic-count { font-weight: 700; }
.topic-next { color: var(--dim); font-size: 0.95rem; }

/* One box per belt, filled for a cleared one. The count beside it says the
   same thing in words; the green only agrees. */
.topic-pips { display: inline-flex; gap: 3px; }
.pip { width: 16px; height: 12px; border: 2px solid var(--rule-hot); background: transparent; }
.pip.on { border-color: var(--green); background: var(--green); }

/* The way in, said as words at the right of the card. */
.topic-card .topic-go {
  grid-column: 2;
  grid-row: 1 / span 4;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.topic-go::after { content: ' \203A'; }

.tag {
  display: inline-block;
  margin-left: 10px;
  padding: 0 7px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
  background: var(--amber-fill);
  border: 1px solid var(--amber);
  vertical-align: 2px;
  white-space: nowrap;
}

/* ---------------------------------------------------------- a topic's page */

/* How a belt works, said once, above the belts. */
.how { display: grid; gap: 6px; }
.how ul { margin: 0; padding-left: 22px; max-width: 62ch; }
.how li { margin: 2px 0; }

/* The other topics, at the foot of a topic's page. */
.jump { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-size: 0.95rem; }
.jump-label { color: var(--dim); }
.jump ul { display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; margin: 0; padding: 0; }
.jump a { display: inline-block; padding: 4px 0; color: var(--ink); }
.others { margin-top: 12px; padding-top: 16px; border-top: 2px solid var(--rule); }

/* --------------------------------------------------------------- the ladder */

.topic { display: grid; gap: 10px; }
h2.topic-name { font-size: 1.15rem; margin: 0; }

.belts { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }

.belt-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 16px;
  background: var(--panel);
  border: 2px solid var(--rule);
  padding: 10px 16px;
}

/* The belt the big button leads to, marked the same way and with a tag. */
.belt-card.next { border-color: var(--amber); box-shadow: inset 6px 0 0 var(--amber); }

.belt-card .num {
  font-family: var(--mono);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.belt-card .nm { font-weight: 700; font-size: 1.1rem; line-height: 1.25; }
.belt-card .idea { color: var(--dim); font-size: 0.95rem; line-height: 1.35; margin-top: 2px; }

/* Each side of a belt: the button, and under it whether it is cleared. The
   word and the mark say it; the green only agrees. */
.sides { display: flex; gap: 12px; }

.side-cell {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 108px;
  font-size: 0.88rem;
  line-height: 1.2;
}
.side-cell .btn { width: 100%; text-align: center; padding: 6px 14px; }
.side-cell .todo { color: var(--dim); }
.side-cell.cleared .btn { border-color: var(--green); background: var(--green-fill); }
.side-cell.cleared .btn:hover { background: #cbe6c7; }

/* Both sides in one round: a way in with no mark of its own. Under it, in
   place of a mark, is what the word on the button means. */
.both-cell {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 108px;
  font-size: 0.88rem;
  line-height: 1.2;
  text-align: center;
}
.both-cell .btn { width: 100%; text-align: center; padding: 6px 14px; }
.both-cell .todo { color: var(--dim); }

/* The Fluent mark, beside the two sides. A mark and not a button, so it is
   drawn flat: a dashed box with the word, and under it whether it is earned. */
.fluent-cell {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 84px;
  font-size: 0.88rem;
  line-height: 1.2;
}
.fluent-word {
  width: 100%;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  padding: 6px 10px;
  color: var(--dim);
  border: 2px dashed var(--rule);
  margin-bottom: 3px;
}
.fluent-cell .todo { color: var(--dim); }
.fluent-cell.earned .fluent-word { color: var(--ink); border: 2px solid var(--green); background: var(--green-fill); }

/* ------------------------------------------------------------- mix your own */

/* Folded under each ladder until it is wanted. A ticked belt is amber, what
   you are acting on, and its box is ticked as well. A belt that cannot be
   ticked is set back, with the word for why. */
.mix { background: var(--panel); border: 2px solid var(--rule); }
.mix > summary { cursor: pointer; padding: 9px 16px; font-weight: 700; }
.mix > summary:hover { background: var(--panel-lo); }
.mix[open] > summary { border-bottom: 2px solid var(--rule); }
.mix-body { display: grid; gap: 14px; padding: 14px 16px 16px; }
.mix-about { margin: 0; color: var(--dim); font-size: 0.95rem; max-width: 62ch; }

.mix-set { border: 0; margin: 0; padding: 0; min-width: 0; }
.mix-set legend { padding: 0; margin-bottom: 6px; font-size: 0.9rem; font-weight: 700; color: var(--dim); }
.mix-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 6px 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mix-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 10px;
  font-size: 1rem;
  line-height: 1.25;
  background: var(--panel);
  border: 2px solid var(--rule-hot);
  cursor: pointer;
}
.mix-pick:hover { background: var(--panel-lo); }
.mix-pick:has(input:checked) { background: var(--amber-fill); border-color: var(--amber); font-weight: 700; }
.mix-pick:has(input:focus-visible) { outline: 3px solid var(--amber); outline-offset: 2px; }
.mix-pick input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--ink); outline: none; }
.mix-num { font-family: var(--mono); font-weight: 700; }

.mix-pick.off { cursor: default; color: var(--dimmer); background: transparent; border-style: dashed; border-color: var(--rule); }
.mix-pick.off:hover { background: transparent; }
.mix-locked { margin-left: auto; font-size: 0.85rem; color: var(--dim); }

.mix-msg { font-weight: 700; }

/* ------------------------------------------------------- the fluency check */

.check-panel { display: grid; gap: 10px; }
.check-panel h2 { font-size: 1.15rem; margin: 0; }
.check-about { margin: 0; color: var(--dim); font-size: 0.95rem; max-width: 62ch; }

/* A belt that is not open: set back, with the word and what opens it. */
.belt-card.locked { background: transparent; border-style: dashed; }
.belt-card.locked .num,
.belt-card.locked .nm,
.belt-card.locked .idea { color: var(--dimmer); }

.locked-note {
  display: grid;
  justify-items: end;
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--dim);
  text-align: right;
}
.locked-word { font-weight: 700; color: var(--ink); }

/* --------------------------------------------------------------- start over */

.page-foot {
  margin-top: 12px;
  padding-top: 16px;
  border-top: 2px solid var(--rule);
}
.page-foot:has(#start-over:empty):has(.erased:empty) { display: none; }

.btn.quiet {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--dim);
  padding: 5px 12px;
  box-shadow: none;
  border-color: var(--rule);
}

.ask-erase { margin: 0 0 12px; font-weight: 700; }
.erased { margin: 10px 0 0; color: var(--dim); }
.erased:empty { display: none; }

@media (max-width: 768px) {
  .next-panel { padding: 14px 14px 16px; }
  .topic-card { grid-template-columns: 1fr; padding: 12px 14px 14px; }
  .topic-card .topic-go { grid-column: 1; grid-row: auto; margin-top: 4px; }
  .btn.big { display: block; text-align: center; padding: 14px 12px; }
  .btn.big.two-line { display: grid; text-align: center; }
  .belt-card { grid-template-columns: 34px 1fr; gap: 8px 12px; padding: 10px 12px; }
  .belt-card .sides,
  .belt-card .locked-note { grid-column: 1 / -1; }
  .side-cell { flex: 1; min-width: 0; }
  .both-cell { flex: 1; min-width: 0; }
  .sides { gap: 8px; }
  .side-cell .btn, .both-cell .btn { padding: 6px 4px; }
  .mix > summary { padding: 9px 12px; }
  .mix-body { padding: 12px 12px 14px; }
  .mix-list { grid-template-columns: 1fr; }
  .mix .btn-row .btn { flex: 1 1 100%; text-align: center; }
  .fluent-cell { flex: 1; min-width: 0; }
  .locked-note {
    grid-auto-flow: column;
    justify-content: start;
    justify-items: start;
    gap: 8px;
    text-align: left;
  }
}
