/* The look of the page: plain and calm, made for reading on a phone first.
   Large letters, strong contrast, one clear button on each screen. */

:root {
  --paper: #fbfaf6;
  --ink: #1b1b1b;
  --soft-ink: #4a4a4a;
  --main: #0b4f6c;        /* buttons and headings */
  --main-dark: #083b51;
  --line: #c9c5b8;
  --weak-paper: #fff4e0;  /* the weak answer */
  --full-paper: #e8f4ea;  /* the full-marks answer */
  --reply-paper: #eaf1f8; /* the AI's marking */
  --note-paper: #fff8d6;
  --focus: #b3261e;
}

* { box-sizing: border-box; }

html { font-size: 112.5%; } /* 18px letters where the browser's own size is 16px */

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.55;
}

.top, main, .bottom {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.top { padding-top: 0.9rem; }
.site-name { margin: 0; font-weight: 700; color: var(--main); letter-spacing: 0.01em; }

h1 { font-size: 1.5rem; line-height: 1.25; margin: 0.8rem 0 0.6rem; }
h2 { font-size: 1.1rem; margin: 1.4rem 0 0.4rem; color: var(--main-dark); }
h1:focus { outline: none; }

.lead { margin: 0 0 1rem; }
.where { margin: 1rem 0 0; color: var(--soft-ink); font-size: 0.9rem; }
.marks { font-weight: 400; color: var(--soft-ink); }

/* A text from the questions file, the AI or the student: shown exactly as written, with its
   line breaks, and broken where a long word would leave the screen. */
.text-block {
  margin: 0;
  padding: 0.8rem 0.9rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.text-block.weak { background: var(--weak-paper); }
.text-block.full { background: var(--full-paper); }
.text-block.reply { background: var(--reply-paper); }

/* The chapters */
.chapter-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.chapter-list li { margin: 0 0 0.6rem; }

.chapter {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.2rem 1rem;
  width: 100%;
  min-height: 3.4rem;
  padding: 0.7rem 0.9rem;
  font: inherit;
  text-align: left;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--main);
  border-radius: 0.6rem;
  cursor: pointer;
}
.chapter:hover { background: var(--reply-paper); }
.chapter-title { font-weight: 600; }
.chapter-count { color: var(--main-dark); font-size: 0.9rem; white-space: nowrap; }
.chapter:disabled { border-color: var(--line); background: #f1efe8; color: var(--soft-ink); cursor: not-allowed; }
.chapter:disabled .chapter-count { color: var(--soft-ink); }

/* The box for typing */
.box-label { display: block; margin: 1.4rem 0 0.2rem; font-weight: 700; }
.hint { margin: 0.2rem 0 0.5rem; color: var(--soft-ink); font-size: 0.9rem; }
.count { text-align: right; }

textarea {
  display: block;
  width: 100%;
  padding: 0.7rem 0.8rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 0.5rem;
  resize: vertical;
}

/* Buttons */
.button {
  display: block;
  width: 100%;
  min-height: 3.2rem;
  margin: 0.8rem 0 0;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--main);
  border: 2px solid var(--main);
  border-radius: 0.6rem;
  cursor: pointer;
}
.button:hover { background: var(--main-dark); }
.button:disabled { background: #5d7f8f; border-color: #5d7f8f; cursor: progress; }
.button.secondary { color: var(--main); background: #fff; }
.button.link {
  min-height: 2.8rem;
  color: var(--main);
  background: transparent;
  border-color: transparent;
  font-weight: 600;
  text-decoration: underline;
}

a { color: var(--main); }

/* Every action can be reached by keyboard, and the place of the keyboard is always visible. */
a:focus-visible, button:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip { position: absolute; left: -999rem; }
.skip:focus { left: 0.5rem; top: 0.5rem; padding: 0.4rem 0.6rem; background: #fff; }

/* Messages */
.status { min-height: 1.5rem; margin: 0.6rem 0; font-weight: 600; }
.note {
  margin: 0.8rem 0;
  padding: 0.8rem 0.9rem;
  background: var(--note-paper);
  border-left: 0.3rem solid #8a6d00;
  border-radius: 0.3rem;
}

.stored-list { margin: 0; padding-left: 1.4rem; }
.stored-list li { margin: 0 0 0.8rem; }
.stored-list p { margin: 0; overflow-wrap: anywhere; }
.stored-list .missing { font-weight: 600; }
.stored-list .why { color: var(--soft-ink); }

.bottom { margin-top: 2rem; padding-top: 1rem; padding-bottom: 2rem; color: var(--soft-ink); font-size: 0.9rem; }
.bottom p { margin: 0.2rem 0; }

/* The plain page "This address was not found" */
.plain-page .back { display: inline-block; margin: 1rem 0; }

[hidden] { display: none !important; }

/* A computer screen: a little more air. The phone's layout stays the base. */
@media (min-width: 48rem) {
  h1 { font-size: 1.8rem; }
  .top { padding-top: 1.4rem; }
  .button { width: auto; min-width: 16rem; }
  .button.link { min-width: 0; display: inline-block; }
}
