/* Todo demo (namespaced under body.demo-todo).
   Poster layout: typographic list on the left, red stats field on the right. */

.demo-todo .todo-poster {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  min-height: calc(100vh - 46px);
}

.demo-todo .todo-main {
  padding: 2.5rem 2rem 3.5rem 2.5rem;
  border-right: 2px solid var(--rule);
}

/* Cap the reading measure, not the column — the border and the red field must
   stay flush however wide the viewport is. */
.demo-todo .todo-form,
.demo-todo ul.issues { max-width: 720px; }

.demo-todo .kicker { color: var(--red); }

.demo-todo .poster-headline {
  margin: 0.9rem 0 0;
  font-size: clamp(2.6rem, 6vw, 4.75rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.88;
}

/* Composer: one bordered bar, button fused to its right edge. */
.demo-todo .todo-form {
  display: flex;
  gap: 0;
  margin: 2.25rem 0 0;
  border: 2px solid var(--rule);
}

.demo-todo .todo-form input[type="text"] {
  flex: 1;
  border: 0;
  padding: 0.85rem 1rem;
  font-size: 1.05rem;
  outline: none;
}

.demo-todo .todo-form input[type="submit"] {
  border: 0;
  border-left: 2px solid var(--rule);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 0.85rem 1.4rem;
  cursor: pointer;
}

.demo-todo .todo-form input[type="submit"]:hover { background: var(--red); }

/* The list as typographic composition: oversized numeral, oversized title,
   the checkbox at the end of the line. */
.demo-todo ul.issues {
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 0;
  border-top: 2px solid var(--rule);
}

.demo-todo ul.issues li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--hairline);
}

.demo-todo .issue-no {
  flex: 0 0 3.4rem;
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.85;
  color: var(--ink);
}

.demo-todo ul.issues li.done .issue-no { color: var(--hairline); }

/* The tick and its title read as one row, and the title is the label, so the
   whole line is the hit area. */
.demo-todo ul.issues form.toggle {
  display: flex;
  flex: 1;
  align-items: flex-start;
  gap: 1rem;
  min-width: 0;
}

.demo-todo ul.issues li .title {
  flex: 1;
  cursor: pointer;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  overflow-wrap: anywhere; /* long unbroken titles must not widen the page */
}

.demo-todo ul.issues li.done .title {
  text-decoration: line-through;
  color: var(--muted);
}

.demo-todo ul.issues input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.3rem 0 0;
  accent-color: var(--red);
  cursor: pointer;
}

.demo-todo ul.issues button {
  font-size: 0.65rem;
  padding: 0.35rem 0.6rem;
  background: var(--paper);
  color: var(--ink);
}

.demo-todo ul.issues button:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--paper);
}

/* --- The red stats field ---------------------------------------------------- */

.demo-todo .todo-facts {
  background: var(--red);
  color: var(--paper);
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.demo-todo .todo-facts .micro-label { color: rgba(255, 255, 255, 0.75); }

.demo-todo .stat-huge {
  margin: 0.1rem 0 0;
  font-size: 5.5rem;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 0.8;
}

.demo-todo .stat {
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  padding-top: 1rem;
}

.demo-todo .stat-big {
  margin: 0.1rem 0 0;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.demo-todo .facts {
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  padding-top: 1rem;
  font-size: 0.65rem;
  line-height: 1.6;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.demo-todo .facts p { margin: 0; }
.demo-todo .facts p + p { margin-top: 0.9rem; }

.demo-todo .todo-facts .foot { margin-top: auto; color: rgba(255, 255, 255, 0.75); }

@media (max-width: 820px) {
  .demo-todo .todo-poster { grid-template-columns: 1fr; }
  .demo-todo .todo-main { border-right: 0; }
}
