/* The Tasks screen — module 26.
 *
 * Its own file rather than more of `screens.css`, which module 14 already
 * established with `autonomy.css` and which the 500-line rule makes the right
 * call again: `screens.css` is at 457. `tests/app/test_layouts.py` discovers
 * every stylesheet in this directory, so a file that is not linked from the
 * shell, from the offline page and from the service worker fails there rather
 * than on his phone.
 *
 * Everything here builds on `beach.css`'s components — `.section`, `.rows`,
 * `.row`, `.button` — and adds only what a checkbox list needs that nothing else
 * on the site does. Every colour is a palette token; there is no hex in this
 * file, which is what keeps the approved set the approved set.
 *
 * Drawn at 393, which is what an iPhone 16 Pro Max reports and the width every
 * frame in `design/beach.pen` is drawn at. */

.screen-tasks .page { gap: 20px; }

/* --- adding one ---------------------------------------------------------- */

/* The first thing on the screen. He wanted to be able to add "call the
 * accountant" without an email existing for it, and that is one field and one
 * tap — the date and the note are behind a disclosure because most tasks have
 * neither and a form with four boxes in it is a form he stops using. */
.task-add { display: grid; gap: 6px; }
.task-add-line { display: flex; align-items: center; gap: 8px; }
.task-add input[type="text"], .task-add input[type="date"] {
  width: 100%;
  font: inherit;
  /* 16px, and not for looks: iOS zooms the whole page in on focus for anything
   * smaller, and a zoomed page with the tab bar off the edge is how a one-line
   * form becomes a thing he has to pinch his way out of. */
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  min-height: var(--tap);
}
.task-add .button-icon { flex: none; width: var(--tap); min-width: var(--tap); padding: 0; }
.task-more { display: grid; gap: 6px; }
.task-more summary {
  font-size: var(--t-small);
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  min-height: 30px;
  display: flex;
  align-items: center;
}
.task-more summary::-webkit-details-marker { display: none; }

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

/* Tick box, then the task. The button is the whole 44px square even though the
 * box drawn inside it is 22 — a checkbox the size of the thing it looks like is
 * a checkbox he misses on a moving train. */
.row.task { display: grid; grid-template-columns: var(--tap) 1fr; align-items: start; gap: 4px; }
.row.task > form { display: block; }
.tick {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  margin: -10px 0 0 -11px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
}
.tick-box {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 2px solid var(--line);
  background: var(--surface);
}
.tick:hover .tick-box, .tick:focus-visible .tick-box { border-color: var(--accent); }
.tick:active .tick-box { background: var(--accent-soft); border-color: var(--accent); }
.row.task.is-late .tick-box { border-color: var(--warn); }

.tick-done {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  margin-left: 1px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* Done, and still legible. Struck through so the list reads at a glance, and
 * not greyed away to nothing: seeing what he got through is half of why the
 * screen is worth opening. */
.row.task.is-done .row-title { color: var(--muted); text-decoration: line-through; }

.section-done { padding-top: 4px; border-top: 1px solid var(--line); }
.section-done .note { line-height: 1.5; }
